/* ========================================================================== 
   MASCOT + GEMINI CHATBOT: "MẮT SÁNG"
   - Mascot thân thiện đại diện cho website bệnh viện
   - Di chuyển nhẹ ở cạnh dưới màn hình trên desktop
   - Chatbot chỉ cung cấp thông tin giáo dục sức khỏe mắt, không chẩn đoán
   ========================================================================== */

:root {
  --eye-chat-primary: #075ea8;
  --eye-chat-primary-dark: #073f78;
  --eye-chat-cyan: #16b6cf;
  --eye-chat-red: #e7394f;
  --eye-chat-ink: #082f55;
  --eye-chat-muted: #60788e;
  --eye-chat-line: rgba(163, 205, 231, 0.72);
  --eye-chat-shadow: 0 24px 70px rgba(4, 45, 82, 0.24);
}

.eye-chatbot-root {
  position: fixed;
  z-index: 980;
  left: 18px;
  bottom: 18px;
  width: 136px;
  height: 138px;
  pointer-events: none;
  transform: translate3d(var(--mascot-x, 0), var(--mascot-y, 0), 0);
  transition: transform 5.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.eye-chatbot-root.is-open,
.eye-chatbot-root.is-paused {
  transition-duration: 500ms;
  transform: translate3d(0, 0, 0);
}

.eye-chatbot-mascot {
  position: absolute;
  left: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 14px 18px rgba(3, 48, 83, 0.22));
  animation: eyeMascotBob 2.7s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.eye-chatbot-mascot:hover,
.eye-chatbot-mascot:focus-visible {
  outline: none;
  filter: drop-shadow(0 18px 22px rgba(3, 48, 83, 0.3));
}

.eye-chatbot-mascot:hover .eye-mascot-image,
.eye-chatbot-mascot:focus-visible .eye-mascot-image {
  transform: translateY(-4px) scale(1.04);
}

.eye-mascot-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 220ms ease;
}

.eye-mascot-arm {
  transform-origin: 72px 78px;
  animation: eyeMascotWave 3.8s ease-in-out infinite;
}

.eye-mascot-pupil {
  transform-origin: center;
  animation: eyeMascotLook 4.4s ease-in-out infinite;
}

.eye-mascot-shadow {
  transform-origin: center;
  animation: eyeMascotShadow 2.7s ease-in-out infinite;
}

.eye-chatbot-bubble {
  position: absolute;
  left: 112px;
  bottom: 72px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: min(280px, calc(100vw - 150px));
  border: 1px solid rgba(171, 211, 235, 0.88);
  border-radius: 20px 20px 20px 5px;
  padding: 13px 38px 13px 15px;
  color: var(--eye-chat-ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(4, 54, 92, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transform: translateY(8px) scale(0.96);
  transform-origin: left bottom;
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms linear;
}

.eye-chatbot-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.eye-chatbot-bubble button[data-chat-open] {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.eye-chatbot-bubble strong {
  color: var(--eye-chat-primary);
}

.eye-chatbot-bubble-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: #6f8498;
  background: #edf7fc;
  font-size: 0.78rem;
  cursor: pointer;
}

.eye-chatbot-bubble-close:hover,
.eye-chatbot-bubble-close:focus-visible {
  color: #fff;
  background: var(--eye-chat-primary);
  outline: none;
}

.eye-chatbot-panel {
  position: fixed;
  z-index: 1100;
  left: 22px;
  bottom: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(410px, calc(100vw - 28px));
  height: min(690px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(170, 211, 235, 0.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--eye-chat-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transform-origin: left bottom;
  transition: opacity 240ms ease, transform 240ms ease, visibility 240ms linear;
}

.eye-chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.eye-chatbot-header {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(49, 214, 226, 0.32), transparent 34%),
    linear-gradient(135deg, #073f78, #0879b8);
}

.eye-chatbot-header-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.13);
}

.eye-chatbot-header-avatar img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.08);
}

.eye-chatbot-header-copy {
  min-width: 0;
}

.eye-chatbot-header-copy strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.eye-chatbot-header-copy span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 650;
}

.eye-chatbot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #47e6a0;
  box-shadow: 0 0 0 4px rgba(71, 230, 160, 0.16);
}

.eye-chatbot-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  cursor: pointer;
}

.eye-chatbot-close:hover,
.eye-chatbot-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.eye-chatbot-disclaimer {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(2, 31, 56, 0.16);
  font-size: 0.65rem;
  line-height: 1.45;
}

.eye-chatbot-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 15px 14px;
  background:
    linear-gradient(rgba(247, 252, 255, 0.97), rgba(247, 252, 255, 0.97)),
    radial-gradient(circle at 10% 10%, rgba(22, 182, 207, 0.14), transparent 25%);
  scrollbar-width: thin;
  scrollbar-color: #bad9ea transparent;
}

.eye-chatbot-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.eye-chatbot-message-row.is-user {
  justify-content: flex-end;
}

.eye-chatbot-message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  overflow: hidden;
  padding: 1px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(217, 244, 255, 0.96));
  box-shadow: 0 4px 12px rgba(4, 54, 92, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

.eye-chatbot-message-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.22);
}

.eye-chatbot-message {
  max-width: 82%;
  border: 1px solid rgba(181, 215, 234, 0.8);
  border-radius: 18px 18px 18px 5px;
  padding: 11px 13px;
  color: #29465f;
  background: #fff;
  box-shadow: 0 7px 18px rgba(6, 55, 92, 0.07);
  font-size: 0.81rem;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.eye-chatbot-message-row.is-user .eye-chatbot-message {
  border-color: transparent;
  border-radius: 18px 18px 5px 18px;
  color: #fff;
  background: linear-gradient(135deg, #075ea8, #0b86c7);
}

.eye-chatbot-message-row.is-urgent .eye-chatbot-message {
  border-color: rgba(225, 64, 75, 0.34);
  color: #7b1f2a;
  background: #fff5f6;
}

.eye-chatbot-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
}

.eye-chatbot-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7897ac;
  animation: eyeTyping 1.15s ease-in-out infinite;
}

.eye-chatbot-typing i:nth-child(2) { animation-delay: 0.14s; }
.eye-chatbot-typing i:nth-child(3) { animation-delay: 0.28s; }

.eye-chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 14px 38px;
}

.eye-chatbot-chip {
  border: 1px solid rgba(13, 116, 174, 0.2);
  border-radius: 999px;
  padding: 8px 10px;
  color: #096b9f;
  background: #eef9fe;
  font: inherit;
  font-size: 0.69rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.eye-chatbot-chip:hover,
.eye-chatbot-chip:focus-visible {
  color: #fff;
  border-color: var(--eye-chat-primary);
  background: var(--eye-chat-primary);
  outline: none;
}

.eye-chatbot-footer {
  border-top: 1px solid #dcecf5;
  padding: 12px;
  background: #fff;
}

.eye-chatbot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
}

.eye-chatbot-input {
  width: 100%;
  min-height: 46px;
  max-height: 116px;
  resize: none;
  border: 1px solid #c7deec;
  border-radius: 16px;
  padding: 12px 13px;
  color: #173d59;
  background: #f8fcfe;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  outline: none;
}

.eye-chatbot-input:focus {
  border-color: #1394c6;
  box-shadow: 0 0 0 3px rgba(19, 148, 198, 0.12);
  background: #fff;
}

.eye-chatbot-send {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--eye-chat-primary), #0b8ec8);
  box-shadow: 0 10px 22px rgba(7, 94, 168, 0.22);
  font-size: 1.05rem;
  cursor: pointer;
}

.eye-chatbot-send:hover,
.eye-chatbot-send:focus-visible {
  background: linear-gradient(135deg, #064c89, #087eb2);
  outline: none;
}

.eye-chatbot-send:disabled,
.eye-chatbot-input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.eye-chatbot-footer-note {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #7a91a4;
  font-size: 0.59rem;
  line-height: 1.4;
}

.eye-chatbot-footer-note a {
  flex: 0 0 auto;
  color: #0873aa;
  font-weight: 750;
  text-decoration: none;
}

.eye-chatbot-footer-note a:hover {
  text-decoration: underline;
}

@keyframes eyeMascotBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes eyeMascotWave {
  0%, 48%, 100% { transform: rotate(0deg); }
  56% { transform: rotate(-18deg); }
  64% { transform: rotate(12deg); }
  72% { transform: rotate(-12deg); }
  80% { transform: rotate(4deg); }
}

@keyframes eyeMascotLook {
  0%, 24%, 100% { transform: translateX(0); }
  35%, 48% { transform: translateX(2px); }
  62%, 76% { transform: translateX(-2px); }
}

@keyframes eyeMascotShadow {
  0%, 100% { transform: scaleX(1); opacity: 0.2; }
  50% { transform: scaleX(0.82); opacity: 0.13; }
}

@keyframes eyeTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 759px) {
  .eye-chatbot-root {
    left: 8px;
    bottom: 78px;
    width: 104px;
    height: 108px;
    transform: none !important;
    transition: none;
  }

  .eye-chatbot-mascot {
    width: 96px;
    height: 96px;
  }

  .eye-chatbot-bubble {
    left: 82px;
    bottom: 62px;
    width: min(244px, calc(100vw - 94px));
    padding: 11px 35px 11px 13px;
  }

  .eye-chatbot-panel {
    left: 7px;
    right: 7px;
    bottom: 7px;
    width: auto;
    height: min(720px, calc(100dvh - 14px));
    border-radius: 23px;
  }

  .eye-chatbot-header {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 13px;
  }

  .eye-chatbot-header-avatar {
    width: 46px;
    height: 46px;
  }

  .eye-chatbot-message {
    max-width: 86%;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eye-chatbot-root,
  .eye-chatbot-panel,
  .eye-chatbot-bubble,
  .eye-mascot-image,
  .eye-chatbot-mascot {
    transition: none;
    animation: none;
  }

  .eye-mascot-arm,
  .eye-mascot-pupil,
  .eye-mascot-shadow,
  .eye-chatbot-typing i {
    animation: none;
  }
}


/* ========================================================================== 
   RICH MESSAGE UI
   Hiển thị câu trả lời gọn hơn, đẹp hơn, có icon minh hoạ
   ========================================================================== */
.eye-chatbot-message-row.is-assistant {
  align-items: flex-start;
}

.eye-chatbot-message.has-rich-content {
  white-space: normal;
  padding: 12px;
}

.eye-chatbot-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eye-chatbot-rich-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(183, 219, 237, 0.8);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.eye-chatbot-rich-block.is-lead {
  border-color: rgba(150, 206, 233, 0.96);
  background: linear-gradient(180deg, #fafdff, #f0f9ff);
}

.eye-chatbot-rich-block.is-note {
  border-color: rgba(236, 117, 127, 0.34);
  background: linear-gradient(180deg, #fff7f8, #fff2f4);
}

.eye-chatbot-rich-paragraph {
  margin: 0;
  color: #284860;
  font-size: 0.8rem;
  line-height: 1.62;
}

.eye-chatbot-rich-paragraph strong,
.eye-chatbot-rich-item-title {
  color: #083d70;
}

.eye-chatbot-inline-link {
  color: #086ca3;
  font-weight: 800;
  text-decoration: none;
}

.eye-chatbot-inline-link:hover {
  text-decoration: underline;
}

.eye-chatbot-rich-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eye-chatbot-rich-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(190, 221, 237, 0.78);
  border-radius: 13px;
  background: #fff;
}

.eye-chatbot-rich-item-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(7, 94, 168, 0.14), rgba(22, 182, 207, 0.18));
  color: #09679f;
  font-size: 0.86rem;
}

.eye-chatbot-rich-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.eye-chatbot-rich-item-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.eye-chatbot-rich-item-text {
  display: block;
  color: #466176;
  font-size: 0.77rem;
  line-height: 1.55;
}

.eye-chatbot-rich-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eye-chatbot-rich-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(186, 219, 236, 0.85);
  border-radius: 999px;
  color: #577386;
  background: #f6fbfe;
  font-size: 0.68rem;
  font-weight: 750;
}

.eye-chatbot-message-row.is-urgent .eye-chatbot-message.has-rich-content {
  border-color: rgba(225, 64, 75, 0.34);
  background: #fff6f7;
}

.eye-chatbot-message-row.is-urgent .eye-chatbot-rich-block.is-note {
  border-color: rgba(225, 64, 75, 0.38);
}

@media (max-width: 759px) {
  .eye-chatbot-message.has-rich-content {
    padding: 10px;
  }

  .eye-chatbot-rich {
    gap: 8px;
  }

  .eye-chatbot-rich-block {
    padding: 9px 10px;
    border-radius: 12px;
  }

  .eye-chatbot-rich-paragraph,
  .eye-chatbot-rich-item-text {
    font-size: 0.76rem;
  }

  .eye-chatbot-rich-item {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 7px;
    padding: 8px 9px;
  }

  .eye-chatbot-rich-item-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
  }

  .eye-chatbot-rich-tag {
    font-size: 0.64rem;
  }
}


/* ========================================================================== 
   ANALYSIS EFFECT + CONTEXTUAL FOLLOW-UP SUGGESTIONS
   ========================================================================== */
.eye-chatbot-message-row.is-thinking {
  align-items: flex-start;
}

.eye-chatbot-message-avatar.is-thinking-avatar {
  overflow: hidden;
  background: linear-gradient(135deg, #075ea8, #16b6cf);
  box-shadow: 0 0 0 4px rgba(22, 182, 207, 0.1);
}

.eye-chatbot-message-avatar.is-thinking-avatar span {
  animation: eyeThinkingBlink 1.8s ease-in-out infinite;
}

.eye-chatbot-thinking-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: min(292px, 82%);
  padding: 11px 12px;
  border-color: rgba(125, 199, 226, 0.85);
  background:
    radial-gradient(circle at 92% 10%, rgba(22, 182, 207, 0.12), transparent 34%),
    linear-gradient(135deg, #ffffff, #eef9ff);
}

.eye-chatbot-thinking-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(7, 94, 168, 0.12), rgba(22, 182, 207, 0.2));
}

.eye-chatbot-thinking-visual b {
  position: absolute;
  width: 17px;
  height: 12px;
  border: 2px solid #087bb5;
  border-radius: 50% 50% 45% 45%;
  animation: eyeThinkingPulse 1.5s ease-in-out infinite;
}

.eye-chatbot-thinking-visual b::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #075ea8;
}

.eye-chatbot-thinking-visual > i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16b6cf;
  animation: eyeThinkingOrbit 1.8s linear infinite;
}

.eye-chatbot-thinking-visual > i:nth-child(1) { animation-delay: 0s; }
.eye-chatbot-thinking-visual > i:nth-child(2) { animation-delay: -0.6s; }
.eye-chatbot-thinking-visual > i:nth-child(3) { animation-delay: -1.2s; }

.eye-chatbot-thinking-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.eye-chatbot-thinking-copy strong {
  color: #083d70;
  font-size: 0.76rem;
  line-height: 1.35;
}

.eye-chatbot-thinking-copy span {
  overflow: hidden;
  color: #607f94;
  font-size: 0.68rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eye-chatbot-thinking-steps {
  display: flex;
  align-items: center;
  gap: 3px;
}

.eye-chatbot-thinking-steps i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7dce9;
  transition: transform 220ms ease, background 220ms ease;
}

.eye-chatbot-thinking-steps i.is-active {
  background: #14a9c8;
  transform: scale(1.2);
}

.eye-chatbot-suggestions {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin: 5px 0 15px 38px;
}

.eye-chatbot-suggestions-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6a8497;
  font-size: 0.66rem;
  font-weight: 750;
}

.eye-chatbot-suggestions-label i {
  color: #10a7c5;
  font-style: normal;
}

.eye-chatbot-suggestions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.eye-chatbot-suggestions.is-follow-up .eye-chatbot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 100%;
  padding: 8px 9px 8px 11px;
  text-align: left;
}

.eye-chatbot-chip span {
  min-width: 0;
}

.eye-chatbot-chip i {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #0874a9;
  background: #fff;
  font-style: normal;
  font-size: 0.68rem;
  box-shadow: 0 3px 8px rgba(7, 94, 168, 0.1);
}

.eye-chatbot-chip:hover i,
.eye-chatbot-chip:focus-visible i {
  color: var(--eye-chat-primary);
}

@keyframes eyeThinkingOrbit {
  0% { transform: rotate(0deg) translateX(17px) rotate(0deg); opacity: 0.45; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg) translateX(17px) rotate(-360deg); opacity: 0.45; }
}

@keyframes eyeThinkingPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes eyeThinkingBlink {
  0%, 42%, 100% { transform: scaleY(1); }
  46%, 50% { transform: scaleY(0.2); }
}

@media (max-width: 759px) {
  .eye-chatbot-thinking-card {
    grid-template-columns: 38px minmax(0, 1fr);
    min-width: min(270px, 86%);
    padding: 10px;
  }

  .eye-chatbot-thinking-visual {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .eye-chatbot-thinking-steps {
    display: none;
  }

  .eye-chatbot-thinking-copy span {
    white-space: normal;
  }

  .eye-chatbot-suggestions {
    margin-left: 37px;
  }

  .eye-chatbot-suggestions-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .eye-chatbot-suggestions.is-follow-up .eye-chatbot-chip {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eye-chatbot-thinking-visual > i,
  .eye-chatbot-thinking-visual b,
  .eye-chatbot-message-avatar.is-thinking-avatar span {
    animation: none;
  }
}


/* ========================================================================== 
   CLEAN RANDOM SUGGESTIONS
   Câu hỏi mở đầu được xáo trộn; nút chỉ còn chữ, không có dấu +/mũi tên
   ========================================================================== */
.eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-suggestions-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: start;
}

.eye-chatbot-chip,
.eye-chatbot-suggestions.is-follow-up .eye-chatbot-chip {
  justify-content: flex-start;
  min-height: 38px;
  padding: 9px 12px;
  line-height: 1.38;
  box-shadow: 0 5px 13px rgba(7, 94, 168, 0.06);
}

.eye-chatbot-chip span {
  width: 100%;
}

.eye-chatbot-chip i {
  display: none !important;
}

@media (max-width: 759px) {
  .eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-suggestions-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-chip {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    text-align: center;
  }

  .eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: auto;
    min-width: 52%;
    justify-self: center;
  }
}

@media (max-width: 390px) {
  .eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-suggestions-buttons {
    grid-template-columns: 1fr;
  }

  .eye-chatbot-suggestions:not(.is-follow-up) .eye-chatbot-chip:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }
}


/* ========================================================================== 
   ANSWER START VISIBILITY
   Luôn đưa người dùng về đầu câu trả lời mới của AI
   ========================================================================== */
.eye-chatbot-answer-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px -2px 10px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #075f98;
  background: linear-gradient(135deg, rgba(7, 94, 168, 0.1), rgba(22, 182, 207, 0.12));
  font-size: 0.72rem;
  line-height: 1;
}

.eye-chatbot-answer-header span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #075ea8, #16b6cf);
  font-size: 0.68rem;
}

.eye-chatbot-answer-header strong {
  color: #075f98;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

@media (max-width: 759px) {
  .eye-chatbot-answer-header {
    margin-bottom: 8px;
    padding: 7px 9px;
  }
}


/* =========================================================
   HEADER TITLE EMPHASIS
   Làm nổi tiêu đề Trợ lý Mắt Sáng + thêm tên bệnh viện
   ========================================================= */
.eye-chatbot-header-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.eye-chatbot-header-copy strong {
  display: block;
  color: #fff4a8;
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(2, 28, 54, 0.24);
}

.eye-chatbot-hospital-name {
  display: block;
  width: fit-content;
  color: #ff4f57;
  font-size: 0.69rem;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: 0.012em;
  text-shadow: 0 1px 1px rgba(50, 8, 12, 0.35), 0 0 10px rgba(255, 255, 255, 0.22);
}

.eye-chatbot-header-copy span {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.84);
}

@media (max-width: 759px) {
  .eye-chatbot-header-copy strong {
    font-size: 1.08rem;
  }

  .eye-chatbot-hospital-name {
    font-size: 0.62rem;
  }
}

/* Kho kiến thức nội bộ - nguồn trả lời */
.eye-chatbot-rich-tag.is-knowledge {
  color: #075b9c;
  background: linear-gradient(135deg, #e5f6ff, #dffaf4);
  border-color: #b8dfef;
  font-weight: 850;
}
.eye-chatbot-source-box {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #cfe4f1;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fcff, #eef8fd);
}
.eye-chatbot-source-box > strong {
  display: block;
  margin-bottom: 7px;
  color: #174d78;
  font-size: .64rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.eye-chatbot-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.eye-chatbot-source-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #c4deec;
  border-radius: 999px;
  color: #235f89;
  background: #fff;
  font-size: .62rem;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
