/* ============================================================
   EduPortal - Ultra Professional Modern Design System
   High Performance, Zero Cumulative Layout Shift (CLS), Sub-30KB
   Small-Screen Compatible (320px to 4K Ultrawide)
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;

  /* Refined Light Theme - Professional Indigo & Slate */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.88);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  
  --primary: #4f46e5;          /* Indigo 600 */
  --primary-hover: #4338ca;    /* Indigo 700 */
  --primary-light: #eef2ff;    /* Indigo 50 */
  --primary-border: #c7d2fe;   /* Indigo 200 */
  
  --accent: #0284c7;           /* Sky 600 */
  --accent-light: #f0f9ff;     /* Sky 50 */
  --accent-border: #bae6fd;
  
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #6366f1;
  
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 20px -3px rgba(79, 70, 229, 0.2);

  --ad-bg: #f8fafc;
  --ad-border: #cbd5e1;
  --ad-text: #64748b;

  --container-max: 1280px;
  --header-height: 68px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* High-End Dark Theme - Deep Obsidian & Electric Indigo */
  --bg-primary: #070a13;
  --bg-surface: #0e1526;
  --bg-surface-elevated: #162035;
  --bg-subtle: #141d33;
  --bg-hover: #1f2b4a;
  --bg-glass: rgba(14, 21, 38, 0.88);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --primary: #6366f1;          /* Indigo 500 */
  --primary-hover: #818cf8;    /* Indigo 400 */
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-border: rgba(99, 102, 241, 0.35);
  
  --accent: #38bdf8;           /* Sky 400 */
  --accent-light: rgba(56, 189, 248, 0.15);
  --accent-border: rgba(56, 189, 248, 0.35);
  
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: #818cf8;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 20px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px -2px rgba(99, 102, 241, 0.35);

  --ad-bg: #090e1b;
  --ad-border: #1e293b;
  --ad-text: #94a3b8;
}

/* ============================================================
   Base Reset & Clean Layout Foundation
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

img, svg {
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Reading Progress Bar (Top of Screen) */
.reading-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.1s ease-out;
}

/* ============================================================
   Header & Sleek Glass Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  will-change: transform;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.25rem;
}

/* Brand Identity */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Navigation Links */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.nav-link {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.nav-link.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-quick-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.header-quick-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Action Icons */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border-color: var(--primary-border);
  transform: translateY(-1px);
}

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 99;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--bg-surface);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.mobile-drawer-nav {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-drawer-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  font-weight: 800;
  margin: 1.25rem 0 0.35rem 0.5rem;
}

/* ============================================================
   Google Ads Responsive Display (Zero Cumulative Layout Shift)
   ============================================================ */
body.ads-disabled .ad-slot,
body.ads-disabled .gm-ad,
body.ads-disabled .gm-ad-label {
  display: none !important;
}

.ad-slot {
  width: 100%;
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.ad-slot:hover {
  border-color: var(--primary-border);
}

.ad-slot-header {
  max-width: var(--container-max);
  padding: 0.85rem 1rem;
  min-height: 98px;
  margin: 1.25rem auto 1.75rem;
}

.ad-slot-footer {
  max-width: var(--container-max);
  padding: 0.85rem 1rem;
  min-height: 98px;
  margin: 2.25rem auto 2.25rem;
}

.ad-slot-sidebar {
  min-height: 260px;
  margin: 1.5rem 0;
  padding: 1.25rem 0.75rem;
  width: 100%;
}

.ad-tag {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ad-text);
  font-weight: 700;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ad-placeholder-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ad-text);
  padding: 0.75rem;
}

.ad-placeholder-box .ad-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.ad-placeholder-box .ad-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.ad-placeholder-box .ad-info strong {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 700;
}

.ad-placeholder-box .ad-info small {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ============================================================
   Main Layout: Content + Professional Sticky Sidebar
   ============================================================ */
.page-wrapper {
  flex: 1;
  padding: 1.25rem 0 2.5rem;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.25rem;
  align-items: start;
}

.main-content-area {
  min-width: 0;
}

/* Sidebar Styles */
.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: calc(var(--header-height) + 1.25rem);
}

.sidebar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.sidebar-widget:hover {
  box-shadow: var(--shadow-md);
}

.sidebar-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
  letter-spacing: -0.015em;
}

.sidebar-title svg {
  color: var(--primary);
}

.sidebar-classes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.sidebar-class-btn {
  padding: 0.55rem 0.2rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.sidebar-class-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  transform: translateY(-1px);
}

.sidebar-class-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.sidebar-subject-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-subject-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.sidebar-subject-item a .item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-subject-item a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.sidebar-subject-item.active a {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 700;
}

/* ============================================================
   Hero Section & Filter Pills (Modern EdTech Banner)
   ============================================================ */
.hero-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(2, 132, 199, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  margin-bottom: 2.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.hero-title {
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 720px;
  margin: 0 auto 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* Quick Filter Category Pills */
.filter-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-pill {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

/* Search Box */
.search-filter-wrapper {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search-input-box {
  width: 100%;
  padding: 0.9rem 1.25rem 0.9rem 3rem;
  font-size: 0.98rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-box:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.search-icon-pos {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Metrics & Trust Bar */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-number {
  font-size: 1.5rem;
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ============================================================
   Class Cards Grid (Home Page)
   ============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title svg {
  color: var(--primary);
}

.classes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.class-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.class-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--card-color, var(--primary));
}

.class-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--primary-border);
}

.class-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.class-number-badge {
  font-size: 1.35rem;
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.class-stage-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.class-card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.class-card-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.subject-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.subject-badge-tag:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.class-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-border);
  transition: all var(--transition-fast);
}

.class-card:hover .class-card-btn {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ============================================================
   Subject & Class Overview Pages
   ============================================================ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs-sep {
  color: var(--text-light);
  font-size: 0.9rem;
}

.page-header-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.page-header-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
}

.page-header-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.subjects-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.subject-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}

.subject-item-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.subject-item-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.subject-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.subject-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.subject-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.subject-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.tag-stem {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
}

/* ============================================================
   Chapter & Content View Template (Ready for notes)
   ============================================================ */
.notes-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.chapter-unit-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.15rem;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.chapter-unit-header {
  padding: 1rem 1.35rem;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.chapter-unit-header:hover {
  background: var(--bg-hover);
}

.chapter-unit-topics {
  padding: 0.85rem 1.35rem;
  list-style: none;
}

.chapter-topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
  gap: 1rem;
}

.chapter-topic-row:last-child {
  border-bottom: none;
}

/* MathJax Equation Container (Horizontal scroll on narrow mobile screens) */
.math-equation-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-xs);
}

.math-equation-card .equation-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copy-equation-btn {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.copy-equation-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Callout Alert Boxes for Notes */
.callout-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  line-height: 1.6;
}

.callout-tip {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--text-main);
}

.callout-warning {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-main);
}

/* ============================================================
   Imported Notes & Chapter Content Styling (Class 6 - 12)
   ============================================================ */
.chapter-section {
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border);
}

.chapter-section:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.chapter-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin: 1.5rem 0 0.85rem;
  line-height: 1.3;
}

.chapter-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.25rem 0 0.6rem;
  letter-spacing: -0.015em;
}

.chapter-section p {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.chapter-section ul, .chapter-section ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  line-height: 1.75;
  font-size: 0.96rem;
}

.chapter-section li {
  margin-bottom: 0.45rem;
}

.learning-list {
  list-style: none !important;
  margin-left: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.learning-list li {
  position: relative;
  padding-left: 1.75rem;
  line-height: 1.7;
}

.learning-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 800;
  font-size: 1.1rem;
}

.note-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.note-box h3 {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.exam-box {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 5px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.exam-box h3 {
  color: var(--warning);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.fact-box {
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.fact-box h3 {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.summary-box {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 5px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.summary-box h3 {
  color: var(--success);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Notes Table Styling (Responsive scroll for small screens) */
.chapter-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.chapter-section th, .chapter-section td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  line-height: 1.55;
}

.chapter-section th {
  background: var(--bg-subtle);
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.chapter-section tr:nth-child(even) {
  background: var(--bg-subtle);
}

/* ============================================================
   Class 10 & 9 Multi-Resource Integration Styles
   Notes, Solutions (.gm-sol-hub), and CBT MCQs (.mcq-post-container)
   ============================================================ */

.chapter-notes {
  width: 100%;
}

.chapter-notes header h1 {
  font-size: 1.4rem;
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.chapter-notes header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.chapter-notes section {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--border);
}

.chapter-notes section:last-child {
  border-bottom: none;
}

.chapter-notes h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.25rem 0 0.65rem;
}

.chapter-notes h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0 0.5rem;
}

.chapter-notes p, .chapter-notes li {
  line-height: 1.75;
  color: var(--text-main);
}

/* CBT MCQ Container Responsive Harmonisation */
.mcq-post-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

[data-theme="dark"] .cbt-palette-card,
[data-theme="dark"] .cbt-question-card,
[data-theme="dark"] .cbt-report-card,
[data-theme="dark"] .solution-card {
  background: var(--bg-surface) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .q-text,
[data-theme="dark"] .palette-title,
[data-theme="dark"] .option-btn {
  color: var(--text-main) !important;
}

[data-theme="dark"] .option-btn {
  background: var(--bg-subtle) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .q-palette-btn {
  background: var(--bg-subtle) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}

/* NCERT Solutions (.gm-sol-hub) Harmonisation */
.gm-sol-hub {
  max-width: 100% !important;
  margin: 0 !important;
}

[data-theme="dark"] .gm-sol-hub {
  --surface-soft: var(--bg-subtle);
  --surface-alt: var(--bg-surface);
  --text-main: var(--text-main);
  --text-muted: var(--text-muted);
  --border-line: var(--border);
}

[data-theme="dark"] .gm-sol-hub .sol-card,
[data-theme="dark"] .gm-sol-hub .ex-block,
[data-theme="dark"] .gm-sol-hub .step-box {
  background: var(--bg-surface) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

/* Exam Test Portal Styles */
.exam-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--warning);
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.9rem;
}

.question-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-top: 1rem;
}

.palette-btn {
  padding: 0.45rem 0.2rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.palette-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Content Placeholder Banner */
.content-placeholder-notice {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  color: var(--text-muted);
  margin: 1.75rem 0;
}

.content-placeholder-notice svg {
  margin-bottom: 0.65rem;
  color: var(--text-light);
}

/* ============================================================
   Site Footer
   ============================================================ */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.85rem;
  line-height: 1.65;
  max-width: 360px;
}

.footer-col-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(2px);
  display: inline-block;
}

.footer-bottom {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.84rem;
  color: var(--text-light);
}

.footer-legal-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
}

.footer-legal-links a {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.footer-legal-links a:hover {
  color: var(--primary);
}

/* Legal and informational pages */
.legal-page-meta {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
}

.legal-page-copy h2 {
  scroll-margin-top: 95px;
}

.legal-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.legal-page-nav a {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.legal-page-callout {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
}

.legal-page-callout p {
  margin: 0;
}

.legal-contact-card {
  margin: 1.25rem 0 0;
  padding: 1.25rem 1.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.legal-contact-card p {
  margin: 0;
}

.legal-contact-card p + p {
  margin-top: 0.55rem;
}

.legal-contact-email {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--primary) !important;
  word-break: break-word;
}

/* ============================================================
   Responsive Breakpoints (Mobile First - Down to 320px)
   ============================================================ */
@media (max-width: 1024px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  
  .site-sidebar {
    position: static;
    margin-top: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }

  .header-quick-badge {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .hero-banner {
    padding: 2.25rem 1.25rem;
  }

  .classes-cards-grid {
    grid-template-columns: 1fr;
  }

  .subjects-list-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .ad-slot-header, .ad-slot-footer {
    min-height: 70px;
    padding: 0.65rem;
    margin: 1.25rem auto;
  }

  .notes-container {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .sidebar-classes-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .chapter-topic-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Editable on-page SEO content
   ========================================================================== */

.seo-page-copy {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.seo-page-copy--below {
  margin: 1.5rem 0 0;
}

.seo-page-copy h2 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.seo-page-copy h3 {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-main);
  margin: 1.25rem 0 0.45rem;
}

.seo-page-copy p,
.seo-page-copy li {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

.seo-page-copy p + p {
  margin-top: 0.8rem;
}

.seo-page-copy ul {
  margin: 0.75rem 0 0 1.15rem;
  padding: 0;
}

.seo-page-copy li + li {
  margin-top: 0.35rem;
}

.seo-page-copy a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.seo-page-copy a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .seo-page-copy {
    padding: 1rem;
  }

  .seo-page-copy h2 {
    font-size: 1.2rem;
  }

  .seo-page-copy h3 {
    font-size: 0.98rem;
  }

  .seo-page-copy p,
  .seo-page-copy li {
    font-size: 0.93rem;
  }
}
