/* MCQs in Operative Dentistry - Custom Stylesheet */
:root {
  --primary: #FF6B00;
  --primary-hover: #E65C00;
  --primary-light: #FFF0E6;
  --primary-dark: #CC5500;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --success: #10B981;
  --success-bg: #D1FAE5;
  --error: #EF4444;
  --error-bg: #FEE2E2;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --accent: #FF6B00;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --font-sans: 'Cairo', 'Almarai', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-arabic: 'Cairo', 'Almarai', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --question-font-size: 1.15rem;
  --question-option-font-size: 0.95rem;
  --question-line-height: 1.55;
}

[data-theme="dark"] {
  --bg-main: #0F172A;
  --bg-card: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --primary-light: #331C0D;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] {
  font-family: var(--font-arabic);
}

/* 🛡️ Strict Content Protection Shield - No Text Selection / No Touch Callout */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  user-select: auto;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Anti-Print & Screenshot Protection Rules */
@media print {
  html, body, #app-root {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* Fullscreen Immersive Intro Video Overlay */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.intro-video-box {
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.skip-intro-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  background: rgba(124, 58, 237, 0.85);
  backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

[dir="rtl"] .skip-intro-btn {
  right: auto;
  left: 1.5rem;
}

.skip-intro-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

/* Header & Navbar */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--card-shadow);
  animation: navbarFade 0.6s ease-out;
}

@keyframes navbarFade {
  0% { opacity: 0; transform: translateY(-15px); }
  100% { opacity: 1; transform: translateY(0); }
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  object-fit: contain;
  background-color: var(--bg-card);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  padding: 0.32rem 0.75rem;
  border-radius: 9999px;
  border: 1.5px solid #6ee7b7;
  box-shadow: 
    0 3px 8px -1px rgba(16, 185, 129, 0.28),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  letter-spacing: 0.015em;
  user-select: none;
}

[data-theme="dark"] .security-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  box-shadow: 
    0 3px 8px -1px rgba(0, 0, 0, 0.3),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

/* 🧊 3D Global Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-decoration: none;
  touch-action: manipulation;
  transform: translateZ(0);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1.5px);
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 48%, #4f46e5 100%);
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 4px 14px -1px rgba(99, 102, 241, 0.45),
    0 2px 4px -1px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #4338ca 100%);
  box-shadow: 
    0 8px 20px -2px rgba(99, 102, 241, 0.6),
    0 3px 6px -1px rgba(0, 0, 0, 0.15),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.8),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.25);
}

.btn-primary:active {
  box-shadow: 
    0 2px 6px -1px rgba(99, 102, 241, 0.4),
    inset 0 2px 3px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(241, 245, 249, 0.9) 100%);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 
    0 3px 8px -2px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 1) 100%);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 
    0 6px 14px -2px rgba(124, 58, 237, 0.2),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(124, 58, 237, 0.2);
}

.btn-secondary:active {
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 2px rgba(0, 0, 0, 0.12);
}

.btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 243, 255, 0.8) 100%);
  box-shadow: 
    0 3px 8px -2px rgba(124, 58, 237, 0.18),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(124, 58, 237, 0.18);
}

.btn-outline:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: white !important;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 6px 16px -2px rgba(124, 58, 237, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 0.5rem;
}

.btn-icon {
  padding: 0.45rem;
  border-radius: 0.55rem;
  border: 1.5px solid var(--border-color);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(241, 245, 249, 0.85) 100%);
  color: var(--text-main);
  box-shadow: 
    0 3px 8px -2px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.btn-icon:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 6px 14px -2px rgba(124, 58, 237, 0.25);
}

/* 🧊 3D Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
  padding: 0.3rem;
  border-radius: 0.75rem;
  gap: 0.35rem;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .nav-tabs {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.tab-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  white-space: nowrap;
}

.tab-btn:hover:not(.active) {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 48%, #4f46e5 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 
    0 4px 12px -1px rgba(99, 102, 241, 0.45),
    0 2px 4px -1px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transform: translateY(-1.5px);
}

.tab-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 16px -1px rgba(99, 102, 241, 0.55),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.75),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .btn-secondary {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 3px 8px -2px rgba(0, 0, 0, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .btn-secondary:hover {
  border-color: var(--primary);
  color: #c084fc;
  box-shadow: 
    0 6px 16px -2px rgba(147, 51, 234, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(147, 51, 234, 0.3);
}

[data-theme="dark"] .btn-outline {
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.5) 0%, rgba(49, 46, 129, 0.6) 100%);
  border-color: rgba(165, 180, 252, 0.4);
  color: #c084fc;
}

/* Layout Containers */
.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  flex: 1;
}

/* Book Royal Purple / Violet Hero Card with Attached Book Background */
.hero-card {
  position: relative;
  background: 
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
  box-shadow: 0 20px 35px -10px rgba(29, 78, 216, 0.4);

  overflow: hidden;
  animation: heroEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-card::after {
  content: '';
  position: absolute;
  right: -5%;
  top: -10%;
  width: 55%;
  height: 120%;
  background: url('../assets/cover.jpg?v=8.0') center/contain no-repeat;
  opacity: 0.18;
  filter: blur(1px);
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 35%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 75%);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  animation: pulseLight 8s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes heroEntrance {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulseLight {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.2; }
  100% { transform: scale(1.1) rotate(5deg); opacity: 0.5; }
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hero-subtitle {
  font-size: 1.05rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
  max-width: 650px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e9d5ff;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.9;
}

.hero-cover {
  width: 185px;
  height: 265px;
  background: var(--bg-card);
  border-radius: 0.85rem;
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(29, 78, 216, 0.3);
  overflow: hidden;
  border: 4px solid white;
  transform: perspective(1000px) rotateY(-8deg) rotateX(4deg);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-cover:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.05);
  box-shadow: 
    0 25px 50px -10px rgba(0, 0, 0, 0.6),
    0 0 45px rgba(29, 78, 216, 0.5);
}

.hero-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Grid & Animated Chapter Cards */
.grid-chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .grid-chapters {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 1rem;
    margin-right: -1.25rem;
    margin-left: -1.25rem;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }
  .grid-chapters::-webkit-scrollbar {
    display: none;
  }
  .chapter-card {
    min-width: 280px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  animation: cardPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardPop {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chapter-card:nth-child(1) { animation-delay: 0.05s; }
.chapter-card:nth-child(2) { animation-delay: 0.1s; }
.chapter-card:nth-child(3) { animation-delay: 0.15s; }
.chapter-card:nth-child(4) { animation-delay: 0.2s; }
.chapter-card:nth-child(5) { animation-delay: 0.25s; }
.chapter-card:nth-child(6) { animation-delay: 0.3s; }
.chapter-card:nth-child(7) { animation-delay: 0.35s; }
.chapter-card:nth-child(8) { animation-delay: 0.4s; }
.chapter-card:nth-child(9) { animation-delay: 0.45s; }

.chapter-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--primary);
  box-shadow: 0 15px 30px -10px rgba(29, 78, 216, 0.25);
}

.chapter-card.featured {
  border: 2px solid var(--primary);
}

.chapter-badge-loaded {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
}

[dir="rtl"] .chapter-badge-loaded {
  right: auto;
  left: 0.75rem;
}

.chapter-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.chapter-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.chapter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* Question View & Protection Overlay Mask */
.quiz-container {
  max-width: 860px;
  margin: 0 auto;
  animation: heroEntrance 0.5s ease-out;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  position: relative;
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* 🏷️ 3D Vibrant Topic Title Badge */
.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  color: #ffffff !important;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 48%, #3b82f6 100%);
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 6px 16px -2px rgba(99, 102, 241, 0.45),
    0 2px 4px -1px rgba(0, 0, 0, 0.12),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
  user-select: none;
  max-width: 100%;
}

.topic-tag:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 10px 22px -3px rgba(99, 102, 241, 0.6),
    0 4px 8px -1px rgba(0, 0, 0, 0.15),
    inset 0 2px 1px rgba(255, 255, 255, 0.8),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.22);
}

.topic-3d-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.topic-tag:hover .topic-3d-icon {
  transform: rotate(-12deg) scale(1.15);
}

.topic-3d-text {
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

[data-theme="dark"] .topic-tag {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 48%, #6366f1 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 6px 18px -2px rgba(147, 51, 234, 0.55),
    0 2px 4px -1px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .topic-tag:hover {
  box-shadow: 
    0 10px 24px -2px rgba(147, 51, 234, 0.7),
    0 4px 8px -1px rgba(0, 0, 0, 0.45),
    inset 0 2px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.4);
}

.page-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.question-text {
  font-size: var(--question-font-size, 1.15rem) !important;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: var(--question-line-height, 1.55);
  transition: font-size 0.2s ease, line-height 0.2s ease;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

/* 🧊 3D MCQ Option Cards */
.option-btn {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: 0.85rem;
  cursor: pointer;
  text-align: left;
  font-size: var(--question-option-font-size, 1rem);
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 
    0 4px 10px -2px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.03),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.option-btn span {
  font-size: var(--question-option-font-size, 1rem);
}

[dir="rtl"] .option-btn {
  text-align: right;
}

.option-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, rgba(245, 243, 255, 0.95) 100%);
  box-shadow: 
    0 8px 18px -2px rgba(124, 58, 237, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.04),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(124, 58, 237, 0.25);
}

.option-btn:active:not(.disabled) {
  transform: translateY(1px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 2px rgba(0, 0, 0, 0.1);
}

/* 🧊 3D Embossed Letter Coin */
.option-letter {
  width: 2.1rem;
  height: 2.1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
  color: var(--text-main);
  box-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.option-btn:hover:not(.disabled) .option-letter {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 
    0 3px 8px rgba(124, 58, 237, 0.3),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1.5px 0 rgba(124, 58, 237, 0.3);
}

.option-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(237, 233, 254, 0.6) 0%, rgba(221, 214, 254, 0.8) 100%);
  box-shadow: 
    0 6px 16px -2px rgba(124, 58, 237, 0.28),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2.5px 0 rgba(124, 58, 237, 0.35);
}

.option-btn.correct {
  border-color: #059669 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.1) 100%) !important;
  color: #065f46 !important;
  box-shadow: 
    0 6px 18px -2px rgba(16, 185, 129, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.85),
    inset 0 -2.5px 0 rgba(5, 150, 105, 0.4) !important;
}

.option-btn.correct .option-letter {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 
    0 3px 8px rgba(16, 185, 129, 0.45),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2) !important;
}

.option-btn.incorrect {
  border-color: #dc2626 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(220, 38, 38, 0.1) 100%) !important;
  color: #991b1b !important;
  box-shadow: 
    0 6px 18px -2px rgba(239, 68, 68, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.85),
    inset 0 -2.5px 0 rgba(220, 38, 38, 0.4) !important;
}

.option-btn.incorrect .option-letter {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 
    0 3px 8px rgba(239, 68, 68, 0.45),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .option-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 4px 10px -2px rgba(0, 0, 0, 0.5),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .option-letter {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .option-btn:hover:not(.disabled) {
  background: linear-gradient(180deg, #2d1f4d 0%, #1e1533 100%);
  border-color: var(--primary);
  box-shadow: 
    0 8px 20px -2px rgba(147, 51, 234, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(147, 51, 234, 0.4);
}

.explanation-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[dir="rtl"] .explanation-box {
  border-left: none;
  border-right: 4px solid var(--primary);
}

.explanation-title {
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .explanation-title {
  color: #c084fc;
}

/* Controls & Pagination */
.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 🧊 3D Dropdown Selects */
.question-select {
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border-color);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(248, 250, 252, 0.9) 100%);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 
    0 4px 10px -2px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.question-select:hover {
  transform: translateY(-1.5px);
  border-color: var(--primary);
  box-shadow: 
    0 6px 14px -2px rgba(124, 58, 237, 0.18),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(124, 58, 237, 0.15);
}

.question-select:focus {
  border-color: var(--primary);
  box-shadow: 
    0 0 0 3px rgba(124, 58, 237, 0.2),
    0 4px 12px -2px rgba(124, 58, 237, 0.25);
}

[data-theme="dark"] .question-select {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 4px 10px -2px rgba(0, 0, 0, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .question-select:hover {
  border-color: var(--primary);
  box-shadow: 
    0 6px 16px -2px rgba(147, 51, 234, 0.3),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(147, 51, 234, 0.25);
}

/* Score Card */
.score-card {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--percentage), var(--border-color) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  position: relative;
}

.score-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* Table View */
.table-responsive {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

[dir="rtl"] .data-table {
  text-align: right;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-main);
  font-weight: 700;
  color: var(--text-muted);
}

.ans-badge {
  display: inline-block;
  width: 1.8rem;
  height: 1.8rem;
  line-height: 1.8rem;
  text-align: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
}

/* Flashcards */
.flashcard-wrapper {
  perspective: 1000px;
  width: 100%;
  max-width: 600px;
  height: 340px;
  margin: 2rem auto;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-wrapper.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-light) 100%);
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Mobile Bottom Navigation Bar */
.mobile-nav-bar {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 4.5rem;
  }

  .nav-tabs {
    display: none;
  }

  .nav-container {
    padding: 0.5rem 1rem;
  }

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

  .brand-subtitle {
    display: none;
  }

  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.75rem 1rem;
    gap: 1.25rem;
  }

  .hero-cover {
    width: 130px;
    height: 170px;
    margin: 0 auto;
  }

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

  .hero-stats {
    justify-content: center;
    gap: 1.25rem;
  }

  .main-content {
    padding: 1rem 0.75rem;
  }

  .question-card {
    padding: 1.15rem;
    border-radius: 0.85rem;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .option-btn {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  /* Bottom Bar */
  .mobile-nav-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0.4rem 0.25rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 0.15rem;
    padding: 0.25rem;
    width: 20%;
  }

  .mobile-nav-item.active {
    color: var(--primary);
    font-weight: 700;
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   ✨ 3D ICONS, SHIMMER GLOW & DENTIST MARKETING STYLES
   ========================================================================== */

/* 🌟 Shimmer Sweep & Glow Animations */
@keyframes shimmerGlow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-120%) rotate(25deg); }
  25% { transform: translateX(120%) rotate(25deg); }
  100% { transform: translateX(120%) rotate(25deg); }
}

@keyframes float3D {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes pulseGlow3D {
  0%, 100% { box-shadow: 0 0 15px rgba(124, 58, 237, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.8); }
  50% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.7), inset 0 2px 2px rgba(255, 255, 255, 0.9); }
}

/* Shimmer Text */
.shimmer-text {
  background: linear-gradient(90deg, #8b5cf6 0%, #c084fc 25%, #fbbf24 50%, #34d399 75%, #8b5cf6 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmerGlow 3.5s linear infinite;
  display: inline-block;
}

.shimmer-gold {
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 25%, #fff 50%, #fbbf24 75%, #d97706 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmerGlow 3s linear infinite;
}

/* Shimmer Button Effect */
.shimmer-btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.5), inset 0 1px 1px rgba(255,255,255,0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shimmer-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: rotate(25deg);
  animation: shimmerSweep 3.5s infinite;
  pointer-events: none;
}

.shimmer-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px -4px rgba(124, 58, 237, 0.6), inset 0 2px 2px rgba(255,255,255,0.8);
}

/* 🧊 3D Icons & Containers */
.icon-3d-box {
  width: 56px;
  height: 56px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 
    0 10px 20px -5px rgba(124, 58, 237, 0.25),
    0 4px 6px -2px rgba(0, 0, 0, 0.05),
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: translateZ(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: float3D 4s ease-in-out infinite;
}

[data-theme="dark"] .icon-3d-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 10px 20px -5px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4);
}

.badge-3d-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: pulseGlow3D 3s infinite;
}

/* 🩺 Marketing Dentist Section */
.marketing-dentist-section {
  background: linear-gradient(135deg, #120724 0%, #1e0e38 50%, #3b0764 100%);
  border-radius: 1.25rem;
  padding: 2rem;
  color: #ffffff;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(15, 8, 30, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.marketing-dentist-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 900px) {
  .marketing-dentist-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.dentist-hero-frame {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.2);
  transform: perspective(1000px) rotateY(-4deg);
  transition: transform 0.4s ease;
}

.dentist-hero-frame:hover {
  transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

.dentist-hero-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.dentist-features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.dentist-feature-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.85rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.dentist-feature-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.dentist-badge-thumb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  object-fit: cover;
}

/* ==========================================================================
   📖 REALISTIC FLIPBOOK / DIGITAL BOOK READER STYLES
   ========================================================================== */
.reader-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1300px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

.reader-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.reader-book-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.3rem;
  border-radius: 0.65rem;
}

[data-theme="dark"] .reader-book-selector {
  background: rgba(255, 255, 255, 0.06);
}

.reader-part-btn {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-part-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.reader-controls-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.reader-select {
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 260px;
  cursor: pointer;
}

.reader-tool-btn {
  padding: 0.45rem 0.75rem;
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reader-tool-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.reader-btn-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-main);
}

.reader-btn-group .reader-tool-btn {
  border: none;
  border-radius: 0;
}

.reader-zoom-label {
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 45px;
  text-align: center;
}

/* --- Flipbook Stage & Physical Book Illusion --- */
.flipbook-stage-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 600px;
  padding: 1rem 0;
}

.stage-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.stage-nav-arrow:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.5);
}

.stage-nav-prev {
  left: 10px;
}

.stage-nav-next {
  right: 10px;
}

.flipbook-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1800px;
}

.open-book-frame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #2a2c33;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 10px 25px -5px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  max-width: 100%;
}

[data-theme="dark"] .open-book-frame {
  background: #11141c;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Physical Book Page Sheet */
.book-page-sheet {
  position: relative;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.book-page-sheet canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
}

.left-page-sheet {
  border-radius: 6px 2px 2px 6px;
  box-shadow: 
    -5px 0 15px rgba(0, 0, 0, 0.1),
    inset -15px 0 25px -5px rgba(0, 0, 0, 0.15);
}

.right-page-sheet {
  border-radius: 2px 6px 6px 2px;
  box-shadow: 
    5px 0 15px rgba(0, 0, 0, 0.1),
    inset 15px 0 25px -5px rgba(0, 0, 0, 0.15);
}

.single-page-sheet {
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Center Spine Shadow Illusion */
.book-spine-divider {
  width: 16px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.15) 20%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(0, 0, 0, 0.15) 80%,
    rgba(0, 0, 0, 0.45) 100%
  );
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 5;
  flex-shrink: 0;
}

.page-corner-fold {
  position: absolute;
  top: 0;
  width: 25px;
  height: 25px;
  pointer-events: none;
  z-index: 4;
}

.page-corner-left {
  left: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.08) 0%, transparent 60%);
}

.page-corner-right {
  right: 0;
  background: linear-gradient(-135deg, rgba(0,0,0,0.08) 0%, transparent 60%);
}

.page-sheet-footer {
  width: 100%;
  padding: 0.4rem 0.8rem;
  background: #fbfbfb;
  border-top: 1px solid #f0f0f0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

/* Loading Overlay inside Stage */
.reader-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  z-index: 20;
  border-radius: 12px;
}

.reader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bottom Control Bar & Scrubber */
.reader-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.reader-page-counter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reader-page-box {
  width: 58px;
  text-align: center;
  padding: 0.35rem 0.4rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.9rem;
}

.reader-slider-wrap {
  flex: 1;
  min-width: 160px;
  max-width: 380px;
  display: flex;
  align-items: center;
}

.reader-range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  accent-color: var(--primary);
  cursor: pointer;
}

/* Mobile Responsive Adjustments */
@media (max-width: 899px) {
  .stage-nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .stage-nav-prev { left: 4px; }
  .stage-nav-next { right: 4px; }
  .open-book-frame {
    padding: 6px;
    border-radius: 8px;
  }
  .reader-controls-cluster {
    width: 100%;
    justify-content: space-between;
  }
  .reader-select {
    max-width: 100%;
    flex: 1;
  }
  .reader-slider-wrap {
    order: 5;
    width: 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   ✨ 3D CHAPTER CARDS & GLOSSY ICONS (Authentic PDF Colors & Specular Shine)
   ========================================================================== */

.chapter-card-3d {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
  transform-style: preserve-3d;
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.07),
    0 8px 18px -4px var(--ch-glow, rgba(0, 0, 0, 0.1)),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
  cursor: pointer;
}

[data-theme="dark"] .chapter-card-3d {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 12px 30px -5px rgba(0, 0, 0, 0.4),
    0 6px 20px -3px var(--ch-glow, rgba(0, 0, 0, 0.2)),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.chapter-card-3d:hover {
  transform: translateY(-8px) scale(1.018);
  border-color: var(--ch-primary, var(--primary));
  box-shadow: 
    0 24px 45px -10px rgba(0, 0, 0, 0.16),
    0 16px 32px -5px var(--ch-glow, rgba(0, 0, 0, 0.25)),
    0 0 20px var(--ch-glow, rgba(0, 0, 0, 0.15)),
    inset 0 1px 2px rgba(255, 255, 255, 1);
}

/* 3D Glossy Banner with authentic PDF color */
.card-3d-banner {
  position: relative;
  height: 124px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    inset 0 -12px 20px -6px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

/* Specular diagonal glass reflection band */
.card-gloss-sheen {
  position: absolute;
  top: -60%;
  left: -50%;
  width: 200%;
  height: 220%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.18) 32%,
    rgba(255, 255, 255, 0.02) 52%,
    transparent 70%
  );
  pointer-events: none;
  transform: rotate(-10deg);
}

/* Banner Top Row */
.banner-top-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.part-pill-glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ch-rating-glass {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ch-rating-glass span {
  color: #FBBF24;
}

/* 3D Glossy Icon Emblem */
.icon-3d-wrapper {
  position: absolute;
  bottom: -22px;
  right: 1.25rem;
  z-index: 6;
}

[dir="rtl"] .icon-3d-wrapper {
  right: auto;
  left: 1.25rem;
}

.icon-3d-sphere {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, var(--ch-light, #e0f2fe) 26%, var(--ch-primary, #14b4ef) 65%, var(--ch-secondary, #001f5f) 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 
    inset 0 3px 5px rgba(255, 255, 255, 0.95),
    inset 0 -4px 6px rgba(0, 0, 0, 0.4),
    0 10px 22px -3px var(--ch-glow, rgba(0, 0, 0, 0.35)),
    0 3px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  overflow: hidden;
}

.icon-3d-gloss-arc {
  position: absolute;
  top: 3px;
  left: 14%;
  width: 72%;
  height: 40%;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.08) 100%);
  pointer-events: none;
  z-index: 3;
}

.icon-3d-glyph {
  font-size: 1.85rem;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
  line-height: 1;
}

.chapter-card-3d:hover .icon-3d-sphere {
  transform: translateY(-6px) rotate(6deg) scale(1.12);
  box-shadow: 
    inset 0 3px 6px rgba(255, 255, 255, 1),
    inset 0 -4px 7px rgba(0, 0, 0, 0.45),
    0 16px 28px -2px var(--ch-glow, rgba(0, 0, 0, 0.45)),
    0 0 20px var(--ch-glow, rgba(0, 0, 0, 0.3));
}

/* Card Body */
.card-3d-body {
  padding: 1.5rem 1.25rem 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.ch-seq-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ch-primary, var(--primary));
  background: rgba(0, 0, 0, 0.035);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border-left: 3px solid var(--ch-primary, var(--primary));
}

[data-theme="dark"] .ch-seq-tag {
  background: rgba(255, 255, 255, 0.06);
}

[dir="rtl"] .ch-seq-tag {
  border-left: none;
  border-right: 3px solid var(--ch-primary, var(--primary));
}

.chapter-title-3d {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta Info Row */
.card-3d-meta {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-icon {
  font-size: 1rem;
}

/* Card 3D Footer */
.card-3d-footer {
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.015);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="dark"] .card-3d-footer {
  background: rgba(0, 0, 0, 0.2);
}

.authors-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.author-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.start-3d-btn {
  background: linear-gradient(135deg, var(--ch-primary, var(--primary)) 0%, var(--ch-secondary, var(--primary-dark)) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 
    0 4px 12px -2px var(--ch-glow, rgba(0, 0, 0, 0.3)),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.25s ease;
}

.start-3d-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 
    0 8px 18px -2px var(--ch-glow, rgba(0, 0, 0, 0.45)),
    0 0 15px var(--ch-glow, rgba(0, 0, 0, 0.3)),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Diagonal Specular Sweep on Card Hover */
.card-specular-sweep {
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: skewX(-25deg);
  pointer-events: none;
  z-index: 10;
  transition: none;
}

.chapter-card-3d:hover .card-specular-sweep {
  left: 200%;
  transition: left 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   📘 3D FILTER PILLS FOR PART ONE & PART TWO
   ========================================================================== */

.filter-pill-p1 {
  background: linear-gradient(135deg, #2ead89 0%, #70b31a 100%) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px rgba(46, 173, 137, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.filter-pill-p2 {
  background: linear-gradient(135deg, #4f9aba 0%, #e2a202 100%) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px rgba(79, 154, 186, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

/* ==========================================================================
   💡 STUDY MODE: 3D EXPLANATION & REFERENCE BOX (NO PAGE NUMBERS)
   ========================================================================== */

.explanation-box-3d {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 12px -2px var(--ch-glow, rgba(0, 0, 0, 0.06));
  animation: answerFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes answerFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.answer-result-banner {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.answer-result-banner.result-correct {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
}

.answer-result-banner.result-incorrect {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.04) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
}

.result-status-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  flex-wrap: wrap;
}

.result-correct .result-status-title {
  color: #059669;
}

.result-incorrect .result-status-title {
  color: #dc2626;
}

.correct-letter-badge {
  background: rgba(15, 23, 42, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 800;
}

[data-theme="dark"] .correct-letter-badge {
  background: rgba(255, 255, 255, 0.12);
}

.correct-option-full {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  padding-left: 1.6rem;
}

[dir="rtl"] .correct-option-full {
  padding-left: 0;
  padding-right: 1.6rem;
}

/* Authentic Book Reference Line Without Page Number */
.answer-book-ref-box {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.04) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--ch-primary, var(--primary));
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .answer-book-ref-box {
  background: rgba(255, 255, 255, 0.04);
}

[dir="rtl"] .answer-book-ref-box {
  border-left: 1px solid var(--border-color);
  border-right: 4px solid var(--ch-primary, var(--primary));
}

.book-ref-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.5;
}

.book-ref-header .book-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.book-ref-header strong {
  color: var(--ch-primary, var(--primary));
}

.explanation-detail-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
  border-top: 1px dashed var(--border-color);
  margin-top: 0.65rem;
}

.explanation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
  gap: 0.5rem;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  cursor: pointer;
}

/* ==========================================================================
   ⚙️ STUDIO CUSTOMIZER MODAL (40 Fonts, 30 Themes, 30 Icons, 30 Backgrounds)
   ========================================================================== */

.customizer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.customizer-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.customizer-modal-container {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 40px rgba(var(--primary-rgb, 14, 165, 233), 0.15);
  border-radius: 24px;
  width: 100%;
  max-width: 960px;
  height: 85vh;
  max-height: 820px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.customizer-modal-overlay.active .customizer-modal-container {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.customizer-modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .customizer-modal-header {
  background: rgba(255, 255, 255, 0.03);
}

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

.customizer-icon-badge {
  font-size: 2rem;
  background: var(--primary-light);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb, 0, 0, 0), 0.2);
}

.customizer-header-title h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.customizer-header-title p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.customizer-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.customizer-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

/* Tabs Navigation */
.customizer-tabs-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.customizer-tabs-nav::-webkit-scrollbar {
  display: none;
}

.customizer-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.customizer-tab-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.customizer-tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb, 0, 0, 0), 0.3);
}

/* Search Box */
.customizer-search-box {
  padding: 0.65rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
}

.customizer-search-box .search-glass-icon {
  position: absolute;
  left: 2.25rem;
  color: var(--text-muted);
  pointer-events: none;
}

[dir="rtl"] .customizer-search-box .search-glass-icon {
  left: auto;
  right: 2.25rem;
}

.customizer-search-box input {
  width: 100%;
  padding: 0.65rem 2.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.customizer-search-box input:focus {
  border-color: var(--primary);
}

.clear-search-btn {
  position: absolute;
  right: 2.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: bold;
}

[dir="rtl"] .clear-search-btn {
  right: auto;
  left: 2.25rem;
}

/* Modal Body */
.customizer-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
}

/* Fonts Grid */
.customizer-grid-fonts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.font-select-card {
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 1.15rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  overflow: hidden;
}

.font-select-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.font-select-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

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

.font-name-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.font-category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.font-arabic-preview {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.font-latin-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Themes Grid */
.customizer-grid-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.theme-select-card {
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.15rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.theme-select-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.theme-select-card.active {
  box-shadow: 0 0 0 3px var(--primary);
}

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

.theme-color-swatches {
  display: flex;
  gap: 0.35rem;
}

.swatch-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.theme-category-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.theme-card-name {
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
}

.theme-card-ar {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.theme-mini-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
}

/* Icons Grid */
.customizer-grid-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.85rem;
}

.icon-select-card {
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-select-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.icon-select-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.icon-preview-sphere {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.7), 0 6px 14px -2px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.icon-glyph {
  font-size: 1.65rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.icon-card-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.icon-card-ar {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Backgrounds Grid */
.customizer-grid-backgrounds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.bg-select-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.bg-select-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.bg-select-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.bg-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.5rem;
}

.bg-card-ar {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.active-tick {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .active-tick {
  right: auto;
  left: 8px;
}

/* Modal Footer */
.customizer-modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.customizer-quick-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.customizer-quick-summary strong {
  color: var(--primary);
}

/* ==========================================================================
   ✨ 3D ICON MICRO-ANIMATIONS (Floating, Pulse, Shimmer, Spin, Wobble)
   ========================================================================== */

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.2); }
}

@keyframes iconShimmer {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 8px rgba(var(--primary-rgb, 14, 165, 233), 0.8)); transform: scale(1.05); }
}

@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes iconWobble {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-3px) rotate(-6deg); }
  75% { transform: translateX(3px) rotate(6deg); }
}

/* Global Icon Animation Triggers based on user selection */
body[data-icon-anim="float"] .icon-3d-sphere,
.anim-float {
  animation: iconFloat 3.2s ease-in-out infinite;
}

body[data-icon-anim="pulse"] .icon-3d-sphere,
.anim-pulse {
  animation: iconPulse 2s ease-in-out infinite;
}

body[data-icon-anim="shimmer"] .icon-3d-sphere,
.anim-shimmer {
  animation: iconShimmer 2.4s ease-in-out infinite;
}

body[data-icon-anim="spin"] .icon-3d-sphere,
.anim-spin {
  animation: iconSpin 8s linear infinite;
}

body[data-icon-anim="wobble"] .icon-3d-sphere,
.anim-wobble {
  animation: iconWobble 2.8s ease-in-out infinite;
}

@keyframes iconOrbit {
  0% { transform: perspective(400px) rotateY(0deg) rotateX(10deg); }
  50% { transform: perspective(400px) rotateY(180deg) rotateX(-10deg) scale(1.08); }
  100% { transform: perspective(400px) rotateY(360deg) rotateX(10deg); }
}

@keyframes iconNeonPulse {
  0%, 100% { filter: drop-shadow(0 0 2px #38bdf8) brightness(1); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px #38bdf8) drop-shadow(0 0 24px #818cf8) brightness(1.3); transform: scale(1.12); }
}

@keyframes iconWaveBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-8px) scale(0.95, 1.05); }
  60% { transform: translateY(2px) scale(1.04, 0.96); }
  80% { transform: translateY(-2px) scale(0.98, 1.02); }
}

@keyframes iconCosmicDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3px, -5px) rotate(3deg); }
  50% { transform: translate(-3px, -8px) rotate(-3deg); }
  75% { transform: translate(-5px, -3px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes iconQuantumFlip {
  0% { transform: perspective(600px) rotateX(0deg); }
  50% { transform: perspective(600px) rotateX(180deg) scale(1.05); }
  100% { transform: perspective(600px) rotateX(360deg); }
}

body[data-icon-anim="orbit"] .icon-3d-sphere,
.anim-orbit {
  animation: iconOrbit 6s ease-in-out infinite;
}

body[data-icon-anim="neon-pulse"] .icon-3d-sphere,
.anim-neon-pulse {
  animation: iconNeonPulse 1.8s ease-in-out infinite;
}

body[data-icon-anim="wave-bounce"] .icon-3d-sphere,
.anim-wave-bounce {
  animation: iconWaveBounce 2.5s ease-in-out infinite;
}

body[data-icon-anim="cosmic-drift"] .icon-3d-sphere,
.anim-cosmic-drift {
  animation: iconCosmicDrift 5s ease-in-out infinite;
}

body[data-icon-anim="quantum-flip"] .icon-3d-sphere,
.anim-quantum-flip {
  animation: iconQuantumFlip 4s ease-in-out infinite;
}

/* ==========================================================================
   🌊 ANIMATED UNDULATING & FLUID BACKGROUND KEYFRAMES
   ========================================================================== */

@keyframes gradientWaveUndulate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes auroraShiftLive {
  0% { background-position: 0% 0%; filter: hue-rotate(0deg); }
  50% { background-position: 100% 100%; filter: hue-rotate(25deg); }
  100% { background-position: 0% 0%; filter: hue-rotate(0deg); }
}

@keyframes liquidPearlShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes oceanicPulse {
  0%, 100% { background-size: 180% 180%; }
  50% { background-size: 220% 220%; }
}

@keyframes laserGridPulse {
  0%, 100% { background-position: 0 0, 0 0, 50% 50%; }
  50% { background-position: 18px 18px, 18px 18px, 50% 50%; }
}

@keyframes bioluminescentGlow {
  0% { background-position: 0% 50%; filter: brightness(0.95); }
  50% { background-position: 100% 50%; filter: brightness(1.2); }
  100% { background-position: 0% 50%; filter: brightness(0.95); }
}

@keyframes holoSheenShift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes plasmaMorph {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes cavitationFloat {
  0% { background-position: 0 0, 24px 36px; }
  100% { background-position: 0 -480px, 24px -360px; }
}

@keyframes amethystFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes goldFoilWave {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes cryoWaveMotion {
  0% { background-position: 50% 0%; }
  50% { background-position: 50% 100%; }
  100% { background-position: 50% 0%; }
}

@keyframes lightCurePulse {
  0%, 100% { background-size: 160% 160%; filter: brightness(1); }
  50% { background-size: 200% 200%; filter: brightness(1.35) drop-shadow(0 0 20px #3b82f6); }
}

@keyframes endoApexGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

@keyframes sunsetVitalityFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes nebulaCosmicDrift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes prismBeamShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@keyframes onyxGoldVeinFlow {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes bioCeramicWave {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Attractive Interaction Animations */
.chapter-card-3d {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.chapter-card-3d:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 20px 40px -10px rgba(var(--primary-rgb, 255, 107, 0), 0.35) !important;
}

.option-btn {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background 0.2s ease !important;
}

.option-btn:hover:not(.disabled) {
  transform: translateX(6px) !important;
}

.bg-select-card:hover .bg-preview-canvas {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.bg-preview-canvas {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Settings Nav Tab Button */
.settings-nav-btn {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(20, 180, 239, 0.1) 100%) !important;
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.settings-nav-btn:hover {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb, 0, 0, 0), 0.25);
}

/* ==========================================================================
   🔍 QUESTION FONT SIZE CUSTOMIZER UI
   ========================================================================== */
.customizer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customizer-quick-fontsize-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.8rem;
}

.qfs-label {
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.qfs-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qfs-step-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.qfs-step-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.qfs-current-badge {
  font-weight: 800;
  color: var(--primary);
  min-width: 42px;
  text-align: center;
  font-size: 0.82rem;
}

/* Question Font Size Panel in Studio */
.customizer-fontsize-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fontsize-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border: 1px solid rgba(var(--primary-rgb, 255, 107, 0), 0.25);
  border-radius: 14px;
}

.fontsize-banner-icon {
  font-size: 2rem;
  line-height: 1;
}

.fontsize-banner-text h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.fontsize-banner-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.fontsize-slider-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.fontsize-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.fontsize-slider-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.fontsize-value-indicator {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(var(--primary-rgb, 255, 107, 0), 0.2);
}

.fontsize-slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qfs-stepper-btn {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.qfs-stepper-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.fontsize-range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 5px;
  background: var(--border-color);
  outline: none;
  transition: background 0.2s ease;
}

.fontsize-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 255, 107, 0), 0.4);
  transition: transform 0.15s ease;
}

.fontsize-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.fontsize-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fontsize-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.fontsize-preset-card {
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.fontsize-preset-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.fontsize-preset-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(var(--primary-rgb, 255, 107, 0), 0.15);
}

.preset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.preset-aa {
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.preset-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.preset-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.preset-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Live Question Preview Box */
.fontsize-preview-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.fontsize-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1.25rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .fontsize-preview-header {
  background: rgba(255, 255, 255, 0.03);
}

.preview-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.preview-mode-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.fontsize-preview-body {
  padding: 1.25rem;
}

.preview-top-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.fontsize-preview-q-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  transition: font-size 0.2s ease, line-height 0.2s ease;
}

.fontsize-preview-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fontsize-preview-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-main);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.fontsize-preview-option.preview-opt-correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: #065f46;
  font-weight: 600;
}

.preview-opt-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fontsize-preview-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.75rem;
}

/* ==========================================================================
   ✨ COMPLETE 3D BUTTONS, ICONS & BADGES DESIGN SYSTEM
   ========================================================================== */

/* 🌙 3D Theme Toggle Switch Button */
#theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 1.5px solid #fde68a !important;
  box-shadow: 
    0 3px 8px -1px rgba(245, 158, 11, 0.25),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08) !important;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#theme-toggle-btn:hover {
  transform: translateY(-2px) rotate(15deg) scale(1.05) !important;
  box-shadow: 0 6px 16px -1px rgba(245, 158, 11, 0.45) !important;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

#theme-toggle-btn:active {
  transform: translateY(1px) scale(0.95) !important;
}

[data-theme="dark"] #theme-toggle-btn {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
  border-color: rgba(165, 180, 252, 0.45) !important;
  box-shadow: 
    0 3px 8px -1px rgba(99, 102, 241, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4) !important;
}

/* 🔒 3D Lock Portal Button */
#lock-portal-btn {
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%) !important;
  border: 1.5px solid #fda4af !important;
  color: #e11d48 !important;
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  padding: 0.35rem 0.85rem !important;
  box-shadow: 
    0 3px 8px -1px rgba(225, 29, 72, 0.22),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#lock-portal-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px -1px rgba(225, 29, 72, 0.38) !important;
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%) !important;
}

#lock-portal-btn:active {
  transform: translateY(1px) !important;
}

[data-theme="dark"] #lock-portal-btn {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.25) 0%, rgba(159, 18, 57, 0.35) 100%) !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
  color: #fda4af !important;
  box-shadow: 
    0 3px 8px -1px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3) !important;
}

/* 🚪 3D Auth Logout Button */
#auth-logout-btn {
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  border: 1.5px solid #fca5a5 !important;
  color: #dc2626 !important;
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  padding: 0.35rem 0.85rem !important;
  box-shadow: 
    0 3px 8px -1px rgba(220, 38, 38, 0.22),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#auth-logout-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px -1px rgba(220, 38, 38, 0.38) !important;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
}

#auth-logout-btn:active {
  transform: translateY(1px) !important;
}

[data-theme="dark"] #auth-logout-btn {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25) 0%, rgba(153, 27, 27, 0.35) 100%) !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
  color: #fca5a5 !important;
  box-shadow: 
    0 3px 8px -1px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3) !important;
}

/* 👑 3D Admin Panel Button */
.admin-panel-trigger-btn {
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 1.5px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 800 !important;
  box-shadow: 
    0 3px 8px -1px rgba(245, 158, 11, 0.25),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s ease !important;
}

.admin-panel-trigger-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px -1px rgba(245, 158, 11, 0.4) !important;
}

/* 👤 3D User Avatar & Details */
.user-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
  color: white !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 
    0 4px 10px -1px rgba(124, 58, 237, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.25s ease;
}

.user-avatar:hover {
  transform: scale(1.1) rotate(5deg);
}

.user-role-badge {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  padding: 0.15rem 0.55rem !important;
  border-radius: 9999px !important;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.9) 0%, rgba(226, 232, 240, 0.9) 100%) !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.user-role-badge.admin {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

/* ⭐ 3D Bookmark Button */
#toggle-bookmark-btn,
.exam-review-bm-btn {
  border-radius: 9999px !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  padding: 0.4rem 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  letter-spacing: 0.02em !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#toggle-bookmark-btn.btn-secondary,
.exam-review-bm-btn.btn-secondary {
  background: linear-gradient(180deg, #fffdf5 0%, #fef3c7 100%) !important;
  border: 1.5px solid #fde68a !important;
  color: #b45309 !important;
  box-shadow: 
    0 3px 8px -1px rgba(245, 158, 11, 0.22),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08) !important;
}

#toggle-bookmark-btn.btn-secondary:hover,
.exam-review-bm-btn.btn-secondary:hover {
  transform: translateY(-2px) !important;
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 6px 14px -1px rgba(245, 158, 11, 0.38) !important;
}

#toggle-bookmark-btn.btn-primary,
.exam-review-bm-btn.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 
    0 4px 12px -1px rgba(245, 158, 11, 0.45),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

#toggle-bookmark-btn.btn-primary:hover,
.exam-review-bm-btn.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px -1px rgba(245, 158, 11, 0.6) !important;
}

/* ❤️ 3D Chapter Badge in Study Mode */
.chapter-badge-study {
  box-shadow: 
    0 4px 12px -2px rgba(0, 0, 0, 0.12),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  transform: translateZ(0) !important;
  user-select: none;
}

.chapter-badge-study:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 
    0 8px 18px -2px rgba(0, 0, 0, 0.18),
    inset 0 2px 1px rgba(255, 255, 255, 0.85),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15) !important;
}

/* 🌟 Global 3D Drop-Shadow on Icons & Emojis */
.tab-btn span,
.btn span,
.topic-3d-icon,
.mobile-nav-icon,
.tab-icon,
.chapter-badge-study span:first-child {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
  display: inline-block;
}

/* 🏷️ 3D Card Depth */
.question-card {
  box-shadow: 
    0 12px 30px -5px rgba(0, 0, 0, 0.08),
    0 4px 12px -2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .question-card {
  box-shadow: 
    0 12px 30px -5px rgba(0, 0, 0, 0.5),
    0 4px 12px -2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}



