/* ============================================
   Chatbot Demo — Matches Automata theme
   ============================================ */

:root {
  --bg: #0A0A0F;
  --bg-2: #0F0F18;
  --surface: #14141E;
  --surface-2: #1A1A28;
  --amber: #FFB800;
  --amber-dim: rgba(255, 184, 0, 0.12);
  --amber-glow: rgba(255, 184, 0, 0.06);
  --text: #E8E8ED;
  --text-2: #8B8B9A;
  --text-3: #55556A;
  --border: rgba(255,255,255,0.06);
  --green: #22C55E;
  --red: #EF4444;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: 'Syne', sans-serif; font-weight: 700; }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem;
}
.nav-tagline { font-size: 0.75rem; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; font-family: 'Syne', sans-serif; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--amber); }
.nav-links a.active { color: var(--amber); }

/* ── MAIN LAYOUT ── */
.main-content {
  margin-top: 60px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* ── LEFT PANEL (info) ── */
.info-panel {
  padding: 48px 40px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  margin-bottom: 16px;
}

.info-panel h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 16px;
}

.info-panel .subtitle {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 400px;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.feature-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
  font-family: 'Syne', sans-serif;
}

.feature-text p {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── CHATBOT WIDGET ── */
.chatbot-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB800, #FF8C00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-header-info h3 {
  font-size: 0.95rem;
}

.chat-header-info span {
  font-size: 0.75rem;
  color: var(--green);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── MESSAGES ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.bot { align-self: flex-start; max-width: 85%; }
.message.user { align-self: flex-end; max-width: 85%; flex-direction: row-reverse; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.bot .msg-avatar { background: linear-gradient(135deg, #FFB800, #FF8C00); }
.user .msg-avatar { background: var(--surface-2); }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.bot .msg-bubble {
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}

.user .msg-bubble {
  background: var(--amber);
  color: #0A0A0F;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* ── SUGGESTIONS ── */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-left: 38px;
}

.suggestion-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.suggestion-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-dim);
}

/* ── BOOKING FORM ── */
.booking-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 0 24px 16px;
}

.booking-form h4 {
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full { grid-column: span 2; }

.form-group label {
  font-size: 0.75rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--amber);
}

.form-group select option { background: var(--surface); }

.btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--amber);
  color: #0A0A0F;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-primary:active { transform: translateY(0); }

/* ── TYPING INDICATOR ── */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── INPUT AREA ── */
.chat-input-area {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: border-color 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--amber);
}

.chat-input::placeholder { color: var(--text-3); }

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: var(--amber);
  color: #0A0A0F;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SERVICE TABS ── */
.service-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.service-tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.service-tab:hover { color: var(--text); background: var(--surface-2); }
.service-tab.active {
  background: var(--amber-dim);
  color: var(--amber);
}

/* ── SCROLLBAR ── */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 4px; }

/* ── CONFIRMATION MESSAGE ── */
.confirmation-card {
  background: linear-gradient(135deg, var(--amber-dim), rgba(34, 197, 94, 0.08));
  border: 1px solid var(--amber);
  border-radius: 12px;
  padding: 16px;
  margin: 0 24px 16px;
  text-align: center;
}

.confirmation-card .check {
  font-size: 2rem;
  margin-bottom: 8px;
}

.confirmation-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.confirmation-card p { font-size: 0.82rem; color: var(--text-2); }

/* ── REFERRAL FORM ── */
.referral-form {
  background: linear-gradient(135deg, var(--surface-2), rgba(255, 184, 0, 0.04));
  border: 1px solid var(--amber);
  border-radius: 16px;
  padding: 20px;
  margin: 0 24px 16px;
}

.referral-form h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text);
}

.referral-form .referral-desc {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-referral {
  background: linear-gradient(135deg, #FFB800, #FF8C00) !important;
}

.referral-trigger {
  border-color: var(--amber) !important;
  color: var(--amber) !important;
  background: var(--amber-dim) !important;
  font-weight: 500 !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .info-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 32px 24px;
  }
  .info-panel h1 { font-size: 1.5rem; }
  .features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .chatbot-panel {
    height: calc(100vh - 60px);
    position: relative;
    top: 0;
  }
}

@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .info-panel { padding: 24px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }
}