/* =============================================================================
   HKSI Paper 1 Interactive Study Experience - Design System
   Topic 1: Regulatory Overview of the Hong Kong Financial Industry

   A premium, modern CSS design system inspired by Bloomberg Terminal aesthetics
   combined with contemporary learning platform patterns.

   Table of Contents:
   1.  CSS Custom Properties (Theming)
   2.  Reset & Base Styles
   3.  Typography
   4.  Layout (Sidebar, Main, Grid)
   5.  Reading Progress Bar
   6.  Hero Section
   7.  Navigation Sidebar
   8.  Section Cards
   9.  Timeline
   10. Org Chart
   11. Flashcards
   12. Quiz Components
   13. Progress Ring
   14. Stat Cards
   15. Accordion
   16. Comparison Table
   17. Key Terms & Tooltips
   18. Modal
   19. Tabs
   20. Search Box
   21. Breadcrumb
   22. Badges
   23. Alert Boxes
   24. Floating TOC
   25. Back to Top & FAB
   26. Hamburger & Mobile Overlay
   27. Animations (@keyframes)
   28. Scroll Animations
   29. Utility Classes
   30. Responsive Breakpoints
   31. Dark Mode Overrides
   ============================================================================= */


/* =============================================================================
   1. CSS CUSTOM PROPERTIES (THEMING)
   ============================================================================= */

:root {
  /* --- Primary Palette --- */
  --color-primary: #0a1628;
  --color-primary-light: #132040;
  --color-primary-lighter: #1a2d52;
  --color-gold: #c9a84c;
  --color-gold-light: #e0c872;
  --color-gold-dark: #a68a35;

  /* --- Secondary Palette --- */
  --color-teal: #0ea5e9;
  --color-teal-light: #38bdf8;
  --color-teal-dark: #0284c7;
  --color-coral: #f97316;
  --color-coral-light: #fb923c;

  /* --- Semantic Colors --- */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.1);
  --color-warning: #eab308;
  --color-warning-bg: rgba(234, 179, 8, 0.1);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info: #0ea5e9;
  --color-info-bg: rgba(14, 165, 233, 0.1);

  /* --- Neutral Scale --- */
  --color-white: #ffffff;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* --- Theme-aware tokens (light mode defaults) --- */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0a1628;
  --bg-code: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.7);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #0ea5e9;

  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-gold: 0 4px 14px rgba(201, 168, 76, 0.25);
  --shadow-teal: 0 4px 14px rgba(14, 165, 233, 0.2);
  --shadow-card-hover: 0 20px 40px rgba(10, 22, 40, 0.12);

  /* --- Spacing Scale --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* --- Typography --- */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;
  --letter-spacing-tight: -0.02em;

  /* --- Layout --- */
  --sidebar-width: 280px;
  --content-max-width: 860px;
  --header-height: 0px;
  --progress-height: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index Scale --- */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-tooltip: 500;
  --z-progress: 600;
  --z-toast: 700;
}


/* =============================================================================
   2. RESET & BASE STYLES
   ============================================================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-teal-light);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background-color: rgba(14, 165, 233, 0.2);
  color: var(--text-primary);
}

ul, ol {
  list-style: none;
}

hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: var(--space-xl) 0;
}


/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: 700;
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

p {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* Gradient text effect for feature headings */
.heading-gradient,
.gradient-text {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Legal reference / regulation cite styling */
code, .code-ref {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-code);
  color: var(--color-coral);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.legal-ref {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-teal);
  background: var(--color-info-bg);
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  font-weight: 500;
  white-space: nowrap;
}

blockquote {
  border-left: 4px solid var(--color-gold);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Small caps for abbreviations */
abbr {
  font-variant: small-caps;
  text-decoration: none;
  letter-spacing: 0.05em;
  cursor: help;
}


/* =============================================================================
   4. LAYOUT (Sidebar, Main, Grid)
   ============================================================================= */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-2xl) var(--space-2xl) var(--space-3xl);
  transition: margin-left var(--transition-base);
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Section spacing */
.section {
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--border-color);
}

.section:last-child {
  border-bottom: none;
}

/* Grid utilities */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}


/* =============================================================================
   5. READING PROGRESS BAR
   ============================================================================= */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--progress-height);
  z-index: var(--z-progress);
  background: var(--border-color-light);
}

.reading-progress__bar,
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-teal), var(--color-gold));
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}


/* =============================================================================
   6. HERO SECTION
   ============================================================================= */

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1628 0%, #132040 30%, #0c2340 60%, #0a1628 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  margin-left: calc(-1 * var(--sidebar-width));
  padding-left: var(--sidebar-width);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(201, 168, 76, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(249, 115, 22, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Animated floating particles (pure CSS) */
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(201, 168, 76, 0.4), transparent),
    radial-gradient(2px 2px at 25% 60%, rgba(14, 165, 233, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 40% 30%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 55% 75%, rgba(201, 168, 76, 0.3), transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(14, 165, 233, 0.4), transparent),
    radial-gradient(2px 2px at 85% 50%, rgba(255, 255, 255, 0.15), transparent),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(201, 168, 76, 0.25), transparent),
    radial-gradient(1px 1px at 90% 80%, rgba(14, 165, 233, 0.2), transparent),
    radial-gradient(2px 2px at 50% 10%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 65% 45%, rgba(201, 168, 76, 0.15), transparent);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: var(--space-xl);
}

.hero-section h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--color-white);
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.8s ease forwards;
}

.hero-section .hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--color-gray-400);
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-section .hero-badge {
  display: inline-block;
  font-size: var(--font-size-sm);
  color: var(--color-gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
  background: rgba(201, 168, 76, 0.08);
  padding: 0.4em 1.2em;
  border-radius: var(--radius-full);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.85em 2em;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--shadow-gold);
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.4);
  color: var(--color-primary);
}

.hero-cta:active {
  transform: translateY(0);
}

/* Decorative grid lines in hero */
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}


/* =============================================================================
   7. NAVIGATION SIDEBAR
   ============================================================================= */

.nav-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  color: var(--color-gray-300);
  overflow-y: auto;
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform var(--transition-base);
}

/* Sidebar scrollbar styling */
.nav-sidebar::-webkit-scrollbar {
  width: 4px;
}

.nav-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.nav-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

.nav-sidebar__header {
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-sidebar__logo {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.02em;
}

.nav-sidebar__logo span {
  color: var(--color-gold);
}

.nav-sidebar__tagline {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Navigation links */
.nav-sidebar__links,
.nav-links {
  padding: var(--space-md) 0;
  flex: 1;
}

.nav-sidebar__link,
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.7rem var(--space-lg);
  color: var(--color-gray-400);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  border-left: 3px solid transparent;
}

.nav-sidebar__link:hover,
.nav-link:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.04);
}

.nav-sidebar__link.active,
.nav-link.active {
  color: var(--color-gold);
  background: rgba(201, 168, 76, 0.06);
  border-left-color: var(--color-gold);
}

/* Section progress indicator dot */
.nav-sidebar__link .progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-700);
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.nav-sidebar__link.completed .progress-dot {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.nav-sidebar__link.active .progress-dot {
  background: var(--color-gold);
  animation: pulse 2s ease infinite;
}

/* Sidebar section progress bar */
.nav-sidebar__progress {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-sidebar__progress-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-sidebar__progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.nav-sidebar__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-teal));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}


/* =============================================================================
   8. SECTION CARDS
   ============================================================================= */

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: visible;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-teal), var(--color-gold));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.section-card:hover::before {
  opacity: 1;
}

.section-card__number {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-teal);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-sm);
}

.section-card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.section-card__description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Glassmorphism variant */
.section-card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}


/* =============================================================================
   9. TIMELINE
   ============================================================================= */

.timeline {
  position: relative;
  padding: var(--space-xl) 0;
}

/* Central connecting line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--color-teal), var(--color-gold), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: var(--space-lg) var(--space-2xl);
  margin-bottom: var(--space-xl);
}

/* Alternating layout */
.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: var(--space-3xl);
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: var(--space-3xl);
}

/* Animated dot on the timeline */
.timeline-item::before {
  content: '';
  position: absolute;
  top: var(--space-xl);
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border: 3px solid var(--color-teal);
  border-radius: 50%;
  z-index: 2;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.timeline-item:nth-child(odd)::before {
  right: -8px;
}

.timeline-item:nth-child(even)::before {
  left: -8px;
}

.timeline-item:hover::before {
  background: var(--color-gold);
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.5);
}

/* Connector arm to dot */
.timeline-item::after {
  content: '';
  position: absolute;
  top: calc(var(--space-xl) + 6px);
  width: var(--space-xl);
  height: 2px;
  background: var(--border-color);
}

.timeline-item:nth-child(odd)::after {
  right: 0;
}

.timeline-item:nth-child(even)::after {
  left: 0;
}

.timeline-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-base);
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
}

.timeline-date {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
}

.timeline-card h4 {
  margin-bottom: var(--space-sm);
}


/* =============================================================================
   10. ORG CHART
   ============================================================================= */

.org-chart {
  position: relative;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  overflow: auto;
  min-height: 400px;
}

.org-chart__container {
  display: flex;
  justify-content: center;
  min-width: fit-content;
}

.org-chart__zoom-controls {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: var(--space-xs);
  z-index: 5;
}

.org-chart__zoom-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  transition: all var(--transition-fast);
}

.org-chart__zoom-btn:hover {
  background: var(--color-teal);
  color: white;
  border-color: var(--color-teal);
}

.org-chart__node {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  min-width: 160px;
}

.org-chart__node:hover {
  border-color: var(--color-teal);
  box-shadow: var(--shadow-teal);
  transform: translateY(-2px);
}

.org-chart__node--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-lighter));
  color: var(--color-white);
  border-color: var(--color-gold);
}

.org-chart__node-title {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.org-chart__node-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}


/* =============================================================================
   11. FLASHCARDS
   ============================================================================= */

.flashcard-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
}

.flashcard {
  perspective: 1000px;
  height: 220px;
  cursor: pointer;
}

.flashcard__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard__inner {
  transform: rotateY(180deg);
}

.flashcard__front,
.flashcard__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--border-color);
}

.flashcard__front {
  background: linear-gradient(145deg, var(--color-primary), var(--color-primary-lighter));
  color: var(--color-white);
  box-shadow: var(--shadow-lg);
}

.flashcard__front h4 {
  color: var(--color-white);
  font-size: var(--font-size-lg);
}

.flashcard__front .flashcard__hint {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  margin-top: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.flashcard__back {
  background: var(--bg-card);
  transform: rotateY(180deg);
  box-shadow: var(--shadow-lg);
}

.flashcard__back p {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Decorative corner accent */
.flashcard__front::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, transparent 50%, rgba(201, 168, 76, 0.15) 50%);
  border-radius: 0 var(--radius-lg) 0 0;
}


/* =============================================================================
   12. QUIZ COMPONENTS
   ============================================================================= */

.quiz-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  max-width: 700px;
  margin: var(--space-xl) auto;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.quiz-question-number {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quiz-score {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

.quiz-question {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  line-height: var(--line-height-normal);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

/* Custom radio circle */
.quiz-option::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-300);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.quiz-option:hover {
  border-color: var(--color-teal);
  background: var(--color-info-bg);
}

.quiz-option:hover::before {
  border-color: var(--color-teal);
}

/* Selected state */
.quiz-option.selected {
  border-color: var(--color-teal);
  background: var(--color-info-bg);
}

.quiz-option.selected::before {
  border-color: var(--color-teal);
  background: var(--color-teal);
  box-shadow: inset 0 0 0 4px var(--bg-card);
}

/* Correct answer */
.quiz-option.correct {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.quiz-option.correct::before {
  border-color: var(--color-success);
  background: var(--color-success);
  box-shadow: inset 0 0 0 4px var(--bg-card);
}

/* Incorrect answer */
.quiz-option.incorrect {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.quiz-option.incorrect::before {
  border-color: var(--color-danger);
  background: var(--color-danger);
  box-shadow: inset 0 0 0 4px var(--bg-card);
}

/* Feedback after answer */
.quiz-feedback {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  animation: fadeInUp 0.3s ease;
}

.quiz-feedback--correct {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
  color: var(--color-success);
}

.quiz-feedback--incorrect {
  background: var(--color-danger-bg);
  border-left: 4px solid var(--color-danger);
  color: var(--color-danger);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}


/* =============================================================================
   13. PROGRESS RING
   ============================================================================= */

.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring__svg {
  transform: rotate(-90deg);
}

.progress-ring__circle-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 6;
}

.progress-ring__circle {
  fill: none;
  stroke: url(#progress-gradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--transition-slow);
  animation: progressFill 1.5s ease forwards;
}

.progress-ring__text {
  position: absolute;
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--text-primary);
}

.progress-ring__label {
  position: absolute;
  bottom: -var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* =============================================================================
   14. STAT CARDS
   ============================================================================= */

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-teal), var(--color-gold));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-info-bg);
  color: var(--color-teal);
}

.stat-card__value,
.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-card__label,
.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Counter animation class */
.stat-card__value[data-animate] {
  animation: countUp 1.5s ease forwards;
}


/* =============================================================================
   15. ACCORDION
   ============================================================================= */

.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.accordion__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
}

.accordion__header:hover {
  background: var(--bg-tertiary);
}

.accordion__icon {
  width: 20px;
  height: 20px;
  position: relative;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.accordion__icon::before,
.accordion__icon::after {
  content: '';
  position: absolute;
  background: var(--text-secondary);
  border-radius: 1px;
}

.accordion__icon::before {
  width: 12px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.accordion__icon::after {
  width: 2px;
  height: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.accordion.open .accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base) ease;
}

.accordion.open .accordion__body {
  max-height: 1000px;
}

.accordion__content {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

/* Accordion with accent color variants */
.accordion--teal .accordion__header {
  border-left: 3px solid var(--color-teal);
}

.accordion--gold .accordion__header {
  border-left: 3px solid var(--color-gold);
}


/* =============================================================================
   16. COMPARISON TABLE
   ============================================================================= */

.comparison-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-xl) 0;
}

.comparison-table__header {
  padding: var(--space-lg);
  font-weight: 700;
  text-align: center;
  font-size: var(--font-size-lg);
}

.comparison-table__header:first-child {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
  color: var(--color-teal);
  border-right: 1px solid var(--border-color);
  border-bottom: 2px solid var(--color-teal);
}

.comparison-table__header:nth-child(2) {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.1), rgba(201, 168, 76, 0.05));
  color: var(--color-gold-dark);
  border-bottom: 2px solid var(--color-gold);
}

.comparison-table__cell {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color-light);
  background: var(--bg-card);
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.comparison-table__cell:nth-child(odd) {
  border-right: 1px solid var(--border-color);
}

.comparison-table__cell:nth-last-child(-n+2) {
  border-bottom: none;
}


/* =============================================================================
   17. KEY TERMS & TOOLTIPS
   ============================================================================= */

.key-term {
  position: relative;
  display: inline;
  font-weight: 600;
  color: var(--color-teal);
  border-bottom: 2px dotted rgba(14, 165, 233, 0.4);
  cursor: help;
  transition: color var(--transition-fast);
}

.key-term:hover {
  color: var(--color-teal-light);
}

.key-term:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip */
.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 400;
  white-space: nowrap;
  max-width: 300px;
  white-space: normal;
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
  line-height: var(--line-height-normal);
}

/* Tooltip arrow */
.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-primary);
}

/* Tooltip directional variants */
.tooltip--bottom {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-6px);
}

.tooltip--bottom::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--color-primary);
}


/* =============================================================================
   18. MODAL
   ============================================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}

.modal.open .modal__content {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: var(--font-size-xl);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal__header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.modal__title {
  font-size: var(--font-size-2xl);
}


/* =============================================================================
   19. TABS
   ============================================================================= */

.tab-container {
  margin: var(--space-xl) 0;
}

.tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-buttons::-webkit-scrollbar {
  display: none;
}

.tab-button {
  padding: var(--space-md) var(--space-xl);
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab-button.active {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
}

.tab-content {
  display: none;
  padding: var(--space-xl) 0;
  animation: fadeInUp 0.3s ease;
}

.tab-content.active {
  display: block;
}


/* =============================================================================
   20. SEARCH BOX
   ============================================================================= */

.search-box {
  position: relative;
  max-width: 400px;
}

.search-box__input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.8rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box__input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.search-box__input::placeholder {
  color: var(--text-tertiary);
}

.search-box__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: var(--font-size-base);
  pointer-events: none;
}

/* Search results dropdown */
.search-box__results,
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.search-box__results.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-box__result-item {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color-light);
  font-size: var(--font-size-sm);
}

.search-box__result-item:last-child {
  border-bottom: none;
}

.search-box__result-item:hover {
  background: var(--bg-tertiary);
}

.search-box__result-item mark {
  background: rgba(201, 168, 76, 0.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}


/* =============================================================================
   21. BREADCRUMB
   ============================================================================= */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.breadcrumb__item {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.breadcrumb__item:hover {
  color: var(--color-teal);
}

.breadcrumb__separator {
  color: var(--border-color);
  font-size: 0.7em;
}

.breadcrumb__current {
  color: var(--text-primary);
  font-weight: 600;
}


/* =============================================================================
   22. BADGES
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15em 0.6em;
  font-size: var(--font-size-xs);
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1.5;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge--primary {
  background: rgba(14, 165, 233, 0.12);
  color: var(--color-teal);
}

.badge--gold {
  background: rgba(201, 168, 76, 0.12);
  color: var(--color-gold-dark);
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge--outline {
  background: transparent;
  border: 1px solid currentColor;
}

.badge--section {
  background: var(--color-primary);
  color: var(--color-gold);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--font-size-xs);
}


/* =============================================================================
   23. ALERT BOXES
   ============================================================================= */

.alert-box {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.alert-box__icon {
  flex-shrink: 0;
  font-size: var(--font-size-xl);
  line-height: 1.5;
}

.alert-box__content {
  flex: 1;
}

.alert-box__title {
  font-weight: 700;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-base);
}

.alert-box--info,
.alert-box.info {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  color: var(--color-teal-dark);
}

.alert-box--warning,
.alert-box.warning {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning);
  color: #92400e;
}

.alert-box--tip,
.alert-box.tip {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
  color: #166534;
}

.alert-box--danger,
.alert-box.danger {
  background: var(--color-danger-bg);
  border-left: 4px solid var(--color-danger);
  color: #991b1b;
}

/* Exam tip special styling */
.alert-box--exam {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.03));
  border-left: 4px solid var(--color-gold);
  color: var(--color-gold-dark);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-left-width: 4px;
}


/* =============================================================================
   24. FLOATING TABLE OF CONTENTS
   ============================================================================= */

.floating-toc {
  position: fixed;
  right: var(--space-xl);
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-sticky);
  max-width: 200px;
}

.floating-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floating-toc__link {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  padding: 4px var(--space-sm);
  border-left: 2px solid var(--border-color);
  transition: all var(--transition-fast);
  display: block;
  line-height: 1.4;
}

.floating-toc__link:hover {
  color: var(--text-primary);
  border-left-color: var(--color-gray-400);
}

.floating-toc__link.active {
  color: var(--color-teal);
  border-left-color: var(--color-teal);
  font-weight: 600;
}


/* =============================================================================
   25. BACK TO TOP & FAB (Floating Action Buttons)
   ============================================================================= */

.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-gold);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-base);
  font-size: var(--font-size-xl);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: var(--color-gold);
}

/* Dark mode toggle FAB */
.theme-toggle {
  position: fixed;
  bottom: var(--space-xl);
  right: calc(var(--space-xl) + 60px);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
  font-size: var(--font-size-lg);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}


/* =============================================================================
   26. HAMBURGER & MOBILE OVERLAY
   ============================================================================= */

.hamburger {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: var(--z-overlay);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.hamburger__line {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

/* Active (X shape) */
.hamburger.active .hamburger__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
  overflow: hidden;
}

/* Toast notification container (JS inlines most styles; this provides theme integration) */
.toast {
  pointer-events: auto;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: var(--color-white);
  font-size: var(--font-size-sm);
  max-width: 340px;
  box-shadow: var(--shadow-lg);
}

.toast--info {
  background: var(--color-info);
}

.toast--success {
  background: var(--color-success);
}

.toast--error {
  background: var(--color-danger);
}

.toast--warning {
  background: var(--color-warning);
}


/* =============================================================================
   27. ANIMATIONS (@keyframes)
   ============================================================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 0 8px rgba(201, 168, 76, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes flipCard {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-15px) translateX(5px);
  }
  50% {
    transform: translateY(-5px) translateX(-5px);
  }
  75% {
    transform: translateY(-20px) translateX(3px);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressFill {
  from {
    stroke-dashoffset: var(--circumference, 283);
  }
  to {
    stroke-dashoffset: var(--target-offset, 0);
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(14, 165, 233, 0.3), 0 0 10px rgba(14, 165, 233, 0.1);
  }
  50% {
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.5), 0 0 30px rgba(14, 165, 233, 0.2);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}


/* =============================================================================
   28. SCROLL ANIMATIONS
   ============================================================================= */

/* Scroll animations: content is ALWAYS visible, animation is purely decorative */
.animate-on-scroll {
  opacity: 1 !important;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1 !important;
  transform: none;
}


/* =============================================================================
   29. UTILITY CLASSES
   ============================================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6em 1.4em;
  font-weight: 600;
  font-size: var(--font-size-base);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Ripple on click */
.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  border-radius: inherit;
}

.btn:active::after {
  animation: ripple 0.5s ease-out;
}

.btn--primary {
  background: var(--color-teal);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-teal-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-teal);
}

.btn--gold {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: var(--color-primary);
}

.btn--gold:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.btn--outline:hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
  background: var(--color-info-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn--sm {
  padding: 0.4em 1em;
  font-size: var(--font-size-sm);
}

.btn--lg {
  padding: 0.85em 2em;
  font-size: var(--font-size-lg);
}

/* Shimmer loading placeholder */
.shimmer {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color-light) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

/* Glow effect */
.glow {
  animation: glow 2s ease infinite;
}

/* Typewriter effect container */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-teal);
  animation: typewriter 3s steps(40) 1s forwards, blink-caret 0.5s step-end infinite;
  width: 0;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--color-teal); }
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Gradient border */
.gradient-border {
  position: relative;
  border: none;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--color-teal), var(--color-gold));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-gold { color: var(--color-gold); }
.text-teal { color: var(--color-teal); }
.text-muted { color: var(--text-tertiary); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* Spacing utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Display utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Decorative dashed separator */
.dashed-separator {
  border: none;
  border-top: 2px dashed var(--border-color);
  margin: var(--space-xl) 0;
}

/* Dotted decorative element */
.dotted-accent {
  position: relative;
}

.dotted-accent::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background-image: radial-gradient(circle, var(--border-color) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.5;
  pointer-events: none;
}


/* =============================================================================
   30. RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Tablet: 768px - 1200px */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 0px;
  }

  .nav-sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .nav-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25);
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-xl);
  }

  .hamburger {
    display: flex;
  }

  .hero-section {
    margin-left: 0;
    padding-left: 0;
  }

  .floating-toc {
    display: none;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }

  h3 {
    font-size: var(--font-size-xl);
  }

  .main-content {
    padding: var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .section-card {
    padding: var(--space-lg);
  }

  /* Timeline collapses to single column */
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 50px !important;
    padding-right: 0 !important;
    text-align: left !important;
  }

  .timeline-item::before {
    left: 12px !important;
    right: auto !important;
  }

  .timeline-item::after {
    left: 28px !important;
    right: auto !important;
    width: 16px;
  }

  /* Grid collapses */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Comparison table stacks */
  .comparison-table {
    grid-template-columns: 1fr;
  }

  .comparison-table__header:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .comparison-table__cell:nth-child(odd) {
    border-right: none;
  }

  /* Flashcards */
  .flashcard-deck {
    grid-template-columns: 1fr;
  }

  /* Quiz */
  .quiz-container {
    padding: var(--space-lg);
  }

  /* Tabs scroll horizontally */
  .tab-buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }

  /* FABs */
  .back-to-top {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 42px;
    height: 42px;
  }

  .theme-toggle {
    bottom: var(--space-md);
    right: calc(var(--space-md) + 54px);
    width: 42px;
    height: 42px;
  }

  /* Search box goes full width */
  .search-box {
    max-width: 100%;
  }

  /* Hero section adjustments */
  .hero-section {
    min-height: 85vh;
    padding: var(--space-xl);
  }

  .hero-content {
    padding: var(--space-md);
  }
}

/* Small mobile: < 480px */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .hero-section h1 {
    font-size: 1.8rem;
  }

  .stat-card__value {
    font-size: var(--font-size-3xl);
  }

  .quiz-option {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}


/* =============================================================================
   31. DARK MODE OVERRIDES
   ============================================================================= */

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2035;
  --bg-card: #151c2c;
  --bg-sidebar: #080c15;
  --bg-code: #1a2035;
  --bg-glass: rgba(21, 28, 44, 0.75);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f172a;
  --text-link: #38bdf8;

  --border-color: #1e293b;
  --border-color-light: #1a2035;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.5);

  /* Semantic color adjustments for dark mode readability */
  --color-success-bg: rgba(34, 197, 94, 0.08);
  --color-warning-bg: rgba(234, 179, 8, 0.08);
  --color-danger-bg: rgba(239, 68, 68, 0.08);
  --color-info-bg: rgba(14, 165, 233, 0.08);
}

/* Dark mode specific overrides that need more than variable swaps */
[data-theme="dark"] ::selection {
  background-color: rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] code,
[data-theme="dark"] .code-ref {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

[data-theme="dark"] blockquote {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .section-card--glass {
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #050810 0%, #0a1225 30%, #081830 60%, #050810 100%);
  background-size: 400% 400%;
}

[data-theme="dark"] .search-box__input {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .accordion__header {
  background: var(--bg-card);
}

[data-theme="dark"] .accordion__header:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .quiz-option::before {
  border-color: var(--color-gray-600);
}

/* Dark mode alert box text adjustments */
[data-theme="dark"] .alert-box--info,
[data-theme="dark"] .alert-box.info {
  color: var(--color-teal-light);
}

[data-theme="dark"] .alert-box--warning,
[data-theme="dark"] .alert-box.warning {
  color: var(--color-gold-light);
}

[data-theme="dark"] .alert-box--tip,
[data-theme="dark"] .alert-box.tip {
  color: var(--color-success);
}

[data-theme="dark"] .alert-box--danger,
[data-theme="dark"] .alert-box.danger {
  color: #fca5a5;
}

[data-theme="dark"] .alert-box--exam {
  color: var(--color-gold-light);
}

[data-theme="dark"] .comparison-table__header:first-child {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0.03));
}

[data-theme="dark"] .comparison-table__header:nth-child(2) {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.03));
  color: var(--color-gold);
}

[data-theme="dark"] .theme-toggle {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .hamburger {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .hamburger__line {
  background: var(--text-primary);
}

[data-theme="dark"] .org-chart__node {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .org-chart__zoom-btn {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-sidebar {
  background: var(--bg-sidebar);
  border-right-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .search-box__result-item mark {
  background: rgba(201, 168, 76, 0.2);
}

/* Light mode explicit declarations (for completeness when toggling) */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0a1628;
  --bg-code: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.7);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #0ea5e9;

  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
}


/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
  .nav-sidebar,
  .hamburger,
  .overlay,
  .back-to-top,
  .theme-toggle,
  .reading-progress,
  .floating-toc,
  .hero-section::after {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .section-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    color: #000;
    background: #fff;
  }
}


/* =============================================================================
   32. CONTENT LAYOUT COMPONENTS
   Missing classes used in index.html for section content, grids, cards, etc.
   ============================================================================= */

/* --- Content Block --- */
.content-block {
  margin-bottom: var(--space-2xl);
}

.content-block:last-child {
  margin-bottom: 0;
}

/* --- Section Header --- */
.section-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.section-header .badge {
  margin-bottom: var(--space-sm);
  display: inline-block;
}

/* --- Outcomes Grid --- */
.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.outcome-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.outcome-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.outcome-item p {
  margin-bottom: 0;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.outcome-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
  text-transform: lowercase;
  font-family: var(--font-mono);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.product-item {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: default;
}

.product-item:hover {
  border-color: var(--color-teal);
  background: var(--color-info-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* --- Services Columns --- */
.services-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-md);
}

.services-columns ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-columns li {
  padding: var(--space-sm) 0;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color-light);
  line-height: var(--line-height-relaxed);
}

.services-columns li:last-child {
  border-bottom: none;
}

.services-columns li::before {
  content: '\2022';
  color: var(--color-teal);
  font-weight: 700;
  margin-right: var(--space-sm);
}

/* --- Objectives List --- */
.objectives-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.objective-item:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-sm);
  background: rgba(201, 168, 76, 0.03);
}

.objective-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.objective-text {
  flex: 1;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.objective-text strong {
  color: var(--text-primary);
}

/* --- Regulator Cards --- */
.regulator-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.regulator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.regulator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-teal));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.regulator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.regulator-card:hover::before {
  opacity: 1;
}

.regulator-card h4 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.regulator-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

.regulator-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* --- Objectives Numbered (SFC Objectives) --- */
.objectives-numbered {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.numbered-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-teal);
  transition: all var(--transition-fast);
}

.numbered-item:hover {
  background: var(--color-info-bg);
  border-left-color: var(--color-gold);
}

.numbered-item p {
  margin-bottom: 0;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.numbered-item p strong {
  color: var(--text-primary);
}

.number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
}

/* --- Duties Flex & Duty Chips --- */
.duties-flex {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.duty-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.duty-chip:hover {
  border-color: var(--color-gold);
  background: rgba(201, 168, 76, 0.06);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* --- HKEX Structure --- */
.hkex-structure {
  margin-top: var(--space-lg);
  text-align: center;
}

.hkex-parent {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-lighter));
  color: var(--color-white);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-gold);
  box-shadow: var(--shadow-gold);
  margin-bottom: var(--space-xl);
  position: relative;
}

.hkex-parent h4 {
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-xl);
}

.hkex-parent p {
  color: var(--color-gray-400);
  font-size: var(--font-size-sm);
  margin-bottom: 0;
}

/* Connector line from parent to children */
.hkex-parent::after {
  content: '';
  position: absolute;
  bottom: -var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: var(--space-xl);
  background: var(--border-color);
}

.hkex-children {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  position: relative;
  padding-top: var(--space-sm);
}

/* Horizontal connector above children */
.hkex-children::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border-color);
}

.hkex-child {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-fast);
  position: relative;
}

.hkex-child::before {
  content: '';
  position: absolute;
  top: -var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: var(--space-sm);
  background: var(--border-color);
}

.hkex-child:hover {
  border-color: var(--color-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hkex-child h5 {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-teal);
  margin-bottom: var(--space-xs);
}

.hkex-child p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 0;
}

/* --- Participants Grid --- */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.participant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.participant-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-teal);
}

.participant-card h4 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.participant-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

.participant-card p strong {
  color: var(--text-primary);
}

.participant-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-info-bg);
  border-radius: var(--radius-md);
}

/* --- Tag Cloud --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: default;
}

.tag:hover {
  background: var(--color-info-bg);
  border-color: var(--color-teal);
  color: var(--color-teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* --- Support Grid --- */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.support-grid > div {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  border-left: 3px solid var(--color-gold);
  transition: all var(--transition-fast);
}

.support-grid > div:hover {
  background: rgba(201, 168, 76, 0.05);
  box-shadow: var(--shadow-sm);
}

.support-grid > div strong {
  color: var(--text-primary);
}


/* =============================================================================
   33. HERO SECTION EXTENDED COMPONENTS
   ============================================================================= */

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--color-white);
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.8s ease forwards;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: 800;
}

.hero-description {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-gray-400);
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.8s ease 0.2s both;
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-stats .stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--space-lg);
}

.hero-stats .stat-card::before {
  background: linear-gradient(90deg, var(--color-gold), var(--color-teal));
  opacity: 0.6;
}

.hero-stats .stat-number {
  color: var(--color-white);
  font-size: var(--font-size-3xl);
}

.hero-stats .stat-label {
  color: var(--color-gray-400);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-actions .btn {
  padding: 0.85em 2em;
  font-size: var(--font-size-lg);
  font-weight: 700;
  border-radius: var(--radius-full);
}

.hero-actions .btn-primary {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: var(--color-primary);
  box-shadow: var(--shadow-gold);
}

.hero-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.4);
  color: var(--color-primary);
}

.hero-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  color: var(--color-white);
}


/* =============================================================================
   34. SITE FOOTER
   ============================================================================= */

.site-footer {
  margin-left: var(--sidebar-width);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: margin-left var(--transition-base);
}

.site-footer p {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
  line-height: var(--line-height-relaxed);
}

.site-footer p:last-child {
  margin-bottom: 0;
}


/* =============================================================================
   35. SIDEBAR EXTENDED COMPONENTS
   ============================================================================= */

/* --- Nav Search --- */
.nav-search {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.nav-search .search-box {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-gray-300);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  max-width: 100%;
}

.nav-search .search-box:focus {
  outline: none;
  border-color: var(--color-teal);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.nav-search .search-box::placeholder {
  color: var(--color-gray-500);
}

.nav-search .search-results {
  position: absolute;
  top: 100%;
  left: var(--space-lg);
  right: var(--space-lg);
  background: var(--color-primary-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  box-shadow: var(--shadow-xl);
}

/* --- Nav Icon --- */
.nav-icon {
  font-size: var(--font-size-base);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Nav Divider --- */
.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: var(--space-sm) var(--space-lg);
}

/* --- Nav Footer --- */
.nav-footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

/* --- Study Timer --- */
.study-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--color-gray-400);
  font-family: var(--font-mono);
  margin-bottom: var(--space-md);
}

.timer-icon {
  font-size: var(--font-size-base);
  flex-shrink: 0;
}

/* --- Progress Display (sidebar) --- */
.progress-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-teal));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  min-width: 0;
}

.progress-text {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  font-weight: 600;
  font-family: var(--font-mono);
}


/* =============================================================================
   36. MOBILE HEADER
   ============================================================================= */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-sticky);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  box-shadow: var(--shadow-sm);
}

.mobile-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle-mobile {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.theme-toggle-mobile:hover {
  background: var(--bg-tertiary);
}


/* =============================================================================
   37. RESPONSIVE OVERRIDES FOR NEW COMPONENTS
   ============================================================================= */

@media (max-width: 1200px) {
  .site-footer {
    margin-left: 0;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    padding-top: calc(56px + var(--space-xl));
  }

  .services-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .participants-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .regulator-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .outcomes-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-columns {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .hero-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .participants-grid {
    grid-template-columns: 1fr;
  }

  .regulator-cards {
    grid-template-columns: 1fr;
  }

  .hkex-children {
    grid-template-columns: repeat(2, 1fr);
  }

  .support-grid {
    grid-template-columns: 1fr;
  }

  .duties-flex {
    gap: var(--space-xs);
  }

  .duty-chip {
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-md);
  }

  .mobile-header .hamburger {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    background: transparent;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hkex-children {
    grid-template-columns: 1fr;
  }

  .outcome-item {
    flex-direction: column;
    align-items: stretch;
  }

  .outcome-letter {
    align-self: flex-start;
  }
}


/* =============================================================================
   38. DARK MODE OVERRIDES FOR NEW COMPONENTS
   ============================================================================= */

[data-theme="dark"] .outcome-item {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .product-item {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .objective-item {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .objective-icon {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .regulator-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .regulator-icon {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .numbered-item {
  background: var(--bg-card);
}

[data-theme="dark"] .duty-chip {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .hkex-child {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .participant-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .participant-icon {
  background: rgba(14, 165, 233, 0.08);
}

[data-theme="dark"] .tag {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .support-grid > div {
  background: var(--bg-card);
}

[data-theme="dark"] .site-footer {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

[data-theme="dark"] .mobile-header {
  background: var(--bg-card);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-search .search-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .hero-stats .stat-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}
