/* ============================================================
   Simulated chatbot widget — reuses site design tokens from styles.css,
   kept in its own file so styles.css stays untouched/diffable.
   ============================================================ */

.chatbot { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 60; font-family: var(--font-body); }

.chatbot-launcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 18px 12px 12px;
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.chatbot-launcher:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.chatbot-launcher-avatar {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-gold); color: var(--brand-deep);
  font-family: var(--font-display); font-weight: 700;
}
.chatbot.is-open .chatbot-launcher { display: none; }

.chatbot-panel {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  width: min(360px, calc(100vw - 2 * var(--space-4)));
  height: min(560px, calc(100vh - 2 * var(--space-5)));
  background: var(--brand-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--brand-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-panel[hidden] { display: none; }

.chatbot-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--grad-brand);
  color: white;
}
.chatbot-avatar {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand-gold); color: var(--brand-deep);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.chatbot-panel-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.chatbot-panel-status { font-size: 12px; opacity: .85; }
.chatbot-close {
  margin-left: auto;
  background: none; border: none; color: white;
  font-size: 22px; line-height: 1; cursor: pointer; opacity: .85;
  padding: var(--space-1);
}
.chatbot-close:hover { opacity: 1; }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--brand-bg-alt);
}

.chatbot-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
  animation: chatbot-pop .25s var(--ease-out);
}
.chatbot-bubble.bot {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--brand-line);
  color: var(--brand-ink);
  border-bottom-left-radius: 4px;
}
.chatbot-bubble.user {
  align-self: flex-end;
  background: var(--grad-brand);
  color: white;
  border-bottom-right-radius: 4px;
}
@keyframes chatbot-pop {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.chatbot-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
}
.chatbot-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-muted);
  animation: chatbot-bounce 1.2s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chatbot-composer {
  padding: var(--space-3);
  border-top: 1px solid var(--brand-line);
  background: white;
}
.chatbot-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chatbot-choice-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--brand-accent);
  background: white;
  color: var(--brand-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chatbot-choice-btn:hover { background: var(--brand-fill); }
.chatbot-choice-btn:disabled { opacity: .5; cursor: default; }

.chatbot-input-row { display: flex; gap: var(--space-2); }
.chatbot-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-line);
  font-size: 14px;
  font-family: var(--font-body);
}
.chatbot-input-row input:focus { outline: none; border-color: var(--brand-accent); }
.chatbot-send-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--grad-brand);
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.chatbot-send-btn:disabled { opacity: .5; cursor: default; }

.chatbot-edit-link {
  background: none; border: none; padding: 0;
  color: var(--brand-accent);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: var(--space-2);
}

@media (max-width: 540px) {
  .chatbot { right: var(--space-3); bottom: var(--space-3); }
  .chatbot-panel {
    right: var(--space-3); left: var(--space-3); bottom: var(--space-3);
    width: auto; height: min(72vh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-bubble, .chatbot-typing span { animation: none !important; }
}
