/* ── Chatbot UI Styles ────────────────────────────────────────────────── */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --user-bg: #2563eb;
  --user-text: #ffffff;
  --assistant-bg: #f1f5f9;
  --assistant-text: #1e293b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Container ────────────────────────────────────────────────────────── */

.chat-container {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

/* ── Header ───────────────────────────────────────────────────────────── */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-icon {
  font-size: 28px;
}

.chat-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.chat-brand p {
  font-size: 12px;
  color: var(--muted);
}

.clear-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.clear-btn:hover {
  background: #f1f5f9;
}

/* ── Messages ─────────────────────────────────────────────────────────── */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
}

.msg.user {
  justify-content: flex-end;
}

.msg.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.msg.user .bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}

.msg.assistant .bubble {
  background: var(--assistant-bg);
  color: var(--assistant-text);
  border-bottom-left-radius: 4px;
}

/* ── Welcome ──────────────────────────────────────────────────────────── */

.welcome {
  text-align: center;
  padding: 40px 20px;
}

.welcome h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.welcome p {
  color: var(--muted);
  margin-bottom: 24px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.suggestion {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion:hover {
  background: #eff6ff;
  border-color: var(--primary);
}

/* ── Typing ───────────────────────────────────────────────────────────── */

.typing-msg .bubble {
  display: flex;
  gap: 4px;
  padding: 14px 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Form ─────────────────────────────────────────────────────────────── */

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  min-height: 48px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}

.chat-form textarea:focus {
  border-color: var(--primary);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-dark);
}

.send-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .chat-header { padding: 12px 16px; }
  .chat-messages { padding: 16px; }
  .bubble { max-width: 88%; }
}
