﻿/* ===================================
   SEBI Grade A Study Portal — CSS
   Complete Redesign — Premium UI
   =================================== */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #07090f;
  --bg2:       #0d1117;
  --surface:   #111827;
  --surface2:  #1a2235;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);

  --blue:      #3b82f6;
  --blue-dim:  rgba(59,130,246,0.15);
  --purple:    #8b5cf6;
  --purple-dim:rgba(139,92,246,0.15);
  --teal:      #14b8a6;
  --teal-dim:  rgba(20,184,166,0.15);
  --green:     #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --orange:    #f97316;
  --orange-dim:rgba(249,115,22,0.15);
  --pink:      #ec4899;
  --pink-dim:  rgba(236,72,153,0.15);
  --red:       #ef4444;
  --yellow:    #eab308;

  --text:      #f1f5f9;
  --text-dim:  #94a3b8;
  --text-faint:#475569;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- ANIMATED BACKGROUND ---- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}
.bg-orb {
  position: fixed; border-radius: 50%; filter: blur(100px);
  pointer-events: none; z-index: 0; opacity: 0.35;
  animation: orbPulse 8s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; top: -200px; right: -150px; background: radial-gradient(circle, #3b82f6 0%, transparent 70%); animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; bottom: -150px; left: -100px; background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); animation-delay: -3s; }
.orb-3 { width: 400px; height: 400px; top: 50%; left: 50%; background: radial-gradient(circle, #14b8a6 0%, transparent 70%); animation-delay: -6s; }

@keyframes orbPulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.1); }
}

/* ---- HEADER ---- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.logo-icon { font-size: 24px; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--text); display: block; line-height: 1.2; }
.logo-sub { font-size: 11px; color: var(--text-dim); display: block; }

.nav { display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav-btn {
  background: transparent; border: none; color: var(--text-dim);
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  font-family: var(--font);
}
.nav-btn:hover { background: var(--border); color: var(--text); }
.nav-btn.active { background: var(--blue-dim); color: var(--blue); }

.header-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 20px; flex-shrink: 0;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ---- HAMBURGER BUTTON ---- */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; background: transparent; border: none;
  cursor: pointer; padding: 8px; border-radius: var(--radius-sm);
  transition: background 0.2s; flex-shrink: 0; margin-left: auto;
}
.hamburger:hover { background: var(--border); }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- MOBILE NAV ---- */
.mobile-nav {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 4px;
  animation: slideDown 0.2s ease;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav .nav-btn {
  width: 100%; text-align: left; padding: 12px 16px;
  font-size: 14px; border-radius: var(--radius-sm);
  min-height: 44px;
}
@keyframes slideDown { from{opacity:0;transform:translateY(-8px);} to{opacity:1;transform:translateY(0);} }


/* ---- MAIN ---- */
.main { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 32px 24px 80px; }

/* ---- SECTIONS ---- */
.section { display: none; animation: fadeUp 0.4s ease; }
.section.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- HERO ---- */
.hero { text-align: center; padding: 60px 0 48px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.3);
  color: var(--blue); font-size: 13px; font-weight: 600;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 20px; letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 18px; color: var(--text-dim); max-width: 620px; margin: 0 auto 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; border: none; padding: 14px 28px;
  border-radius: var(--radius); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.25s; font-family: var(--font);
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(59,130,246,0.5); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); padding: 14px 28px;
  border-radius: var(--radius); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.25s; font-family: var(--font);
}
.btn-secondary:hover { background: var(--surface2); border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }

/* ---- STATS ROW ---- */
.stats-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 16px; margin: 0 0 32px;
}

/* ---- ABOUT SEBI BANNER ---- */
.about-sebi-banner {
  background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(59,130,246,0.10));
  border: 1px solid rgba(20,184,166,0.3);
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  cursor: pointer; transition: all 0.25s;
}
.about-sebi-banner:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 4px 24px rgba(20,184,166,0.15); }
.about-sebi-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.about-sebi-icon { font-size: 36px; flex-shrink: 0; }
.about-sebi-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.about-sebi-sub { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.about-sebi-btn {
  background: var(--teal); color: #000; border: none;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex-shrink: 0; font-family: var(--font);
  transition: all 0.2s;
}
.about-sebi-btn:hover { background: #0d9488; transform: scale(1.03); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  text-align: center;
  transition: all 0.25s;
}
.stat-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.stat-num { font-size: 40px; font-weight: 800; background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.stat-detail { font-size: 12px; color: var(--text-dim); }

/* ---- FEATURE CARDS ---- */
.features-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; margin-bottom: 40px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  cursor: pointer; transition: all 0.25s;
}
.feature-card:hover { border-color: var(--blue); background: var(--surface2); transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { font-size: 32px; margin-bottom: 14px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 16px; }
.feature-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.tag-blue   { background: var(--blue-dim); color: var(--blue); }
.tag-purple { background: var(--purple-dim); color: var(--purple); }
.tag-green  { background: var(--green-dim); color: var(--green); }
.tag-teal   { background: var(--teal-dim); color: var(--teal); }
.tag-orange { background: var(--orange-dim); color: var(--orange); }
.tag-red    { background: rgba(239,68,68,0.15); color: var(--red); }
.tag-pink   { background: var(--pink-dim); color: var(--pink); }
.tag-yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }

/* ---- INFO PANEL ---- */
.info-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.panel-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pattern-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.pattern-header { background: linear-gradient(135deg, var(--blue-dim), var(--purple-dim)); color: var(--blue); padding: 12px 16px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.pattern-body { padding: 12px 16px; }
.pattern-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pattern-row:last-child { border-bottom: none; }
.pattern-row.total { font-weight: 700; color: var(--text); }
.marks { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.marks.positive { color: var(--green); }
.marks.negative { color: var(--red); }
.marks.neutral  { color: var(--text-dim); }
.marks.warning  { color: var(--yellow); }

/* ---- SECTION HEADERS ---- */
.section-header { margin-bottom: 32px; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.section-sub { color: var(--text-dim); font-size: 15px; }

/* ---- PYQ GRID ---- */
.pyq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.pyq-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  cursor: pointer; transition: all 0.25s;
  display: flex; flex-direction: column;
}
.pyq-card:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: var(--shadow); }
.pyq-card-year { font-size: 12px; font-weight: 700; margin-bottom: 10px; display: inline-block; padding: 3px 10px; border-radius: 12px; }
.pyq-card-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.pyq-card-meta { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; flex: 1; line-height: 1.6; }
.pyq-card-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pyq-stat { font-size: 12px; background: var(--bg2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 10px; color: var(--text-dim); }
.pyq-btn {
  width: 100%; background: linear-gradient(135deg, var(--blue-dim), var(--purple-dim));
  border: 1px solid rgba(59,130,246,0.3); color: var(--blue);
  padding: 10px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pyq-btn:hover { background: var(--blue-dim); border-color: var(--blue); }

/* Dual-button action row on PYQ cards */
.pyq-card-actions { display: flex; gap: 10px; margin-top: 16px; }
.pyq-btn-primary {
  flex: 1; background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border: none; color: #fff;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 2px 12px rgba(59,130,246,0.25);
}
.pyq-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(59,130,246,0.4); }
.pyq-btn-secondary {
  flex: 0 0 auto; background: var(--surface2);
  border: 1px solid var(--border2); color: var(--text-dim);
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.pyq-btn-secondary:hover { border-color: var(--yellow); color: var(--yellow); }

/* ---- GUIDES GRID ---- */
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.guide-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all 0.25s;
}
.guide-card:hover { border-color: var(--purple); transform: translateY(-3px); box-shadow: var(--shadow); }
.guide-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.guide-icon { font-size: 28px; margin-bottom: 10px; }
.guide-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.guide-subtitle { font-size: 13px; color: var(--text-dim); }
.guide-body { padding: 16px 24px; }
.guide-topics { list-style: none; margin-bottom: 16px; }
.guide-topics li { font-size: 13px; color: var(--text-dim); padding: 5px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.guide-topics li:last-child { border-bottom: none; }
.guide-topics li::before { content: "→"; color: var(--purple); font-weight: 700; flex-shrink: 0; }
.guide-footer { padding: 16px 24px; background: var(--bg2); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.guide-mcq-count { font-size: 12px; color: var(--text-dim); }
.guide-open-btn {
  background: var(--purple-dim); border: 1px solid rgba(139,92,246,0.3);
  color: var(--purple); padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font);
}
.guide-open-btn:hover { background: rgba(139,92,246,0.25); }

/* ---- ENGLISH LAYOUT ---- */
.english-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.english-topics { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: sticky; top: 88px; }
.english-topic-header { padding: 16px 20px; background: linear-gradient(135deg, var(--pink-dim), var(--purple-dim)); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--pink); }
.english-topic-btn {
  width: 100%; text-align: left; background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  color: var(--text-dim); padding: 12px 20px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  font-family: var(--font); display: flex; align-items: center; gap: 10px;
}
.english-topic-btn:last-child { border-bottom: none; }
.english-topic-btn:hover { background: var(--border); color: var(--text); }
.english-topic-btn.active { background: var(--pink-dim); color: var(--pink); font-weight: 600; }

.english-preview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 500px;
}
.preview-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 400px; text-align: center; padding: 40px;
}
.preview-icon { font-size: 48px; margin-bottom: 16px; }
.preview-placeholder h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.preview-placeholder p { font-size: 14px; color: var(--text-dim); }
.english-content { padding: 28px; }
.english-content h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--pink); }
.english-content h4 { font-size: 15px; font-weight: 700; margin: 20px 0 10px; color: var(--text); }
.english-content p { font-size: 14px; color: var(--text-dim); line-height: 1.8; margin-bottom: 14px; }
.english-content .rule-box { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--pink); border-radius: var(--radius-sm); padding: 14px 16px; margin: 12px 0; }
.english-content .rule-box strong { color: var(--pink); }
.english-content .pyq-hit { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.25); border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0; font-size: 13px; }
.english-content .pyq-hit strong { color: var(--yellow); }
.eg-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.eg-table th { background: var(--bg2); color: var(--text-dim); padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 600; }
.eg-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.eg-table tr:hover td { background: var(--border); }
.wrong { color: var(--red); font-weight: 600; }
.right { color: var(--green); font-weight: 600; }

/* ---- REVISION TABS ---- */
.revision-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.rev-tab {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: var(--font);
}
.rev-tab:hover { border-color: var(--teal); color: var(--teal); }
.rev-tab.active { background: var(--teal-dim); border-color: var(--teal); color: var(--teal); font-weight: 700; }

.revision-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  min-height: 400px;
}
.rev-table { width: 100%; border-collapse: collapse; }
.rev-table th { background: var(--bg2); color: var(--teal); padding: 10px 14px; text-align: left; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.rev-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.rev-table tr:hover td { background: rgba(20,184,166,0.05); }
.rev-table .num-cell { font-family: var(--mono); font-weight: 700; color: var(--teal); font-size: 14px; }
.rev-table .fact-cell { color: var(--text); font-weight: 600; }
.rev-section-title { font-size: 16px; font-weight: 700; color: var(--teal); margin: 20px 0 12px; display: flex; align-items: center; gap: 8px; }
.rev-section-title:first-child { margin-top: 0; }

/* ---- MODAL OVERLAY ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }

.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; width: 100%; max-width: 900px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease;
}
@keyframes slideUp { from{transform:translateY(30px);opacity:0;} to{transform:translateY(0);opacity:1;} }

.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title-group { display: flex; flex-direction: column; gap: 6px; }
.modal-year-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; display: inline-block; width: fit-content; }
.modal-title { font-size: 20px; font-weight: 800; }
.modal-desc { font-size: 13px; color: var(--text-dim); }
.modal-close {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.15s; flex-shrink: 0;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { overflow-y: auto; padding: 28px; flex: 1; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ---- Q&A DISPLAY ---- */
.qa-section-title {
  font-size: 16px; font-weight: 700; margin: 24px 0 16px;
  padding: 10px 16px; background: linear-gradient(135deg, var(--blue-dim), var(--purple-dim));
  border-left: 3px solid var(--blue); border-radius: var(--radius-sm);
  color: var(--blue);
}
.qa-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden;
}
.qa-question { padding: 14px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; transition: background 0.15s; }
.qa-question:hover { background: var(--surface2); }
.qa-question-text { flex: 1; line-height: 1.6; }
.qa-chevron { color: var(--text-dim); font-size: 12px; flex-shrink: 0; margin-top: 2px; transition: transform 0.2s; }
.qa-item.open .qa-chevron { transform: rotate(180deg); }

.qa-answer { display: none; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.qa-item.open .qa-answer { display: block; animation: slideDown 0.2s ease; }
@keyframes slideDown { from{opacity:0;transform:translateY(-6px);} to{opacity:1;transform:translateY(0);} }

.qa-answer-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-dim); border: 1px solid rgba(34,197,94,0.3);
  color: var(--green); padding: 4px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 700; margin-bottom: 10px;
}
.qa-explanation { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.qa-explanation strong { color: var(--text); }

/* ---- ANSWER KEY TABLE ---- */
.answer-key-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; margin: 16px 0;
}
.ak-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.ak-q { color: var(--text-dim); font-weight: 500; }
.ak-a { font-family: var(--mono); font-weight: 700; color: var(--green); }

/* ---- DOWNLOAD BTN ---- */
.download-row { display: flex; gap: 12px; margin-bottom: 24px; }
.download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font); text-decoration: none;
}
.download-btn:hover { border-color: var(--green); color: var(--green); }

/* ---- SUBJECT COVERAGE GRID (Home) ---- */
.subject-coverage { margin-bottom: 32px; }
.subject-coverage .panel-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.coverage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.coverage-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.coverage-phase { background: linear-gradient(135deg, var(--blue-dim), var(--purple-dim)); padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--blue); border-bottom: 1px solid var(--border); }
.coverage-item { padding: 10px 16px; font-size: 13px; color: var(--text-dim); border-bottom: 1px solid var(--border); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 8px; }
.coverage-item:last-child { border-bottom: none; }
.coverage-item:hover { background: var(--border); color: var(--text); padding-left: 20px; }

/* ---- NOTES SECTION ---- */
.notes-phase-label { font-size: 14px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--purple); border-radius: var(--radius-sm); display: inline-block; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all 0.25s; display: flex; flex-direction: column; }
.note-card:hover { border-color: var(--purple); transform: translateY(-3px); box-shadow: var(--shadow); }
.note-card-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.note-card-icon { font-size: 28px; margin-bottom: 10px; }
.note-card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.note-card-sub { font-size: 12px; color: var(--text-dim); }
.note-card-body { padding: 12px 20px; flex: 1; }
.note-topics { list-style: none; }
.note-topics li { font-size: 12px; color: var(--text-dim); padding: 4px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.note-topics li:last-child { border-bottom: none; }
.note-topics li::before { content: '▸'; color: var(--purple); font-size: 10px; flex-shrink: 0; }
.note-card-footer { padding: 12px 20px; background: var(--bg2); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.note-q-count { font-size: 11px; color: var(--text-dim); }
.note-open-btn { background: var(--purple-dim); border: 1px solid rgba(139,92,246,0.3); color: var(--purple); padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: var(--font); }
.note-open-btn:hover { background: rgba(139,92,246,0.25); }

/* ---- MARKDOWN READER MODAL ---- */
.md-reader-modal { max-width: 960px; }
.md-content { font-family: var(--font); }
.md-content h1 { font-size: 26px; font-weight: 800; margin: 0 0 20px; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 12px; }
.md-content h2 { font-size: 20px; font-weight: 700; margin: 32px 0 14px; color: var(--blue); display: flex; align-items: center; gap: 8px; }
.md-content h2::before { content: ''; width: 3px; height: 20px; background: var(--blue); border-radius: 2px; display: inline-block; flex-shrink: 0; }
.md-content h3 { font-size: 16px; font-weight: 700; margin: 22px 0 10px; color: var(--purple); }
.md-content h4 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; color: var(--text); }
.md-content p { font-size: 14px; line-height: 1.8; color: var(--text-dim); margin-bottom: 14px; }
.md-content ul, .md-content ol { margin: 8px 0 14px 20px; }
.md-content li { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 4px; }
.md-content strong { color: var(--text); font-weight: 700; }
.md-content em { color: var(--yellow); font-style: italic; }
.md-content code { font-family: var(--mono); font-size: 13px; background: var(--bg2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--teal); }
.md-content pre { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin: 14px 0; overflow-x: auto; }
.md-content pre code { background: none; border: none; padding: 0; color: var(--green); font-size: 13px; line-height: 1.7; }
.md-content blockquote { border-left: 3px solid var(--blue); background: var(--blue-dim); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 14px 0; }
.md-content blockquote p { color: var(--text); margin: 0; }
.md-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.md-content th { background: var(--bg2); color: var(--blue); padding: 10px 14px; text-align: left; font-weight: 700; border-bottom: 2px solid var(--border); }
.md-content td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.md-content tr:hover td { background: rgba(59,130,246,0.04); }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.md-content a { color: var(--blue); text-decoration: none; }
.md-content a:hover { text-decoration: underline; }

/* ---- FOOTER ---- */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 32px 24px; text-align: center;
  position: relative; z-index: 1;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-logo { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.footer-text { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.footer-note { font-size: 13px; color: var(--text-faint); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .pattern-grid { grid-template-columns: 1fr; }
  .coverage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .hamburger { display: flex; }
  .nav { display: none; }
  .header-badge { display: none; }
  .header-inner { flex-wrap: nowrap; height: 58px; }

  .hero { padding: 32px 0 24px; }
  .hero-title { font-size: clamp(26px, 7vw, 40px); }
  .hero-sub { font-size: 14px; }

  .features-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .pattern-grid { grid-template-columns: 1fr; }
  .coverage-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .pyq-grid { grid-template-columns: 1fr; }
  .guides-grid { grid-template-columns: 1fr; }
  .english-layout { grid-template-columns: 1fr; }
  .english-topics { position: static; }

  .main { padding: 20px 16px 60px; }
  .section-title { font-size: 22px; }

  /* Full-screen modal on mobile */
  .modal-overlay { align-items: flex-start; padding: 0; }
  .modal { border-radius: 0; max-height: 100dvh; width: 100vw; margin: 0; }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 20px 16px; }
  .md-reader-modal { max-width: 100vw; }

  /* PYQ card buttons stack */
  .pyq-card-actions { flex-direction: column; }
  .pyq-btn-secondary { flex: 1; justify-content: center; }

  /* Revision table scrolls horizontally */
  .rev-table { display: block; overflow-x: auto; }

  /* Hamburger always visible */
  .hamburger { display: flex; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .hero-tag { font-size: 11px; }
  .modal-title { font-size: 16px; }
  .note-card-title { font-size: 14px; }
  .pyq-btn-primary, .pyq-btn-secondary { font-size: 12px; padding: 10px 12px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .pyq-grid { grid-template-columns: 1fr; }
  .guides-grid { grid-template-columns: 1fr; }
}
