/* ============================================================
   XYZ SCHOOL — MAIN STYLESHEET
   ============================================================ */

/* ---------- 1. RESET & BASE ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --maths-1: #DB2777;
  --maths-2: #F97316;
  --science-1: #1E3A8A;
  --science-2: #06B6D4;
  --accent: #F59E0B;
  --accent-soft: #FEF3C7;
  --bg: #F8FAFC;
  --bg-warm: #FEFCE8;
  --surface: #FFFFFF;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-glow-maths: 0 20px 50px rgba(219, 39, 119, 0.25);
  --shadow-glow-science: 0 20px 50px rgba(30, 58, 138, 0.25);

  /* Radii */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Mukta', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 60%);
  min-height: 100vh;
  /* overflow-x: hidden; */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- 2. ANIMATED BACKGROUND SYMBOLS ---------- */
.bg-symbols {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sym {
  position: absolute;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: rgba(30, 58, 138, 0.06);
  animation: float 20s ease-in-out infinite;
  user-select: none;
}

.sym-1  { top: 8%;  left: 6%;   animation-delay: 0s;   color: rgba(219, 39, 119, 0.08); }
.sym-2  { top: 20%; right: 10%; animation-delay: -3s;  color: rgba(30, 58, 138, 0.08); }
.sym-3  { top: 55%; left: 3%;   animation-delay: -6s;  }
.sym-4  { top: 70%; right: 15%; animation-delay: -9s;  color: rgba(219, 39, 119, 0.08); }
.sym-5  { top: 35%; left: 45%;  animation-delay: -12s; color: rgba(245, 158, 11, 0.12); }
.sym-6  { top: 82%; left: 40%;  animation-delay: -15s; }
.sym-7  { top: 12%; left: 30%;  animation-delay: -4s;  color: rgba(6, 182, 212, 0.1); }
.sym-8  { top: 45%; right: 4%;  animation-delay: -8s;  }
.sym-9  { top: 88%; left: 8%;   animation-delay: -11s; }
.sym-10 { top: 60%; left: 75%;  animation-delay: -14s; color: rgba(245, 158, 11, 0.12); }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-30px) rotate(8deg); }
  66%      { transform: translateY(20px) rotate(-6deg); }
}

/* ---------- 3. HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: 'Martel', serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-text {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.top-nav {
  display: flex;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: all 0.25s var(--ease);
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--maths-1);
}

/* ---------- 4. MAIN LAYOUT ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  min-height: calc(100vh - 200px);
}

/* Page fade-in for every route change */
.page-enter {
  animation: pageEnter 0.5s var(--ease) both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 5. HERO (Homepage) ---------- */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero-title {
  font-family: 'Martel', serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--science-1) 0%, var(--maths-1) 60%, var(--maths-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  animation: pageEnter 0.7s var(--ease) both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 0.5rem;
  font-weight: 500;
  animation: pageEnter 0.7s 0.1s var(--ease) both;
}

.hero-badge {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #92400E;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  animation: pageEnter 0.7s 0.2s var(--ease) both;
}

/* ---------- 6. SUBJECT CARDS (Homepage) ---------- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.75rem;
  margin-top: 1rem;
}

.subject-card {
  position: relative;
  display: block;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: white;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: pageEnter 0.6s var(--ease) both;
}

.subject-card.maths {
  background: linear-gradient(135deg, var(--maths-1) 0%, var(--maths-2) 100%);
  animation-delay: 0.15s;
}

.subject-card.science {
  background: linear-gradient(135deg, var(--science-1) 0%, var(--science-2) 100%);
  animation-delay: 0.25s;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.subject-card:hover {
  transform: translateY(-10px);
}

.subject-card.maths:hover  { box-shadow: var(--shadow-glow-maths); }
.subject-card.science:hover{ box-shadow: var(--shadow-glow-science); }

.subject-card:hover::before {
  opacity: 1;
}

.subject-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  font-size: 2.4rem;
  margin-bottom: 1.25rem;
  transition: transform 0.4s var(--ease);
}

.subject-card:hover .subject-icon {
  transform: rotate(-8deg) scale(1.08);
}

.subject-card h2 {
  font-family: 'Martel', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.subject-card p {
  font-size: 1rem;
  opacity: 0.92;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.subject-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.3s var(--ease), gap 0.3s var(--ease);
}

.subject-card:hover .subject-cta {
  background: rgba(255, 255, 255, 0.32);
  gap: 0.85rem;
}

/* ---------- 7. PAGE TITLE (Class / Chapter pages) ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s var(--ease);
}

.back-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(-3px);
}

.page-title {
  font-family: 'Martel', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* ---------- 8. CLASS SELECTOR ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.class-card {
  position: relative;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: all 0.35s var(--ease);
  overflow: hidden;
  animation: pageEnter 0.5s var(--ease) both;
}

.class-card:nth-child(1) { animation-delay: 0.05s; }
.class-card:nth-child(2) { animation-delay: 0.15s; }
.class-card:nth-child(3) { animation-delay: 0.25s; }

.class-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.class-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

.class-card:hover::after {
  opacity: 1;
}

.class-num {
  font-family: 'Martel', serif;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.class-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.class-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ---------- 9. CHAPTER GRID ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.chapter-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
  animation: pageEnter 0.45s var(--ease) both;
}

.chapter-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.chapter-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1.6rem;
  background: var(--accent-soft);
  transition: transform 0.3s var(--ease);
}

.chapter-card:hover .chapter-badge {
  transform: rotate(-6deg) scale(1.06);
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-num-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--maths-1);
  margin-bottom: 0.2rem;
}

.chapter-title {
  font-family: 'Martel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

/* ---------- 10. CHAPTER DETAIL TABS ---------- */
.chapter-hero {
  margin-bottom: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  color: white;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.25);
}

/* ---------- 11. TAB CONTENT ---------- */
.tab-panel {
  animation: pageEnter 0.4s var(--ease) both;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Notes rich content */
.notes-content h2 {
  font-family: 'Martel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--science-1);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-soft);
}

.notes-content h3 {
  font-family: 'Martel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.5rem 0 0.75rem;
}

.notes-content p {
  margin-bottom: 0.9rem;
  color: var(--text);
}

.notes-content ul,
.notes-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.notes-content li {
  margin-bottom: 0.4rem;
}

.notes-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}

.notes-content iframe {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

/* Question card (for exercises / homework / tests) */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
  animation: pageEnter 0.4s var(--ease) both;
}

.question-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.question-card h3 {
  font-family: 'Martel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--maths-1);
  margin-bottom: 0.6rem;
}

.question-card p {
  margin-bottom: 0.85rem;
  color: var(--text);
}

.question-card label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s var(--ease);
  font-weight: 500;
}

.question-card label:hover {
  background: var(--bg);
}

.question-card input[type="radio"] {
  accent-color: var(--maths-1);
  width: 18px;
  height: 18px;
}

/* ---------- 12. LOADING & ERROR STATES ---------- */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--maths-1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-right: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-msg {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  text-align: center;
  font-weight: 600;
}

/* ---------- 13. FOOTER ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-sub {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ---------- 14. RESPONSIVE ---------- */
@media (max-width: 720px) {
  #app { padding: 1.5rem 1rem 3rem; }

  .header-inner { padding: 0.75rem 1rem; }

  .logo { font-size: 1.25rem; }
  .logo-text { font-size: 1rem; }

  .top-nav .nav-link { padding: 0.4rem 0.75rem; font-size: 0.9rem; }

  .subject-grid { gap: 1.25rem; }
  .subject-card { padding: 2rem 1.5rem; }
  .subject-icon { width: 64px; height: 64px; font-size: 2rem; }
  .subject-card h2 { font-size: 1.65rem; }

  .class-grid { gap: 1rem; }
  .class-card { padding: 1.5rem 1rem; }
  .class-num { font-size: 2.4rem; }

  .chapter-grid { grid-template-columns: 1fr; }

  .tabs { padding: 0.35rem; }
  .tab-btn { padding: 0.6rem 0.9rem; font-size: 0.9rem; }

  .content-card, .question-card { padding: 1.15rem; }
}

@media (max-width: 420px) {
  .top-nav { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bg-symbols { display: none; }
}

/* ============================================================
   EXTENDED STYLES FOR NOTES CONTENT
   ============================================================ */

.notes-content .lead {
  font-size: 1.08rem;
  color: var(--text);
  font-weight: 500;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
}

.notes-content .callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  margin: 1.25rem 0;
  font-size: 0.98rem;
}

.notes-content .callout-science {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E3A8A;
}

.notes-content .muted {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

.notes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.96rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notes-table thead {
  background: linear-gradient(135deg, var(--science-1), var(--science-2));
  color: white;
}

.notes-table th,
.notes-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.notes-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.notes-table tbody tr:last-child td {
  border-bottom: none;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 1rem 0;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.notes-content .mcq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.notes-content .mcq:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.notes-content .mcq p {
  margin-bottom: 0.6rem;
}

.notes-content .mcq label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s var(--ease);
}

.notes-content .mcq label:hover {
  background: var(--bg);
}

.notes-content .mcq input[type="radio"] {
  accent-color: var(--science-1);
  width: 18px;
  height: 18px;
}

.notes-content h4 {
  font-family: 'Martel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.25rem 0 0.6rem;
}


/* ============================================================
   EXERCISE & TEST — APP-STYLE UI
   ============================================================ */

/* ---------- Question card headers ---------- */
.q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.q-number {
  font-family: 'Martel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--maths-1);
  letter-spacing: 0.02em;
}

.q-type,
.q-marks {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #92400E;
  letter-spacing: 0.02em;
}

.test-question .q-marks {
  background: #EFF6FF;
  color: var(--science-1);
}

.q-text {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.9rem;
  line-height: 1.6;
}

/* ---------- Options (shared base) ---------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: 52px;
  transition: all 0.25s var(--ease);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.option:hover {
  border-color: var(--accent);
  background: #FFFBEB;
}

.option:focus-visible {
  outline: 3px solid var(--science-2);
  outline-offset: 2px;
}

.option-marker {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
}

.option-text {
  flex: 1;
  line-height: 1.4;
}

.option-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 900;
  width: 24px;
  text-align: center;
}

/* ---------- Exercise: correct / wrong states ---------- */
.option.correct {
  background: #ECFDF5;
  border-color: var(--success);
  color: #065F46;
}

.option.correct .option-marker {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.option.correct .option-icon {
  color: var(--success);
}

.option.wrong {
  background: #FEF2F2;
  border-color: var(--danger);
  color: #991B1B;
}

.option.wrong .option-marker {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.option.wrong .option-icon {
  color: var(--danger);
}

.option:disabled {
  cursor: default;
}

/* ---------- Feedback text under options ---------- */
.q-feedback {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  display: none;
  line-height: 1.5;
}

.q-feedback:not(:empty) {
  display: block;
}

.q-feedback.success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.q-feedback.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.q-feedback.neutral {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* ---------- Answer reveal for text questions ---------- */
.answer-reveal {
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--border);
  overflow: hidden;
}

.answer-reveal summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--science-1);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.answer-reveal summary::-webkit-details-marker { display: none; }

.answer-reveal summary::before {
  content: '👁️';
  font-size: 1.05rem;
}

.answer-reveal[open] summary::before {
  content: '📖';
}

.answer-reveal .answer-body {
  padding: 0 1rem 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
}

/* ============================================================
   TEST PANEL
   ============================================================ */

.test-panel {
  /* Extra bottom space so content isn't hidden behind submit bar */
  padding-bottom: 120px;
}

/* Sticky timer + progress at top */
.test-header {
  position: sticky;
  top: 62px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.test-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.test-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.test-pill-time {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--science-1);
  font-family: 'Martel', serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.test-pill-time.warning {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #92400E;
}

.test-pill-time.danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
  animation: pulseTimer 1s infinite;
}

@keyframes pulseTimer {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* Thin progress bar under pills */
.test-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin-top: 0.6rem;
}

.test-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--science-2), var(--science-1));
  border-radius: inherit;
  transition: width 0.35s var(--ease);
}

/* Test question options — no hover states during the test */
.option-test {
  cursor: pointer;
}

.option-test:hover {
  border-color: var(--science-2);
  background: #F0FDFF;
}

.option-test input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-test input[type="radio"]:checked ~ .option-marker {
  background: var(--science-1);
  border-color: var(--science-1);
  color: white;
}

.option-test:has(input:checked) {
  background: #EFF6FF;
  border-color: var(--science-1);
}

.option-test input[type="radio"]:focus-visible ~ .option-marker {
  outline: 3px solid var(--science-2);
  outline-offset: 2px;
}

/* Locked state after submit */
.test-panel[data-submitted="true"] .option-test {
  cursor: default;
}

.test-panel[data-submitted="true"] .option-test:hover {
  border-color: var(--border);
  background: var(--surface);
}

/* ============================================================
   FIXED BOTTOM SUBMIT BAR (mobile-app style)
   ============================================================ */

.test-submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.08);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  animation: slideUpBar 0.35s var(--ease) both;
}

@keyframes slideUpBar {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.submit-bar-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.submit-info {
  flex: 1;
  min-width: 0;
}

.submit-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.submit-info-value {
  font-family: 'Martel', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--science-1);
  font-variant-numeric: tabular-nums;
}

.btn-submit {
  flex-shrink: 0;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.35);
  transition: all 0.25s var(--ease);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.45);
}

.btn-submit:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

/* ============================================================
   TEST RESULT PANEL
   ============================================================ */

.test-result {
  margin-top: 1.5rem;
  animation: pageEnter 0.5s var(--ease) both;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
  position: relative;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--science-2), var(--science-1), var(--maths-1), var(--maths-2));
}

.result-hero {
  margin-bottom: 1.25rem;
}

.result-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  animation: popIn 0.6s var(--ease) both;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-grade {
  font-family: 'Martel', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--science-1);
  margin-bottom: 0.35rem;
}

.result-message {
  color: var(--text-muted);
  font-size: 0.98rem;
  font-weight: 500;
  max-width: 340px;
  margin: 0 auto;
}

.result-score {
  margin: 1.5rem auto;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #EFF6FF, #FEF3C7);
  max-width: 320px;
}

.result-score-big {
  font-family: 'Martel', serif;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-score-total {
  font-size: 1.5rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  font-weight: 700;
}

.result-percent {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

.stat {
  padding: 0.9rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.stat-value {
  font-family: 'Martel', serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-correct { background: #ECFDF5; border-color: #A7F3D0; }
.stat-correct .stat-value { color: var(--success); }

.stat-wrong { background: #FEF2F2; border-color: #FECACA; }
.stat-wrong .stat-value { color: var(--danger); }

.stat-skip { background: #F1F5F9; border-color: #CBD5E1; }
.stat-skip .stat-value { color: var(--text-muted); }

.result-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--science-1), var(--maths-1));
  color: white;
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* Post-submit state for question cards */
.test-question.unattempted {
  opacity: 0.95;
  border-style: dashed;
}

/* ============================================================
   MOBILE APP STYLE
   ============================================================ */

@media (max-width: 720px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  #app {
    padding: 1rem 0.9rem 3rem;
  }

  /* Bigger touch targets */
  .option {
    padding: 0.95rem 0.9rem;
    min-height: 56px;
    font-size: 1.02rem;
  }

  .option-marker {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  /* Tabs stay full-width and stick in place */
  .tabs {
    border-radius: var(--radius);
    padding: 0.4rem;
  }

  .tab-btn {
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
    min-height: 44px;
  }

  /* Sticky header offset for mobile */
  .test-header {
    top: 58px;
    padding: 0.65rem 0.75rem;
  }

  .test-pill {
    font-size: 0.82rem;
    padding: 0.35rem 0.7rem;
  }

  .test-pill-time {
    font-size: 0.95rem;
  }

  /* Bigger primary buttons */
  .btn-submit {
    padding: 0.95rem 1.35rem;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
  }

  .submit-bar-inner {
    gap: 0.75rem;
  }

  .result-card {
    padding: 1.5rem 1.1rem;
  }

  .result-score-big {
    font-size: 2.5rem;
  }

  .result-grade {
    font-size: 1.35rem;
  }

  .result-stats {
    gap: 0.5rem;
  }

  .stat {
    padding: 0.75rem 0.35rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .result-actions .btn {
    flex: 1;
    min-width: 130px;
  }

  /* Larger tap area for answer reveal */
  .answer-reveal summary {
    padding: 0.9rem 1rem;
  }
}

/* Very narrow screens — stack submit bar contents */
@media (max-width: 380px) {
  .submit-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-info {
    text-align: center;
  }

  .btn-submit {
    max-width: none;
    width: 100%;
  }
}


/* ============================================================
   ITEM SELECTOR (for notes / abhyas / tests lists)
   ============================================================ */

.item-selector-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.item-selector-header h3 {
  font-family: 'Martel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.item-selector-header p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 520px;
  margin: 0 auto;
}

.item-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: all 0.3s var(--ease);
  animation: pageEnter 0.4s var(--ease) both;
  box-shadow: var(--shadow-sm);
  min-height: 84px;
  -webkit-tap-highlight-color: transparent;
}

.item-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.item-card:focus-visible {
  outline: 3px solid var(--science-2);
  outline-offset: 2px;
}

.item-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1.6rem;
  background: var(--accent-soft);
  transition: transform 0.3s var(--ease);
}

.item-card:hover .item-card-icon {
  transform: rotate(-6deg) scale(1.06);
}

.item-card-content {
  flex: 1;
  min-width: 0;
}

.item-card-label {
  font-family: 'Martel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.item-card-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}

.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.item-meta-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.item-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.item-card:hover .item-card-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* Back-to-list button on item pages */
.item-back-row {
  margin-bottom: 1.25rem;
}

/* ============================================================
   NOTES BLOCKS
   ============================================================ */

.notes-blocks > * + * {
  margin-top: 1.1rem;
}

.notes-blocks h2 {
  font-family: 'Martel', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--science-1);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-soft);
  line-height: 1.3;
}

.notes-blocks h3 {
  font-family: 'Martel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.notes-blocks p {
  color: var(--text);
  line-height: 1.7;
}

.notes-blocks ul,
.notes-blocks ol {
  padding-left: 1.5rem;
}

.notes-blocks li {
  margin-bottom: 0.35rem;
}

.notes-image {
  text-align: center;
}

.notes-image img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.notes-image .img-caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ============================================================
   SLIDESHOW
   ============================================================ */

.slideshow {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0F172A;
  box-shadow: var(--shadow-md);
  user-select: none;
}

.slideshow-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide.active { opacity: 1; }

.slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: white;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.slide-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.08);
}

.slide-prev { left: 0.75rem; }
.slide-next { right: 0.75rem; }

.slide-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.2rem;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  pointer-events: auto;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: all 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.slide-dot.active {
  background: white;
  width: 22px;
  border-radius: 999px;
}

.slide-counter {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

/* ============================================================
   FILL IN THE BLANKS — inline interactive
   ============================================================ */

.fill-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: all 0.3s var(--ease);
}

.fill-block.correct {
  border-color: var(--success);
  background: #ECFDF5;
}

.fill-block.wrong {
  border-color: var(--danger);
  background: #FEF2F2;
}

.fill-label {
  font-family: 'Martel', serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--maths-1);
  margin-bottom: 0.55rem;
}

.fill-question {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.9;
}

.fill-input {
  display: inline-block;
  min-width: 140px;
  padding: 0.35rem 0.6rem;
  margin: 0 0.3rem;
  border: none;
  border-bottom: 2px dashed var(--science-1);
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--science-1);
  text-align: center;
  outline: none;
  transition: all 0.25s var(--ease);
}

.fill-input:focus {
  border-bottom-color: var(--accent);
  background: #FFFBEB;
}

.fill-input:disabled {
  background: transparent;
  border-bottom-style: solid;
  border-bottom-color: transparent;
}

.fill-block.correct .fill-input {
  color: var(--success);
  font-weight: 800;
}

.fill-block.wrong .fill-input {
  color: var(--danger);
}

.fill-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.fill-btn {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--science-1);
  color: white;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  min-height: 42px;
  -webkit-tap-highlight-color: transparent;
}

.fill-btn:hover { background: var(--science-2); }

.fill-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.fill-feedback {
  font-size: 0.92rem;
  font-weight: 700;
}

.fill-feedback.success { color: var(--success); }
.fill-feedback.error   { color: var(--danger); }
.fill-feedback.hint    { color: #92400E; }

/* ============================================================
   INLINE MCQ (inside notes)
   ============================================================ */

.inline-mcq {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: all 0.3s var(--ease);
}

.inline-mcq.solved {
  border-color: var(--success);
}

.inline-mcq-label {
  font-family: 'Martel', serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--maths-1);
  margin-bottom: 0.55rem;
}

.inline-mcq-question {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.6;
}

.inline-mcq .options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================
   ACTIVITY / YOUTUBE / TABLE (notes blocks)
   ============================================================ */

.notes-video {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.notes-video .video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.notes-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.notes-video .video-label {
  background: var(--surface);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.notes-activity {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  color: #1E3A8A;
  line-height: 1.6;
}

.notes-activity .activity-label {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
  display: block;
}

.notes-callout {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1.5px solid;
  line-height: 1.6;
}

.notes-callout.info     { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.notes-callout.warning  { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.notes-callout.tip      { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
.notes-callout.important{ background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

.notes-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.96rem;
}

.notes-table thead {
  background: linear-gradient(135deg, var(--science-1), var(--science-2));
  color: white;
}

.notes-table th,
.notes-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.notes-table tbody tr:nth-child(even) { background: var(--bg); }
.notes-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   QUESTION TYPES (in abhyas)
   ============================================================ */

.q-type-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.q-type-mcq   { background: #FCE7F3; color: #9D174D; }
.q-type-fill  { background: #DBEAFE; color: #1E40AF; }
.q-type-vsa   { background: #DCFCE7; color: #166534; }
.q-type-sa    { background: #FED7AA; color: #9A3412; }
.q-type-la    { background: #E9D5FF; color: #6B21A8; }
.q-type-hots  { background: #FEE2E2; color: #991B1B; }

@media (max-width: 720px) {
  .item-cards { grid-template-columns: 1fr; }
  .item-card  { padding: 1rem; }

  .slideshow-track { aspect-ratio: 4 / 3; }
  .slide-nav { width: 38px; height: 38px; font-size: 1.35rem; }
  .slide-prev { left: 0.4rem; }
  .slide-next { right: 0.4rem; }
  .slide-dots { bottom: 3.5rem; }

  .fill-input { min-width: 100px; font-size: 0.98rem; }
  .fill-btn { font-size: 0.88rem; padding: 0.5rem 0.9rem; }
}

/* ============================================================
   HOMEWORK HEADER
   ============================================================ */

.hw-header {
  margin-bottom: 1.25rem;
}

.hw-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border: 1.5px solid #FCD34D;
}

.hw-icon {
  font-size: 1.85rem;
  flex-shrink: 0;
}

.hw-title-text {
  font-family: 'Martel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #92400E;
  line-height: 1.3;
}

.hw-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #78350F;
  font-weight: 600;
}

.hw-task-due,
.hw-marks {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.4rem;
}

.hw-task-due { color: #B45309; }