/* =============================================
   BHAGAVATAM – Sacred Scripture Chatbot
   Design: Divine Dark Spiritual Theme
   ============================================= */

/* ── CSS Variables ── */
:root {
  --bg-deepest:    #06040f;
  --bg-deep:       #0d0820;
  --bg-mid:        #120d2e;
  --bg-card:       #1a1240;
  --bg-card2:      #1f1650;

  --gold-vivid:    #f5c842;
  --gold-soft:     #e8a84c;
  --gold-muted:    #c8893a;
  --gold-glow:     rgba(245, 200, 66, 0.35);
  --gold-glow2:    rgba(245, 200, 66, 0.12);

  --purple-vivid:  #9b59f5;
  --purple-mid:    #7340c8;
  --purple-deep:   #4a208a;
  --purple-glow:   rgba(155, 89, 245, 0.3);

  --teal-accent:   #3de8d4;
  --teal-glow:     rgba(61, 232, 212, 0.2);

  --text-primary:  #f0e8ff;
  --text-secondary:#b8a8d8;
  --text-muted:    #7060a8;

  --border-gold:   rgba(245, 200, 66, 0.25);
  --border-purple: rgba(155, 89, 245, 0.2);

  --sidebar-w:     300px;
  --header-h:      70px;
  --input-area-h:  110px;

  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --radius-full:   9999px;

  --font-display:  'Cinzel', serif;
  --font-body:     'Cormorant Garamond', serif;
  --font-ui:       'Inter', sans-serif;

  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-family: var(--font-ui);
}

/* ── Particle Canvas ── */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Mandala Background ── */
.mandala-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mandala {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  animation: rotateMandala linear infinite;
}

.mandala::before,
.mandala::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-purple);
}
.mandala::after { inset: 20px; border-color: var(--border-gold); }

.mandala-1 {
  width: 600px; height: 600px;
  top: -150px; right: -100px;
  animation-duration: 60s;
  opacity: 0.25;
}
.mandala-2 {
  width: 400px; height: 400px;
  bottom: -100px; left: -80px;
  animation-duration: 45s;
  animation-direction: reverse;
  opacity: 0.2;
}
.mandala-3 {
  width: 300px; height: 300px;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 80s;
  opacity: 0.1;
}

@keyframes rotateMandala {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.mandala-3 { animation: rotateMandala 80s linear infinite; }

/* ── Screens ── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.screen.active {
  display: flex;
  opacity: 1;
}

/* =============================================
   LANDING SCREEN
   ============================================= */
#landingScreen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, #1f0a5a 0%, var(--bg-deepest) 70%);
  overflow-y: auto;
  padding: 40px 20px;
}

.landing-content {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  z-index: 1;
}

/* Logo */
.logo-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, var(--gold-vivid), var(--purple-vivid), var(--gold-vivid)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateMandala 4s linear infinite;
}

.logo-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow:
    0 0 30px var(--gold-glow),
    0 0 60px var(--purple-glow),
    inset 0 0 20px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

/* Title Block */
.title-block { text-align: center; }

.app-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-vivid) 0%, #fff9e6 40%, var(--gold-soft) 70%, var(--purple-vivid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-shadow: none;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}

.app-subtitle {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--gold-soft);
  letter-spacing: 0.15em;
  margin: 8px 0 14px;
  opacity: 0.9;
}

.app-description {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
}

/* Upload Area */
.upload-area {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 2px dashed var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--gold-glow2) 0%, transparent 70%);
  pointer-events: none;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--gold-vivid);
  background: linear-gradient(135deg, #1f1650 0%, #271b60 100%);
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px var(--gold-glow2);
}

.upload-icon {
  width: 64px; height: 64px;
  color: var(--gold-soft);
  opacity: 0.8;
}
.upload-icon svg { width: 100%; height: 100%; }

.upload-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-vivid);
  letter-spacing: 0.05em;
}

.upload-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.upload-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold-muted) 100%);
  color: #1a0a00;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 32px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(200, 137, 58, 0.4);
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 200, 66, 0.5);
  background: linear-gradient(135deg, var(--gold-vivid) 0%, var(--gold-soft) 100%);
}

.btn-shimmer {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* Progress */
.progress-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: visible;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-vivid), var(--gold-vivid));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  position: relative;
}

.progress-glow {
  position: absolute;
  top: -4px; right: 0;
  width: 16px; height: 14px;
  background: var(--gold-vivid);
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.8;
}

.progress-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Feature Chips */
.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(155, 89, 245, 0.12);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.chip:hover {
  background: rgba(155, 89, 245, 0.2);
  border-color: var(--purple-vivid);
  color: var(--text-primary);
}

.chip-icon { font-size: 0.9rem; }

/* =============================================
   CHAT SCREEN
   ============================================= */
#chatScreen {
  display: flex;
  flex-direction: row;
  background: var(--bg-deepest);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  border-right: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.sidebar-logo-img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 12px var(--gold-glow);
  flex-shrink: 0;
}

.sidebar-title-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gold-vivid), var(--gold-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-verse {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-style: italic;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--gold-soft); background: var(--border-gold); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-gold) transparent;
}
.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 2px; }

/* PDF Info Card */
.pdf-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 200, 66, 0.07);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.pdf-icon {
  width: 36px; height: 36px;
  color: var(--gold-soft);
  flex-shrink: 0;
}
.pdf-icon svg { width: 100%; height: 100%; }

.pdf-details { flex: 1; min-width: 0; }

.pdf-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-pages {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pdf-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  flex-shrink: 0;
  animation: blinkDot 2s ease-in-out infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--gold-soft);
  background: var(--bg-card2);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-vivid);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Suggestions */
.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-item {
  background: rgba(155, 89, 245, 0.08);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.suggestion-item:hover {
  background: rgba(155, 89, 245, 0.18);
  border-color: var(--purple-vivid);
  color: var(--text-primary);
  transform: translateX(3px);
}

/* Search Settings */
.search-settings { display: flex; flex-direction: column; gap: 10px; }

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.setting-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.setting-select {
  background: var(--bg-card);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-family: var(--font-ui);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.setting-select:focus, .setting-select:hover {
  border-color: var(--gold-muted);
}
.setting-select option { background: var(--bg-mid); }

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-gold);
}

.change-pdf-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(245, 200, 66, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--gold-soft);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-ui);
}

.change-pdf-btn:hover {
  background: rgba(245, 200, 66, 0.16);
  color: var(--gold-vivid);
}

.change-pdf-btn svg { width: 16px; height: 16px; }

/* ── Chat Main ── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(74, 32, 138, 0.15) 0%, transparent 70%);
}

/* Chat Header */
.chat-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(13, 8, 32, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.mobile-menu-btn svg { width: 22px; height: 22px; }

.header-title-group { flex: 1; }

.header-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-soft);
  letter-spacing: 0.06em;
}

.header-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

.clear-chat-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.clear-chat-btn:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.05);
}

.clear-chat-btn svg { width: 18px; height: 18px; }

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-purple) transparent;
}
.messages-container::-webkit-scrollbar { width: 5px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--border-purple); border-radius: 3px; }

/* Message Bubble */
.message { display: flex; flex-direction: column; gap: 6px; animation: msgSlideIn 0.4s ease; }

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user { align-items: flex-end; }
.message.bot  { align-items: flex-start; }

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.message.user .message-meta { flex-direction: row-reverse; }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-avatar {
  background: linear-gradient(135deg, var(--purple-vivid), var(--purple-deep));
  color: #fff;
  box-shadow: 0 0 10px var(--purple-glow);
}

.bot-avatar {
  background: linear-gradient(135deg, var(--gold-muted), var(--gold-soft));
  color: #1a0a00;
  box-shadow: 0 0 10px var(--gold-glow);
  font-family: var(--font-body);
}

.message-bubble {
  max-width: 75%;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  line-height: 1.65;
  position: relative;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, var(--purple-mid) 0%, var(--purple-deep) 100%);
  border: 1px solid rgba(155, 89, 245, 0.35);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(115, 64, 200, 0.3);
}

.message.bot .message-bubble {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border-gold);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 85%;
}

/* Welcome message */
.welcome-msg {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: msgSlideIn 0.6s ease;
}

.welcome-om {
  font-family: var(--font-body);
  font-size: 3rem;
  color: var(--gold-soft);
  text-shadow: 0 0 20px var(--gold-glow);
  animation: pulse 3s ease-in-out infinite;
  line-height: 1;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold-vivid), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 460px;
  line-height: 1.7;
}

/* Result Cards */
.results-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-count-badge {
  background: rgba(245, 200, 66, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--gold-vivid);
}

.result-card {
  background: linear-gradient(135deg, rgba(26, 18, 64, 0.8) 0%, rgba(18, 13, 46, 0.9) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 8px 0;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.result-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-vivid), var(--purple-vivid));
  border-radius: 3px 0 0 3px;
}

.result-card:hover {
  border-color: var(--gold-soft);
  transform: translateX(2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.result-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--gold-soft);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.result-text {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  font-style: italic;
}

.result-text mark {
  background: rgba(245, 200, 66, 0.28);
  color: var(--gold-vivid);
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
  font-weight: 600;
  box-shadow: 0 0 8px var(--gold-glow2);
}

.result-relevance {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.relevance-bar-bg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}

.relevance-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--purple-vivid), var(--gold-vivid));
}

.relevance-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 35px;
  text-align: right;
}

/* No results */
.no-results {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

.dot-loader {
  display: flex;
  gap: 4px;
}

.dot-loader span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  animation: dotBounce 1.4s ease-in-out infinite;
}
.dot-loader span:nth-child(2) { animation-delay: 0.2s; }
.dot-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(1); opacity: 0.5; }
  40%            { transform: scale(1.3); opacity: 1; }
}

/* Input Area */
.input-area {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border-gold);
  background: rgba(13, 8, 32, 0.9);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px var(--gold-glow2), 0 8px 30px rgba(0,0,0,0.3);
}

.input-deco {
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--gold-muted);
  line-height: 1;
  padding-bottom: 2px;
  flex-shrink: 0;
  user-select: none;
}

.user-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  padding: 0;
}

.user-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-muted));
  color: #1a0a00;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(200, 137, 58, 0.4);
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.5);
  background: linear-gradient(135deg, var(--gold-vivid), var(--gold-soft));
}

.send-btn:active { transform: scale(0.96); }
.send-btn svg { width: 17px; height: 17px; }

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.input-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ── Sidebar Collapsed ── */
.sidebar.collapsed { transform: translateX(-100%); }

/* ── Mobile ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .mobile-menu-btn { display: flex; }

  .sidebar-toggle { display: none; }

  .message.bot .message-bubble { max-width: 100%; }

  .messages-container { padding: 16px; }
  .chat-header { padding: 0 16px; }
  .input-area { padding: 12px 16px 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-chips .chip:nth-child(n+3) { display: none; }
}
