/* ============================================================
   MarathiGK.com — Main Stylesheet
   Mobile-first | Dark Mode | Marathi Unicode support
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f97316;

  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.25);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-body: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  --font-ui:   'Poppins', 'Noto Sans Devanagari', sans-serif;

  --nav-h: 64px;
  --transition: all .2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-hero: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.5);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; color: var(--text); margin-bottom: .5rem; }
.section-subtitle { color: var(--text-secondary); font-size: 1.05rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; border: 2px solid transparent;
  transition: var(--transition); cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline {
  background: transparent; color: var(--primary); border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; border-color: #25d366; }
.btn-whatsapp:hover { background: #128c7e; border-color: #128c7e; color: #fff; }
.btn-lg { padding: .8rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); height: var(--nav-h);
}
.nav-container {
  max-width: 1400px; margin: 0 auto; padding: 0 1rem;
  height: 100%; display: flex; align-items: center; gap: 1rem;
}
.nav-logo {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.3rem; font-weight: 800; color: var(--text);
  flex-shrink: 0;
}
.logo-icon { font-size: 1.4rem; }
.logo-dot { color: var(--primary); }
.nav-search {
  flex: 1; max-width: 400px; display: flex; align-items: center;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-full); overflow: hidden;
}
.nav-search input {
  flex: 1; padding: .45rem 1rem; background: transparent;
  border: none; outline: none; color: var(--text); font-family: inherit; font-size: .95rem;
}
.nav-search button {
  padding: .45rem 1rem; background: var(--primary); color: #fff; border: none;
  font-size: 1rem; transition: var(--transition);
}
.nav-search button:hover { background: var(--primary-dark); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.btn-dark-toggle {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-secondary); padding: .4rem .7rem; border-radius: 8px;
  font-size: 1rem; transition: var(--transition);
}
.btn-dark-toggle:hover { color: var(--primary); }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: .3rem;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-mobile {
  display: none; flex-direction: column; gap: 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  position: absolute; top: var(--nav-h); left: 0; right: 0;
  box-shadow: var(--shadow-lg); z-index: 99;
}
.nav-mobile a {
  padding: .9rem 1.5rem; color: var(--text); font-weight: 500;
  border-bottom: 1px solid var(--border-light); display: block;
}
.nav-mobile a:hover { background: var(--bg-secondary); color: var(--primary); }
.nav-mobile.open, .nav-hamburger.open { display: flex; }

/* ── HERO ── */
.hero {
  position: relative; overflow: hidden;
  background: var(--bg-hero); min-height: 85vh;
  display: flex; align-items: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-container {
  position: relative; z-index: 1; width: 100%; max-width: 900px;
  margin: 0 auto; padding: 4rem 1rem; text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.15); color: #fff;
  padding: .4rem 1.2rem; border-radius: var(--radius-full);
  font-size: .9rem; font-weight: 600; margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(4px);
}
.hero-title {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 900; color: #fff; line-height: 1.15;
  margin-bottom: 1rem; letter-spacing: -.02em;
}
.hero-gradient {
  background: linear-gradient(90deg, #fbbf24, #f472b6, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  color: rgba(255,255,255,.85); font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 2.5rem; line-height: 1.7;
}

/* ── HERO SEARCH BAR ── */
.hero-search-wrapper { margin-bottom: 1.5rem; }
.hero-search-box {
  position: relative; background: var(--bg-card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  display: flex; align-items: center; overflow: visible;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.hero-search-box:focus-within { border-color: var(--primary); }
.hero-search-box.small { border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.search-icon-left {
  padding: 0 1rem; color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0;
}
.hero-search-input {
  flex: 1; padding: 1.1rem .5rem; background: transparent;
  border: none; outline: none; font-size: 1.1rem;
  color: var(--text); font-family: var(--font-body);
}
.hero-search-input::placeholder { color: var(--text-muted); }
.search-voice-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 0 .75rem; font-size: 1rem; opacity: .6;
}
.hero-search-btn {
  flex-shrink: 0; background: var(--primary); color: #fff;
  border: none; padding: .9rem 1.75rem;
  font-size: 1rem; font-weight: 700; font-family: var(--font-ui);
  border-radius: 0 calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px) 0;
  display: flex; align-items: center; gap: .5rem;
  transition: var(--transition);
}
.hero-search-btn:hover { background: var(--primary-dark); }

/* ── SEARCH DROPDOWN ── */
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 200; display: none; overflow: hidden;
}
.search-dropdown.open { display: block; }
.search-dropdown-inner { max-height: 400px; overflow-y: auto; }
.sd-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text);
}
.sd-item:hover, .sd-item:focus { background: var(--bg-secondary); }
.sd-item:last-child { border-bottom: none; }
.sd-icon { color: var(--primary); font-size: 1rem; flex-shrink: 0; margin-top: 3px; }
.sd-content { flex: 1; min-width: 0; }
.sd-q { font-size: .95rem; font-weight: 500; color: var(--text); line-height: 1.4; }
.sd-q mark { background: #fef3c7; color: #92400e; border-radius: 3px; padding: 0 2px; }
.sd-meta { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.sd-ans { font-size: .85rem; color: var(--text-secondary); margin-top: 4px; }
.sd-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .95rem; }
.sd-loading { padding: 1.5rem; text-align: center; }
.sd-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TRENDING ── */
.trending-searches {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  justify-content: center; margin-bottom: 2rem;
}
.trending-label { color: rgba(255,255,255,.8); font-size: .9rem; font-weight: 600; }
.trending-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.trending-tag {
  background: rgba(255,255,255,.15); color: #fff;
  padding: .3rem .9rem; border-radius: var(--radius-full);
  font-size: .85rem; border: 1px solid rgba(255,255,255,.25);
  transition: var(--transition); backdrop-filter: blur(4px);
}
.trending-tag:hover { background: rgba(255,255,255,.3); color: #fff; }

/* ── HERO STATS ── */
.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 900; color: #fff; line-height: 1; }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.7); font-weight: 500; }
.hero-stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.3); }

/* ── CATEGORIES GRID ── */
.categories-section { background: var(--bg-secondary); }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.category-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  color: var(--text); transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: var(--cat-color, var(--primary));
  color: var(--text);
}
.cat-icon-wrap {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--cat-color, var(--primary)); font-size: 1.2rem;
}
.cat-info { flex: 1; min-width: 0; }
.cat-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.cat-count { font-size: .8rem; color: var(--text-muted); }
.cat-arrow { color: var(--text-muted); font-size: .85rem; flex-shrink: 0; }

/* ── QUESTION CARDS ── */
.questions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.question-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; color: var(--text);
  transition: var(--transition); box-shadow: var(--shadow-sm); display: block;
}
.question-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); color: var(--text); }
.q-category-badge { font-size: .78rem; color: var(--primary); font-weight: 600; margin-bottom: .75rem; }
.q-text { font-size: .97rem; font-weight: 600; line-height: 1.5; margin-bottom: .75rem; }
.q-answer-preview { font-size: .85rem; color: var(--text-secondary); }
.ans-label { font-weight: 700; color: var(--success); margin-right: .25rem; }

/* ── QUIZ CTA SECTION ── */
.quiz-cta-section { background: var(--bg-secondary); padding: 4rem 0; }
.quiz-cta-card {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border-radius: 24px; padding: 3rem; display: flex;
  align-items: center; gap: 3rem; overflow: hidden; position: relative;
}
.quiz-cta-card::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px; background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.quiz-cta-content { flex: 1; position: relative; z-index: 1; }
.quiz-cta-icon { font-size: 3rem; margin-bottom: 1rem; }
.quiz-cta-content h2 { font-size: 2rem; font-weight: 900; color: #fff; margin-bottom: .5rem; }
.quiz-cta-content p { color: rgba(255,255,255,.85); margin-bottom: 1.5rem; font-size: 1.05rem; }
.quiz-cta-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.quiz-cta-btns .btn-primary { background: #fff; color: var(--primary); border-color: #fff; }
.quiz-cta-btns .btn-primary:hover { background: #f8f8f8; }
.quiz-cta-btns .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.quiz-cta-btns .btn-outline:hover { background: rgba(255,255,255,.15); }
.quiz-cta-visual { flex-shrink: 0; position: relative; z-index: 1; }
.quiz-preview-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem;
  width: 280px; box-shadow: var(--shadow-xl);
}
.qpc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.qpc-cat { font-size: .8rem; font-weight: 700; color: var(--primary); background: var(--bg-secondary); padding: .2rem .7rem; border-radius: var(--radius-full); }
.qpc-timer { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; }
.qpc-q { font-weight: 700; margin-bottom: 1rem; color: var(--text); font-size: .95rem; }
.qpc-options { display: flex; flex-direction: column; gap: .5rem; }
.qpc-opt { padding: .5rem .9rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .85rem; color: var(--text-secondary); }
.qpc-correct { border-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); font-weight: 700; }

/* ── FEATURES ── */
.features-section { background: var(--bg); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.feature-card {
  text-align: center; padding: 2rem 1.5rem;
  background: var(--bg-secondary); border-radius: var(--radius);
  border: 1px solid var(--border); transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { color: var(--text-secondary); font-size: .9rem; }

/* ── QUESTION PAGE ── */
.breadcrumb-bar { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: .75rem 0; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .85rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); }
.breadcrumb i { color: var(--text-muted); font-size: .7rem; }
.breadcrumb span { color: var(--text-muted); }

.question-page { padding: 2rem 0 4rem; }
.question-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.question-card-full {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.q-meta { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.q-cat-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--bg-secondary); color: var(--primary);
  font-size: .8rem; font-weight: 700; padding: .3rem .8rem;
  border-radius: var(--radius-full); border: 1px solid var(--primary-light);
}
.diff-badge {
  font-size: .75rem; font-weight: 700; padding: .25rem .65rem;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: .05em;
}
.diff-easy { background: #d1fae5; color: #065f46; }
.diff-medium { background: #fef3c7; color: #92400e; }
.diff-hard { background: #fee2e2; color: #991b1b; }
.exam-badge { font-size: .78rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary); padding: .25rem .65rem; border-radius: var(--radius-full); }

.question-text { padding: 2rem 1.75rem 1.5rem; font-size: 1.25rem; font-weight: 700; line-height: 1.6; color: var(--text); }

.mcq-options { padding: 0 1.75rem 1.5rem; display: grid; gap: .6rem; }
.mcq-opt {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
}
.mcq-opt:hover { border-color: var(--primary); background: var(--bg-secondary); }
.mcq-correct { border-color: var(--success) !important; background: color-mix(in srgb, var(--success) 10%, transparent) !important; }
.opt-key { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.opt-check { margin-left: auto; color: var(--success); }

.answer-section { margin: 0 1.75rem 1.5rem; background: color-mix(in srgb, var(--success) 10%, transparent); border: 1.5px solid var(--success); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.answer-label { font-size: .85rem; font-weight: 700; color: var(--success); margin-bottom: .4rem; display: flex; align-items: center; gap: .4rem; }
.answer-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }

.explanation-section { margin: 0 1.75rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.explanation-toggle { padding: .9rem 1.25rem; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 600; background: var(--bg-secondary); color: var(--text); }
.explanation-toggle i:last-child { margin-left: auto; transition: transform .2s; }
.explanation-body { display: none; padding: 1rem 1.25rem; font-size: .95rem; line-height: 1.7; color: var(--text-secondary); }
.explanation-body.open { display: block; }

.question-actions { padding: 1rem 1.75rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; flex-wrap: wrap; }
.prev-next-nav { padding: 1rem 1.75rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; }
.prev-next-btn { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); font-size: .9rem; font-weight: 600; transition: var(--transition); padding: .5rem; border-radius: var(--radius-sm); }
.prev-next-btn:hover { color: var(--primary); background: var(--bg-secondary); }

.question-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; color: var(--text); }
.widget-title i { color: var(--primary); }
.sidebar-search { position: relative; }
.sidebar-search input { width: 100%; padding: .65rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text); font-family: inherit; font-size: .9rem; outline: none; }
.related-list { list-style: none; }
.related-list li { border-bottom: 1px solid var(--border-light); }
.related-list li:last-child { border-bottom: none; }
.related-list a { display: block; padding: .6rem 0; font-size: .88rem; color: var(--text-secondary); line-height: 1.4; }
.related-list a:hover { color: var(--primary); }
.sidebar-quiz-cta { text-align: center; background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color: #fff; }
.sqc-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.sidebar-quiz-cta h3 { color: #fff; margin-bottom: .4rem; }
.sidebar-quiz-cta p { color: rgba(255,255,255,.85); font-size: .9rem; margin-bottom: 1rem; }

/* ── CATEGORY PAGE ── */
.category-page { padding: 2rem 0 4rem; }
.category-header {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 5px solid var(--cat-color, var(--primary));
  border-radius: var(--radius); padding: 1.5rem 2rem;
  margin-bottom: 1.5rem; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.cat-header-icon {
  width: 60px; height: 60px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--cat-color, var(--primary)); flex-shrink: 0;
}
.cat-header-info { flex: 1; }
.cat-header-info h1 { font-size: 1.75rem; font-weight: 900; margin-bottom: .25rem; }
.cat-header-info p { color: var(--text-secondary); margin-bottom: .5rem; }
.cat-header-stats { display: flex; gap: 1rem; font-size: .85rem; color: var(--text-muted); }
/* ── CATEGORY SEARCH BAR ── */
.cat-search-bar {
  margin-bottom: 2rem;
}
.cat-search-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}
.cat-search-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}
.cat-search-box {
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  border: 2px solid var(--border) !important;
}
.cat-search-box:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12) !important;
}
.cat-search-box .hero-search-input {
  font-size: 1rem;
  padding: .9rem .5rem;
}
.cat-search-btn {
  border-radius: 0 calc(var(--radius-sm) - 2px) calc(var(--radius-sm) - 2px) 0 !important;
  padding: .85rem 1.4rem !important;
  font-size: .95rem !important;
}
.cat-search-hints {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: .6rem;
  font-size: .78rem;
  color: var(--text-muted);
}
.cat-search-hints span {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.cat-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; align-items: start; }
.questions-list { display: flex; flex-direction: column; gap: .65rem; }
.question-list-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  color: var(--text); transition: var(--transition);
}
.question-list-item:hover {
  border-color: var(--border);
  border-left-color: var(--primary);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateX(3px);
  background: color-mix(in srgb, var(--primary) 3%, var(--bg-card));
}
.q-number {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(99,102,241,.1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .83rem; flex-shrink: 0;
  color: var(--primary);
  border: 1.5px solid rgba(99,102,241,.2);
}
.q-list-content { flex: 1; min-width: 0; }
.q-list-text { font-weight: 600; font-size: .95rem; margin-bottom: .3rem; line-height: 1.45; }
.q-list-answer {
  font-size: .8rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--bg-secondary);
  padding: .15rem .55rem;
  border-radius: 20px;
  border: 1px solid var(--border-light);
}
.q-list-answer strong { color: var(--primary); font-weight: 700; }
.q-list-arrow { color: var(--text-muted); font-size: .8rem; transition: var(--transition); }
.question-list-item:hover .q-list-arrow { color: var(--primary); transform: translateX(2px); }
.cat-sidebar-list { list-style: none; }
.cat-sidebar-list li { border-bottom: 1px solid var(--border-light); }
.cat-sidebar-list li:last-child { border-bottom: none; }
.cat-sidebar-list li.active a {
  color: var(--primary); font-weight: 700;
  background: rgba(99,102,241,.07);
  border-radius: var(--radius-sm);
  padding-left: .5rem;
  margin: 0 -.5rem;
}
.cat-sidebar-list a {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .25rem; color: var(--text-secondary);
  font-size: .9rem; transition: var(--transition);
  border-radius: var(--radius-sm);
}
.cat-sidebar-list a:hover { color: var(--primary); padding-left: .5rem; }
.cat-count-badge {
  margin-left: auto;
  font-size: .72rem; font-weight: 700;
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: .15rem .55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  min-width: 24px; text-align: center;
}
.cat-sidebar-list li.active .cat-count-badge {
  background: rgba(99,102,241,.15);
  color: var(--primary);
  border-color: rgba(99,102,241,.25);
}

/* ── SEARCH RESULTS PAGE ── */
.search-results-page { padding: 2rem 0 4rem; }
.search-results-hero { padding: 2rem 0; }
.results-meta { color: var(--text-secondary); margin-bottom: 1.5rem; }
.results-meta strong { color: var(--text); font-size: 1.1rem; }
.results-list { display: flex; flex-direction: column; gap: 1rem; }
.result-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: block; color: var(--text); transition: var(--transition);
}
.result-card:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--text); }
.result-cat-badge { font-size: .78rem; font-weight: 700; color: var(--primary); margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.result-question { font-weight: 600; font-size: 1.02rem; margin-bottom: .5rem; line-height: 1.5; }
.result-question mark { background: #fef3c7; color: #92400e; border-radius: 3px; padding: 0 2px; }
.result-answer { font-size: .88rem; color: var(--text-secondary); margin-bottom: .5rem; }
.result-link-arrow { font-size: .82rem; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.no-results, .search-prompt { text-align: center; padding: 4rem 1rem; }
.no-results-icon, .search-prompt-icon { font-size: 4rem; margin-bottom: 1rem; }
.no-results h2, .search-prompt h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.no-results p, .search-prompt p { color: var(--text-secondary); margin-bottom: 1rem; }
.category-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.5rem; }

/* ── QUIZ PAGE ── */
.quiz-page { padding: 2rem 0 4rem; }
.quiz-hero { text-align: center; margin-bottom: 2.5rem; }
.quiz-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; margin-bottom: .5rem; }
.quiz-hero p { color: var(--text-secondary); font-size: 1.05rem; }
.quiz-quick-start { margin-bottom: 2rem; }
.quiz-start-btn {
  display: flex; align-items: center; gap: 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff; padding: 1.25rem 2rem; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; max-width: 400px; margin: 0 auto;
  transition: var(--transition); box-shadow: var(--shadow);
}
.quiz-start-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: #fff; }
.qsb-icon { font-size: 2rem; }
.quiz-start-btn div { flex: 1; }
.quiz-start-btn strong { display: block; font-size: 1.15rem; }
.quiz-start-btn small { opacity: .8; font-weight: 400; font-size: .85rem; }
.quiz-categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 3rem; }
.quiz-cat-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  color: var(--text); transition: var(--transition);
}
.quiz-cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--cat-color, var(--primary)); color: var(--text); }
.qcc-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent); display: flex; align-items: center; justify-content: center; color: var(--cat-color, var(--primary)); font-size: 1.15rem; flex-shrink: 0; }
.qcc-info { flex: 1; }
.qcc-info h3 { font-size: .95rem; font-weight: 700; margin-bottom: 2px; }
.qcc-info small { color: var(--text-muted); font-size: .8rem; }
.qcc-start { font-size: .82rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.quiz-how-section { text-align: center; padding: 3rem 0; border-top: 1px solid var(--border); }
.quiz-how-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 2rem; }
.quiz-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.quiz-step { padding: 1.5rem 1rem; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.3rem; font-weight: 900; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.quiz-step p { color: var(--text-secondary); font-size: .95rem; line-height: 1.5; }

/* ── QUIZ PLAY ── */
.quiz-play-page { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--bg-secondary); }
.quiz-play-container { width: 100%; max-width: 680px; background: var(--bg-card); border-radius: 24px; box-shadow: var(--shadow-xl); overflow: hidden; }
.quiz-play-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.quiz-cat-name { font-weight: 700; font-size: .9rem; color: var(--primary); }
.qph-progress { flex: 1; }
#qProgressText { font-size: .8rem; color: var(--text-muted); margin-bottom: .4rem; display: block; }
.progress-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s ease; }
.qph-timer { font-size: 1.1rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .3rem; }
.quiz-body { padding: 2rem 1.5rem; min-height: 250px; }
.quiz-question-text { font-size: 1.2rem; font-weight: 700; line-height: 1.6; margin-bottom: 1.5rem; color: var(--text); }
.quiz-options { display: flex; flex-direction: column; gap: .65rem; }
.quiz-opt {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-secondary);
  transition: var(--transition); color: var(--text); font-size: .97rem; font-weight: 500; text-align: left; font-family: inherit;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt-correct { border-color: var(--success) !important; background: color-mix(in srgb, var(--success) 12%, transparent) !important; color: var(--success); font-weight: 700; }
.quiz-opt-wrong { border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 12%, transparent) !important; color: var(--danger); }
.qo-key { width: 28px; height: 28px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.quiz-answer-reveal { margin-top: 1.25rem; padding: 1rem 1.25rem; background: color-mix(in srgb, var(--success) 10%, transparent); border: 1.5px solid var(--success); border-radius: var(--radius-sm); }
.qa-correct { font-weight: 700; color: var(--success); margin-bottom: .5rem; }
.qa-explanation { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; }
.quiz-footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.quiz-result-screen { padding: 3rem 2rem; text-align: center; }
.qr-grade { font-size: 2rem; margin-bottom: .5rem; }
.qr-score { font-size: 4rem; font-weight: 900; color: var(--primary); margin-bottom: 1.5rem; }
.qr-breakdown { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; }
.qr-stat span { display: block; font-size: 2rem; font-weight: 900; }
.qr-stat { text-align: center; font-size: .85rem; color: var(--text-secondary); }
.qr-stat.correct span { color: var(--success); }
.qr-stat.wrong span { color: var(--danger); }
.qr-stat.skipped span { color: var(--text-muted); }
.qr-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Quiz Summary ── */
.qr-summary { text-align: left; margin-top: 2rem; border-top: 2px solid var(--border); padding-top: 1.5rem; }
.qr-summary-item { background: var(--bg-secondary); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; border-left: 4px solid var(--border); }
.qrs-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.qrs-num { font-size: .78rem; font-weight: 700; color: var(--text-muted); background: var(--bg-card); padding: .15rem .55rem; border-radius: 20px; }
.qrs-status { font-size: .82rem; font-weight: 700; }
.qrs-question { font-size: .93rem; font-weight: 600; color: var(--text-primary); line-height: 1.5; margin-bottom: .65rem; }
.qrs-answers { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; }
.qrs-ans { padding: .3rem .7rem; border-radius: 6px; }
.correct-ans { background: #dcfce7; color: #15803d; font-size: .85rem; }
.wrong-ans   { background: #fee2e2; color: #b91c1c; font-size: .85rem; }
.qrs-explanation { margin-top: .6rem; font-size: .82rem; color: var(--text-secondary); background: var(--bg-card); padding: .5rem .75rem; border-radius: 8px; border-left: 3px solid var(--primary); line-height: 1.55; }

/* ── PAGINATION ── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .5rem; padding: 2rem 0; flex-wrap: wrap; }
.page-btn {
  display: flex; align-items: center; gap: .3rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text); font-weight: 500;
  transition: var(--transition); background: var(--bg-card);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── FOOTER ── */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 3rem 0 0; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem 3rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { font-size: 1.3rem; font-weight: 800; color: var(--text); display: block; margin-bottom: .75rem; }
.footer-brand p { color: var(--text-secondary); font-size: .9rem; line-height: 1.6; margin-bottom: 1rem; }
.footer-socials { display: flex; gap: .75rem; }
.footer-socials a { width: 36px; height: 36px; border-radius: 50%; background: var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.footer-socials a:hover { background: var(--primary); color: #fff; }
.footer-links h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--text-secondary); font-size: .9rem; }
.footer-links a:hover { color: var(--primary); }
.footer-legal { border-top: 1px solid var(--border); background: rgba(0,0,0,.06); }
[data-theme="dark"] .footer-legal { background: rgba(255,255,255,.03); }
.footer-legal-inner {
  max-width: 1200px; margin: 0 auto; padding: .85rem 1rem;
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: .5rem .65rem;
}
.footer-legal-inner a {
  font-size: .82rem; color: var(--text-muted);
  transition: color .15s;
}
.footer-legal-inner a:hover { color: var(--primary); }
.footer-legal-inner span { color: var(--border); font-size: .75rem; }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.footer-bottom p { font-size: .85rem; color: var(--text-muted); }

/* ── SCROLL TOP ── */
.scroll-top {
  position: fixed; bottom: 2rem; right: 1.5rem; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 1rem;
  box-shadow: var(--shadow-lg); transition: var(--transition); opacity: 0; pointer-events: none;
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 6rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: .65rem 1.5rem;
  border-radius: var(--radius-full); font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 1000; opacity: 0;
  transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── ALERT ── */
.alert { padding: .9rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }

/* ── 404 ── */
.page-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.page-404 .emoji { font-size: 5rem; margin-bottom: 1rem; }
.page-404 h1 { font-size: 3rem; font-weight: 900; color: var(--primary); margin-bottom: .5rem; }
.page-404 p { color: var(--text-secondary); margin-bottom: 2rem; }

/* ── ADMIN LOGIN ── */
.admin-login-body { background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.admin-login-page { width: 100%; max-width: 420px; padding: 1rem; }
.admin-login-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 2.5rem; box-shadow: var(--shadow-xl); border: 1px solid var(--border); }
.admin-login-logo { text-align: center; margin-bottom: 2rem; }
.admin-login-logo span { font-size: 3rem; display: block; margin-bottom: .5rem; }
.admin-login-logo h1 { font-size: 1.5rem; font-weight: 900; color: var(--text); }

/* ── FORM STYLES ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; color: var(--text); }
.required { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-secondary);
  color: var(--text); font-family: var(--font-body); font-size: .97rem;
  transition: border-color .2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: var(--bg-card); }
.form-group textarea { resize: vertical; min-height: 90px; }
.input-pw { position: relative; }
.input-pw input { padding-right: 3rem; }
.input-pw button { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid-2 .full-width { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 1rem; align-items: center; padding-top: .5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .question-layout, .cat-layout { grid-template-columns: 1fr; }
  .question-sidebar { order: -1; }
  .footer-container { grid-template-columns: 1fr 1fr; }
  .quiz-cta-visual { display: none; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile.open { display: flex; }
  .hero-stats .hero-stat-divider { display: none; }
  .hero-stats { gap: 1.5rem; }
  .footer-container { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-2 .full-width { grid-column: auto; }
  .quiz-cta-card { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .hero-search-input { font-size: 1rem; }
  .hero-search-btn { padding: .9rem 1rem; font-size: .9rem; }
  .footer-container { grid-template-columns: 1fr; }
  .quiz-play-header { flex-wrap: wrap; gap: .5rem; }
  .categories-grid { grid-template-columns: 1fr; }
}
