/* ============================================
   ilmkidunya.io — Design System & Global Styles
   Premium Education Platform for Pakistan
   ============================================ */



/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors (Logo Inspired)
     #ff8a28 (Orange)
     #f367bd (Pink)
     #ffbd29 (Yellow)
     #39d7e6 (Cyan/Teal)
  */
  --primary: #d66b10;        /* Orange Darker (for text/hover) */
  --primary-light: #ff8a28;  /* Primary Orange */
  --primary-dark: #cc5f04;   /* Deep Orange */
  --primary-glow: rgba(255, 138, 40, 0.15);

  --secondary: #39d7e6;      /* Brand Cyan/Teal */
  --secondary-light: #62e1ee;
  --secondary-dark: #1faec3;

  --accent: #f367bd;         /* Pink Accent */
  --accent-light: #f795d3;
  --accent-dark: #c93693;

  --gold: #ffbd29;           /* Yellow Gold */
  --gold-dark: #dba016;

  /* Surfaces (Clean Light Theme) */
  --bg-primary: #ffffff;
  --bg-secondary: #F8F9FA;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #F8F9FA;

  /* Text */
  --text-primary: #212529;
  --text-secondary: #4A5568;
  --text-muted: #576579;
  --text-heading: #0a1d37;    /* High Contrast Deep Navy for readability */

  /* Borders */
  --border-subtle: #E2E8F0;
  --border-card: #E2E8F0;
  --border-hover: #CBD5E0;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #ff8a28 0%, #f367bd 100%); /* Orange to Pink sunset gradient */
  --gradient-hero: linear-gradient(180deg, #fffbf2 0%, #ffffff 100%);    /* Very soft warm header background */
  --gradient-card-hover: none;
  --gradient-accent: linear-gradient(135deg, #39d7e6 0%, #ffbd29 100%);  /* Cyan to Yellow gradient */

  /* Shadows (Softer, subtle shadows) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-glow: none;
  --shadow-card: 0 1px 3px 0 rgba(0,0,0,0.05), 0 1px 2px 0 rgba(0,0,0,0.03);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  overflow-x: hidden; /* Prevent horizontal scroll — on html, not body, to avoid clipping fixed elements */
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  /* NOTE: overflow-x:hidden is on <html>, not body.
     body overflow-x:hidden creates a scroll container that clips
     position:fixed children (dropdown, modals). Never put it on body. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

::selection {
  background: var(--primary-light);
  color: #fff;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* ---------- Background Orbs (Hidden for Light Theme) ---------- */
.bg-orbs {
  display: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: box-shadow var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 40px;
  width: auto;
  display: block;
  transition: transform var(--transition-fast);
}

.nav-logo:hover {
  transform: scale(1.02);
}

/* Mega Dropdown / Courses Dropdown */
.courses-dropdown {
  position: relative;
  margin-left: var(--space-md);
}

.dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-btn:hover {
  background: var(--bg-secondary);
}

.dropdown-btn::after {
  content: '';
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--text-heading);
  border-bottom: 1.5px solid var(--text-heading);
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform var(--transition-fast);
  display: inline-block;
}

.dropdown-btn.active::after {
  transform: rotate(225deg);
}

.dropdown-content {
  /* display:none by default — JS controls show/hide via inline style */
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 520px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-lg);
  z-index: 1010;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* .show class kept for fallback CSS-only context */
.dropdown-content.show {
  display: grid;
  animation: dropdownOpen 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownOpen {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.dropdown-col-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 4px;
}

.dropdown-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-links a:hover {
  background: var(--bg-secondary);
  color: var(--primary-light);
  padding-left: 12px;
}

/* Navigation Search */
.nav-search {
  flex: 1;
  max-width: 320px;
  margin: 0 var(--space-xl);
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-secondary);
  font-family: var(--font-primary);
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.nav-search input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.15);
}

.nav-search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Nav Right / Utilities */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-btn-login {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-btn-login:hover {
  color: var(--primary-light);
}

.nav-btn-signup {
  background: var(--primary-light);
  color: #0a1d37;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-btn-signup:hover {
  background: var(--primary);
  color: #ffffff;
}

.nav-links {
  display: none; /* Replaced by dropdown/nav-right utilities */
}

/* Mobile menu button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--gradient-hero);
  overflow: hidden;
  text-align: left;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(20, 143, 150, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (max-width: 991px) {
  .hero {
    text-align: center;
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-3xl);
  }
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .hero-illustration {
    order: -1; /* Display graphic above text on small screens */
    margin: 0 auto;
    max-width: 440px;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.15;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 991px) {
  .hero-actions {
    justify-content: center;
  }
}

.hero-illustration {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Hero Slideshow Styles */
.hero-slideshow {
  position: relative;
  width: 100%;
  max-width: 580px; /* Increased from 460px */
  aspect-ratio: 460 / 380;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Hide overflow for horizontal slide transitions */
}

.hero-slideshow-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(10, 42, 102, 0.06));
}

.slideshow-dots {
  display: flex;
  gap: 8px;
  margin-top: var(--space-md);
  z-index: 12;
}

.slideshow-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-card);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}

.slideshow-dots .dot:hover {
  background: var(--secondary);
}

.slideshow-dots .dot.active {
  background: var(--primary-light);
  width: 20px;
  border-radius: 4px;
}

/* Animated grid background for hero (Soft opacity for light theme) */
.hero-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(57, 215, 230, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 215, 230, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 0%, transparent 70%);
  animation: gridMove 25s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-light);
  color: var(--text-heading);
  border-bottom: 3px solid rgba(0,0,0,0.15);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 138, 40, 0.25);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-heading);
  border: 1.5px solid var(--border-card);
  border-bottom: 3px solid var(--border-card);
}

.btn-secondary:hover {
  border-color: var(--primary-light);
  background: rgba(255, 138, 40, 0.05);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-download {
  background: var(--bg-secondary);
  color: var(--secondary-dark);
  border: 1px solid var(--border-card);
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.btn-download:hover {
  background: var(--secondary-light);
  color: var(--text-heading);
  border-color: var(--secondary-light);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--secondary);
  color: var(--text-heading);
  border-bottom: 3px solid rgba(0,0,0,0.15);
}

.btn-accent:hover {
  background: var(--secondary-dark);
  color: var(--text-heading);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: block;
  color: inherit;
  text-decoration: none;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

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

.card:hover::before {
  opacity: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Subject Card specifics */
.subject-card {
  text-align: center;
  cursor: pointer;
}

.subject-card:hover .subject-icon {
  transform: scale(1.05);
}

.subject-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 1.8rem;
  transition: all var(--transition-smooth);
}

.subject-icon.physics { background: #E8F0FE; color: #1865F2; }
.subject-icon.chemistry { background: #E0F2F1; color: #148F96; }
.subject-icon.biology { background: #FBE9E7; color: #D84315; }
.subject-icon.maths { background: #FFFDE7; color: #F57F17; }
.subject-icon.islamiat { background: #F3E5F5; color: #7B1FA2; }

.card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-primary {
  background: rgba(255, 138, 40, 0.1);
  color: var(--primary);
  border: 1px solid rgba(255, 138, 40, 0.2);
}

.badge-secondary {
  background: rgba(57, 215, 230, 0.1);
  color: var(--secondary-dark);
  border: 1px solid rgba(57, 215, 230, 0.2);
}

.badge-accent {
  background: rgba(243, 103, 189, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(243, 103, 189, 0.2);
}

.badge-gold {
  background: rgba(255, 189, 41, 0.1);
  color: var(--gold-dark);
  border: 1px solid rgba(255, 189, 41, 0.2);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ---------- Section Title ---------- */
.section-title {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.section-title p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
}

.section-title .divider {
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: var(--space-md) auto 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: calc(var(--nav-height) + var(--space-lg)) 0 var(--space-md);
  background: var(--bg-secondary);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  font-size: 0.88rem;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
}

.breadcrumb-list li a {
  color: var(--text-muted);
}

.breadcrumb-list li a:hover {
  color: var(--primary-light);
}

.breadcrumb-list li:last-child {
  color: var(--primary);
  font-weight: 500;
}

.breadcrumb-list .separator {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ---------- Class Sections ---------- */
.class-section {
  margin-bottom: var(--space-3xl);
}

.class-section h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.class-section h3 .class-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

/* ---------- Download Items ---------- */
.download-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.download-item:hover {
  border-color: var(--border-hover);
  background: rgba(18, 18, 42, 0.8);
}

.download-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.download-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(108, 99, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary-light);
  flex-shrink: 0;
}

.download-meta h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.download-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Article Content ---------- */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: var(--space-2xl) 0 var(--space-md);
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: var(--space-xl) 0 var(--space-md);
}

.article-content p {
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  background: rgba(108, 99, 255, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ---------- Internal Links Section ---------- */
.internal-links {
  background: var(--bg-secondary);
  padding: var(--space-3xl) 0;
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.internal-link-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  color: var(--text-primary);
  text-decoration: none;
}

.internal-link-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  color: var(--primary-light);
}

.internal-link-card .link-icon {
  font-size: 1.5rem;
}

.internal-link-card .link-text {
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---------- Search Box ---------- */
.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1.25rem 0.9rem 3rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-base);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .nav-brand {
  margin-bottom: var(--space-md);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col h3,
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-lg);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-sm);
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 29, 55, 0.05);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-smooth);
}

.footer-social a:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 12px rgba(57, 215, 230, 0.3);
}

/* ---------- FAQ / Accordion ---------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.faq-item:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.faq-item.active {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: none;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--bg-secondary);
  color: var(--secondary-dark);
}

.faq-question .faq-toggle {
  font-size: 1.4rem;
  color: var(--secondary);
  transition: transform var(--transition-smooth), color var(--transition-smooth);
  font-weight: 400;
  display: inline-block;
  line-height: 1;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
  animation: ctaPulse 6s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-md);
  position: relative;
}

.cta-banner p {
  color: rgba(255,255,255,0.85);
  max-width: 500px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

.cta-banner .btn {
  position: relative;
}

/* ---------- Table of Contents ---------- */
.toc {
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.toc h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toc ul {
  list-style: none;
  padding: 0;
}

.toc li {
  margin-bottom: var(--space-xs);
}

.toc a {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toc a:hover {
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.08);
}

/* ---------- Notice / Alert ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
}

.notice-info {
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.notice-success {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.notice-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Animations ---------- */
.fade-in {
  /* Cards start visible by default — JS adds .will-animate before animating */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* JS adds .will-animate class first, which hides the element, then .visible shows it */
.fade-in.will-animate {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in.will-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.will-animate {
  opacity: 0;
  transform: translateX(-30px);
}

.slide-in-left.will-animate.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger animation delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* Pulse animation for CTAs */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 0 12px rgba(108, 99, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
}

.pulse {
  animation: pulse 2.5s infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: auto;
  }

  .nav {
    padding: var(--space-sm) 0;
  }

  .nav-inner {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .nav-brand {
    order: 1;
  }

  .nav-logo {
    height: 32px;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .courses-dropdown {
    margin-left: 0;
    order: 3;
    width: auto;
  }

  .nav-search {
    margin: 0;
    max-width: none;
    flex: 1;
    min-width: 200px;
    order: 4;
  }

  /* Dropdown content on mobile screens - stack vertically, still uses visibility approach */
  .dropdown-content {
    position: static;
    width: 100%;
    max-width: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: var(--space-sm) 0;
    margin-top: 4px;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    background: transparent;
    animation: none !important; /* No animation on mobile */
  }

  .dropdown-content.show {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .dropdown-col-title {
    font-size: 0.9rem;
    color: var(--primary);
    border-bottom-color: var(--border-subtle);
  }

  .dropdown-links a {
    padding: 4px 0 !important;
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    border-bottom: none !important;
  }

  /* The slide-in drawer targeting .nav-right */
  .nav-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 80px var(--space-lg) var(--space-lg);
    border-left: 1px solid var(--border-subtle);
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    gap: var(--space-md);
    z-index: 999;
  }

  .nav-right.open {
    transform: translateX(0);
  }

  .nav-right a, .nav-right .nav-link-item, .nav-right .nav-btn-highlight {
    color: #ffffff !important;
    width: 100%;
    font-size: 1.1rem;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: block;
    text-align: left;
    background: none;
    border-radius: 0;
  }

  .nav-right .nav-btn-highlight {
    background: var(--primary-light) !important;
    color: #0a1d37 !important;
    text-align: center;
    border-bottom: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-top: var(--space-sm);
  }

  .hero {
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-2xl);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .download-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .internal-links-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .internal-links-grid {
    grid-template-columns: 1fr;
  }

  .breadcrumb-list {
    font-size: 0.8rem;
    flex-wrap: wrap;
  }
}

/* ---------- Print ---------- */
@media print {
  .nav, .bg-orbs, .footer, .hero-grid {
    display: none;
  }
  body {
    background: #fff;
    color: #222;
  }
  .card {
    border: 1px solid #ccc;
    background: #f9f9f9;
  }
}

/* ============ Pairing Scheme Table Styles ============ */
.scheme-table-container {
  overflow-x: auto;
  margin: var(--space-xl) 0;
  background: rgba(18, 18, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.scheme-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.scheme-table th {
  background: rgba(108, 99, 255, 0.15);
  color: var(--text-heading);
  font-weight: 700;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 2px solid var(--border-subtle);
  font-family: var(--font-display);
}

.scheme-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.scheme-table tr:last-child td {
  border-bottom: none;
}

.scheme-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ============ Quiz / Online Test Widget ============ */
.quiz-widget {
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin: var(--space-xl) 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-md);
}

.quiz-progress-bar {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  margin-right: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.quiz-timer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 80px;
}

.quiz-screen {
  display: none;
}

.quiz-screen.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

.quiz-intro {
  text-align: center;
  padding: var(--space-xl) 0;
}

.quiz-intro h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text-heading);
}

.quiz-intro p {
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
}

.quiz-question-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.quiz-option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.quiz-option-btn:hover:not(:disabled) {
  background: rgba(108, 99, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quiz-option-btn.correct {
  background: rgba(0, 212, 170, 0.15) !important;
  border-color: var(--secondary) !important;
  color: #fff;
}

.quiz-option-btn.incorrect {
  background: rgba(255, 107, 107, 0.15) !important;
  border-color: var(--accent) !important;
  color: #fff;
}

.quiz-feedback {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: none;
}

.quiz-feedback.visible {
  display: block;
}

.quiz-feedback-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.quiz-feedback-title.correct {
  color: var(--secondary);
}

.quiz-feedback-title.incorrect {
  color: var(--accent);
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
}

.quiz-results-screen {
  text-align: center;
  padding: var(--space-xl) 0;
}

.quiz-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto var(--space-xl);
  box-shadow: 0 0 20px var(--primary-glow);
}

.quiz-score-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.quiz-score-total {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.quiz-results-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* ============ Textbook Embedded Styles ============ */
.textbook-wrapper {
  background: rgba(18, 18, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin: var(--space-xl) 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.textbook-cover-mock {
  width: 140px;
  height: 200px;
  background: linear-gradient(135deg, var(--primary) 0%, #1a1a3a 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-md);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.textbook-cover-mock::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 4%, rgba(0,0,0,0.05) 6%, rgba(255,255,255,0.04) 8%, rgba(255,255,255,0) 100%);
}

.textbook-cover-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.textbook-cover-meta {
  font-size: 0.7rem;
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.textbook-details {
  flex-grow: 1;
}

.textbook-details h3 {
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
  color: var(--text-heading);
}

.textbook-details p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
  line-height: 1.6;
}

.textbook-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.textbook-info-item {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.textbook-info-item strong {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .textbook-wrapper {
    flex-direction: column;
    text-align: center;
  }
  .textbook-cover-mock {
    margin: 0 auto;
  }
  .textbook-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ Interactive Directory Dashboard Styles ============ */
.directory-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  align-items: center;
  width: 100%;
}

.directory-controls .search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.directory-controls .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  z-index: 2;
}

.directory-controls #directory-search {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.directory-controls #directory-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(108, 99, 255, 0.25);
  background: var(--bg-surface);
}

.directory-controls .filter-tabs {
  display: flex;
  gap: var(--space-sm);
  background: rgba(18, 18, 42, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none; /* Firefox */
}

.directory-controls .filter-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.directory-controls .filter-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-smooth);
}

.directory-controls .filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.directory-controls .filter-tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

/* Directory Cards */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.directory-card {
  background: rgba(18, 18, 42, 0.4);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.directory-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-card-hover);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: 0;
}

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

.directory-card:hover::before {
  opacity: 1;
}

.directory-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.directory-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.directory-class-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.directory-class-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.directory-class-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.directory-class-row .class-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.directory-class-row .class-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.directory-class-row .res-link {
  font-size: 0.8rem;
  padding: 5px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

.directory-class-row .res-link:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .directory-grid {
    grid-template-columns: 1fr;
  }
}

/* Snippet Answer Box */
.snippet-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.snippet-box p {
  color: var(--text-primary) !important;
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}

.snippet-box p strong {
  color: var(--secondary-dark) !important;
}


/* ==========================================================================
   Interactive Infographic: Your Pathway to Exam Success on IlmkiDunya.io
   ========================================================================== */
.infographic-section {
  padding: var(--space-3xl) 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: visible; /* Must be visible so SVG paths and plane can render outside card bounds */
}

.hwb-outer {
  position: relative;
  max-width: 1000px;
  margin: var(--space-3xl) auto;
  padding: var(--space-xl) 0;
  overflow: visible;
}

.hwb-plane {
  position: absolute;
  width: 56px;
  height: 53px;
  pointer-events: none;
  z-index: 10;
  will-change: transform;
  transform-origin: center center;
  transition: opacity 0.3s ease;
}

.hwb-plane img {
  width: 100%;
  height: auto;
  display: block;
}

.hwb-steps-wrap {
  display: flex;
  flex-direction: column;
  gap: 120px; /* Large gap to allow curvy path visual spacing */
  position: relative;
}

.hwb-step {
  position: relative;
  width: 45%;
  z-index: 2;
  box-sizing: border-box;
}

.hwb-step.step-left {
  align-self: flex-start;
  margin-right: auto;
}

.hwb-step.step-right {
  align-self: flex-end;
  margin-left: auto;
}

.hwb-step-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.hwb-step:hover .hwb-step-content,
.hwb-step.active .hwb-step-content {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-lg);
}

.hwb-step-label {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

/* Label colors matching steps */
.label-yellow {
  background: rgba(255, 189, 41, 0.12);
  color: var(--gold-dark, #c58600);
}
.label-pink {
  background: rgba(243, 103, 189, 0.12);
  color: var(--accent-dark, #cc358d);
}
.label-orange {
  background: rgba(255, 138, 40, 0.12);
  color: var(--primary-light, #e06000);
}
.label-cyan {
  background: rgba(57, 215, 230, 0.12);
  color: var(--secondary-dark, #0b939c);
}

.hwb-step-content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.hwb-step-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Global SVG Paths Container — overflow:visible lets bezier arcs render
   outside the element bounds. Parent must also have overflow:visible. */
.hwb-svg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.hwb-seg {
  stroke-dasharray: 8, 8;
  animation: dashAnimation 40s linear infinite;
}

@keyframes dashAnimation {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Mobile Responsiveness for Pathway Timeline */
@media (max-width: 1024px) {
  .hwb-steps-wrap {
    gap: var(--space-lg);
  }

  .hwb-step {
    width: 100% !important;
    margin: 0 !important;
    align-self: stretch !important;
  }

  .hwb-svg-container {
    display: none !important;
  }

  #hwb-plane {
    display: none !important;
  }
  
  .hwb-step-content {
    transform: none !important;
  }
}


/* Board Exams Core Tools - Alternating Rows */
.board-tools-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  margin-top: var(--space-2xl);
}

.board-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.board-tool-row.reverse {
  direction: rtl;
}

.board-tool-row.reverse > * {
  direction: ltr;
}

.board-tool-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.board-tool-content h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.board-tool-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.board-tool-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.board-tool-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
  .board-tool-row {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .board-tool-row.reverse {
    direction: ltr;
  }
  
  .board-tool-content {
    align-items: center;
  }
  
  .board-tool-img {
    max-width: 300px;
  }
}


/* ---------- Accordion Notes Section (Khan Academy Inspired) ---------- */
.accordion-container {
  max-width: 800px;
  margin: var(--space-2xl) auto;
  border-top: 1px solid var(--border-subtle);
}

.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  transition: background-color var(--transition-fast);
}

.accordion-header {
  width: 100%;
  padding: var(--space-lg) var(--space-md);
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: var(--bg-secondary);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.accordion-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

/* Custom icon background colors matching brand/logo theme */
.class-9-icon { background: rgba(255, 138, 40, 0.1); color: var(--primary-light); }
.class-10-icon { background: rgba(57, 215, 230, 0.1); color: var(--secondary-dark); }
.class-11-icon { background: rgba(243, 103, 189, 0.15); color: var(--accent-dark); }
.class-12-icon { background: rgba(255, 189, 41, 0.15); color: var(--gold-dark); }
.sciences-icon { background: rgba(57, 215, 230, 0.1); color: var(--secondary-dark); font-size: 1.1rem; }
.humanities-icon { background: rgba(255, 138, 40, 0.1); color: var(--primary-light); font-size: 1.1rem; }

.accordion-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
}

.accordion-chevron {
  width: 12px;
  height: 12px;
  border-bottom: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition-base);
  margin-right: var(--space-sm);
  display: block;
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
  transform: rotate(-135deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth) ease-out;
  background: var(--bg-primary);
}

.accordion-panel-inner {
  padding: 0 var(--space-md) var(--space-xl) 54px; /* Aligning grid with title text */
}

.accordion-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md) var(--space-2xl);
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 600px) {
  .accordion-links-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .accordion-panel-inner {
    padding: 0 var(--space-md) var(--space-lg) var(--space-md); /* Less padding on small screens */
  }
}

.accordion-links-grid a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: color var(--transition-fast);
  display: block;
}

.accordion-links-grid a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* ---------- Digital Learning Tools Carousel ---------- */
.tools-carousel-wrapper {
  position: relative;
  margin-top: var(--space-2xl);
  display: flex;
  align-items: center;
  width: 100%;
}

.tools-carousel {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar in Firefox */
  scroll-snap-type: x mandatory;
  padding: 12px 4px; /* Space for card hover shadow */
  width: 100%;
}

.tools-carousel::-webkit-scrollbar {
  display: none; /* Hide scrollbar in Chrome/Safari */
}

.tools-carousel .tool-card {
  flex: 0 0 calc(25% - (3 * var(--space-lg) / 4));
  scroll-snap-align: start;
}

@media (max-width: 1024px) {
  .tools-carousel .tool-card {
    flex: 0 0 calc(33.333% - (2 * var(--space-lg) / 3));
  }
}

@media (max-width: 768px) {
  .tools-carousel .tool-card {
    flex: 0 0 calc(50% - (var(--space-lg) / 2));
  }
}

@media (max-width: 480px) {
  .tools-carousel .tool-card {
    flex: 0 0 100%;
  }
}

/* Carousel Overlay Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--text-heading);
  transition: all var(--transition-fast);
}

.carousel-btn:hover {
  background: var(--bg-secondary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  color: var(--primary-light);
}

.carousel-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.carousel-btn.btn-prev {
  left: -23px; /* Hang halfway off the edge */
}

.carousel-btn.btn-next {
  right: -23px; /* Hang halfway off the edge */
}

/* Tool Cards */
.tool-card {
  display: flex;
  flex-direction: column;
  border-radius: 24px; /* Rounded corners matching Image 2 */
  padding: 0;
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: 0 4px 16px rgba(10, 42, 102, 0.04);
  overflow: hidden;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(10, 42, 102, 0.08);
}

.tool-card-header {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  margin: 0;
  padding: var(--space-md) var(--space-sm);
  background: transparent;
}

.tool-card-body {
  background: #ffffff;
  border-radius: 24px 24px 0 0; /* Curves into the header */
  padding: var(--space-md);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1.25 / 1;
  width: 100%;
}

.tool-card-body img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-smooth);
}

.tool-card:hover .tool-card-body img {
  transform: scale(1.05);
}

/* Card custom background colors matching Image 2 */
.tool-study-guides {
  background: #ffe28a; /* Pastel Yellow */
}
.tool-study-guides .tool-card-header {
  color: #0a1d37;
}

.tool-flashcards {
  background: #383bdc; /* Deep Indigo/Blue */
}
.tool-flashcards .tool-card-header {
  color: #ffffff;
}

.tool-practice-tests {
  background: #ffd4a6; /* Pastel Peach */
}
.tool-practice-tests .tool-card-header {
  color: #0a1d37;
}

.tool-expert-solutions {
  background: #a6f3cf; /* Pastel Mint Green */
}
.tool-expert-solutions .tool-card-header {
  color: #0a1d37;
}

.tool-learn {
  background: #a5e8ff; /* Pastel Sky Blue */
}
.tool-learn .tool-card-header {
  color: #0a1d37;
}

/* ---------- Features Rows (Khan Academy Style) ---------- */
.features-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl);
  margin-top: var(--space-2xl);
}

.feature-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-3xl);
  align-items: stretch; /* Stretch columns to equal height */
}

.feature-row.reverse {
  grid-template-columns: 1fr 1.1fr;
}

.feature-row.reverse .feature-text {
  order: 2; /* Put text on the right */
}

.feature-row.reverse .feature-image {
  order: 1; /* Put image on the left */
}

.feature-text {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically center heading and paragraph */
  height: 340px; /* Lock height to match image container */
}

.feature-text h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}

.feature-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.feature-image {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: none; /* Removed shadow */
  border: none; /* Removed border */
  background: transparent; /* Transparent background */
  height: 340px; /* Lock height to match text container */
  width: 100%;
  transition: transform var(--transition-base);
}

.feature-image:hover {
  transform: translateY(-4px);
}

.feature-image img {
  width: 100%;
  height: 100%; /* Fill container height */
  display: block;
  object-fit: contain; /* Prevent cropping, display full image */
}

@media (max-width: 991px) {
  .features-rows {
    gap: var(--space-3xl);
  }
  
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }
  
  .feature-row.reverse .feature-text {
    order: 1;
  }
  
  .feature-row.reverse .feature-image {
    order: 2;
  }
  
  .feature-text {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto; /* Reset to auto on mobile stack */
  }
  
  .feature-image {
    max-width: 440px;
    margin: 0 auto;
    height: auto; /* Reset to auto on mobile stack */
  }
  
  .feature-image img {
    height: auto; /* Reset to auto on mobile stack */
  }
}

/* Coming Soon styles for inactive features */
.coming-soon-link {
  color: #94a3b8 !important;
  cursor: not-allowed;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.coming-soon-link::after {
  content: "Soon";
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.coming-soon-card {
  opacity: 0.65;
  cursor: not-allowed !important;
  pointer-events: none !important;
  position: relative;
  overflow: hidden;
  filter: grayscale(20%);
}

.coming-soon-card::before {
  content: "Soon";
  position: absolute;
  top: 12px;
  right: -25px;
  background: #ff8a28;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 25px;
  transform: rotate(45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}



/* ================================================
   9th Class Maths Hub Page — Component Styles
   ================================================ */
.maths-hub-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  align-items: start;
  margin-top: var(--space-2xl);
}
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-md));
  max-height: calc(100vh - var(--nav-height) - var(--space-xl));
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toc-link {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 550;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.toc-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}
@media (min-width: 992px) {
  .maths-card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-xl);
  }
}
@media (max-width: 991px) {
  .maths-hub-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
  .maths-card-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--space-lg);
  }
}

/* Interactive Tools Styles */
.interactive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
  transition: box-shadow 0.3s ease;
}
.interactive-card:hover {
  box-shadow: var(--shadow-lg);
}
.interactive-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0.75rem 0 0.75rem;
  gap: 0.25rem;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}
.tab-btn:hover {
  color: var(--primary);
  background: rgba(255, 138, 40, 0.05);
}
.tab-btn.active {
  color: var(--primary);
  background: var(--bg-card);
  border-top: 2px solid var(--primary-light);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 0 -2px 5px rgba(0,0,0,0.02);
  z-index: 2;
}
.tab-panel {
  display: none;
  animation: tabFadeIn 0.4s ease forwards;
  padding: 2rem;
}
.tab-panel.active {
  display: block;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Visual Elements styling */
.feature-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  height: 180px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}
.feature-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .feature-image-wrapper img {
  transform: scale(1.05);
}

/* Split-Layout Feature Rows for Desktop */
.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3.5rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.feature-row-image-container {
  width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-md);
}
.feature-row-image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  transition: transform 0.5s ease;
}
.feature-row:hover .feature-row-image-container img {
  transform: scale(1.03);
}
.feature-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .feature-row {
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    padding: 0;
    margin-bottom: 4.5rem;
  }
  .feature-row.alternate-layout {
    grid-template-columns: 1.2fr 1fr;
  }
  .feature-row.alternate-layout .feature-row-image-container {
    grid-column: 2;
  }
  .feature-row.alternate-layout .feature-row-content {
    grid-column: 1;
    grid-row: 1;
  }
}

/* ---------- PDF Viewer Styles ---------- */
.pdf-viewer-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border-subtle, #3b3b4f);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.pdf-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(18, 18, 42, 0.75);
  border-bottom: 1px solid var(--border-subtle, #3b3b4f);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pdf-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  word-break: break-all;
}

.pdf-viewer-wrapper {
  position: relative;
  width: 100%;
  height: 650px;
  background: #323639;
}

@media (max-width: 768px) {
  .pdf-viewer-wrapper {
    height: 480px;
  }
}

/* ---------- PDF Viewer Sidebar Layout ---------- */
.pdf-viewer-layout {
  display: flex;
  gap: var(--space-xl, 2rem);
  margin-top: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-xl, 2rem);
  position: relative;
  align-items: flex-start;
}

.pdf-toc-sidebar {
  width: 320px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: var(--shadow-card, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.toc-header {
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
  background: var(--bg-card, #f8fafc);
  border-bottom: 1px solid var(--border-card, #e2e8f0);
}

.toc-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary, #0f172a);
  font-family: var(--font-header, inherit);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-content {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

.toc-chapter-group {
  border-bottom: 1px solid var(--border-card, #e2e8f0);
}

.toc-chapter-group:last-child {
  border-bottom: none;
}

.toc-chapter-title {
  width: 100%;
  text-align: left;
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
  background: none;
  border: none;
  font-family: var(--font-primary, inherit);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toc-chapter-title:hover {
  background: var(--bg-hover, #f1f5f9);
}

.toc-toggle {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  transition: transform 0.2s ease;
}

.toc-chapter-group.collapsed .toc-parts-list {
  display: none;
}

.toc-chapter-group.collapsed .toc-toggle {
  transform: rotate(-90deg);
}

.toc-parts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f8fafc;
}

.toc-part-item {
  padding: var(--space-sm, 0.75rem) var(--space-lg, 1.5rem) var(--space-sm, 0.75rem) calc(var(--space-lg, 1.5rem) + 1rem);
  font-size: 0.88rem;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.toc-part-item:hover {
  color: var(--primary, #3b82f6);
  background: var(--bg-hover, #f1f5f9);
}

.toc-part-item.active {
  color: var(--primary, #3b82f6);
  font-weight: 600;
  background: var(--bg-active, #eff6ff);
  border-left: 3px solid var(--primary, #3b82f6);
  padding-left: calc(var(--space-lg, 1.5rem) + 1rem - 3px);
}

.pdf-viewer-main {
  flex: 1;
  min-width: 0;
}

/* Mobile TOC toggle button */
.toc-mobile-toggle {
  display: none;
  width: 100%;
  padding: var(--space-md, 1rem);
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  margin-bottom: var(--space-md, 1rem);
  font-family: var(--font-primary, inherit);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary, #3b82f6);
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* Chapter section in downloads grid */
.chapter-download-group {
  margin-bottom: var(--space-xl, 2rem);
}

.chapter-download-group:last-child {
  margin-bottom: 0;
}

.chapter-download-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-top: 0;
  margin-bottom: var(--space-md, 1rem);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary, #3b82f6);
  display: inline-block;
}

@media (max-width: 1024px) {
  .pdf-viewer-layout {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pdf-toc-sidebar {
    width: 100%;
    position: static;
    max-height: 400px;
    margin-bottom: var(--space-md, 1rem);
    display: none;
  }
  
  .pdf-toc-sidebar.open {
    display: flex;
  }
  
  .toc-mobile-toggle {
    display: flex;
  }
}

/* Nav right helper styles */
.nav-link-item {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-link-item:hover {
  color: var(--primary-light);
}

.nav-btn-highlight {
  background: var(--primary-light);
  color: #0a1d37 !important;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(255, 138, 40, 0.15);
}

.nav-btn-highlight:hover {
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 4px 8px rgba(204, 95, 4, 0.25);
}

.audience-section-title {
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.audience-section-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.audience-hero-container {
  padding: 0;
}

.audience-hero-svg {
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-social a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary, #64748b);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  color: var(--primary, #ff8a28);
  transform: translateY(-1px);
}

.footer-social-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}


