/*
 * [AI_NETWORK_MAP & DATA_FLOW]
 * CSS Design System & Theme Engine for Iran Constitution Presentation & Teaching Hub
 * Features: Dark Glassmorphism, High-Contrast Classroom Projector Mode, Smooth Transitions,
 *           Interactive Mindmap Styles, Quiz Engine UI, Presenter Overlay, Responsive Design.
 */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --font-main: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Dark Glass Theme Tokens (Default) */
  --bg-primary: #070b14;
  --bg-secondary: #0d1527;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-card: rgba(30, 41, 59, 0.65);
  --bg-glass-card-hover: rgba(51, 65, 85, 0.8);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-glow: rgba(59, 130, 246, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;
  
  --gold-accent: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.3);
  --emerald-accent: #34d399;
  --emerald-glow: rgba(52, 211, 153, 0.25);
  --rose-accent: #fb7185;
  
  --header-height: 70px;
  --bottom-bar-height: 65px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-luxury: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 25px -5px rgba(56, 189, 248, 0.15);
}

/* Classroom / Projector High-Contrast Mode */
body.projector-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --bg-glass-card: #ffffff;
  --bg-glass-card-hover: #f1f5f9;
  --border-glass: #cbd5e1;
  --border-glass-glow: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-accent: #1d4ed8;
  
  --gold-accent: #b45309;
  --gold-glow: rgba(180, 83, 9, 0.2);
  --emerald-accent: #047857;
  --emerald-glow: rgba(4, 120, 87, 0.2);
  --rose-accent: #be123c;
  
  --shadow-luxury: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  user-select: none;
}

/* Ambient Animated Background Mesh */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  filter: blur(120px);
  border-radius: 50%;
  opacity: 0.28;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.ambient-blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #38bdf8 0%, #1d4ed8 70%);
  top: -100px;
  right: -100px;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #10b981 0%, #047857 70%);
  bottom: -50px;
  left: -50px;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.ambient-blob-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #fbbf24 0%, #d97706 70%);
  top: 40%;
  left: 30%;
  animation: floatOrb 26s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, -60px) scale(0.95); }
}

/* Layout Hierarchy - Locked Viewport */
.app-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

/* Top App Header */
.app-header {
  height: var(--header-height);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  transition: background 0.5s ease;
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-titles .author-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.author-tag .badge-pill {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-accent);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

/* Header Controls & Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 10px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-glass:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-glow);
  transform: translateY(-1px);
}

.btn-glass.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(16, 185, 129, 0.3) 100%);
  border-color: var(--text-accent);
  color: var(--text-accent);
}

.btn-glass svg {
  width: 18px;
  height: 18px;
}

/* Main Presentation Viewport - Non-collapsing flex area */
.presentation-viewport {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2rem;
  width: 100%;
}

/* Slide Container & 3D Transitions */
.slide-stage {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  max-height: 820px;
  position: relative;
  perspective: 1200px;
}

/* =========================================================================
   DEEP DYNAMIC CHAPTER THEMING ENGINE (8 DISTINCT LUXURY STYLES)
   ========================================================================= */

/* CHAPTER 1: Cyber-Cyan & Sovereign Gold Matrix */
body[data-chapter="1"] {
  --bg-primary: #050b14;
  --bg-glass: rgba(8, 17, 34, 0.85);
  --bg-glass-card: rgba(15, 29, 58, 0.75);
  --bg-glass-card-hover: rgba(22, 45, 88, 0.9);
  --border-glass: rgba(56, 189, 248, 0.25);
  --border-glass-glow: rgba(56, 189, 248, 0.6);
  --text-accent: #38bdf8;
  --gold-accent: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(56, 189, 248, 0.3) 0%, rgba(251, 191, 36, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(56, 189, 248, 0.35);
  --slot-glow: 0 0 25px rgba(56, 189, 248, 0.25);
}

/* CHAPTER 2: Persian Emerald & Luminous Aqua Jewel */
body[data-chapter="2"] {
  --bg-primary: #021a14;
  --bg-glass: rgba(4, 30, 23, 0.85);
  --bg-glass-card: rgba(6, 48, 37, 0.75);
  --bg-glass-card-hover: rgba(10, 72, 56, 0.9);
  --border-glass: rgba(16, 185, 129, 0.3);
  --border-glass-glow: rgba(16, 185, 129, 0.65);
  --text-accent: #10b981;
  --gold-accent: #06b6d4;
  --gold-glow: rgba(6, 182, 212, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(6, 182, 212, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(16, 185, 129, 0.35);
  --slot-glow: 0 0 25px rgba(16, 185, 129, 0.3);
}

/* CHAPTER 3: Imperial Amethyst & Sunset Amber */
body[data-chapter="3"] {
  --bg-primary: #120722;
  --bg-glass: rgba(26, 12, 48, 0.85);
  --bg-glass-card: rgba(45, 20, 82, 0.75);
  --bg-glass-card-hover: rgba(68, 30, 124, 0.9);
  --border-glass: rgba(168, 85, 247, 0.3);
  --border-glass-glow: rgba(168, 85, 247, 0.65);
  --text-accent: #c084fc;
  --gold-accent: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(245, 158, 11, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 40px -5px rgba(168, 85, 247, 0.35);
  --slot-glow: 0 0 25px rgba(168, 85, 247, 0.3);
}

/* CHAPTER 4: Sovereign 24k Gold & Royal Cobalt Command */
body[data-chapter="4"] {
  --bg-primary: #181003;
  --bg-glass: rgba(35, 22, 5, 0.88);
  --bg-glass-card: rgba(58, 38, 10, 0.78);
  --bg-glass-card-hover: rgba(88, 58, 16, 0.9);
  --border-glass: rgba(251, 191, 36, 0.35);
  --border-glass-glow: rgba(251, 191, 36, 0.7);
  --text-accent: #fbbf24;
  --gold-accent: #38bdf8;
  --gold-glow: rgba(56, 189, 248, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(251, 191, 36, 0.4) 0%, rgba(56, 189, 248, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.85), 0 0 45px -5px rgba(251, 191, 36, 0.4);
  --slot-glow: 0 0 30px rgba(251, 191, 36, 0.35);
}

/* CHAPTER 5: Executive Titanium & Azure Horizon */
body[data-chapter="5"] {
  --bg-primary: #041424;
  --bg-glass: rgba(8, 28, 48, 0.85);
  --bg-glass-card: rgba(14, 46, 78, 0.75);
  --bg-glass-card-hover: rgba(20, 68, 114, 0.9);
  --border-glass: rgba(6, 182, 212, 0.3);
  --border-glass-glow: rgba(6, 182, 212, 0.65);
  --text-accent: #06b6d4;
  --gold-accent: #10b981;
  --gold-glow: rgba(16, 185, 129, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(6, 182, 212, 0.35) 0%, rgba(16, 185, 129, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(6, 182, 212, 0.35);
  --slot-glow: 0 0 25px rgba(6, 182, 212, 0.3);
}

/* CHAPTER 6: Parliamentary Saffron & Solar Crimson */
body[data-chapter="6"] {
  --bg-primary: #1c0803;
  --bg-glass: rgba(38, 14, 7, 0.88);
  --bg-glass-card: rgba(64, 24, 12, 0.78);
  --bg-glass-card-hover: rgba(98, 38, 20, 0.9);
  --border-glass: rgba(249, 115, 22, 0.35);
  --border-glass-glow: rgba(249, 115, 22, 0.7);
  --text-accent: #f97316;
  --gold-accent: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(249, 115, 22, 0.4) 0%, rgba(251, 191, 36, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.85), 0 0 40px -5px rgba(249, 115, 22, 0.4);
  --slot-glow: 0 0 28px rgba(249, 115, 22, 0.35);
}

/* CHAPTER 7: Ultraviolet Court of Justice & Sapphire Ice */
body[data-chapter="7"] {
  --bg-primary: #130421;
  --bg-glass: rgba(28, 8, 46, 0.88);
  --bg-glass-card: rgba(48, 14, 78, 0.78);
  --bg-glass-card-hover: rgba(76, 22, 122, 0.9);
  --border-glass: rgba(168, 85, 247, 0.35);
  --border-glass-glow: rgba(168, 85, 247, 0.7);
  --text-accent: #a855f7;
  --gold-accent: #38bdf8;
  --gold-glow: rgba(56, 189, 248, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(56, 189, 248, 0.25) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.85), 0 0 45px -5px rgba(168, 85, 247, 0.4);
  --slot-glow: 0 0 30px rgba(168, 85, 247, 0.35);
}

/* CHAPTER 8: Cyberpunk Neon Hot Pink & Golden Nebula */
body[data-chapter="8"] {
  --bg-primary: #1c0312;
  --bg-glass: rgba(38, 6, 24, 0.88);
  --bg-glass-card: rgba(68, 12, 44, 0.78);
  --bg-glass-card-hover: rgba(104, 18, 68, 0.9);
  --border-glass: rgba(236, 72, 153, 0.35);
  --border-glass-glow: rgba(236, 72, 153, 0.75);
  --text-accent: #ec4899;
  --gold-accent: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.45);
  --chapter-badge-bg: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(251, 191, 36, 0.3) 100%);
  --shadow-luxury: 0 20px 50px -10px rgba(0, 0, 0, 0.9), 0 0 50px -5px rgba(236, 72, 153, 0.45);
  --slot-glow: 0 0 35px rgba(236, 72, 153, 0.4);
}

.slide-card {
  width: 100%;
  height: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: var(--shadow-luxury);
  padding: 2.25rem 2.75rem;
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s ease, background 0.7s ease, border-color 0.6s ease, box-shadow 0.7s ease;
  overflow-y: auto;
}

.slide-card.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 20;
}

.slide-card.prev-slide {
  transform: translateY(-30px) scale(0.97);
}

/* Slide Header */
.slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
  gap: 1rem;
}

.slide-header-content {
  flex: 1;
}

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

.btn-canvas-expand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan-accent);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-canvas-expand:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--cyan-accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-canvas-expand.active {
  background: var(--gold-accent);
  color: #0f172a;
  border-color: var(--gold-accent);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
}

/* =========================================================================
   ADAPTIVE SLIDE LAYOUT ARCHETYPES & CANVAS THEATER SYSTEM
   ========================================================================= */
.slide-main-stage {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  min-height: 0;
  position: relative;
  width: 100%;
}

/* 1. SPLIT-HERO LAYOUT (50-50 Balanced View) */
.layout-split-hero .slide-main-stage {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: stretch;
  gap: 1.75rem;
}

.layout-split-hero .slide-content-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-left: 0.5rem;
}

.layout-split-hero .slide-visual-anim-slot {
  width: 100%;
  height: 100%;
  min-height: 380px;
  max-height: 520px;
  margin: 0;
}

/* 2. PANORAMIC CENTERPIECE LAYOUT (Full-width Visual Showcase) */
.layout-panoramic .slide-main-stage {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.layout-panoramic .slide-visual-anim-slot {
  width: 100%;
  height: 330px;
  min-height: 290px;
  max-height: 380px;
  margin: 0;
}

.layout-panoramic .slide-content-pane {
  flex: 1;
  overflow-y: auto;
}

.layout-panoramic .slide-content-pane .content-cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.layout-panoramic .slide-content-pane .timeline-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* 3. QUIZ ARENA LAYOUT (Interactive Live Assessment Arena) */
.layout-quiz-arena .slide-main-stage {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: stretch;
  gap: 1.75rem;
}

.layout-quiz-arena .slide-visual-anim-slot {
  width: 100%;
  height: 100%;
  min-height: 360px;
  margin: 0;
}

.layout-quiz-arena .slide-content-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 4. EXPANDED / FULLSCREEN CANVAS THEATER MODE */
.slide-card.expanded-canvas-view .slide-main-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.slide-card.expanded-canvas-view .slide-visual-anim-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  z-index: 50;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.slide-card.expanded-canvas-view .slide-content-pane {
  display: none;
}

/* SLIDE VISUAL ANIMATION SLOT (Glassmorphic Theater Frame) */
.slide-visual-anim-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.7) 0%, rgba(5, 10, 20, 0.9) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--border-glass-glow);
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), var(--slot-glow), inset 0 0 35px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  padding: 1rem 1rem 0.75rem 1rem;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-anim-canvas {
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  border-radius: 16px;
}

.slide-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.slide-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--chapter-badge-bg);
  color: var(--text-accent);
  border: 1px solid var(--border-glass-glow);
  box-shadow: 0 0 14px var(--border-glass-glow);
  transition: all 0.5s ease;
}

.chapter-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-accent);
  text-shadow: 0 0 10px var(--gold-glow);
}

.slide-title {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
}

.slide-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.slide-number-pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

/* Slide Body & Content Blocks */
.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

/* Grid & Card Variations */
.content-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.15rem;
}

.feature-box {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.feature-box::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--text-accent);
  border-radius: 0 16px 16px 0;
  opacity: 0.8;
  transition: all 0.35s ease;
}

.feature-box:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-glow);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--border-glass-glow);
}

.feature-box:hover::before {
  width: 6px;
  box-shadow: 0 0 12px var(--text-accent);
}

.feature-box-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.feature-box-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.feature-box-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.points-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.points-list li {
  position: relative;
  padding-right: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.points-list li::before {
  content: "•";
  position: absolute;
  right: 0;
  color: var(--text-accent);
  font-size: 1.35rem;
  line-height: 1;
}

/* Comparison 2-Columns */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.comparison-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.5rem;
}

.comparison-card.col-cyan {
  border-top: 4px solid #06b6d4;
}

.comparison-card.col-emerald {
  border-top: 4px solid #10b981;
}

.comparison-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Timeline Layout */
.timeline-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.timeline-step {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  transition: var(--transition-smooth);
}

.timeline-step:hover {
  border-color: var(--text-accent);
  transform: translateY(-4px);
}

.timeline-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold-accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Hexagon / Grid Pillars */
.hex-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.hex-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.hex-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
  border: 1px solid var(--text-accent);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Comparative International Law Matrix Table */
.matrix-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass-card);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.matrix-table th {
  padding: 0.9rem 1.1rem;
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-accent);
  border-bottom: 1px solid var(--border-glass);
}

body.projector-mode .matrix-table th {
  background: #f1f5f9;
  color: #1e40af;
}

.matrix-table td {
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  line-height: 1.5;
}

.matrix-table tr:hover td {
  background: var(--bg-glass-card-hover);
}

.matrix-table td:first-child {
  font-weight: 700;
  color: var(--text-primary);
}

/* Interactive Quiz View */
.quiz-wrapper {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.quiz-question-title svg {
  width: 28px;
  height: 28px;
  fill: var(--gold-accent);
  flex-shrink: 0;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.quiz-option-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem 1.35rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition-smooth);
}

.quiz-option-btn:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-glow);
  transform: translateX(-4px);
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

.quiz-explanation-box {
  display: none;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid var(--text-accent);
  border-radius: 14px;
  padding: 1.25rem;
  animation: fadeIn 0.4s ease;
}

.quiz-explanation-box.show {
  display: block;
}

.quiz-explanation-header {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-accent);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quiz-explanation-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Interactive Mindmap / Tree Visualization */
.mindmap-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem;
}

.mindmap-root-node {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  border: 2px solid #60a5fa;
  padding: 1rem 2rem;
  border-radius: 18px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
  text-align: center;
  max-width: 600px;
}

.mindmap-branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.mindmap-branch-node {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass-glow);
  border-radius: 14px;
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.mindmap-branch-node:hover {
  transform: translateY(-4px);
  border-color: var(--text-accent);
}

.mindmap-branch-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

.mindmap-branch-detail {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* In-Slide Navigation Footer (End of Content Pane) */
.slide-footer-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-glass);
  width: 100%;
}

.btn-slide-nav-step {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass-card);
  color: var(--text-primary);
}

.btn-slide-nav-step:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-glow);
  transform: translateY(-2px);
}

.btn-slide-nav-step.btn-step-next {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(251, 191, 36, 0.25) 100%);
  border-color: var(--text-accent);
  color: var(--text-accent);
  margin-right: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-slide-nav-step.btn-step-next:hover {
  background: linear-gradient(135deg, var(--text-accent) 0%, var(--gold-accent) 100%);
  color: #0f172a;
  box-shadow: 0 0 20px var(--border-glass-glow);
  transform: translateY(-3px) scale(1.02);
}

.btn-slide-nav-step.btn-step-finish {
  background: linear-gradient(135deg, #10b981 0%, #fbbf24 100%);
  color: #0f172a;
  border-color: #fbbf24;
  font-weight: 900;
}

/* Bottom Presentation Control Bar */
.bottom-bar {
  height: var(--bottom-bar-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  flex-shrink: 0;
  position: relative;
  z-index: 60;
  width: 100%;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-nav {
  height: 44px;
  padding: 0 0.95rem;
  border-radius: 12px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.btn-nav:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--text-accent);
  color: var(--text-accent);
  transform: scale(1.03);
}

.btn-nav-primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(251, 191, 36, 0.3) 100%) !important;
  border-color: var(--gold-accent) !important;
  color: var(--gold-accent) !important;
  box-shadow: 0 0 16px var(--gold-glow);
}

.btn-nav-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #0f172a !important;
  transform: scale(1.05);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Slide Progress Track */
.progress-container {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 999px;
  width: 0%;
  transition: width 0.35s ease;
}

/* Drawer / Chapter Menu Modal */
.chapters-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-glass);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapters-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chapter-menu-item {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chapter-menu-item:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-glow);
  transform: translateX(-4px);
}

.chapter-menu-item.active {
  border-color: var(--text-accent);
  background: rgba(59, 130, 246, 0.15);
}

.chapter-menu-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-accent);
}

.chapter-menu-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.chapter-menu-pages {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Presenter Mode Floating Sheet */
.presenter-panel {
  position: fixed;
  bottom: calc(var(--bottom-bar-height) + 15px);
  left: 25px;
  width: 420px;
  max-height: 500px;
  background: var(--bg-secondary);
  border: 1px solid var(--text-accent);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 90;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.presenter-panel.open {
  display: flex;
}

.presenter-panel-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.presenter-title {
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.class-stopwatch {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-accent);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.presenter-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.presenter-notes-box {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.key-terms-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.key-term-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-accent);
}

/* Virtual Laser & Spotlight Tool */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 50;
  display: none;
  mask-image: radial-gradient(circle 140px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 90%, black 100%);
  -webkit-mask-image: radial-gradient(circle 140px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 90%, black 100%);
}

.spotlight-overlay.active {
  display: block;
}

/* Edit Mode Highlighting */
body.edit-mode [contenteditable="true"] {
  outline: 2px dashed #f59e0b;
  outline-offset: 4px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  cursor: text;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar Polish */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* =========================================================================
   35 DEDICATED SLIDE ANIMATIONS & MOBILE-FRIENDLY CONTROLS
   ========================================================================= */
.slide-anim-canvas {
  width: 100% !important;
  height: 100% !important;
  flex: 1;
  display: block;
  border-radius: 14px;
  cursor: crosshair;
  touch-action: none;
}

.anim-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.65rem;
  padding: 0.45rem 0.75rem;
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
  box-sizing: border-box;
}

.anim-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.anim-mode-btn:hover {
  color: var(--text-primary);
  border-color: var(--cyan-accent);
  background: rgba(56, 189, 248, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.anim-mode-btn.active {
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #fbbf24;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
  transform: translateY(-1px);
}

body.projector-mode .anim-mode-bar {
  border-top-color: #e2e8f0;
}

body.projector-mode .anim-mode-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.projector-mode .anim-mode-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.35);
}

/* =========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (DESKTOP, TABLET, MOBILE, SMALL)
   ========================================================================= */

/* 1. TABLET SCREENS (<= 1024px) */
@media (max-width: 1024px) {
  .presentation-viewport {
    padding: 1rem 1.5rem;
  }
  .slide-card {
    padding: 1.5rem 1.75rem;
  }
  .layout-split-hero .slide-main-stage,
  .layout-quiz-arena .slide-main-stage {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .layout-split-hero .slide-visual-anim-slot,
  .layout-quiz-arena .slide-visual-anim-slot {
    width: 100%;
    min-height: 300px;
    max-height: 360px;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .timeline-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .hex-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mindmap-branches {
    grid-template-columns: 1fr;
  }
}

/* 2. MOBILE SCREENS (<= 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
    --bottom-bar-height: 54px;
  }

  .app-container {
    height: 100vh;
    height: 100dvh;
  }

  /* Compact Header */
  .app-header {
    height: var(--header-height);
    padding: 0 0.75rem;
  }
  .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .brand-icon svg {
    width: 18px;
    height: 18px;
  }
  .brand-titles h1 {
    font-size: 0.88rem;
    font-weight: 800;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-titles .author-tag {
    display: none;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .header-actions .btn-glass {
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
    border-radius: 8px;
    gap: 0.2rem;
  }
  .header-actions .btn-glass span {
    display: none;
  }
  .header-actions #btnChaptersMenu span {
    display: inline;
    font-size: 0.72rem;
  }

  /* Full-bleed Presentation Viewport */
  .presentation-viewport {
    padding: 0.4rem 0.5rem;
    overflow: hidden;
    align-items: stretch;
    justify-content: stretch;
  }
  .slide-stage {
    width: 100%;
    height: 100%;
    max-height: none;
    perspective: none;
  }

  /* Fluid Mobile Slide Card with Native Smooth Scroll */
  .slide-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0.75rem 0.85rem 0.6rem 0.85rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Compact Slide Header */
  .slide-header {
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    gap: 0.5rem;
  }
  .slide-meta {
    gap: 0.35rem;
    margin-bottom: 0.15rem;
  }
  .chapter-indicator {
    font-size: 0.72rem;
  }
  .slide-badge {
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
  }
  .slide-title {
    font-size: 1.15rem;
    line-height: 1.35;
  }
  .slide-subtitle {
    font-size: 0.82rem;
    margin-top: 0.15rem;
    line-height: 1.4;
  }
  .slide-number-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    white-space: nowrap;
  }

  /* Mobile Slide Main Stage */
  .slide-main-stage {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1 0 auto;
    min-height: 0;
  }

  /* Mobile Animation Slot (Fixed Height, Horizontal Scrollable Modes) */
  .layout-panoramic .slide-visual-anim-slot,
  .layout-split-hero .slide-visual-anim-slot,
  .layout-quiz-arena .slide-visual-anim-slot,
  .slide-visual-anim-slot {
    width: 100%;
    height: 225px;
    min-height: 210px;
    max-height: 245px;
    flex: 0 0 auto;
    padding: 0.5rem 0.5rem 0.35rem 0.5rem;
    border-radius: 14px;
    margin-bottom: 0.35rem;
  }

  .anim-mode-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    justify-content: flex-start;
    padding: 0.25rem 0.4rem;
    margin-top: 0.3rem;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .anim-mode-bar::-webkit-scrollbar {
    display: none;
  }
  .anim-mode-btn {
    flex: 0 0 auto;
    font-size: 0.68rem;
    padding: 0.22rem 0.6rem;
    white-space: nowrap;
  }

  /* Mobile Slide Content Pane (In-flow, Non-trapping) */
  .slide-content-pane {
    flex: 1 0 auto;
    overflow-y: visible;
    padding: 0;
  }

  /* Content Elements Optimization */
  .content-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .feature-box {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
  }
  .feature-box-title {
    font-size: 0.92rem;
  }
  .feature-box-desc {
    font-size: 0.82rem;
    line-height: 1.55;
  }
  .points-list li {
    font-size: 0.8rem;
    padding-right: 1rem;
    line-height: 1.5;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .comparison-card {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
  }
  .comparison-title {
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
  }
  .timeline-container {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 0.4rem;
  }
  .timeline-step {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
  }
  .hex-pillars-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  .hex-card {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    gap: 0.6rem;
  }
  .hex-num {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .matrix-table th,
  .matrix-table td {
    padding: 0.55rem 0.65rem;
    font-size: 0.76rem;
  }
  .quiz-wrapper {
    padding: 0.85rem;
    gap: 0.75rem;
    border-radius: 14px;
  }
  .quiz-question-title {
    font-size: 0.98rem;
    gap: 0.4rem;
    line-height: 1.4;
  }
  .quiz-question-title svg {
    width: 20px;
    height: 20px;
  }
  .quiz-option-btn {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
    gap: 0.5rem;
    border-radius: 10px;
  }
  .quiz-option-letter {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  .mindmap-root-node {
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    border-radius: 12px;
  }
  .mindmap-branches {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .mindmap-branch-node {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
  }

  /* In-Slide Navigation Footer on Mobile */
  .slide-footer-nav-bar {
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
  }
  .btn-slide-nav-step {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.84rem;
  }

  /* Compact Bottom Control Bar */
  .bottom-bar {
    height: var(--bottom-bar-height);
    padding: 0 0.5rem;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid var(--border-glass-glow);
  }
  .nav-controls {
    gap: 0.25rem;
  }
  .btn-nav {
    height: 38px;
    padding: 0 0.55rem;
    font-size: 0.75rem;
    border-radius: 9px;
    gap: 0.25rem;
  }
  .btn-nav-primary {
    padding: 0 0.75rem;
  }
  .btn-nav svg {
    width: 16px;
    height: 16px;
  }
  .progress-container {
    margin: 0 0.25rem;
    max-width: none;
  }
  .progress-info {
    font-size: 0.65rem;
  }
  #btnExportPdf, #btnPrintPDF {
    display: none;
  }

  .presenter-panel {
    width: 92%;
    left: 4%;
    bottom: calc(var(--bottom-bar-height) + 10px);
  }
  .chapters-drawer {
    width: 300px;
    right: -320px;
  }
  .btn-canvas-expand {
    display: none;
  }
}

/* 3. ULTRA COMPACT PHONES (<= 480px) */
@media (max-width: 480px) {
  .presentation-viewport {
    padding: 0.25rem 0.35rem;
  }
  .slide-card {
    padding: 0.65rem 0.65rem 0.5rem 0.65rem;
  }
  .slide-title {
    font-size: 1.05rem;
  }
  .slide-visual-anim-slot {
    height: 205px;
    min-height: 195px;
    max-height: 220px;
    padding: 0.4rem 0.4rem 0.25rem 0.4rem;
  }
  .brand-titles h1 {
    max-width: 105px;
    font-size: 0.82rem;
  }
}

/* =========================================================================
   ROYAL IMPERIAL INTRO PORTAL & WELCOME CEREMONY STYLES
   ========================================================================= */
.royal-intro-portal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(8, 14, 30, 0.96) 0%, rgba(2, 5, 14, 0.99) 100%);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.75s ease;
}

.royal-intro-portal.dissolving {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(14px);
  pointer-events: none;
  visibility: hidden;
}

.royal-intro-portal.hidden {
  display: none !important;
}

.royal-canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.royal-intro-canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.royal-portal-content {
  position: relative;
  z-index: 20;
  max-width: 960px;
  width: 92%;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
  pointer-events: auto;
}

.royal-header-crest {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.royal-crest-badge {
  display: inline-block;
  padding: 0.35rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35);
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
}

.royal-main-title {
  font-size: 2.25rem;
  font-weight: 900;
  color: #f8fafc;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 0 35px rgba(251, 191, 36, 0.4);
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.royal-source-tag {
  font-size: 1rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Plaques Grid */
.royal-plaques-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 820px;
}

.royal-plaque {
  position: relative;
  border-radius: 20px;
  padding: 1.6rem 1.65rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  text-align: right;
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.royal-plaque:hover {
  transform: translateY(-4px) scale(1.02);
}

.plaque-professor {
  background: linear-gradient(135deg, rgba(30, 20, 5, 0.88) 0%, rgba(15, 10, 3, 0.96) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(251, 191, 36, 0.25);
}

.plaque-professor:hover {
  border-color: #fbbf24;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 45px rgba(251, 191, 36, 0.45);
}

.plaque-creator {
  background: linear-gradient(135deg, rgba(8, 25, 45, 0.88) 0%, rgba(3, 12, 25, 0.96) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.25);
}

.plaque-creator:hover {
  border-color: #38bdf8;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 45px rgba(56, 189, 248, 0.45);
}

.plaque-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plaque-icon-box svg {
  width: 28px;
  height: 28px;
}

.plaque-professor .plaque-icon-box {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  color: #0f172a;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.plaque-creator .plaque-icon-box {
  background: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  color: #0f172a;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.plaque-body {
  flex: 1;
}

.plaque-role-tag {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.25rem;
  display: block;
}

.plaque-creator .plaque-role-tag {
  color: #38bdf8;
}

.plaque-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.plaque-meta {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Enter Button */
.royal-portal-actions {
  margin-top: 0.5rem;
}

.btn-royal-enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.1rem 2.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #f59e0b 100%);
  border: 2px solid #fef08a;
  color: #0f172a;
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 35px rgba(251, 191, 36, 0.5), 0 0 50px rgba(251, 191, 36, 0.35);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-royal-enter:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 45px rgba(251, 191, 36, 0.7), 0 0 65px rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 50%, #d97706 100%);
}

.btn-royal-enter svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-royal-enter:hover svg {
  transform: translateX(-4px);
}

/* Mobile Responsiveness for Royal Portal */
@media (max-width: 768px) {
  .royal-portal-content {
    gap: 1.25rem;
    padding: 1.5rem 1rem;
  }
  .royal-main-title {
    font-size: 1.45rem;
  }
  .royal-source-tag {
    font-size: 0.82rem;
  }
  .royal-plaques-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .royal-plaque {
    padding: 1rem 1.15rem;
    gap: 0.85rem;
  }
  .plaque-name {
    font-size: 1.05rem;
  }
  .plaque-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .btn-royal-enter {
    padding: 0.85rem 1.85rem;
    font-size: 0.95rem;
    width: 100%;
  }
}

