/* ==========================================================================
   100Top Islam & Quran (2026 Edition) — Design System
   Emerald & Gold Luxury Glassmorphism | Redesigned for Beauty & Clarity
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Background Depth Stack */
  --bg-primary: #050f0d;
  --bg-secondary: #091a17;
  --bg-tertiary: #0d2520;
  --bg-elevated: #122e29;
  --bg-glass: rgba(9, 26, 23, 0.82);
  --bg-glass-strong: rgba(5, 15, 13, 0.94);

  /* Card Surfaces */
  --card-bg: rgba(10, 30, 26, 0.72);
  --card-bg-hover: rgba(13, 37, 33, 0.88);
  --card-border: rgba(212, 175, 55, 0.16);
  --card-border-hover: rgba(245, 197, 66, 0.48);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.18), 0 0 0 1px rgba(245, 197, 66, 0.25);

  /* Text Hierarchy */
  --text-primary: #f1f5f9;
  --text-secondary: #b8c8cc;
  --text-muted: #7a9097;
  --text-arabic: #fcd34d;
  --text-arabic-dim: #e5b730;

  /* Gold Accent System */
  --gold-100: rgba(212, 175, 55, 0.1);
  --gold-200: rgba(212, 175, 55, 0.2);
  --gold-400: rgba(212, 175, 55, 0.4);
  --accent-gold: #c9a227;
  --accent-gold-bright: #f5c542;
  --accent-gold-light: #fde68a;
  --accent-gold-glow: rgba(245, 197, 66, 0.4);

  /* Emerald Accent System */
  --em-100: rgba(16, 185, 129, 0.1);
  --em-200: rgba(16, 185, 129, 0.2);
  --em-400: rgba(16, 185, 129, 0.4);
  --accent-emerald: #0d9e6d;
  --accent-emerald-bright: #2fd3a0;
  --accent-teal: #14b8a6;

  /* Domain Colors (per-category accent stripes) */
  --domain-arabic: #4f8ef7;
  --domain-quran: #a78bfa;
  --domain-theology: #f59e0b;
  --domain-worship: #10b981;
  --domain-tazkiyah: #ec4899;
  --domain-seerah: #f97316;
  --domain-fiqh: #06b6d4;
  --domain-civ: #8b5cf6;
  --domain-daily: #22c55e;
  --domain-cosmos: #38bdf8;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-mid: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(212, 175, 55, 0.28);
  --border-emerald: rgba(16, 185, 129, 0.28);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Border Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-2xl: 40px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-normal: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-slow: 420ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Backwards compatibility aliases */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);
  --radius-full: var(--r-full);
  --transition-fast: var(--t-fast);
  --transition-normal: var(--t-normal);
  --transition-slow: var(--t-slow);
}

/* ─── Midnight OLED Theme ─── */
[data-theme='midnight'] {
  --bg-primary: #010504;
  --bg-secondary: #050d0b;
  --bg-tertiary: #091411;
  --bg-elevated: #0d1c19;
  --bg-glass: rgba(4, 10, 8, 0.9);
  --bg-glass-strong: rgba(2, 6, 5, 0.97);
  --card-bg: rgba(5, 13, 11, 0.85);
  --card-bg-hover: rgba(8, 18, 15, 0.95);
  --card-border: rgba(212, 175, 55, 0.2);
  --text-muted: #607a82;
}

/* ─── Warm Sand Light Theme ─── */
[data-theme='light'] {
  --bg-primary: #faf7f0;
  --bg-secondary: #f2eada;
  --bg-tertiary: #e7dbc7;
  --bg-elevated: #ddd0b8;
  --bg-glass: rgba(250, 247, 240, 0.9);
  --bg-glass-strong: rgba(242, 234, 218, 0.97);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-hover: rgba(255, 255, 255, 0.98);
  --card-border: rgba(180, 130, 20, 0.18);
  --card-border-hover: rgba(180, 130, 20, 0.5);
  --card-shadow: 0 4px 20px rgba(80, 60, 20, 0.1);
  --card-shadow-hover: 0 16px 50px rgba(80, 60, 20, 0.18), 0 0 0 1px rgba(180, 130, 20, 0.25);
  --text-primary: #0f172a;
  --text-secondary: #364152;
  --text-muted: #6b7a8a;
  --text-arabic: #92400e;
  --text-arabic-dim: #b45309;
  --gold-100: rgba(180, 83, 9, 0.1);
  --gold-200: rgba(180, 83, 9, 0.18);
  --gold-400: rgba(180, 83, 9, 0.38);
  --accent-gold: #b45309;
  --accent-gold-bright: #d97706;
  --accent-gold-light: #fde68a;
  --accent-gold-glow: rgba(180, 83, 9, 0.22);
  --accent-emerald: #047857;
  --accent-emerald-bright: #059669;
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-mid: rgba(0, 0, 0, 0.12);
  --border-gold: rgba(180, 83, 9, 0.28);
}

/* ─────────────────────────────────────────────────────────────────────────────
   GLOBAL RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Animated Particle Canvas */
#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 130px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY UTILITIES
   ───────────────────────────────────────────────────────────────────────────── */
.font-arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  line-height: 2;
}

.text-gold {
  color: var(--accent-gold-bright);
}
.text-emerald {
  color: var(--accent-emerald-bright);
}

.gradient-text-gold {
  background: linear-gradient(135deg, #ffe599 0%, #d4af37 45%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #047857 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────────────────────
   NAVIGATION BAR
   ───────────────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition:
    box-shadow var(--t-normal),
    border-color var(--t-normal);
}

.navbar.scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border-bottom-color: var(--border-gold);
}

.nav-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.8rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}

.brand-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(16, 185, 129, 0.3));
  border: 1px solid var(--border-gold);
  display: grid;
  place-items: center;
  color: var(--accent-gold-bright);
  font-size: 1.15rem;
  box-shadow:
    0 0 20px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: box-shadow var(--t-fast);
}

.brand-logo:hover .brand-icon {
  box-shadow:
    0 0 30px rgba(212, 175, 55, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-emerald-bright);
  margin-top: 2px;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--gold-200), var(--em-200));
  color: var(--accent-gold-bright);
  border: 1px solid var(--border-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Nav Tabs */
.nav-tabs-wrapper {
  flex: 1;
}

.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  list-style: none;
}

.nav-tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--r-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.nav-tab-btn i {
  font-size: 0.9em;
  transition: transform var(--t-fast);
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(212, 175, 55, 0.22));
  border-color: var(--border-gold);
  box-shadow:
    0 0 18px rgba(212, 175, 55, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-tab-btn.active i {
  transform: scale(1.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* Icon Button (theme toggle etc) */
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 0.95rem;
}

.btn-icon:hover {
  color: var(--accent-gold-bright);
  border-color: var(--border-gold);
  background: var(--bg-tertiary);
  transform: translateY(-1px) rotate(12deg);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  padding: 5rem 1.75rem 3.5rem;
  max-width: 1440px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
}

/* Faint watermark Arabic calligraphy behind title */
.hero-section::before {
  content: 'بسم الله';
  font-family: var(--font-arabic);
  font-size: clamp(8rem, 20vw, 18rem);
  color: var(--accent-gold-bright);
  opacity: 0.025;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
  user-select: none;
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.25rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
  animation: pill-shimmer 4s ease-in-out infinite;
  background-size: 200%;
}

@keyframes pill-shimmer {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.12);
  }
  50% {
    box-shadow:
      0 0 28px rgba(212, 175, 55, 0.32),
      0 0 0 1px rgba(212, 175, 55, 0.1);
  }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1.35rem;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2rem;
  line-height: 1.75;
  font-weight: 400;
}

/* Hero CTA Button */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-emerald));
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  font-family: var(--font-display);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  box-shadow:
    0 0 25px rgba(212, 175, 55, 0.3),
    0 6px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 3rem;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 0 40px rgba(212, 175, 55, 0.5),
    0 12px 30px rgba(0, 0, 0, 0.5);
}

.hero-cta i {
  transition: transform var(--t-fast);
}
.hero-cta:hover i {
  transform: translateX(4px);
}

/* Hero Stats Grid */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto 1rem;
}

.stat-chip {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--t-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.stat-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-emerald));
  opacity: 0;
  transition: opacity var(--t-fast);
}

.stat-chip:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

.stat-chip:hover::before {
  opacity: 1;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SEARCH & FILTER HUB
   ───────────────────────────────────────────────────────────────────────────── */
.search-filter-section {
  scroll-margin-top: 80px;
  position: sticky;
  top: 59px;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 1.75rem;
  margin-bottom: 2rem;
  transition: border-color var(--t-normal);
}

.search-filter-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

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

.search-input-wrapper:focus-within .search-icon {
  color: var(--accent-gold-bright);
}

.search-input {
  width: 100%;
  padding: 0.85rem 2.8rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--card-border);
  border-radius: var(--r-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--t-fast);
}

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

.search-input:focus {
  border-color: var(--accent-gold-bright);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.18),
    0 0 20px rgba(212, 175, 55, 0.1);
  background: var(--bg-tertiary);
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
  transition: color var(--t-fast);
  padding: 0.25rem;
  border-radius: var(--r-full);
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

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

.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-filter-toggle:hover {
  color: var(--accent-gold-bright);
  border-color: var(--border-gold);
  background: var(--bg-tertiary);
}

.btn-filter-toggle.active {
  color: var(--accent-gold-bright);
  border-color: var(--border-gold);
  background: linear-gradient(135deg, var(--gold-100), var(--em-100));
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

/* View Toggle */
.view-options {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 0.25rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-mid);
}

.view-btn {
  padding: 0.38rem 0.85rem;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--t-fast);
}

.view-btn.active {
  background: var(--bg-tertiary);
  color: var(--accent-gold-bright);
  border-color: var(--border-gold);
}

/* Category Pills */
.categories-scroll {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.category-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-gold);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.category-chip.active {
  background: linear-gradient(135deg, var(--em-200), var(--gold-200));
  border-color: var(--accent-gold-bright);
  color: #fff;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}

.chip-count {
  font-size: 0.68rem;
  padding: 0.1rem 0.42rem;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.28);
  color: var(--accent-gold-bright);
  font-weight: 800;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MAIN CONTENT
   ───────────────────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.75rem 4rem;
  width: 100%;
}

.tab-pane {
  display: none;
  scroll-margin-top: 110px;
}

.tab-pane.active {
  display: block;
  animation: fadeInUp 320ms var(--t-normal) backwards;
}

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

/* Section Header */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  line-height: 1.65;
  max-width: 680px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONCEPT CARDS
   ───────────────────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.concept-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--t-normal),
    border-color var(--t-normal),
    box-shadow var(--t-normal),
    background var(--t-normal);
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

/* Domain accent stripe at top */
.concept-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--domain-color, var(--accent-gold)), transparent);
  opacity: 0.7;
  transition:
    opacity var(--t-fast),
    height var(--t-fast);
}

.concept-card:hover::before {
  opacity: 1;
  height: 4px;
}

.concept-card:hover {
  transform: translateY(-6px) scale(1.005);
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  background: var(--card-bg-hover);
}

.card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card-id-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-gold-bright);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-sm);
  background: var(--gold-100);
  border: 1px solid var(--border-gold);
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

.card-category-tag {
  font-size: 0.7rem;
  color: var(--accent-emerald-bright);
  font-weight: 700;
  background: var(--em-100);
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border-emerald);
  white-space: nowrap;
}

.card-arabic-heading {
  font-size: calc(1.85rem * var(--ar-scale));
  color: var(--text-arabic);
  font-weight: 700;
  margin-bottom: 0.3rem;
  line-height: 1.5;
  text-shadow: 0 2px 12px rgba(252, 211, 77, 0.25);
}

.card-english-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.card-root-box {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  display: inline-block;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.card-summary {
  font-size: 0.895rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Verse Embed */
.card-verse-box {
  background: linear-gradient(135deg, rgba(6, 20, 18, 0.7), rgba(10, 30, 26, 0.5));
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--r-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.1rem;
  transition: border-left-color var(--t-fast);
}

[data-theme='light'] .card-verse-box {
  background: linear-gradient(135deg, rgba(255, 248, 230, 0.8), rgba(255, 252, 240, 0.9));
  border-color: rgba(180, 130, 20, 0.2);
  border-left-color: var(--accent-gold);
}

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

.card-verse-ref {
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--accent-gold-bright);
  letter-spacing: 0.02em;
}

.btn-play-verse {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--gold-200), var(--em-200));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-play-verse:hover {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-emerald));
  color: #000;
  transform: scale(1.06);
  box-shadow: 0 0 14px var(--accent-gold-glow);
}

.btn-play-verse.playing {
  background: var(--accent-emerald-bright);
  color: #000;
  animation: pulse-audio 1.4s infinite;
}

@keyframes pulse-audio {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 211, 160, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(47, 211, 160, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 211, 160, 0);
  }
}

.card-verse-arabic {
  font-size: calc(1.1rem * var(--ar-scale));
  color: var(--text-arabic);
  margin-bottom: 0.35rem;
  line-height: 1.7;
}

.card-verse-english {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.btn-card-details {
  background: transparent;
  border: none;
  color: var(--accent-gold-bright);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--t-fast);
  padding: 0.2rem 0;
}

.btn-card-details:hover {
  color: #fff;
  gap: 0.6rem;
}

.btn-bookmark {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0.3rem 0.4rem;
  border-radius: var(--r-sm);
}

.btn-bookmark:hover {
  color: var(--accent-gold-bright);
  transform: scale(1.25);
}

.btn-bookmark.bookmarked {
  color: var(--accent-gold-bright);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

/* List View */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cards-list .concept-card {
  flex-direction: row;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 1.25rem;
}

.cards-list .concept-card::before {
  width: 3px;
  height: 100%;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  top: 0;
  left: 0;
  right: auto;
}

.cards-list .card-summary,
.cards-list .card-verse-box {
  display: none;
}

.cards-list .card-arabic-heading {
  font-size: calc(1.5rem * var(--ar-scale));
  margin-bottom: 0;
  min-width: 160px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FLASHCARD STUDIO
   ───────────────────────────────────────────────────────────────────────────── */
.flashcard-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto 1.5rem;
}

.flashcard-category-select {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--r-full);
  padding: 0.55rem 1.2rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t-fast);
}

.flashcard-category-select:focus {
  border-color: var(--accent-gold-bright);
  box-shadow: 0 0 0 3px var(--gold-100);
}

.flashcards-container {
  max-width: 760px;
  margin: 0 auto;
  perspective: 1400px;
}

.flashcard-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: var(--r-full);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.flashcard-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald-bright), var(--accent-gold-bright));
  border-radius: var(--r-full);
  transition: width 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(47, 211, 160, 0.5);
}

.flashcard-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
  user-select: none;
}

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

.flashcard-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: var(--r-xl);
  background: #0a1e1b;
  border: 1.5px solid var(--card-border);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(212, 175, 55, 0.08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow-y: auto;
  transition: border-color var(--t-fast);
}

.flashcard-wrapper:hover .flashcard-face {
  border-color: rgba(212, 175, 55, 0.3);
}

[data-theme='light'] .flashcard-face {
  background: #ffffff;
  border-color: rgba(180, 130, 20, 0.22);
  box-shadow: 0 20px 50px rgba(80, 60, 20, 0.15);
}

[data-theme='midnight'] .flashcard-face {
  background: #040e0c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.flashcard-front {
  transform: rotateY(0deg);
  z-index: 2;
}
.flashcard-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.flashcard-controls-hub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.flashcard-nav-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-flash-action {
  padding: 0.75rem 1.3rem;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-gold);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--t-fast);
  font-family: var(--font-sans);
}

.btn-flash-action:hover {
  background: var(--accent-gold);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-flash-flip {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-bright));
  color: #000;
  font-weight: 900;
  border: none;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  box-shadow:
    0 0 24px var(--accent-gold-glow),
    0 6px 18px rgba(0, 0, 0, 0.4);
}

.btn-flash-flip:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 0 35px var(--accent-gold-glow),
    0 10px 24px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-gold));
  color: #000;
}

.flashcard-mastery-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-mastery {
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-mid);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: var(--font-sans);
}

.btn-mastery:hover {
  border-color: var(--accent-emerald-bright);
  color: var(--accent-emerald-bright);
}

.btn-mastery.mastered {
  background: var(--em-200);
  border-color: var(--accent-emerald-bright);
  color: var(--accent-emerald-bright);
  box-shadow: 0 0 10px rgba(47, 211, 160, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOP 20 RESERVATIONS
   ───────────────────────────────────────────────────────────────────────────── */
.reservations-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.reservation-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-normal);
  box-shadow: var(--card-shadow);
}

.reservation-card:hover {
  border-color: var(--card-border-hover);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(212, 175, 55, 0.1);
}

.reservation-header {
  padding: 1.25rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1rem;
  user-select: none;
  transition: background var(--t-fast);
}

.reservation-header:hover {
  background: rgba(255, 255, 255, 0.025);
}

.reservation-title-group {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.reservation-num {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  font-family: var(--font-display);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.12);
}

.reservation-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.reservation-toggle-icon {
  font-size: 1.1rem;
  color: var(--accent-gold-bright);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.reservation-card.open .reservation-toggle-icon {
  transform: rotate(180deg);
}

.reservation-body {
  padding: 0 1.6rem 1.75rem;
  display: none;
  border-top: 1px solid var(--border-subtle);
  animation: slideDown 280ms ease;
}

.reservation-card.open .reservation-body {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reservation-objection-box {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  padding: 0.9rem 1.2rem;
  border-radius: var(--r-sm);
  margin: 1.25rem 0;
  color: #fca5a5;
  font-size: 0.95rem;
  line-height: 1.65;
}

.reservation-counter-text {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.85;
  white-space: pre-line;
  margin-bottom: 1.5rem;
}

.reservation-takeaway-banner {
  background: linear-gradient(135deg, var(--em-100), var(--gold-100));
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────────
   JOURNAL & REFLECTIONS
   ───────────────────────────────────────────────────────────────────────────── */
.questions-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

.question-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  transition:
    border-color var(--t-normal),
    box-shadow var(--t-normal);
}

.question-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.question-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-gold-bright);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.question-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.question-context {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.question-prompts-list {
  list-style: none;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.question-prompts-list li {
  font-size: 0.84rem;
  color: var(--text-muted);
  position: relative;
  padding-left: 1.35rem;
  line-height: 1.55;
}

.question-prompts-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent-gold-bright);
  font-size: 0.72rem;
  top: 0.22em;
}

.journal-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  resize: vertical;
  outline: none;
  margin-bottom: 0.75rem;
  transition: all var(--t-fast);
  line-height: 1.65;
}

.journal-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.journal-textarea:focus {
  border-color: var(--accent-gold-bright);
  box-shadow: 0 0 0 3px var(--gold-100);
  background: var(--bg-tertiary);
}

.journal-save-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: all var(--t-fast);
  font-family: var(--font-sans);
}

.journal-save-btn:hover {
  background: var(--accent-gold);
  color: #000;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   QUOTES CAROUSEL
   ───────────────────────────────────────────────────────────────────────────── */
.quotes-carousel-wrapper {
  max-width: 960px;
  margin: 4rem auto 2rem;
  position: relative;
}

.quote-card {
  background: linear-gradient(145deg, rgba(13, 37, 33, 0.92), rgba(6, 20, 18, 0.98));
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xl);
  padding: 3rem 3.5rem;
  text-align: center;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 175, 55, 0.08);
  position: relative;
  overflow: hidden;
}

.quote-card::before {
  content: '"';
  font-size: 7rem;
  color: var(--accent-gold-bright);
  opacity: 0.12;
  position: absolute;
  top: 0.5rem;
  left: 2rem;
  line-height: 1;
  font-family: Georgia, serif;
  pointer-events: none;
}

.quote-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

[data-theme='light'] .quote-card {
  background: linear-gradient(145deg, rgba(255, 252, 242, 0.96), rgba(255, 248, 230, 0.98));
}

.quote-theme {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--accent-emerald-bright);
  margin-bottom: 1.25rem;
}

.quote-body {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.7;
  color: #fff;
  margin-bottom: 1.75rem;
  font-style: italic;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

[data-theme='light'] .quote-body {
  color: var(--text-primary);
}

.quote-source {
  font-size: 0.88rem;
  color: var(--accent-gold-bright);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   STICKY AUDIO PLAYER BAR
   ───────────────────────────────────────────────────────────────────────────── */
.audio-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #071512;
  border-top: 1px solid var(--border-gold);
  padding: 0.9rem 1.75rem;
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.8),
    0 -1px 0 rgba(212, 175, 55, 0.1);
  transition: transform var(--t-normal);
}

.audio-player-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-gold) 30%, var(--accent-emerald) 70%, transparent 100%);
}

[data-theme='light'] .audio-player-bar {
  background: #fff8e8;
}
[data-theme='midnight'] .audio-player-bar {
  background: #030907;
}

.audio-player-bar.minimized {
  transform: translateY(100%);
}

.audio-bar-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Track Info */
.audio-track-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 220px;
  flex: 0 0 auto;
}

.audio-track-badge {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-emerald));
  display: grid;
  place-items: center;
  color: #000;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

/* Equalizer animation bars (inside badge when playing) */
.audio-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.audio-eq span {
  display: block;
  width: 3px;
  background: #000;
  border-radius: 2px;
  animation: eq-bar 0.8s ease-in-out infinite alternate;
}

.audio-eq span:nth-child(1) {
  animation-delay: 0s;
  height: 40%;
}
.audio-eq span:nth-child(2) {
  animation-delay: 0.15s;
  height: 80%;
}
.audio-eq span:nth-child(3) {
  animation-delay: 0.3s;
  height: 60%;
}
.audio-eq span:nth-child(4) {
  animation-delay: 0.45s;
  height: 100%;
}

@keyframes eq-bar {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}

.audio-track-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.audio-track-surah {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.audio-track-verse {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Controls Center */
.audio-controls-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  max-width: 560px;
}

.audio-btn-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn-audio-main {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-bright));
  border: none;
  color: #000;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 0 18px var(--accent-gold-glow);
}

.btn-audio-main:hover {
  transform: scale(1.12);
  box-shadow: 0 0 28px var(--accent-gold-glow);
}

.btn-audio-sub {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0.3rem;
}

.btn-audio-sub:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Seek Bar Timeline */
.audio-timeline-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audio-time-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 32px;
}

.audio-seek-bar {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--r-full);
  outline: none;
  cursor: pointer;
}

.audio-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-gold-bright);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-gold-glow);
  transition: transform var(--t-fast);
}

.audio-seek-bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Extra Controls */
.audio-extra-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.speed-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  outline: none;
  cursor: pointer;
  transition: all var(--t-fast);
}

.speed-select:hover {
  border-color: var(--border-gold);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODAL DEEP-DIVE
   ───────────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--t-normal);
}

.modal-overlay.active {
  display: grid;
  opacity: 1;
}

.modal-card {
  background: linear-gradient(145deg, rgba(10, 30, 26, 0.97), rgba(6, 20, 18, 0.99));
  border: 1px solid var(--card-border-hover);
  border-radius: var(--r-xl);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.75rem;
  position: relative;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.85),
    0 0 50px rgba(212, 175, 55, 0.18),
    0 0 0 1px rgba(212, 175, 55, 0.1);
  animation: modalSlideIn var(--t-slow) cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

[data-theme='light'] .modal-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(255, 252, 240, 0.99));
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close-btn {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: all var(--t-fast);
}

.modal-close-btn:hover {
  background: var(--accent-gold);
  color: #000;
  transform: rotate(90deg);
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.master-footer {
  margin-top: auto;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-top: 1px solid var(--border-gold);
  padding: 3.5rem 1.75rem 2.5rem;
  position: relative;
  z-index: 10;
}

.master-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-emerald), transparent);
}

.footer-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.footer-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
}

.footer-version-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--r-full);
  background: var(--gold-100);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Pulse dot on version tag */
.footer-version-tag i {
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--accent-gold-bright);
  transition: right var(--t-fast);
}

.footer-links a:hover {
  color: var(--accent-gold-bright);
}
.footer-links a:hover::after {
  right: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 900px) {
  .nav-content {
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    gap: 0.65rem;
  }

  .nav-tabs-wrapper {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

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

  .nav-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 0.3rem;
    width: max-content;
    padding-bottom: 2px;
  }

  .nav-tab-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
  }

  .audio-bar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .audio-controls-center {
    max-width: 100%;
  }
  .audio-track-info {
    min-width: auto;
  }

  .flashcard-controls-hub {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 3rem 1rem 2rem;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-cta {
    font-size: 0.9rem;
    padding: 0.8rem 1.75rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .questions-container {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 1.75rem 1.25rem;
  }

  .flashcard-wrapper {
    height: 440px;
  }
  .flashcard-face {
    padding: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .quote-card {
    padding: 2rem 1.5rem;
  }
}

/* ==========================================================================
   TOP 20 IMPROVEMENTS & FIXES EXTENSIONS (v1.0.6)
   ========================================================================== */

/* 1. Global Arabic Typography Scaler */
:root,
[data-arabic-scale='md'] {
  --ar-scale: 1;
}
[data-arabic-scale='sm'] {
  --ar-scale: 0.88;
}
[data-arabic-scale='lg'] {
  --ar-scale: 1.2;
}
[data-arabic-scale='xl'] {
  --ar-scale: 1.45;
}

.btn-font-scale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-mid);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-font-scale:hover,
.btn-font-scale.active {
  color: var(--accent-gold-bright);
  border-color: var(--border-gold);
  background: var(--bg-tertiary);
}

/* 2. Floating Back-To-Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 95px;
  right: 25px;
  z-index: 95;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-emerald));
  color: #000;
  border: none;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 15px var(--accent-gold-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all var(--t-normal);
}

.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.6),
    0 0 25px var(--accent-gold-glow);
}

/* 3. Audio Player Multi-Reciter, Volume, Repeat & Scrub Visualizer */
.audio-reciter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  outline: none;
  cursor: pointer;
  max-width: 170px;
}

.audio-reciter-select:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.audio-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audio-volume-slider {
  width: 65px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  outline: none;
  cursor: pointer;
}

.audio-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-gold-bright);
  cursor: pointer;
}

.btn-audio-repeat {
  position: relative;
}

.btn-audio-repeat.repeat-one {
  color: var(--accent-emerald-bright);
}

.btn-audio-repeat.repeat-one::after {
  content: '1';
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 0.62rem;
  font-weight: 900;
  background: var(--accent-emerald-bright);
  color: #000;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.btn-audio-repeat.repeat-all {
  color: var(--accent-gold-bright);
}

/* Audio Seek Bar Visual Gradient Fill */
.audio-seek-bar {
  background: linear-gradient(
    to right,
    var(--accent-gold) 0%,
    var(--accent-gold) var(--seek-percent, 0%),
    rgba(255, 255, 255, 0.12) var(--seek-percent, 0%),
    rgba(255, 255, 255, 0.12) 100%
  );
}

/* 4. Highlight Animation for Random Dimension Picker */
@keyframes highlightGoldPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 197, 66, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 30px 6px rgba(245, 197, 66, 0.9);
    border-color: var(--accent-gold-bright);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px 2px rgba(245, 197, 66, 0.4);
  }
}

.card-highlight-target {
  animation: highlightGoldPulse 2s ease-in-out 2;
  border-color: var(--accent-gold-bright) !important;
}

/* 5. Keyboard Shortcuts Modal Dialog */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
}

.shortcut-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

kbd {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xs);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-gold-bright);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* 6. Journal Stats & Autosave indicator */
.journal-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.journal-counter-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.journal-save-status {
  font-size: 0.76rem;
  color: var(--accent-emerald-bright);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.journal-save-status.visible {
  opacity: 1;
}

/* 7. Accessibility Focus Rings */
:focus-visible {
  outline: 2px solid var(--accent-gold-bright);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(245, 197, 66, 0.4);
}

/* 8. Print Stylesheet */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  #canvas-bg,
  .navbar,
  .search-filter-section,
  .audio-player-bar,
  .master-footer,
  .back-to-top-btn,
  .quotes-carousel-wrapper,
  .hero-section {
    display: none !important;
  }
  .app-container {
    padding-bottom: 0 !important;
  }
  .main-content {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .tab-pane {
    display: block !important;
    page-break-after: always;
  }
  .cards-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
  }
  .concept-card {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .card-arabic-heading,
  .card-verse-arabic {
    color: #78350f !important;
  }
  .card-english-title {
    color: #000 !important;
  }
  .card-summary,
  .card-verse-english {
    color: #333 !important;
  }
}

/* ==========================================================================
   NURULQURAN SHOWCASE VISUAL UPGRADE (v1.0.7)
   Official Othmani Medina Mushaf Typography & Atmospheric Glassmorphism 2.0
   ========================================================================== */

/* ─── KFGQPC Official Othmani Font ─── */
@font-face {
  font-family: 'KFGQPC Uthmanic Script HAFS';
  src: url('https://verses.quran.foundation/fonts/quran/hafs/uthmanic_hafs/UthmanicHafs1Ver18.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-arabic: 'KFGQPC Uthmanic Script HAFS', 'Amiri', 'Traditional Arabic', serif;

  /* NurulQuran Gold System */
  --nq-gold-1: #fff0b8;
  --nq-gold-2: #f5c97b;
  --nq-gold-3: #d4af37;
  --nq-gold-4: #9a7b2c;

  /* NurulQuran Bioluminescent Teals */
  --nq-teal-1: #5eead4;
  --nq-teal-2: #2dd4bf;
  --nq-teal-3: #0f766e;

  --shadow-glow: 0 0 35px rgba(245, 201, 123, 0.22);
}

/* ─── Atmospheric Aurora Glow Orbs ─── */
.bg-canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  transition: opacity 0.5s ease;
}

.orb-1 {
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, #0f766e 0%, transparent 70%);
  top: -20vw;
  left: -15vw;
  animation: orbDrift1 28s ease-in-out infinite alternate;
}

.orb-2 {
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, #1e3a8a 0%, transparent 70%);
  bottom: -15vw;
  right: -10vw;
  animation: orbDrift2 32s ease-in-out infinite alternate;
}

.orb-3 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.35) 0%, transparent 70%);
  top: 35%;
  left: 30%;
  animation: orbDrift3 24s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8vw, 10vh) scale(1.15);
  }
}
@keyframes orbDrift2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-8vw, -6vh) scale(1.08);
  }
}
@keyframes orbDrift3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6vw, -8vh) scale(1.12);
  }
}

/* ─── Sacred Geometric Dot Grid & Film Grain ─── */
.geometric-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    radial-gradient(var(--accent-gold-bright) 1px, transparent 1px), radial-gradient(var(--accent-emerald-bright) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position:
    0 0,
    24px 24px;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Bismillah Calligraphic Header ─── */
.bismillah-hero {
  font-family: var(--font-arabic);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--nq-gold-2);
  margin-bottom: 24px;
  direction: rtl;
  letter-spacing: 1px;
  text-shadow: 0 2px 24px rgba(245, 201, 123, 0.45);
  animation: fadeIn 1s ease-out;
  line-height: 1.4;
  user-select: none;
}

/* ─── Showcase Exhibits Dropdown (.islam-dropdown-wrapper) ─── */
.islam-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.islam-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--accent-emerald-bright);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}

.islam-dropdown-btn:hover,
.islam-dropdown-btn.active {
  background: rgba(45, 212, 191, 0.25);
  border-color: var(--accent-emerald-bright);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
}

.islam-dropdown-btn .chevron-icon {
  font-size: 0.75rem;
  transition: transform var(--t-fast);
}

.islam-dropdown-btn.active .chevron-icon {
  transform: rotate(180deg);
}

.islam-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--bg-glass-strong);
  border: 1px solid var(--card-border-hover);
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(212, 175, 55, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.islam-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.islam-dropdown-menu .dropdown-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold-bright);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.islam-dropdown-menu .dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--t-fast);
  cursor: pointer;
}

.islam-dropdown-menu .dropdown-item:hover {
  background: var(--bg-elevated);
  border-left: 2px solid var(--accent-gold-bright);
  transform: translateX(4px);
}

.islam-dropdown-menu .item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-emerald-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.islam-dropdown-menu .item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Hero Pulse Dot ─── */
.hero-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald-bright);
  box-shadow: 0 0 12px var(--accent-emerald-bright);
  animation: heroPulse 2s infinite;
  display: inline-block;
}

@keyframes heroPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* ─── Enhanced Card Glassmorphism ─── */
.concept-card {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-verse-arabic,
.card-arabic-heading,
.font-arabic {
  font-family: var(--font-arabic) !important;
  line-height: 1.8;
}

/* ==========================================================================
   v1.1 — Accessibility, icons, dialogs, SRS flashcards, static pages
   ========================================================================== */

/* The [hidden] attribute must win over component display rules. */
[hidden] {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  background: var(--accent-gold-bright);
  color: #000;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.75rem;
}

.main-content:focus {
  outline: none;
}

/* SVG icons (sprite generated at build time) */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.125em;
  display: inline-block;
}
.btn-icon .icon,
.btn-audio-main .icon,
.modal-close-btn .icon,
.back-to-top-btn .icon {
  vertical-align: 0;
}
.search-icon {
  width: 1rem;
  height: 1rem;
}
.nav-tab-btn .icon {
  transition: transform var(--t-fast);
}
.nav-tab-btn.active .icon {
  transform: scale(1.15);
}
.hero-cta .icon {
  transition: transform var(--t-fast);
}
.hero-cta:hover .icon:last-child {
  transform: translateX(4px);
}
.footer-version-tag .icon {
  animation: pulse-dot 2.5s ease-in-out infinite;
}

/* Brand */
.brand-word {
  color: var(--text-primary);
}
.brand-icon-sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

/* Button resets for elements that became real buttons */
.stat-chip,
.reservation-header,
.dropdown-item {
  font: inherit;
  color: inherit;
  text-align: inherit;
  border: none;
  background: none;
}
.hero-stats-grid {
  list-style: none;
  padding: 0;
}
.stat-chip {
  width: 100%;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.dropdown-item {
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
}
.dropdown-item:focus-visible {
  background: var(--bg-elevated);
  outline-offset: -2px;
}
.islam-dropdown-menu:not(.open) {
  pointer-events: none;
}

/* Reservations */
.reservation-heading {
  margin: 0;
  font: inherit;
}
.reservation-header {
  width: 100%;
}
.reservation-header .reservation-question {
  display: block;
}
.reservation-cat {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-emerald-bright);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.reservation-toggle-icon .icon {
  transition: transform var(--t-fast);
}
.reservation-card.open .reservation-toggle-icon {
  transform: none;
}
.reservation-card.open .reservation-toggle-icon .icon {
  transform: rotate(180deg);
}
.reservation-objection-box p {
  margin-top: 0.35rem;
}
.reservation-takeaway-banner .icon {
  font-size: 1.25rem;
  margin-top: 0.15rem;
}
.reservation-link {
  margin-top: 1rem;
  font-size: 0.82rem;
}
.reservation-link a,
.static-article a:not(.btn-filter-toggle):not(.hero-cta) {
  color: var(--accent-gold-bright);
}
.reservation-tools {
  max-width: 700px;
  margin: 0 auto 2rem;
}
.reservation-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
[data-theme='light'] .reservation-takeaway-banner {
  color: var(--text-primary);
}
[data-theme='light'] .reservation-objection-box {
  color: #991b1b;
}

/* Empty / status */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}
.empty-state h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.empty-state p {
  max-width: 450px;
  margin: 0 auto;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.app-status {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.app-status a {
  color: var(--accent-gold-bright);
}
.section-header-center {
  justify-content: center;
  text-align: center;
  margin-bottom: 1.5rem;
}
.section-header-center .section-title {
  justify-content: center;
}
.section-header-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}
.journal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Font scale group */
.font-scale-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-font-scale {
  width: auto;
  min-width: 34px;
  padding: 0 0.45rem;
}

/* Cards */
.card-title-link {
  color: inherit;
  text-decoration: none;
}
.card-title-link:hover {
  color: var(--accent-gold-bright);
}
.btn-card-details {
  text-decoration: none;
}
.root-gloss {
  font-family: var(--font-sans);
  letter-spacing: 0;
}
.root-letters {
  font-family: var(--font-arabic);
  letter-spacing: 0.05em;
}
blockquote.card-verse-arabic {
  margin: 0 0 0.35rem;
}
.q-verse-arabic {
  font-size: calc(1.1rem * var(--ar-scale));
}

/* Deep-dive dialog */
.modal-card:focus {
  outline: none;
}
.modal-card-sm {
  max-width: 600px;
}
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 3rem 1.5rem 0;
  flex-wrap: wrap;
}
.detail-badges,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.detail-badges .card-id-badge {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
}
.btn-bookmark-lg {
  font-size: 1.3rem;
}
.modal-arabic-title {
  font-size: calc(2.5rem * var(--ar-scale));
  color: var(--text-arabic);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.detail-root {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.detail-panel {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
  line-height: 1.7;
}
[data-theme='light'] .detail-panel {
  background: var(--bg-secondary);
}
.detail-kicker {
  color: var(--accent-gold-bright);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.detail-verse {
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  border-radius: var(--r-lg);
}
.modal-verse-arabic {
  font-size: calc(1.6rem * var(--ar-scale));
  color: var(--text-arabic);
  line-height: 1.9;
  margin: 0 0 0.85rem;
}
.detail-verse .card-verse-english {
  -webkit-line-clamp: unset;
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.detail-section {
  margin-bottom: 1.75rem;
}
.detail-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.detail-body {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.8;
}
.detail-gem {
  background: var(--gold-100);
  border-left: 3px solid var(--accent-gold-bright);
  border-radius: var(--r-sm);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}
.detail-gem-text {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.btn-copy-quote {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-bright);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-full);
  cursor: pointer;
}
.detail-practice {
  background: var(--em-100);
  border: 1px solid var(--border-emerald);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.detail-practice .detail-kicker {
  color: var(--accent-emerald-bright);
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}
.detail-tags li {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  color: var(--text-muted);
}
[data-theme='light'] .detail-tags li {
  background: var(--bg-secondary);
}
.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}
.detail-nav a {
  text-decoration: none;
}

/* Shortcuts dialog */
.shortcuts-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.shortcuts-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}
.shortcuts-grid dd {
  margin: 0;
  white-space: nowrap;
}
.shortcuts-foot {
  text-align: center;
  margin-top: 1.5rem;
}

/* Toasts */
/* Bottom-center so toasts never cover dialog close buttons or the navbar. */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  pointer-events: none;
}
.toast-container .toast-action {
  pointer-events: auto;
}
body.player-open .toast-container {
  bottom: 150px;
}
@media (max-width: 900px) {
  body.player-open .toast-container {
    bottom: 250px;
  }
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 0.75rem 1.1rem;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  animation: fadeInUp 200ms ease;
  transition: opacity 300ms ease;
}
.toast .icon {
  color: var(--accent-gold-bright);
}
.toast-error {
  border-color: #ef4444;
}
.toast-error .icon {
  color: #f87171;
}
.toast-leaving {
  opacity: 0;
}
.toast-action {
  margin-left: auto;
  background: var(--accent-gold-bright);
  color: #000;
  border: none;
  border-radius: var(--r-full);
  padding: 0.3rem 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

/* Audio player */
.audio-track-text p {
  margin: 0;
}
.audio-arabic-snippet {
  font-size: calc(0.95rem * var(--ar-scale));
  color: var(--text-arabic);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  line-height: 1.6;
}
.btn-audio-repeat.repeat-one::after {
  line-height: 12px;
}
body.player-open .back-to-top-btn {
  bottom: 130px;
}
@media (max-width: 900px) {
  body.player-open .back-to-top-btn {
    bottom: 230px;
  }
}

/* Quotes */
.quote-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.btn-icon-sm {
  width: 34px;
  height: 34px;
}
blockquote.quote-body {
  margin-top: 0;
}

/* Journal */
.question-kicker {
  font-size: 0.75rem;
  color: var(--accent-emerald-bright);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.question-prompts-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold-bright);
  margin-bottom: 0.4rem;
}
.journal-save-status {
  opacity: 1;
}

/* Flashcards */
.flashcard-studio-header {
  align-items: flex-end;
}
.fc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.fc-field label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.flashcard-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.flashcard-stats strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.flashcard-stats .text-emerald strong {
  color: var(--accent-emerald-bright);
}
.fc-top,
.fc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fc-bottom {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
.fc-center {
  text-align: center;
  margin: auto 0;
  padding: 1rem 0;
}
.fc-center-left {
  text-align: left;
}
.fc-prompt {
  font-size: 0.85rem;
  color: var(--accent-gold-bright);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.flash-arabic {
  font-size: calc(3.2rem * var(--ar-scale));
  color: var(--text-arabic);
  line-height: 1.4;
  margin-bottom: 1rem;
  text-align: center;
}
.flash-arabic-sm {
  font-size: calc(1.3rem * var(--ar-scale));
  color: var(--accent-gold-bright);
}
.fc-root {
  font-size: 1rem;
  padding: 0.4rem 1rem;
}
.fc-ref {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.fc-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}
.fc-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.fc-title-row .fc-title {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}
.fc-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 0.85rem;
}
.fc-center-left .fc-summary {
  margin-left: 0;
}
.fc-action {
  font-size: 0.85rem;
  color: var(--accent-emerald-bright);
  line-height: 1.5;
  background: var(--em-100);
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-sm);
  border-left: 2px solid var(--accent-emerald);
}
.fc-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.fc-hint-strong {
  font-size: 0.8rem;
  color: var(--accent-emerald-bright);
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.fc-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.fc-badge-new {
  color: var(--accent-gold-bright);
  background: var(--gold-100);
}
.fc-badge-mastered {
  color: var(--accent-emerald-bright);
  background: var(--em-200);
}
.fc-answer-badge {
  background: var(--em-200);
  color: var(--accent-emerald-bright);
  border-color: var(--border-emerald);
}
.fc-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.fc-done-icon {
  font-size: 3rem;
  color: var(--accent-emerald-bright);
}
.flashcard-wrapper.fc-empty {
  cursor: default;
}
.flashcard-counter {
  text-align: center;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--accent-gold-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.flashcard-help {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.flash-grade-group {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn-grade {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-mid);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-grade kbd {
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
}
.grade-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.grade-again:hover {
  border-color: #ef4444;
  color: #fca5a5;
}
.grade-good:hover {
  border-color: var(--accent-gold-bright);
  color: var(--accent-gold-bright);
}
.grade-easy:hover {
  border-color: var(--accent-emerald-bright);
  color: var(--accent-emerald-bright);
}
.btn-flash-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
[data-theme='light'] .btn-grade:hover.grade-again {
  color: #b91c1c;
}

/* Light-theme contrast fixes for hard-coded whites */
[data-theme='light'] .nav-tab-btn.active,
[data-theme='light'] .category-chip.active,
[data-theme='light'] .islam-dropdown-btn:hover,
[data-theme='light'] .islam-dropdown-btn.active,
[data-theme='light'] .btn-card-details:hover {
  color: var(--text-primary);
}

/* Static (pre-rendered) pages */
.static-page .app-container {
  padding-bottom: 0;
}
.static-main {
  max-width: 880px;
  padding-top: 2.5rem;
}
.static-article .modal-title {
  font-size: 2.2rem;
}
.static-cta {
  margin: 2rem 0;
  text-align: center;
}
.static-cta .hero-cta {
  margin: 0;
  text-decoration: none;
}

/* Reduced motion: stop decorative animation and smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora-orb,
  .hero-pill,
  .hero-pulse-dot {
    animation: none !important;
  }
  #canvas-bg {
    display: none;
  }
}

.aurora-orb {
  will-change: transform;
}
.search-clear-btn:not([hidden]) {
  display: grid;
  place-items: center;
}

/* Mobile overflow fixes: centered flex children must not size to their max-content. */
.hero-section,
.main-content,
.search-filter-section {
  width: 100%;
  min-width: 0;
}
.hero-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}
@media (max-width: 640px) {
  .hero-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .stat-chip {
    padding: 1rem 0.75rem;
  }
  .filter-actions {
    flex-wrap: wrap;
  }
  .search-input-wrapper {
    min-width: 0;
    flex-basis: 100%;
  }
  .search-filter-section {
    position: static;
  }
  .detail-top {
    margin-right: 2.5rem;
  }
  .modal-arabic-title {
    font-size: calc(2rem * var(--ar-scale));
  }
  .modal-title {
    font-size: 1.5rem;
  }
  .audio-extra-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
}
@media (max-width: 900px) {
  .nav-tabs-wrapper {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   VISUAL SHARE CARD GENERATOR (v1.1.4)
   ========================================================================== */
.modal-overlay-card {
  z-index: 220;
}

.modal-card-generator {
  max-width: 940px;
  width: 95%;
  padding: 2.25rem;
}

.card-generator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-right: 2.5rem;
}

.card-gen-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.card-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.card-generator-body {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 2.25rem;
  align-items: start;
}

.card-preview-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.card-preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #030a08;
  border: 1.5px solid var(--border-gold);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(212, 175, 55, 0.15);
}

.card-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-preview-loader {
  position: absolute;
  inset: 0;
  background: rgba(4, 14, 12, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--accent-gold-bright);
  font-size: 0.92rem;
  font-weight: 700;
  z-index: 5;
}

.rotate-spin {
  animation: spin 1s linear infinite;
  font-size: 1.4rem;
}

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

.card-quick-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  gap: 0.75rem;
}

.card-dimension-indicator {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-controls-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-control-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-theme-selector {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-card-theme {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-mid);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  width: 100%;
}

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

.btn-card-theme.active {
  border-color: var(--accent-gold-bright);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.18);
}

.theme-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.swatch-emerald {
  background: radial-gradient(circle, #2fd3a0 0%, #0d9e6d 50%, #041a14 100%);
}

.swatch-midnight {
  background: radial-gradient(circle, #38bdf8 0%, #0284c7 50%, #041226 100%);
}

.swatch-onyx {
  background: radial-gradient(circle, #f5c542 0%, #d4af37 50%, #171510 100%);
}

.theme-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.theme-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.theme-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.theme-check-icon {
  opacity: 0;
  color: var(--accent-gold-bright);
  font-size: 0.95rem;
  transition: opacity var(--t-fast);
}

.btn-card-theme.active .theme-check-icon {
  opacity: 1;
}

.card-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.88rem 1.4rem;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}

.btn-card-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-emerald));
  color: #040e0b;
  border: none;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
}

.btn-card-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(212, 175, 55, 0.5);
  filter: brightness(1.06);
}

.card-actions-subrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-card-secondary {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-gold);
  color: var(--accent-gold-bright);
}

.btn-card-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-gold-bright);
  color: #fff;
  transform: translateY(-1px);
}

.card-info-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.card-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-card-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.btn-card-icon:hover {
  color: var(--accent-gold-bright);
  transform: scale(1.12);
}

.detail-gem-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.btn-card-gem {
  border-color: var(--border-emerald) !important;
  color: var(--accent-emerald-bright) !important;
}

.btn-card-gem:hover {
  border-color: var(--accent-emerald-bright) !important;
  background: var(--em-100) !important;
  color: #fff !important;
}

@media (max-width: 820px) {
  .modal-card-generator {
    padding: 1.75rem 1.25rem;
  }
  .card-generator-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .card-preview-wrapper {
    max-width: 320px;
    margin: 0 auto;
  }
}

