/* Website assistant — floating chat button + panel (js/chat-widget.js).
   Sits above the WhatsApp button (bottom-right); uses the site's tokens. */

.chat-launcher {
  position: fixed; right: 24px; bottom: 96px; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px 0 14px; border-radius: 999px;
  background: var(--primary); color: #04150a; border: none; cursor: pointer;
  font: 600 0.9rem "Inter", sans-serif; box-shadow: 0 10px 30px -8px var(--primary-glow);
  transition: transform 0.2s ease;
}
.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher-icon { font-size: 1.15rem; line-height: 1; }

.chat-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 1001;
  width: 380px; height: min(600px, calc(100vh - 120px));
  display: none; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.chat-panel.open { display: flex; }

.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.chat-head-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-glow); font-size: 1.1rem;
}
.chat-head-title { font: 600 0.95rem "Poppins", sans-serif; color: var(--text); }
.chat-head-sub { font-size: 0.75rem; color: var(--text-faint); }
.chat-head-actions { margin-left: auto; display: flex; gap: 4px; }
.chat-icon-btn {
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--text-dim);
  padding: 6px 8px; cursor: pointer; font-size: 0.8rem; line-height: 1; white-space: nowrap;
}
.chat-icon-btn:hover { border-color: var(--border); color: var(--text); }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 88%; font-size: 0.88rem; line-height: 1.55; border-radius: 14px; padding: 10px 13px; overflow-wrap: anywhere; }
.chat-msg.bot { align-self: flex-start; background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #04150a; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.chat-msg p { margin: 0 0 8px; color: inherit; }
.chat-msg p:last-child, .chat-msg ul:last-child, .chat-msg ol:last-child, .chat-msg pre:last-child { margin-bottom: 0; }
.chat-msg ul, .chat-msg ol { margin: 0 0 8px; padding-left: 18px; }
.chat-msg ul { list-style: disc; }
.chat-msg ol { list-style: decimal; }
.chat-msg li { margin-bottom: 2px; }
.chat-msg a { color: var(--accent); text-decoration: underline; }
.chat-msg :not(pre) > code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; }
/* Always dark, like the site's code windows. */
.chat-msg pre {
  margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; overflow-x: auto;
  background: #0b1220; border: 1px solid #263258; color: #cbd5f5; font: 0.78rem/1.5 "SFMono-Regular", Menlo, Consolas, monospace;
}

.chat-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: chat-blink 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-suggestion {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 6px 11px; font-size: 0.78rem; cursor: pointer; text-align: left;
}
.chat-suggestion:hover { border-color: var(--primary); color: var(--text); }

.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-form textarea {
  flex: 1; margin: 0; resize: none; min-height: 42px; max-height: 120px;
  font: 0.88rem/1.4 "Inter", sans-serif; padding: 10px 12px;
}
.chat-send { padding: 0 16px; border-radius: 10px; flex-shrink: 0; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.chat-foot { padding: 0 12px 10px; font-size: 0.7rem; color: var(--text-faint); text-align: center; background: var(--surface); }

@media (max-width: 620px) {
  .chat-launcher { right: 16px; bottom: 80px; height: 44px; padding: 0 14px 0 12px; }
  .chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 16px); height: calc(100dvh - 16px); }
}
