/* ==========================================================================
   HEQ WERDK - WebApp Specialized Styles
   Emerald Green & Royal Gold Theme, Glassmorphism, App-like Mobile Feel
   ========================================================================== */

/* 1. Custom Font: Forma DJR Arabic Display */
@font-face {
  font-family: 'FormaDJRArabic';
  src: url('../../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('https://werdk-cdn.b-cdn.net/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FormaDJRArabic';
  src: url('../../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('https://werdk-cdn.b-cdn.net/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FormaDJRArabic';
  src: url('../../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('../heq_werdk_app/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype'),
       url('https://werdk-cdn.b-cdn.net/assets/fonts/alfont_com_FormaDJRArabicDisplay-Bold-Testing.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* 2. Custom Font: Uthmanic Hafs */
@font-face {
  font-family: 'Uthmani';
  src: url('../../heq_werdk_app/assets/fonts/UthmanicHafs_V20.ttf') format('truetype'),
       url('../heq_werdk_app/assets/fonts/UthmanicHafs_V20.ttf') format('truetype'),
       url('https://werdk-cdn.b-cdn.net/assets/fonts/UthmanicHafs_V20.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Typography: Forma DJR Arabic across all UI, preserving Uthmanic for Quranic verses */
  --font-display: 'FormaDJRArabic', system-ui, -apple-system, sans-serif;
  --font-main: 'FormaDJRArabic', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-quran: 'Uthmani', 'Amiri', serif;

  /* WebApp Emerald & Royal Gold palette */
  --emerald-950: #011A14;
  --emerald-900: #022C22;
  --emerald-800: #064E3B;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10B981;
  --gold-500: #FFD700;
  --gold-400: #E5C158;
  --gold-600: #B45309;

  /* App Theme Variables (Ultra-Luxury Glassmorphism Dark Mode) */
  --app-bg: #01140F;
  --app-bg-secondary: #022019;
  --app-card-bg: rgba(2, 44, 34, 0.65);
  --app-card-border: rgba(255, 215, 0, 0.22);
  --app-card-border-top: rgba(255, 215, 0, 0.45);
  --app-text: #F1FBF8;
  --app-text-muted: #8FB7A8;
  --app-gold: #FFD700;
  --gold: #FFD700;
  --app-glass: rgba(2, 44, 34, 0.65);
  --app-glass-border: rgba(255, 215, 0, 0.22);
  --app-glass-border-top: rgba(255, 215, 0, 0.45);
  --app-active-glow: 0 0 20px rgba(255, 215, 0, 0.25);
}

[data-theme="light"] {
  --app-bg: #F4F8F6;
  --app-bg-secondary: #E8F1EC;
  --app-card-bg: rgba(255, 255, 255, 0.85);
  --app-card-border: rgba(8, 129, 120, 0.2);
  --app-card-border-top: rgba(8, 129, 120, 0.35);
  --app-text: #0B251E;
  --app-text-muted: #4B6E64;
  --app-gold: #B45309;
  --gold: #B45309;
  --app-glass: rgba(255, 255, 255, 0.85);
  --app-glass-border: rgba(8, 129, 120, 0.22);
  --app-glass-border-top: rgba(8, 129, 120, 0.4);
  --app-active-glow: 0 0 20px rgba(180, 83, 9, 0.2);
}

body.webapp-body {
  background-color: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  padding-bottom: 96px; /* Space for Floating Capsule Bottom Nav on Mobile */
  direction: rtl;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Card Utility (Tier-1 Ultra-Luxury Engineering) */
.glass-panel {
  background: var(--app-card-bg);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-top: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: var(--radius-md, 18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

[data-theme="light"] .glass-panel {
  border: 1px solid rgba(8, 129, 120, 0.2);
  border-top: 1px solid rgba(8, 129, 120, 0.35);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 44, 34, 0.65);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  padding: 12px 24px;
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(8, 129, 120, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.app-header-inner {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 clamp(16px, 3.5vw, 56px) !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.app-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.app-brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-text);
  letter-spacing: 0.5px;
}

.app-brand-subtitle {
  font-size: 0.72rem;
  color: var(--app-gold);
  font-weight: 600;
  display: block;
}

/* Header Quick Actions (Spacious & Decluttered on Far Left) */
.header-quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-hoopoe-guide {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--app-gold);
  padding: 7px 16px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-hoopoe-guide:hover {
  background: rgba(255, 215, 0, 0.22);
  border-color: var(--app-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

.hoopoe-btn-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.btn-site-link {
  color: var(--app-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-site-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 215, 0, 0.2);
}

/* Floating Island Navigation Bar (Desktop Linear / Raycast Style) */
.app-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(2, 44, 34, 0.65);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-top: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 9999px;
  padding: 5px 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .app-nav-tabs {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(8, 129, 120, 0.22);
  border-top: 1px solid rgba(8, 129, 120, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.app-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-tab-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.app-tab-btn:hover {
  color: var(--app-text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 215, 0, 0.12);
}

.app-tab-btn:hover svg {
  transform: translateY(-1px);
}

.app-tab-btn.active {
  color: var(--app-gold);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--app-gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

[data-theme="light"] .app-tab-btn.active {
  color: var(--app-gold);
  background: rgba(180, 83, 9, 0.12);
  border-color: var(--app-gold);
  box-shadow: 0 0 14px rgba(180, 83, 9, 0.2);
}

/* Floating Island Navigation Bar (Mobile Floating Capsule) */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  max-width: 540px;
  margin: 0 auto;
  z-index: 1000;
  background: rgba(2, 44, 34, 0.75);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-top: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 9999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px;
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(8, 129, 120, 0.25);
  border-top: 1px solid rgba(8, 129, 120, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 9999px;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.bottom-nav-item:hover {
  color: var(--app-text);
}

.bottom-nav-item.active {
  color: var(--app-gold);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--app-gold);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.22);
}

.bottom-nav-item.active svg {
  transform: translateY(-1px);
}

[data-theme="light"] .bottom-nav-item.active {
  color: var(--app-gold);
  background: rgba(180, 83, 9, 0.12);
  border: 1px solid var(--app-gold);
  box-shadow: 0 0 12px rgba(180, 83, 9, 0.2);
}

@media (max-width: 1024px) {
  .app-nav-tabs {
    display: none;
  }
  .bottom-nav {
    display: flex;
  }
  .app-container {
    padding-bottom: 105px !important;
  }
}

/* App Main Container */
.app-container {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 20px;
}

@media (max-width: 600px) {
  .app-header-inner {
    height: 64px !important;
    padding: 0 14px !important;
  }

  .app-brand img {
    width: 32px;
    height: 32px;
  }

  .app-brand-title {
    font-size: 1.1rem;
  }

  .app-brand-subtitle {
    font-size: 0.64rem;
  }

  .bottom-nav {
    bottom: 10px;
    left: 8px;
    right: 8px;
    padding: 4px;
    max-width: none;
  }

  .bottom-nav-item {
    padding: 4px 6px;
    font-size: 0.68rem;
    min-width: 40px;
    min-height: 40px;
  }

  .bottom-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .app-container {
    padding: 0 12px 110px !important;
    margin: 12px auto;
  }
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* ==========================================================================
   MODULE 1: QURAN & WIRD READER
   ========================================================================== */
.quran-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
}

.quran-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quran-select {
  background: var(--app-bg-secondary);
  color: var(--app-text);
  border: 1px solid var(--app-card-border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.quran-search-input {
  background: var(--app-bg-secondary);
  color: var(--app-text);
  border: 1px solid var(--app-card-border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  width: 200px;
  outline: none;
}

.quran-text-container {
  padding: 40px 36px;
  margin-bottom: 30px;
  line-height: 2.8;
  text-align: justify;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal);
}

.mushaf-font-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--app-card-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.font-size-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.font-size-btn:hover {
  background: rgba(0, 210, 255, 0.2);
  color: #00D2FF;
}

.surah-title-banner {
  text-align: center;
  padding: 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.4), rgba(1, 26, 20, 0.6));
  border: 1px solid var(--app-card-border);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.surah-name {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--app-gold);
  margin-bottom: 4px;
}

.bismillah-text {
  font-family: var(--font-quran);
  font-size: 1.8rem;
  color: var(--app-text);
  margin: 16px 0 8px;
  text-align: center;
  letter-spacing: 1px;
}

.ayah-item {
  display: inline !important;
  font-family: var(--font-quran);
  font-size: var(--quran-font-size, 1.75rem);
  color: var(--app-text);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  line-height: 2.6;
}

.ayah-item:hover {
  background-color: rgba(255, 215, 0, 0.08);
}

/* التظليل الحقيقي للآيات - تظليل انسيابي نقي بدون كروت أو صناديق منفصلة */
.ayah-item.active-audio,
.ayah-item.active-reading {
  display: inline !important;
  background-color: rgba(255, 215, 0, 0.18) !important;
  color: #FFFFFF !important;
  border-radius: 4px !important;
  padding: 2px 4px !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-box-decoration-break: clone !important;
  box-decoration-break: clone !important;
  transition: background-color 0.3s ease;
}

[data-theme="light"] .ayah-item.active-audio,
[data-theme="light"] .ayah-item.active-reading {
  background-color: rgba(217, 119, 6, 0.18) !important;
  color: #064E3B !important;
}

.ayah-item.active-audio .ayah-end-symbol,
.ayah-item.active-reading .ayah-end-symbol {
  background: var(--app-gold) !important;
  color: #011A14 !important;
  border-color: var(--app-gold) !important;
  font-weight: 800 !important;
  transform: scale(1.05);
}

.ayah-end-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 6px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--app-gold);
  border: 1.5px solid var(--app-gold);
  border-radius: 50%;
  vertical-align: middle;
  transition: all 0.3s ease;
}

/* ==========================================================================
   AYAH ACTION SHEET / POPUP MENU (Flutter SmartWird Ayah Tap Menu)
   ========================================================================== */
.ayah-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 2500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.25s ease;
}

.ayah-action-overlay.open {
  display: flex;
}

@media (min-width: 768px) {
  .ayah-action-overlay {
    align-items: center;
    padding: 20px;
  }
}

.ayah-action-sheet {
  width: 100%;
  max-width: 500px;
  background: rgba(2, 44, 34, 0.88);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-top: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 22px 24px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .ayah-action-sheet {
    border-radius: 24px;
  }
}

.ayah-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ayah-action-surah {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-gold);
}

.ayah-action-num {
  font-size: 0.85rem;
  color: #00D2FF;
  margin-right: 8px;
  font-weight: 600;
}

.action-sheet-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--app-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.action-sheet-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: #EF4444;
}

.ayah-action-preview {
  font-family: var(--font-quran);
  font-size: 1.35rem;
  line-height: 2;
  color: #FFFFFF;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  max-height: 120px;
  overflow-y: auto;
}

.ayah-action-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ayah-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.ayah-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--app-gold);
  transform: translateY(-2px);
}

.ayah-action-btn.primary {
  background: linear-gradient(135deg, rgba(8, 129, 120, 0.35), rgba(16, 185, 129, 0.25));
  border-color: var(--app-teal);
}

.ayah-action-btn.primary:hover {
  background: linear-gradient(135deg, rgba(8, 129, 120, 0.55), rgba(16, 185, 129, 0.4));
  border-color: var(--app-gold);
}

.action-btn-icon-frame {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-btn-icon-frame.play {
  background: rgba(0, 210, 255, 0.15);
  color: #00D2FF;
}

.action-btn-icon-frame.tafseer {
  background: rgba(255, 215, 0, 0.15);
  color: var(--app-gold);
}

.action-btn-icon-frame.copy {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.action-btn-text-wrap {
  display: flex;
  flex-direction: column;
}

.action-btn-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.action-btn-sub {
  font-size: 0.78rem;
  color: var(--app-text-muted);
}

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

/* ==========================================================================
   MODULE 2: TADABBUR & TAFSEER MODAL / SIDE PANEL
   ========================================================================== */
.tadabbur-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tadabbur-overlay.open {
  display: flex;
}

.tadabbur-modal {
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.tadabbur-close-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: transparent;
  border: none;
  color: var(--app-text-muted);
  cursor: pointer;
}

.tadabbur-ayah-box {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--app-card-border);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-family: var(--font-quran);
  font-size: 1.45rem;
  line-height: 2.2;
  text-align: center;
  color: var(--app-gold);
}

.tadabbur-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--app-bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--app-card-border);
}

.tadabbur-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tadabbur-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-gold);
}

.copy-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid var(--app-glass-border);
  color: var(--app-gold);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-badge-btn:hover {
  background: var(--app-gold);
  color: #000;
}

/* ==========================================================================
   MODULE 3: PRAYER TIMES & QIBLA
   ========================================================================== */
.prayer-hero-card {
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.6), rgba(1, 26, 20, 0.8));
  border: 1px solid var(--app-card-border);
}

.next-prayer-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 215, 0, 0.15);
  color: var(--app-gold);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.countdown-clock {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.hijri-date-text {
  color: var(--app-text-muted);
  font-size: 1rem;
}

.prayers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.prayer-card {
  padding: 20px;
  text-align: center;
  border-radius: var(--radius-sm);
}

.prayer-card.current {
  border-color: var(--app-gold);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.prayer-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.prayer-time {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--app-gold);
}

/* Qibla Compass */
.qibla-card {
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compass-dial {
  width: 220px;
  height: 220px;
  border: 3px solid var(--app-gold);
  border-radius: 50%;
  position: relative;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
}

.compass-needle {
  width: 4px;
  height: 90px;
  background: linear-gradient(to top, #EF4444 50%, var(--app-gold) 50%);
  position: absolute;
  top: 20px;
  transform-origin: 50% 90px;
  transition: transform 0.5s ease-out;
}

/* ==========================================================================
   MODULE 4: SPIRITUAL OASIS & ATHKAR
   ========================================================================== */
.athkar-cats-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.athkar-cat-btn {
  white-space: nowrap;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  color: var(--app-text);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
}

.athkar-cat-btn.active {
  background: var(--app-gold);
  color: #000;
  border-color: var(--app-gold);
}

.athkar-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thikr-card {
  padding: 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.thikr-text {
  font-size: 1.25rem;
  line-height: 2;
  margin-bottom: 14px;
  font-family: var(--font-quran);
}

.thikr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thikr-reward {
  font-size: 0.85rem;
  color: var(--app-text-muted);
}

.thikr-count-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--app-gold);
  color: #000;
  font-weight: 700;
  font-size: 1.1rem;
}

.thikr-card.completed {
  opacity: 0.5;
  border-color: #10B981;
}

.thikr-card.completed .thikr-count-badge {
  background: #10B981;
  color: #fff;
}

/* ==========================================================================
   MODULE 5: DIGITAL TASBIH
   ========================================================================== */
.tasbih-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.tasbih-display {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  margin: 0 auto 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(2, 44, 34, 0.6) 80%);
  border: 4px solid var(--app-gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.25);
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease;
}

.tasbih-display:active {
  transform: scale(0.96);
}

.tasbih-number {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
}

.tasbih-target-label {
  font-size: 0.85rem;
  color: var(--app-gold);
  margin-top: 8px;
}

.tasbih-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

/* ==========================================================================
   MODULE 6: AUDIO PLAYER & RADIOS
   ========================================================================== */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.radio-station-card {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.radio-station-card:hover {
  border-color: var(--app-gold);
}

.radio-station-card.playing {
  border-color: var(--app-gold);
  background: rgba(255, 215, 0, 0.1);
}

/* Persistent Audio Player Bar */
.persistent-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--app-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--app-card-border);
  padding: 10px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
}

.persistent-player-bar.active {
  display: flex;
}

@media (max-width: 900px) {
  .persistent-player-bar.active {
    bottom: 58px; /* Above bottom nav */
  }
}

.player-info-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--app-gold);
}

.player-info-sub {
  font-size: 0.8rem;
  color: var(--app-text-muted);
}

.player-btn-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--app-gold);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MODULE 7: COSMIC SCALE SIMULATION
   ========================================================================== */
.cosmic-interactive-card {
  padding: 32px;
  text-align: center;
}

.cosmic-viewport {
  min-height: 380px;
  border-radius: 24px;
  background: radial-gradient(circle at center, #0B1C2A 0%, #010408 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
}

.cosmic-object-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 40px rgba(0, 210, 255, 0.5);
  position: relative;
}

.cosmic-object-circle img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

.cosmic-slider {
  width: 100%;
  max-width: 650px;
  accent-color: #00D2FF;
  margin: 20px 0;
  height: 8px;
}

/* Visual Comparison Peers (Identical to Flutter VisualComparisonPeer) */
.cosmic-peers-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.cosmic-peer-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.cosmic-peer-circle {
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 15px currentColor;
}

.cosmic-quran-box {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.4), rgba(1, 26, 20, 0.7));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-right: 4px solid var(--app-gold);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 24px auto;
  max-width: 820px;
  text-align: right;
}

.cosmic-human-benchmark {
  background: rgba(255, 215, 0, 0.08);
  border: 1px dashed rgba(255, 215, 0, 0.4);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 16px auto;
  max-width: 820px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #F8FAFC;
}

/* ==========================================================================
   FLUTTER AUDIO LIBRARY (Hajen Standard & Reciters Grid)
   ========================================================================== */
.audio-subtabs-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--app-card-border);
  padding-bottom: 12px;
}

.audio-subtab-btn {
  background: transparent;
  border: 1px solid var(--app-card-border);
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.audio-subtab-btn:hover {
  color: var(--app-text);
  border-color: var(--emerald-500);
}

.audio-subtab-btn.active {
  background: rgba(0, 210, 255, 0.15);
  color: #00D2FF;
  border-color: #00D2FF;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
}

.reciters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.reciter-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.reciter-card:hover {
  transform: translateY(-6px);
  border-color: #00D2FF;
  box-shadow: 0 12px 30px rgba(0, 210, 255, 0.2);
}

.reciter-img-wrap {
  width: 100%;
  height: 180px;
  position: relative;
  background: #000000;
  overflow: hidden;
}

.reciter-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.reciter-card:hover .reciter-img-wrap img {
  transform: scale(1.05);
}

.reciter-meta {
  padding: 14px 12px;
  text-align: center;
  background: rgba(13, 13, 13, 0.7);
}

.reciter-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reciter-rewaya {
  font-size: 0.8rem;
  color: #00D2FF;
  font-weight: 600;
}

/* Reciter Surahs List Drawer / View (Flutter Style) */
.reciter-surahs-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reciter-surahs-modal.open {
  display: flex;
}

.reciter-surahs-panel {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: rgba(2, 44, 34, 0.88);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-top: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.reciter-surahs-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reciter-surahs-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.surah-audio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

.surah-audio-row:hover, .surah-audio-row.playing {
  background: rgba(0, 210, 255, 0.08);
  border-color: #00D2FF;
}

.play-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #00D2FF;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.35);
  transition: transform var(--transition-fast);
}

.play-circle-btn:hover {
  transform: scale(1.1);
}



/* ==========================================================================
   FLUTTER QURAN INDEX MODAL (Replication of QuranIndexSheet.show)
   ========================================================================== */
.quran-index-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  z-index: 2800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quran-index-modal.active {
  display: flex;
}

.quran-index-panel {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  background: rgba(2, 44, 34, 0.88);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-top: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quran-index-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.quran-index-tabs {
  display: flex;
  gap: 8px;
}

.quran-index-tab-btn {
  flex: 1;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quran-index-tab-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--app-gold);
  color: var(--app-gold);
}

.quran-index-body {
  padding: 12px 18px;
  overflow-y: auto;
  flex: 1;
}

.quran-index-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quran-index-row:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: #00D2FF;
  transform: translateX(-3px);
}

.index-row-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.12);
  color: var(--app-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.index-row-title {
  font-family: var(--font-quran);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
}

/* ==========================================================================
   FLOATING AYAH RIBBON BAR (Replication of Flutter _isAyahRibbonOpen)
   ========================================================================== */
.ayah-ribbon-bar {
  position: fixed;
  bottom: 82px;
  left: 20px;
  z-index: 1500;
  display: flex;
  align-items: center;
  background: rgba(12, 18, 23, 0.94);
  border: 1.2px solid rgba(255, 215, 0, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
  overflow: hidden;
}

.ayah-ribbon-bar.collapsed .ayah-ribbon-content {
  display: none;
}

.ayah-ribbon-toggle {
  padding: 10px 14px;
  background: var(--app-gold);
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: background 0.2s;
}

.ayah-ribbon-toggle:hover {
  background: #FFE033;
}

.ayah-ribbon-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.ayah-ribbon-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00D2FF;
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.4);
}

.ayah-ribbon-chips-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 320px;
  padding: 2px 0;
}

.ayah-chip {
  padding: 5px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ayah-chip:hover, .ayah-chip.active {
  background: var(--app-gold);
  color: #000;
  border-color: var(--app-gold);
}

/* ==========================================================================
   PRAYER TIMES SUNNAH GUIDANCE & MUADHIN VOICE SELECTOR
   ========================================================================== */
.prayer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prayer-listen-btn {
  background: transparent;
  border: none;
  color: var(--app-gold);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.prayer-listen-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  transform: scale(1.1);
}

.prayer-sunnah-hint {
  font-size: 0.72rem;
  color: var(--app-text-muted);
  margin-top: 8px;
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.muadhin-selector-panel {
  padding: 20px 24px;
  margin-bottom: 24px;
}

/* ==========================================================================
   COSMIC SCALE 3-TAB CARD & QUICK JUMP BAR
   ========================================================================== */
.cosmic-zoom-badge {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #00D2FF;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.35);
  padding: 4px 14px;
  border-radius: 20px;
}

.cosmic-jump-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.cosmic-jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #E2E8F0;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.cosmic-jump-chip.active {
  background: #FFFFFF;
  color: #000000;
  border-color: #FFFFFF;
  font-weight: 700;
}

.cosmic-card-tabs-bar {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.cosmic-card-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cosmic-card-tab-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00D2FF;
  color: #00D2FF;
  font-weight: 700;
}

.cosmic-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.cosmic-tab-content.active {
  display: block;
}

.benchmark-icon-frame {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 215, 0, 0.15);
  color: var(--app-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   SPIRITUAL & MOTIVATIONAL SPLASH SCREEN
   ========================================================================== */
.app-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, #022C22 0%, #011A14 85%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
}

.app-splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-mascot-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 35px rgba(255, 215, 0, 0.6));
  animation: splashPulse 2.8s ease-in-out infinite alternate;
}

@keyframes splashPulse {
  0% { transform: scale(0.96) translateY(0); filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.4)); }
  100% { transform: scale(1.05) translateY(-8px); filter: drop-shadow(0 0 45px rgba(255, 215, 0, 0.85)); }
}

.splash-app-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--app-gold);
  margin-bottom: 6px;
  text-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.splash-app-badge {
  display: inline-block;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid var(--app-gold);
  color: var(--app-gold);
  padding: 4px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.splash-quote-card {
  max-width: 580px;
  width: 100%;
  background: rgba(6, 44, 34, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 20px;
  padding: 22px 28px;
  backdrop-filter: blur(15px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 28px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  transition: opacity 0.4s ease;
}

.splash-quote-text {
  font-size: 1.15rem;
  color: #FEF3C7;
  line-height: 1.7;
  font-weight: 700;
  margin-bottom: 8px;
}

.splash-quote-source {
  font-size: 0.85rem;
  color: var(--app-emerald);
  font-weight: 600;
}

.splash-progress-track {
  width: 240px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

.splash-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--app-gold), transparent);
  animation: splashSlide 1.8s infinite ease-in-out;
}

@keyframes splashSlide {
  0% { left: -45%; }
  100% { left: 100%; }
}

.splash-skip-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #D1FAE5;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.splash-skip-btn:hover {
  border-color: var(--app-gold);
  color: var(--app-gold);
  background: rgba(255, 215, 0, 0.1);
}

/* ==========================================================================
   INTERACTIVE HOOPOE ONBOARDING GUIDE & DEDICATED 3D COMPANION DOCK
   ========================================================================== */

/* 1. Dedicated Floating Mascot Launcher Dock (Seamless 3D Mascot, NO CIRCLE, DRAGGABLE) */
.floating-hoopoe-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(2, 44, 34, 0.78);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-top: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 9999px;
  padding: 6px 18px 6px 10px;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--app-text);
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.floating-hoopoe-launcher.dragging {
  cursor: grabbing !important;
  transform: scale(1.05) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.4) !important;
  border-color: var(--app-gold) !important;
}

[data-theme="light"] .floating-hoopoe-launcher {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(8, 129, 120, 0.25);
  border-top: 1px solid rgba(8, 129, 120, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.floating-hoopoe-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--app-gold);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 215, 0, 0.3);
}

.launcher-mascot-frame {
  width: 44px;
  height: 44px;
  position: relative;
  overflow: visible !important; /* NO CIRCLE, NO CLIPPING! */
  flex-shrink: 0;
}

.launcher-mascot-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  position: absolute;
  top: -9px;
  right: -7px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s ease;
  pointer-events: none;
}

.floating-hoopoe-launcher:hover .launcher-mascot-img {
  transform: translateY(-4px) rotate(-4deg) scale(1.08);
}

.launcher-text-wrap {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.launcher-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-gold);
  line-height: 1.2;
}

.launcher-sub {
  font-size: 0.7rem;
  color: var(--app-text-muted);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .floating-hoopoe-launcher {
    bottom: 84px; /* Docked comfortably right above the mobile floating capsule bottom nav */
    left: 14px;
    padding: 6px 14px 6px 8px;
  }
}

@media (max-width: 480px) {
  .launcher-sub {
    display: none;
  }
}

/* 2. Interactive Spotlight Overlay */
.hoopoe-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hoopoe-guide-overlay.active {
  display: block;
  opacity: 1;
}

.hoopoe-target-highlight {
  position: relative;
  z-index: 10001 !important;
  box-shadow: 0 0 0 3px var(--app-gold), 0 0 30px rgba(255, 215, 0, 0.85) !important;
  border-radius: 9999px !important;
  animation: targetSpotlightPulse 1.8s infinite alternate !important;
}

@keyframes targetSpotlightPulse {
  0% { box-shadow: 0 0 0 2px var(--app-gold), 0 0 15px rgba(255, 215, 0, 0.5); }
  100% { box-shadow: 0 0 0 4px var(--app-gold), 0 0 35px rgba(255, 215, 0, 0.95); }
}

/* 3. Hoopoe Guide Character Card - Perfectly Centered Floating Island */
.hoopoe-guide-character {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 620px;
  width: calc(100% - 36px);
  pointer-events: auto;
  animation: hoopoeSlideUpCenter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hoopoeSlideUpCenter {
  from { opacity: 0; transform: translate(-50%, 25px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@media (max-width: 768px) {
  .hoopoe-guide-character {
    bottom: 84px; /* Right above the floating bottom nav */
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    max-width: none;
    gap: 8px;
    animation: hoopoeSlideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

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

/* 4. Pure 3D Transparent Mascot (NO CIRCLE, NO CLIPPING, TRULY EMBEDDED) */
.hoopoe-avatar-frame {
  width: 135px;
  height: 135px;
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important; /* NO CIRCLE! */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.55));
  animation: hoopoeFloatNatural 3s ease-in-out infinite;
  z-index: 2;
  margin-bottom: -6px;
}

@media (max-width: 768px) {
  .hoopoe-avatar-frame {
    width: 95px;
    height: 95px;
  }
}

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

.hoopoe-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* 5. Speech Bubble Card (Frosted Emerald Glass) */
.hoopoe-speech-bubble {
  flex: 1;
  background: rgba(2, 44, 34, 0.9);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-top: 1px solid rgba(255, 215, 0, 0.55);
  border-radius: 22px;
  padding: 20px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
}

[data-theme="light"] .hoopoe-speech-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(8, 129, 120, 0.3);
  border-top: 1px solid rgba(8, 129, 120, 0.6);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.hoopoe-speech-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hoopoe-speech-desc {
  color: #ECFDF5;
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

[data-theme="light"] .hoopoe-speech-desc {
  color: #064E3B;
}

.hoopoe-guide-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}



