/* Ars Hygeia chatbot widget — Whitmore brand palette */

:root {
  --hyg-cream:    #faf7f2;
  --hyg-charcoal: #2a2a2a;
  --hyg-gold:     #b59a5e;
  --hyg-line:     rgba(42, 42, 42, 0.12);
  --hyg-muted:    #6b6b6b;
}

#hygeia-widget-root * {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#hygeia-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--hyg-charcoal);
  color: var(--hyg-cream);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: transform 0.15s ease;
}
#hygeia-toggle:hover { transform: scale(1.05); }

#hygeia-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  height: 480px;
  max-height: calc(100vh - 48px);
  background: var(--hyg-cream);
  border: 1px solid var(--hyg-line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: none;          /* hidden by default — JS adds .open to show */
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}
#hygeia-panel.open {
  display: flex;
}

/* Persistent AI disclaimer banner (always visible inside the panel) */
.hygeia-disclaimer {
  padding: 8px 14px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--hyg-muted);
  background: rgba(181, 154, 94, 0.08);
  border-bottom: 1px solid var(--hyg-line);
  font-style: italic;
}

#hygeia-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hyg-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
}
#hygeia-title strong {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  color: var(--hyg-charcoal);
  letter-spacing: 0.2px;
}
#hygeia-title span {
  display: block;
  font-size: 11px;
  color: var(--hyg-muted);
  margin-top: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
#hygeia-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--hyg-muted);
  cursor: pointer;
  padding: 0 4px;
}
#hygeia-close:hover { color: var(--hyg-charcoal); }

#hygeia-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hygeia-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}

/* Markdown rendering inside bot messages */
.hygeia-msg-bot p { margin: 0 0 8px 0; }
.hygeia-msg-bot p:last-child { margin-bottom: 0; }
.hygeia-msg-bot h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px; font-weight: 600;
  margin: 8px 0 4px; color: var(--hyg-charcoal);
}
.hygeia-msg-bot h4 {
  font-size: 13px; font-weight: 600;
  margin: 8px 0 4px; color: var(--hyg-charcoal);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.hygeia-msg-bot h5 {
  font-size: 13px; font-weight: 600;
  margin: 6px 0 2px; color: var(--hyg-charcoal);
}
.hygeia-msg-bot ul {
  margin: 4px 0 8px; padding-left: 18px;
}
.hygeia-msg-bot li { margin: 2px 0; }
.hygeia-msg-bot strong { font-weight: 600; color: var(--hyg-charcoal); }
.hygeia-msg-bot em { font-style: italic; }
.hygeia-msg-bot hr {
  border: none;
  border-top: 1px solid var(--hyg-line);
  margin: 10px 0;
}
.hygeia-msg-bot a {
  color: var(--hyg-charcoal);
  text-decoration: underline;
  text-decoration-color: var(--hyg-gold);
}
.hygeia-msg-user {
  align-self: flex-end;
  background: var(--hyg-charcoal);
  color: var(--hyg-cream);
  border-bottom-right-radius: 4px;
}
.hygeia-msg-bot {
  align-self: flex-start;
  background: white;
  color: var(--hyg-charcoal);
  border: 1px solid var(--hyg-line);
  border-bottom-left-radius: 4px;
}
.hygeia-msg-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--hyg-muted);
  font-style: italic;
}

.hygeia-typing { display: flex; gap: 4px; padding: 14px; }
.hygeia-typing span {
  width: 6px; height: 6px;
  background: var(--hyg-muted);
  border-radius: 50%;
  animation: hyg-bounce 1.2s infinite ease-in-out;
}
.hygeia-typing span:nth-child(2) { animation-delay: 0.15s; }
.hygeia-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hyg-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

#hygeia-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--hyg-line);
  background: white;
}
#hygeia-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--hyg-line);
  border-radius: 999px;
  font-size: 14px;
  outline: none;
  background: var(--hyg-cream);
  color: var(--hyg-charcoal);
}
#hygeia-input:focus { border-color: var(--hyg-gold); }
#hygeia-input:disabled { opacity: 0.5; }

#hygeia-send {
  background: var(--hyg-charcoal);
  color: var(--hyg-cream);
  border: none;
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
#hygeia-send:hover { background: var(--hyg-gold); }

@media (max-width: 480px) {
  #hygeia-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
    height: calc(100vh - 24px);
  }
}
