/* ═══════════════════════════════════════════════════════
   Jhooth Pakdo — Design System
   Dark theme + Indian tricolor accents + glassmorphism
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #12121f;
  --bg-card: rgba(20, 20, 40, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #606078;
  --saffron: #FF6B35;
  --white-accent: #F0F0F5;
  --green: #1A8C5B;
  --saffron-glow: rgba(255, 107, 53, 0.15);
  --green-glow: rgba(26, 140, 91, 0.15);
  --gradient-india: linear-gradient(135deg, #FF6B35, #FFFFFF 50%, #1A8C5B);
  --gradient-warm: linear-gradient(135deg, #FF6B35, #FF8F6B);
  --gradient-cool: linear-gradient(135deg, #1A8C5B, #2DB87A);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-main: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Particle Canvas ─── */
#particles-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0.4;
}

/* ─── Header ─── */
#app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 24px;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo-group { display: flex; align-items: center; gap: 12px; }
.shield-icon { width: 40px; height: 40px; animation: pulse-shield 3s ease-in-out infinite; }
@keyframes pulse-shield {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,107,53,0.4)); }
  50% { filter: drop-shadow(0 0 14px rgba(26,140,91,0.6)); }
}
.check-mark { stroke-dasharray: 20; stroke-dashoffset: 20; animation: draw-check 1.5s ease forwards 0.5s; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.logo-text {
  font-size: 1.35rem; font-weight: 800;
  background: var(--gradient-india); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
.logo-subtitle { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }

/* Nav */
.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font: 500 0.85rem var(--font-main); cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; gap: 6px;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-glass); }
.nav-tab.active {
  color: var(--saffron);
  background: var(--saffron-glow);
}
.tab-icon { font-size: 1rem; }

/* ─── Main ─── */
#main-content {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 0 20px 100px;
}
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.4s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Hero ─── */
.hero-section { text-align: center; padding: 60px 0 30px; }
.hero-badge {
  display: inline-block; padding: 6px 18px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 50px; font-size: 0.75rem; color: var(--text-secondary);
  margin-bottom: 20px; letter-spacing: 0.5px;
}
.hero-title { font-size: 2.4rem; font-weight: 800; line-height: 1.25; margin-bottom: 16px; }
.gradient-text {
  background: var(--gradient-warm); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc { color: var(--text-secondary); font-size: 1.05rem; max-width: 540px; margin: 0 auto 28px; }

/* Quick Chips */
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  padding: 8px 16px; border-radius: 50px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  color: var(--text-secondary); font-size: 0.82rem;
  cursor: pointer; transition: var(--transition);
}
.chip:hover {
  background: var(--saffron-glow); border-color: var(--saffron);
  color: var(--saffron); transform: translateY(-2px);
}

/* ─── Chat ─── */
.chat-container { min-height: 0; }
.chat-messages { display: flex; flex-direction: column; gap: 16px; padding: 20px 0; }

.msg { display: flex; gap: 12px; animation: fadeUp 0.35s ease; max-width: 100%; }
.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.msg.user .msg-avatar { background: var(--gradient-warm); }
.msg.bot .msg-avatar { background: var(--gradient-cool); }

.msg-bubble {
  padding: 16px 20px; border-radius: var(--radius-lg);
  max-width: 85%; line-height: 1.7; font-size: 0.92rem;
}
.msg.user .msg-bubble {
  background: var(--saffron-glow); border: 1px solid rgba(255,107,53,0.2);
  border-top-right-radius: 4px; color: var(--text-primary);
}
.msg.bot .msg-bubble {
  background: var(--bg-card); border: 1px solid var(--border-glass);
  border-top-left-radius: 4px;
  backdrop-filter: blur(12px);
}
.msg.bot .msg-bubble h2 { font-size: 1rem; margin: 12px 0 6px; color: var(--saffron); }
.msg.bot .msg-bubble h2:first-child { margin-top: 0; }
.msg.bot .msg-bubble h3 { font-size: 0.92rem; margin: 10px 0 4px; }
.msg.bot .msg-bubble p { margin-bottom: 8px; }
.msg.bot .msg-bubble ul, .msg.bot .msg-bubble ol { padding-left: 20px; margin-bottom: 8px; }
.msg.bot .msg-bubble li { margin-bottom: 4px; }
.msg.bot .msg-bubble strong { color: var(--white-accent); }
.msg.bot .msg-bubble code {
  background: rgba(255,255,255,0.06); padding: 2px 6px;
  border-radius: 4px; font-size: 0.85em;
}

/* Typing indicator */
.typing-dots { display: flex; gap: 5px; padding: 8px 0; }
.typing-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Input Area ─── */
.input-area {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 16px 20px 20px; z-index: 50;
  background: linear-gradient(to top, var(--bg-primary) 60%, transparent);
}
.input-wrapper {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl); padding: 8px 8px 8px 20px;
  backdrop-filter: blur(16px);
  transition: border-color var(--transition);
}
.input-wrapper:focus-within { border-color: var(--saffron); box-shadow: 0 0 24px var(--saffron-glow); }

#claim-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font: 400 0.95rem var(--font-main);
  resize: none; max-height: 120px; padding: 8px 0; line-height: 1.5;
}
#claim-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient-warm); border: none;
  color: #fff; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 20px rgba(255,107,53,0.4); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.send-btn svg { width: 20px; height: 20px; }

.input-footer {
  max-width: 860px; margin: 6px auto 0;
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted); padding: 0 12px;
}

/* ─── Timeline ─── */
.timeline-header { text-align: center; padding: 50px 0 30px; }
.section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.section-desc { color: var(--text-secondary); margin-bottom: 24px; }

.timeline-input-group {
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
}
#timeline-topic {
  flex: 1; padding: 12px 20px; border-radius: 50px;
  background: var(--bg-card); border: 1px solid var(--border-glass);
  color: var(--text-primary); font: 400 0.92rem var(--font-main);
  outline: none; transition: var(--transition);
}
#timeline-topic:focus { border-color: var(--green); box-shadow: 0 0 20px var(--green-glow); }

.btn-primary {
  padding: 12px 28px; border-radius: 50px;
  background: var(--gradient-cool); border: none;
  color: #fff; font: 600 0.9rem var(--font-main);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--green-glow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Timeline cards */
.timeline-content { position: relative; padding: 20px 0 0 30px; }
.timeline-content::before {
  content: ''; position: absolute; left: 14px; top: 0; bottom: 0;
  width: 2px; background: var(--border-glass);
}
.tl-event {
  position: relative; margin-bottom: 24px;
  padding: 18px 22px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px); animation: fadeUp 0.4s ease;
}
.tl-event::before {
  content: ''; position: absolute; left: -24px; top: 22px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border-glass); background: var(--bg-primary);
}
.tl-event[data-type="misinfo"]::before { border-color: #e74c3c; background: rgba(231,76,60,0.2); }
.tl-event[data-type="correction"]::before { border-color: var(--green); background: var(--green-glow); }
.tl-event[data-type="fact"]::before { border-color: var(--saffron); background: var(--saffron-glow); }
.tl-event[data-type="event"]::before { border-color: #6c5ce7; background: rgba(108,92,231,0.2); }

.tl-date { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.5px; }
.tl-title { font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.tl-desc { color: var(--text-secondary); font-size: 0.85rem; }
.tl-type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 50px;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  margin-bottom: 8px;
}
.tl-type-badge.misinfo { background: rgba(231,76,60,0.15); color: #e74c3c; }
.tl-type-badge.correction { background: var(--green-glow); color: var(--green); }
.tl-type-badge.fact { background: var(--saffron-glow); color: var(--saffron); }
.tl-type-badge.event { background: rgba(108,92,231,0.15); color: #6c5ce7; }

.tl-summary {
  padding: 20px; border-radius: var(--radius-md);
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  margin-bottom: 28px; text-align: center;
}
.tl-summary h3 { margin-bottom: 8px; }
.tl-summary-stats { display: flex; gap: 20px; justify-content: center; margin-top: 12px; }
.tl-stat { font-size: 0.85rem; color: var(--text-secondary); }
.tl-stat strong { color: var(--text-primary); }

/* ─── About ─── */
.about-container { padding: 40px 0; display: flex; flex-direction: column; gap: 24px; }
.glass-card {
  padding: 32px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
}
.glass-card h2 { margin-bottom: 16px; }
.glass-card h3 { margin-bottom: 12px; color: var(--saffron); }
.glass-card p { color: var(--text-secondary); margin-bottom: 12px; }

.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.stat-card {
  text-align: center; padding: 20px;
  border-radius: var(--radius-md); background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}
.stat-number {
  display: block; font-size: 2rem; font-weight: 800;
  background: var(--gradient-india); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; display: block; }

.how-it-works { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-warm); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.step p { color: var(--text-secondary); font-size: 0.88rem; margin-top: 2px; }

.principles-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.principles-list li { color: var(--text-secondary); font-size: 0.92rem; padding: 8px 0; border-bottom: 1px solid var(--border-glass); }
.principles-list li:last-child { border: none; }

.tech-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-badge {
  padding: 8px 18px; border-radius: 50px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  font-size: 0.85rem; color: var(--text-secondary);
}

/* ─── Loading spinner ─── */
.spinner-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border-glass);
  border-top-color: var(--saffron);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  .hero-title { font-size: 1.6rem; }
  .about-stats { grid-template-columns: 1fr; }
  .timeline-input-group { flex-direction: column; }
  .msg-bubble { max-width: 92%; }
  .nav-tab { padding: 6px 10px; font-size: 0.78rem; }
}
