@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eff1f5;
  --ink: #111318;
  --ink-soft: #4b5563;
  --line: #e5e7eb;
  --physics: #2563eb;
  --chemistry: #ea580c;
  --biology: #059669;
  --accent: #6d28d9;
  --accent-light: #f3e8ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.seo-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.seo-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.seo-nav-in {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.seo-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.seo-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.seo-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.seo-nav-links a { text-decoration: none; transition: color .15s; }
.seo-nav-links a:hover, .seo-nav-links a.active { color: var(--ink); }
.seo-cta-sm {
  background: var(--ink);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.seo-cta-sm:hover { opacity: 0.9; }

.seo-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 20px 0 8px;
}
.seo-crumb a { text-decoration: none; font-weight: 600; color: var(--ink-soft); }
.seo-crumb a:hover { color: var(--ink); text-decoration: underline; }

.seo-hero {
  background: linear-gradient(135deg, #0b0f1c 0%, #141b33 65%, #1d153b 100%);
  color: #fff;
  border-radius: 18px;
  padding: 34px 30px;
  margin: 12px 0 28px;
  position: relative;
  overflow: hidden;
}
.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
  color: #e9d5ff;
  border: 1px solid rgba(255,255,255,0.16);
  margin-bottom: 12px;
}
.seo-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.seo-hero p {
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 15.5px;
  max-width: 760px;
}
.seo-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.seo-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f8fafc;
}
.seo-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
}
.btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
}

.seo-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.seo-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.seo-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
a.seo-card { text-decoration: none; display: block; }
a.seo-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.seo-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.seo-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.subj-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag-physics { background: #eff6ff; color: var(--physics); }
.tag-chemistry { background: #fff7ed; color: var(--chemistry); }
.tag-biology { background: #ecfdf5; color: var(--biology); }
.tag-all { background: var(--accent-light); color: var(--accent); }

.seo-section { margin: 28px 0; }
.seo-section h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.concept-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.concept-box ul { margin: 10px 0 0; padding-left: 20px; }
.concept-box li { margin-bottom: 8px; font-size: 14.5px; }

.trap-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0 26px;
  font-size: 14.5px;
}
.trap-box strong { color: #92400e; display: block; margin-bottom: 4px; }

/* Interactive Quiz Cards */
.q-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
}
.q-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}
.q-stem {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}
.q-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.q-opt {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.q-opt:hover:not(:disabled) { border-color: var(--accent); background: #faf5ff; }
.q-opt.is-correct { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.q-opt.is-wrong { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.q-exp {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13.5px;
}
.q-exp.hidden { display: none; }
.q-ncert {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent);
  font-size: 12.5px;
}

.score-bar {
  position: sticky;
  bottom: 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.formula-table th, .formula-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: top;
}
.formula-table th { background: var(--surface); font-weight: 700; }
.formula-table code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
}

.filter-input {
  width: 100%;
  max-width: 420px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.cta-banner {
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  color: #fff;
  border-radius: 16px;
  padding: 26px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 32px 0;
}
.cta-banner h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.cta-banner p { margin: 0; color: #ede9fe; font-size: 14px; max-width: 560px; }
.cta-btn-white {
  background: #fff;
  color: #4c1d95;
  text-decoration: none;
  font-weight: 800;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.seo-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 48px;
  padding: 32px 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.seo-footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.seo-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.seo-footer a { text-decoration: none; font-weight: 600; }
.seo-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Mock test specific */
.mock-shell {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 20px;
  align-items: start;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.pal-btn {
  padding: 9px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.pal-btn.current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109,40,217,0.2); }
.pal-btn.answered { background: #10b981; color: #fff; border-color: #10b981; }
.pal-btn.review { background: #f59e0b; color: #fff; border-color: #f59e0b; }

@media (max-width: 900px) {
  .seo-grid-3, .seo-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mock-shell { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .seo-nav-links { display: none; }
  .seo-grid-3, .seo-grid-4, .q-opts { grid-template-columns: 1fr; }
  .seo-hero { padding: 24px 18px; }
}
