/* 
  Noor Al-Hidaya Design System
  Theme: Serene, Spiritual, Professional
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&family=Amiri:wght@400;700&family=Figtree:wght@300;400;600&display=swap');

:root {
    /* Colors */
    --primary: #1b4d3e; /* Deep Emerald */
    --primary-variant: #12362b;
    --primary-light: #2a7a62;
    --secondary: #c5a059; /* Royal Gold */
    --secondary-variant: #a68545;
    --accent: #ffd700;
    --background: #f8f9fa;
    --surface: #ffffff;
    --on-primary: #ffffff;
    --on-secondary: #ffffff;
    --on-background: #1a1c1e;
    --on-surface: #1a1c1e;
    --on-surface-variant: #6b6e76;
    --outline: #74777f;
    --error: #ba1a1a;
    --success: #2e7d32;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --gold-gradient: linear-gradient(135deg, #c5a059 0%, #f1d38e 50%, #c5a059 100%);
    --emerald-gradient: linear-gradient(135deg, #1b4d3e 0%, #2a7a62 100%);
    
    /* Derived theme colors */
    --primary-subtle: rgba(27, 77, 62, 0.08);
    --primary-faint: rgba(27, 77, 62, 0.03);
    --primary-overlay: rgba(27, 77, 62, 0.92);
    --secondary-subtle: rgba(197, 160, 89, 0.12);
    --secondary-faint: rgba(197, 160, 89, 0.05);
    --secondary-border: rgba(197, 160, 89, 0.3);
    --surface-hover: rgba(0, 0, 0, 0.03);
    --surface-border: rgba(0, 0, 0, 0.06);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --white-faint: rgba(255, 255, 255, 0.1);
    --white-subtle: rgba(255, 255, 255, 0.05);
    --white-semi: rgba(255, 255, 255, 0.7);
    --text-shadow-dark: rgba(0, 0, 0, 0.25);
    
    /* Semantic */
    --color-correct: #2e7d32;
    --color-correct-bg: rgba(76, 175, 80, 0.12);
    --color-wrong: #c62828;
    --color-wrong-bg: rgba(244, 67, 54, 0.12);
    --color-missing: #ef6c00;
    --color-missing-bg: rgba(255, 152, 0, 0.12);
    --color-extra: #1565c0;
    --color-extra-bg: rgba(33, 150, 243, 0.12);
    
    /* Brand */
    --whatsapp: #25d366;
    --whatsapp-bg: rgba(37, 211, 102, 0.08);
    --whatsapp-border: rgba(37, 211, 102, 0.2);
    --danger: #b91c1c;
    --yt-red: #ff0000;
    
    /* Typography */
    --font-main: 'Tajawal', sans-serif;
    --font-quran: 'Amiri', serif;
    --font-alt: 'Figtree', sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 12px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 64px;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --app-footer-h: 58px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(27, 77, 62, 0.05);
    --shadow-md: 0 4px 16px rgba(27, 77, 62, 0.1);
    --shadow-lg: 0 8px 32px rgba(27, 77, 62, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--on-surface);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl; /* Arabic priority */
}

/* App Container */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--secondary-border);
    border-radius: var(--radius-full);
    background: var(--white-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.logo-icon:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 16px rgba(197, 160, 89, 0.35);
}

.logo-icon:active {
    transform: scale(0.94);
}

.app-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    display: block;
    pointer-events: none;
}

.app-loading-logo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-full);
    margin: 0 auto 12px;
    border: 2px solid var(--primary-subtle);
    box-shadow: var(--shadow-sm);
}

/* Home hero banner */
.home-hero-banner {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    background: linear-gradient(145deg, #0f2840 0%, var(--primary) 42%, var(--primary-light) 100%);
}

.home-hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 18% 50%, var(--secondary-subtle) 0%, transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 45%);
    pointer-events: none;
}

.home-hero-banner::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--gold-gradient);
    opacity: 0.85;
}

.home-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md) calc(var(--spacing-md) + 4px);
}

.home-hero-logo-wrap {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), var(--secondary-border));
    box-shadow:
        0 0 0 2px var(--secondary-border),
        0 8px 24px rgba(0, 0, 0, 0.28);
}

.home-hero-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    display: block;
}

.home-hero-text {
    flex: 1;
    min-width: 0;
    color: #fff;
    text-align: right;
}

.home-hero-text h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.home-hero-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.92;
    color: rgba(255, 255, 255, 0.9);
}

.home-hero-tagline {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode .home-hero-banner {
    background: linear-gradient(145deg, #051018 0%, #0f2840 35%, var(--primary) 100%);
}

body.dark-mode .logo-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(197, 160, 89, 0.5);
}

h1 {
    font-size: 20px;
    font-weight: 700;
}

/* Prayer Times Card */
.prayer-card {
    background: var(--emerald-gradient);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--secondary-border);
    box-shadow: 0 4px 15px var(--primary-subtle);
}

.next-prayer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prayer-name {
    font-size: 14px;
    opacity: 0.9;
}

.prayer-time {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
}

/* Main Content */
main {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-bottom: calc(var(--app-footer-h) + 100px);
}

main.home-main {
    padding-top: var(--spacing-xs);
}

main.home-main .home-hero-banner {
    margin-top: 0;
}

main.home-main .section-title:first-of-type {
    margin-top: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--outline);
    opacity: 0.2;
}

/* Grid View */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.grid-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary-light);
}

.grid-icon {
  width: 65px;
  height: 65px;
  background: var(--emerald-gradient);
  color: var(--accent);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 6px 15px var(--primary-subtle);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--secondary-border);
}

.grid-icon.has-img {
  padding: 0;
  overflow: hidden;
  background: var(--emerald-gradient);
}

.grid-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-item:hover .grid-icon {
  transform: translateY(-5px) rotate(3deg);
  box-shadow: 0 10px 20px var(--primary-subtle);
  background: var(--gold-gradient);
  color: var(--primary);
}

.grid-label {
    font-weight: 700;
    font-size: 15px;
}

.grid-sublabel {
    font-size: 11px;
    color: var(--on-surface-variant);
    margin-top: 4px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: var(--app-footer-h);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--outline);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

/* App Footer (copyright + developer) */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--surface);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 7px 10px 9px;
    text-align: center;
    z-index: 1001;
    line-height: 1.45;
}

.app-footer-copy {
    margin: 0;
    font-size: 10px;
    color: var(--on-surface-variant);
    font-weight: 600;
}

.app-footer-dev {
    margin: 3px 0 0;
    font-size: 10px;
    color: var(--on-surface-variant);
}

.app-footer-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1b8a4a !important;
    font-weight: 800;
    font-size: 11px;
    text-decoration: none;
    margin-right: 3px;
    transition: opacity 0.2s ease;
}

.app-footer-whatsapp i {
    font-size: 13px;
    color: #25d366;
}

.app-footer-whatsapp:active {
    opacity: 0.75;
}

body.dark-mode .app-footer {
    background: #05140f;
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .app-footer-whatsapp {
    color: #4ade80 !important;
}

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

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Dark Mode Overrides */
body.dark-mode {
    --background: #0a1f18;
    --surface: #122c22;
    --on-surface: #f8f9ff;
    --on-surface-variant: #b0beb8;
    --outline: #40594f;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode header {
    background: linear-gradient(135deg, var(--primary-variant) 0%, var(--primary) 100%);
}

body.dark-mode .grid-item {
    background: var(--surface);
    border-color: var(--white-subtle);
}

body.dark-mode .bottom-nav {
    background: var(--primary-variant);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stepper Component */
.stepper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.step-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--secondary);
}

.step-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}

.step-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: var(--on-surface-variant);
}

.step-img {
    width: 100%;
    height: 150px;
    background: var(--surface-container-high, #eee);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    object-fit: cover;
}

/* Quran Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.repeat-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 14px;
}

.repeat-btn {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ── TASBEEH ──────────────────────────────────────── */
.tasbeeh-mini {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.tasbeeh-counter {
    font-size: 56px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.tasbeeh-label { font-size: 14px; color: var(--on-surface-variant); margin: 8px 0; }
.tasbeeh-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--on-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    margin: 8px 0;
    transition: transform 0.2s;
    user-select: none;
}
.tasbeeh-btn:active { transform: scale(0.92); }
.progress-bar-wrap {
    height: 6px;
    background: var(--primary-subtle);
    border-radius: var(--radius-full);
    margin-top: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* ── SEARCH BAR ───────────────────────────────────── */
.search-bar { margin-bottom: 16px; }
.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--outline);
    font-family: var(--font-main);
    font-size: 14px;
    background: var(--surface);
    color: var(--on-surface);
    outline: none;
    transition: border-color .25s;
}
.search-bar input:focus { border-color: var(--primary); }

/* ── REPEAT CONTROLS ──────────────────────────────── */
.repeat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-subtle);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}
.repeat-btn {
    width: 26px; height: 26px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px; font-weight: 700;
    user-select: none;
}

/* ── SURAH LIST ───────────────────────────────────── */
.surah-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.surah-row:hover { transform: translateX(-4px); box-shadow: var(--shadow-md); }
.surah-num {
    width: 32px; height: 32px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.surah-info { flex: 1; }
.surah-name { font-weight: 700; font-size: 15px; }
.surah-meta { font-size: 11px; color: var(--on-surface-variant); }
.surah-arabic { font-family: var(--font-quran); font-size: 20px; color: var(--primary); }

/* ── QURAN SCREEN ─────────────────────────────────── */
.quran-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--on-surface-variant);
    margin-bottom: 16px;
}
.basmala {
    font-family: var(--font-quran);
    font-size: 22px;
    text-align: center;
    color: var(--primary);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--primary-subtle);
    margin-bottom: 16px;
}
.quran-placeholder {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}
.player-btns { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

.surah-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-subtle);
}

.surah-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--emerald-gradient);
    color: var(--on-primary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.surah-nav-btn--next {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-variant) 100%);
    color: var(--primary-variant);
}

.surah-nav-btn:active:not(:disabled) {
    transform: scale(0.96);
}

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

.surah-nav-counter {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

body.dark-mode .surah-nav-row {
    border-color: var(--white-faint);
}
.play-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 14px;
}
.fav-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 14px;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--on-primary);
    background: var(--gold-gradient);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn:hover {
    background: linear-gradient(135deg, #c5a059 0%, #d4af37 100%);
    transform: translateY(-2px) translateX(4px);
    box-shadow: 0 6px 16px rgba(197, 160, 89, 0.4);
}

.back-btn i {
    font-size: 18px;
}

/* ── HIFZ ─────────────────────────────────────────── */
.page-desc { color: var(--on-surface-variant); font-size: 14px; margin-bottom: 16px; }
.hifz-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    border-right: 4px solid var(--secondary);
    cursor: pointer;
    transition: transform .2s;
}
.hifz-card:hover { transform: translateX(-4px); }
.hifz-card-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.hifz-card-desc { font-size: 13px; color: var(--on-surface-variant); }
.hifz-card-meta { font-size: 12px; color: var(--secondary); margin-top: 6px; }
.hifz-card-btn { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 10px; }
.hifz-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-box {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-lbl { font-size: 11px; color: var(--on-surface-variant); margin-top: 4px; }

/* Hifz Progress */
.hifz-surah-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}
.surah-hifz-row {
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s;
}
.surah-hifz-row:active { transform: scale(0.98); }
.surah-hifz-row.completed { border-right: 4px solid var(--success); }
.sh-info { display: flex; align-items: center; gap: 12px; }
.sh-num { color: var(--on-surface-variant); font-size: 12px; font-weight: 700; width: 24px; }
.sh-name { font-weight: 700; color: var(--primary); }

/* Study Card */
.study-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-top: 15px;
}
.study-header {
  text-align: center;
  margin-bottom: 20px;
  color: var(--on-surface-variant);
  font-size: 13px;
}
.study-text {
  font-family: var(--font-quran);
  font-size: 24px;
  line-height: 2.2;
  text-align: justify;
  direction: rtl;
  margin-bottom: 30px;
  padding: 15px;
  background: var(--primary-faint);
  border-radius: var(--radius-md);
}
.study-controls {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.hifz-success-msg {
  border: 2px solid var(--white-faint);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  .study-controls { flex-direction: row; }
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-lbl { font-size: 11px; color: var(--on-surface-variant); }

/* ── RECITER ───────────────────────────────────────── */
.mic-btn {
    width: 80px;
    height: 80px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--on-primary);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 var(--secondary-border);
}

.mic-btn.recording {
    background: var(--error);
    animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

.reciter-mode-toggle {
    background: var(--surface-hover);
    padding: 4px;
    border-radius: var(--radius-md);
}

.mode-btn {
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--on-surface-variant);
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.reciter-result-area {
    margin-top: 24px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--outline);
}

.recognized-text {
    font-size: 20px;
    line-height: 1.8;
    color: var(--primary);
    text-align: center;
    margin: 15px 0;
    font-family: 'Amiri', serif;
}

.accuracy-bar-wrap {
    height: 8px;
    background: var(--surface-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.accuracy-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.ai-engines-info {
    margin-top: 24px;
    padding: 12px;
    background: var(--primary-faint);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--secondary);
}

/* ── Detailed Reciter Report ── */
.reciter-report-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-top: 24px;
    border: 1px solid var(--secondary-subtle);
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.report-stat-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-val { font-size: 20px; font-weight: 700; display: block; }
.stat-lbl { font-size: 11px; opacity: 0.8; }

.report-stat-item.correct { background: rgba(76, 175, 80, 0.1); color: #2e7d32; }
.report-stat-item.wrong { background: rgba(244, 67, 54, 0.1); color: #c62828; }
.report-stat-item.missing { background: rgba(255, 152, 0, 0.1); color: #ef6c00; }
.report-stat-item.extra { background: rgba(33, 150, 243, 0.1); color: #1565c0; }

.report-details-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.word-comparison-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: 'Amiri', serif;
    font-size: 19px;
    line-height: 2;
    direction: rtl;
}

.comparison-word {
    padding: 2px 8px;
    border-radius: 6px;
    cursor: default;
    position: relative;
    transition: all 0.2s;
}

.comparison-word.correct { background: rgba(76, 175, 80, 0.15); color: #2e7d32; border-bottom: 2px solid #4caf50; }
.comparison-word.wrong { background: rgba(244, 67, 54, 0.15); color: #c62828; border-bottom: 2px solid #f44336; }
.comparison-word.missing { background: rgba(255, 152, 0, 0.15); color: #ef6c00; border-bottom: 2px solid #ff9800; border-style: dashed; }

.word-correction {
    display: block;
    font-size: 11px;
    font-family: var(--font-main);
    opacity: 0.9;
    margin-top: 2px;
    line-height: 1.2;
    font-weight: 500;
}

.comparison-word.extra { background: rgba(33, 150, 243, 0.15); color: #1565c0; border-bottom: 2px solid #2196f3; }

.word-tooltip {
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    background: var(--on-surface);
    color: var(--surface);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-main);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.comparison-word:hover .word-tooltip { opacity: 1; }

.final-percentage-badge {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.percentage-circle {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}



/* ── FIQH TABS ────────────────────────────────────── */
.fiqh-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.fiqh-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    transition: all .25s;
}
.fiqh-tab.active { background: var(--primary); color: var(--on-primary); }
.step-dua {
    font-family: var(--font-quran);
    font-size: 18px;
    color: var(--primary);
    margin-top: 10px;
    padding: 10px;
    background: var(--primary-faint);
    border-radius: var(--radius-sm);
    line-height: 2;
    text-align: center;
}

/* ── AZKAR ────────────────────────────────────────── */
.azkar-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.azkar-cat-btn {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-main);
    transition: all .25s;
    color: var(--on-surface);
}
.azkar-cat-btn.active { color: var(--on-primary); }
.azkar-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}
.azkar-source { font-size: 11px; color: var(--secondary); margin-bottom: 10px; font-weight: 600; }
.azkar-text {
    font-family: var(--font-quran);
    font-size: 20px;
    line-height: 2.2;
    color: var(--on-surface);
    margin-bottom: 14px;
    text-align: center;
}
.azkar-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--on-surface-variant);
    margin-bottom: 14px;
}
.azkar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.azkar-nav button {
    padding: 8px 20px;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
}
.azkar-nav button:disabled { opacity: 0.35; cursor: default; }
.azkar-nav span { font-size: 13px; color: var(--on-surface-variant); }

/* ── DUAS ───────────────────────────────────────────── */
.duas-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.duas-tab {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    white-space: nowrap;
}
.duas-tab.active {
    background: var(--emerald-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.duas-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.duas-cat-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    border-top: 4px solid var(--cat-color, var(--secondary));
}
.duas-cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.duas-cat-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border-radius: var(--radius-full);
}
.duas-cat-title { font-size: 14px; font-weight: 700; color: var(--on-surface); line-height: 1.5; margin-bottom: 4px; }
.duas-cat-count { font-size: 12px; color: var(--on-surface-variant); }
.duas-cat-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px;
    border-radius: var(--radius-md);
    color: #fff;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.duas-cat-banner-icon { font-size: 42px; }
.duas-cat-banner-title { font-size: 20px; font-weight: 700; font-family: var(--font-quran); }
.duas-cat-banner-count { font-size: 13px; opacity: .92; margin-top: 2px; }
.duas-list { display: flex; flex-direction: column; gap: 10px; }
.duas-list-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.duas-list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.duas-list-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 12px;
}
.duas-list-body { flex: 1; min-width: 0; }
.duas-list-text {
    font-family: var(--font-quran);
    font-size: 15px;
    color: var(--on-surface);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.duas-list-meta { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; }
.duas-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--on-surface-variant);
    font-size: 14px;
    width: 100%;
}
.dua-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-top: 5px solid var(--cat-color, var(--secondary));
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    box-shadow: var(--shadow-md);
}
.dua-badge {
    width: 56px;
    height: 56px;
    margin: -44px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--surface);
    border: 2px solid var(--cat-color, var(--secondary));
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}
.dua-text {
    font-family: var(--font-quran);
    font-size: 22px;
    line-height: 2.2;
    color: var(--on-surface);
    text-align: center;
    margin: 14px 0;
}
.dua-source, .dua-count, .dua-desc {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    line-height: 1.8;
}
.dua-source { background: var(--secondary-subtle); color: var(--on-surface); border: 1px solid var(--secondary-border); }
.dua-count { background: var(--primary-faint); color: var(--primary); text-align: center; font-weight: 600; }
.dua-desc { background: var(--surface-hover); color: var(--on-surface-variant); border: 1px solid var(--surface-border); }
.dua-font-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0;
    padding: 10px 14px;
    border: 1px dashed var(--outline);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--on-surface-variant);
}
.dua-font-btns { display: flex; gap: 8px; }
.dua-font-btns button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all .2s;
}
.dua-font-btns button:hover { background: var(--primary-subtle); color: var(--primary); }
.dua-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 8px;
}
.dua-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.dua-action-btn i { font-size: 14px; }
.dua-action-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.dua-action-btn.fav-on { background: var(--secondary-subtle); border-color: var(--secondary); color: var(--secondary); }
.dua-action-btn.saved-on { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.dua-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-border);
}
.dua-nav button {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dua-nav button:disabled { opacity: 0.35; cursor: default; }
.dua-nav span { font-size: 13px; color: var(--on-surface-variant); }
body.dark-mode .duas-cat-card, body.dark-mode .duas-list-card, body.dark-mode .dua-card {
    border-color: var(--white-subtle);
}
body.dark-mode .duas-tab { border-color: var(--white-subtle); }
body.dark-mode .dua-desc { background: rgba(255,255,255,0.05); }

/* ── HAJJ & UMRAH ────────────────────────────────────────────── */
.hajj-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.hajj-tab {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    white-space: nowrap;
}
.hajj-tab.active {
    background: var(--emerald-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.hajj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hajj-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    border-top: 4px solid var(--hajj-color, var(--secondary));
}
.hajj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.hajj-card-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border-radius: var(--radius-full);
}
.hajj-card-title { font-size: 14px; font-weight: 700; color: var(--on-surface); line-height: 1.5; margin-bottom: 4px; }
.hajj-card-desc { font-size: 11px; color: var(--on-surface-variant); line-height: 1.5; }
.hajj-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px;
    border-radius: var(--radius-md);
    color: #fff;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.hajj-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--on-surface-variant);
    font-size: 14px;
    width: 100%;
}
.hajj-fav-list { display: flex; flex-direction: column; gap: 10px; }
.hajj-fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.hajj-fav-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hajj-fav-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 12px;
}
.hajj-fav-body { flex: 1; min-width: 0; }
.hajj-fav-title { font-size: 14px; font-weight: 700; color: var(--on-surface); line-height: 1.5; }
.hajj-fav-sub { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; }
.hajj-steps { display: flex; flex-direction: column; gap: 10px; }
.hajj-step-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-right: 4px solid var(--hajj-color, var(--secondary));
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.hajj-step-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hajj-step-num {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    border-radius: var(--radius-full);
}
.hajj-step-body { flex: 1; min-width: 0; }
.hajj-step-title { font-size: 14px; font-weight: 700; color: var(--on-surface); }
.hajj-step-short { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; line-height: 1.5; }
.hajj-step-detail { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); padding: 18px 16px; box-shadow: var(--shadow-md); }
.hajj-step-detail-head {
    margin: -18px -16px 16px;
    padding: 20px 18px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: #fff;
    text-align: center;
}
.hajj-step-detail-num { font-size: 12px; opacity: .9; margin-bottom: 4px; }
.hajj-step-detail-title { font-size: 22px; font-weight: 700; font-family: var(--font-quran); }
.hajj-sec { margin-bottom: 12px; }
.hajj-sec-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-faint);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}
.hajj-sec-body {
    font-size: 14px;
    line-height: 1.9;
    color: var(--on-surface);
    background: var(--surface-hover);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-quran);
}
.hajj-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-border);
}
.hajj-step-nav button {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hajj-step-nav button:disabled { opacity: 0.35; cursor: default; }
.hajj-step-nav span { font-size: 13px; color: var(--on-surface-variant); }
.hajj-list { display: flex; flex-direction: column; gap: 10px; }
.hajj-item-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.hajj-item-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--on-surface); line-height: 1.5; }
.hajj-item-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    border-radius: var(--radius-full);
}
.hajj-item-desc { font-size: 13px; line-height: 1.9; color: var(--on-surface-variant); margin-top: 8px; }
.hajj-item-rule {
    font-size: 12px;
    line-height: 1.8;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-faint);
    color: var(--on-surface);
    border: 1px solid var(--secondary-border);
}
.hajj-item-rule.hajj-kaffara { background: var(--secondary-subtle); }
.hajj-item-desc.hajj-correct { color: var(--on-surface); }
.hajj-map-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.hajj-map-icon { font-size: 32px; min-width: 40px; }
.hajj-faqs { display: flex; flex-direction: column; gap: 10px; }
.hajj-faq {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.hajj-faq summary {
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--on-surface);
    cursor: pointer;
    line-height: 1.7;
    list-style: none;
    position: relative;
    padding-left: 34px;
}
.hajj-faq summary::-webkit-details-marker { display: none; }
.hajj-faq summary::after {
    content: '+';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--secondary);
    transition: transform .2s;
}
.hajj-faq[open] summary::after { content: '−'; }
.hajj-faq-a {
    padding: 0 14px 14px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--on-surface-variant);
    border-top: 1px dashed var(--surface-border);
    margin: 0 12px;
    padding-top: 12px;
}
.hajj-duas-list { display: flex; flex-direction: column; gap: 12px; }
.hajj-dua-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-top: 4px solid var(--hajj-color, var(--secondary));
    border-radius: var(--radius-md);
    padding: 16px 14px;
    box-shadow: var(--shadow-sm);
}
.hajj-dua-title { font-size: 14px; font-weight: 700; color: var(--secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hajj-dua-count { font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-faint); padding: 3px 10px; border-radius: var(--radius-full); }
.hajj-dua-text {
    font-family: var(--font-quran);
    font-size: 16px;
    line-height: 2;
    color: var(--on-surface);
    text-align: center;
}
.hajj-dua-source { font-size: 12px; color: var(--on-surface-variant); margin-top: 10px; text-align: center; }
.hajj-dua-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 14px;
}
.hajj-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.hajj-action-btn i { font-size: 14px; }
.hajj-action-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.hajj-action-btn.hajj-fav-on { background: var(--secondary-subtle); border-color: var(--secondary); color: var(--secondary); }
.hajj-action-btn.hajj-speak-btn.listening { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.hajj-checklist-progress {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--on-surface);
}
.hajj-checklist-progress .progress-bar-wrap { margin-top: 10px; }
.hajj-checklist { display: flex; flex-direction: column; gap: 8px; }
.hajj-checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
}
.hajj-checklist-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hajj-checklist-item.checked { border-color: var(--primary); background: var(--primary-faint); }
.hajj-checklist-icon { font-size: 20px; }
.hajj-checklist-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--on-surface); }
.hajj-checklist-item.checked .hajj-checklist-label { text-decoration: line-through; color: var(--on-surface-variant); }
.hajj-checklist-item i { color: var(--outline); font-size: 20px; }
.hajj-checklist-item.checked i { color: var(--primary); }
.hajj-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: 1px dashed var(--outline);
    background: transparent;
    color: var(--on-surface-variant);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.hajj-reset-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.hajj-notes-input {
    width: 100%;
    min-height: 220px;
    padding: 14px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.9;
    resize: vertical;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}
.hajj-notes-input:focus { outline: none; border-color: var(--secondary); }
.hajj-notes-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border: none;
    background: var(--emerald-gradient);
    color: #fff;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
}
.hajj-notes-save:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hajj-notes-heading { margin: 4px 0 12px; font-size: 17px; font-weight: 800; color: var(--on-surface); }
.hajj-notes-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border: 2px dashed var(--secondary);
    background: transparent;
    color: var(--secondary);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}
.hajj-notes-add-btn:hover { background: var(--primary-subtle); transform: translateY(-2px); }
.hajj-note-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all .2s;
}
.hajj-note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--secondary); }
.hajj-note-body { flex: 1; min-width: 0; }
.hajj-note-title { font-size: 15px; font-weight: 700; color: var(--on-surface); margin-bottom: 3px; }
.hajj-note-text { font-size: 13px; color: var(--on-surface-variant); line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hajj-note-muted { opacity: .6; }
.hajj-note-date { font-size: 11px; color: var(--secondary); margin-top: 4px; }
.hajj-note-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hajj-note-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--surface-border);
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all .2s;
}
.hajj-note-btn:hover { transform: scale(1.1); }
.hajj-note-delete { background: rgba(239, 68, 68, .12); color: #ef4444; }
.hajj-note-delete:hover { background: rgba(239, 68, 68, .25); }
.hajj-note-form { margin-top: 14px; }
.hajj-note-title-input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}
.hajj-note-title-input:focus { outline: none; border-color: var(--secondary); }
.hajj-note-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hajj-note-badges { display: flex; gap: 6px; }
.hajj-note-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--secondary); background: var(--primary-subtle); padding: 2px 7px; border-radius: 999px; }
.hajj-note-font-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hajj-note-font-label { font-size: 12px; font-weight: 600; color: var(--on-surface-variant); }
.hajj-note-size-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--surface-border); background: var(--surface); color: var(--on-surface); border-radius: var(--radius-sm); cursor: pointer; transition: all .2s; }
.hajj-note-size-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.hajj-note-size-val { min-width: 30px; text-align: center; font-size: 14px; font-weight: 700; color: var(--on-surface); }
.hajj-note-select {
    flex: 1;
    min-width: 110px;
    padding: 8px 10px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.hajj-note-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hajj-note-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.hajj-note-tool-btn:hover { border-color: var(--secondary); color: var(--secondary); transform: translateY(-1px); }
.hajj-note-rec-btn.recording { background: rgba(239, 68, 68, .15); border-color: #ef4444; color: #ef4444; animation: hajjPulse 1.2s infinite; }
@keyframes hajjPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.hajj-note-rec-timer { display: block; font-size: 12px; color: #ef4444; font-weight: 700; margin-bottom: 8px; }
.hajj-emoji-panel {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.hajj-emoji-btn {
    font-size: 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: transform .15s;
}
.hajj-emoji-btn:hover { transform: scale(1.25); background: var(--primary-subtle); }
.hajj-note-media-label { font-size: 13px; font-weight: 700; color: var(--secondary); margin: 12px 0 8px; }
.hajj-note-images-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.hajj-note-image-box { position: relative; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.hajj-note-image { width: 100%; height: 90px; object-fit: cover; display: block; }
.hajj-note-image-remove {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
}
.hajj-note-image-remove:hover { background: #ef4444; }
.hajj-note-audio-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-sm); }
.hajj-note-audio { flex: 1; min-width: 0; height: 40px; }
.hajj-note-audio-dur { font-size: 12px; font-weight: 700; color: var(--on-surface-variant); white-space: nowrap; }
body.dark-mode .hajj-card, body.dark-mode .hajj-step-card, body.dark-mode .hajj-step-detail,
body.dark-mode .hajj-item-card, body.dark-mode .hajj-map-card, body.dark-mode .hajj-faq,
body.dark-mode .hajj-dua-card, body.dark-mode .hajj-checklist-item, body.dark-mode .hajj-fav-card,
body.dark-mode .hajj-note-card {
    border-color: var(--white-subtle);
}
body.dark-mode .hajj-tab { border-color: var(--white-subtle); }
body.dark-mode .hajj-sec-body { background: rgba(255,255,255,0.05); }

/* ── ON THIS DAY (حدث في مثل هذا اليوم) ─────────────────────── */
.otd-banner {
    background: var(--emerald-gradient);
    height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    padding: 12px;
}
.otd-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.otd-tab {
    flex: 1;
    padding: 9px 8px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    white-space: nowrap;
}
.otd-tab.active {
    background: var(--emerald-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.otd-today-card {
    background: var(--emerald-gradient);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.otd-list { display: flex; flex-direction: column; gap: 12px; }
.otd-card {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-right: 4px solid var(--otd-color, var(--secondary));
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.otd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.otd-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: var(--radius-full);
}
.otd-card-body { flex: 1; min-width: 0; }
.otd-card-date { font-size: 11px; font-weight: 600; color: var(--otd-color, var(--secondary)); margin-bottom: 4px; }
.otd-card-title { font-size: 15px; font-weight: 700; color: var(--on-surface); line-height: 1.5; margin-bottom: 4px; font-family: 'Amiri', serif; }
.otd-card-short { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.otd-read-more { font-size: 11px; font-weight: 700; color: var(--otd-color, var(--secondary)); margin-top: 6px; }
.otd-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--on-surface-variant);
    font-size: 14px;
    width: 100%;
}
.otd-month-section { margin-bottom: 20px; }
.otd-month-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-subtle);
    font-family: 'Amiri', serif;
}
.otd-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.otd-chip {
    padding: 7px 14px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.otd-chip.active { background: var(--emerald-gradient); border-color: transparent; color: #fff; box-shadow: var(--shadow-sm); }
.otd-cal-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.otd-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.otd-cal-title { font-size: 16px; font-weight: 700; color: var(--on-surface); font-family: 'Amiri', serif; }
.otd-cal-nav {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}
.otd-cal-nav:hover { background: var(--primary-subtle); }
.otd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.otd-cal-day-name { text-align: center; font-size: 11px; font-weight: 700; color: var(--on-surface-variant); padding: 4px 0; }
.otd-cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--surface-hover, rgba(0,0,0,0.03));
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
}
.otd-cal-cell:hover { border-color: var(--primary-subtle); transform: scale(1.05); }
.otd-cal-cell.today { background: var(--emerald-gradient); color: #fff; box-shadow: var(--shadow-sm); }
.otd-cal-cell.has-otd { border-color: var(--secondary); }
.otd-cal-hnum { font-size: 15px; font-weight: 700; }
.otd-cal-cell.today .otd-cal-hnum { color: #fff; }
.otd-cal-gnum { font-size: 10px; color: var(--on-surface-variant); }
.otd-cal-cell.today .otd-cal-gnum { color: rgba(255,255,255,0.85); }
.otd-cal-dot {
    position: absolute;
    bottom: 3px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--secondary);
}
.otd-cal-empty { aspect-ratio: 1; }
.otd-occ-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .2s;
}
.otd-occ-item:hover { border-color: var(--secondary); }
.otd-occ-date {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--secondary);
    border-radius: var(--radius-full);
    padding: 4px 10px;
}
.otd-occ-title { font-size: 13px; font-weight: 600; color: var(--on-surface); }
.otd-back-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    cursor: pointer;
}
.otd-detail-head {
    border-radius: var(--radius-md);
    padding: 26px 20px;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.otd-detail-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 4px 12px;
    margin-top: 8px;
}
.otd-detail-date { font-size: 13px; margin-top: 8px; opacity: .95; }
.otd-detail-title { font-size: 21px; font-weight: 700; margin-top: 6px; font-family: 'Amiri', serif; line-height: 1.5; }
.otd-detail-body { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
.otd-detail-text { font-size: 15px; color: var(--on-surface); line-height: 1.9; }
.otd-sources { margin-top: 16px; }
.otd-sources-label { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.otd-sources-list { display: flex; flex-wrap: wrap; gap: 8px; }
.otd-source-chip {
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    padding: 5px 12px;
}
.otd-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.otd-action-btn {
    flex: 1;
    min-width: 100px;
    padding: 11px 8px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.otd-action-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.otd-action-btn.otd-fav-on { border-color: var(--error); color: var(--error); }
body.dark-mode .otd-card, body.dark-mode .otd-cal-card,
body.dark-mode .otd-occ-item, body.dark-mode .otd-detail-body {
    border-color: var(--white-subtle);
}
body.dark-mode .otd-tab { border-color: var(--white-subtle); }
body.dark-mode .otd-chip { border-color: var(--white-subtle); }
body.dark-mode .otd-cal-cell { background: rgba(255,255,255,0.05); }
body.dark-mode .otd-cal-nav { border-color: var(--white-subtle); background: var(--surface); }

/* ── NEAREST MOSQUE (أقرب مسجد) ─────────────────────────────── */
.mosque-banner {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 55%, #1a3a5c 100%);
    height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    padding: 12px;
}
.mosque-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.mosque-tab {
    flex: 1;
    padding: 9px 8px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    white-space: nowrap;
}
.mosque-tab.active {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.mosque-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}
.mosque-toolbar-label { font-size: 13px; font-weight: 700; color: var(--on-surface); }
.mosque-refresh-btn {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--primary);
    border-radius: var(--radius-full);
    padding: 7px 14px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.mosque-refresh-btn:hover { background: var(--primary-subtle); }
.mosque-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mosque-chip {
    padding: 7px 14px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--on-surface-variant);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.mosque-chip.active {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.mosque-map {
    height: 300px;
    border-radius: var(--radius-md);
    margin-top: 14px;
    border: 1px solid var(--surface-border);
    overflow: hidden;
    z-index: 1;
}
.mosque-map .leaflet-container { font-family: var(--font-main); direction: ltr; }
.mosque-map .leaflet-control-attribution { font-size: 10px; }
.mosque-user-dot {
    width: 16px;
    height: 16px;
    background: #1a3a5c;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(42, 95, 143, 0.35);
}
.mosque-loading {
    text-align: center;
    padding: 26px 16px;
    color: var(--on-surface-variant);
    font-size: 14px;
    font-weight: 600;
}
.mosque-perm-card, .mosque-error-card {
    text-align: center;
    padding: 26px 18px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 14px;
}
.mosque-offline-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-top: 14px;
    color: var(--on-surface);
    font-size: 12px;
}
.mosque-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.mosque-btn.primary {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.mosque-btn.ghost {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--surface-border);
}
.mosque-btn.gold {
    background: linear-gradient(135deg, #c9a96e 0%, #f1d38e 100%);
    color: #3a2d0b;
    box-shadow: var(--shadow-sm);
}
.mosque-btn.ghost:hover { background: var(--primary-subtle); }
.mosque-list { display: flex; flex-direction: column; gap: 12px; }
.mosque-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-right: 4px solid #1a3a5c;
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.mosque-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mosque-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #1a3a5c;
    background: rgba(26, 58, 92, 0.1);
    border-radius: var(--radius-full);
}
.mosque-card-body { flex: 1; min-width: 0; }
.mosque-card-name { font-size: 15px; font-weight: 700; color: var(--on-surface); line-height: 1.5; margin-bottom: 4px; font-family: 'Amiri', serif; }
.mosque-card-addr { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; margin-bottom: 4px; }
.mosque-card-dist { font-size: 12px; font-weight: 700; color: #1a3a5c; }
.mosque-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mosque-fab {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: #1a3a5c;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.mosque-fab:hover { background: var(--primary-subtle); border-color: #1a3a5c; }
.mosque-fab.active { background: var(--error); border-color: var(--error); color: #fff; }
.mosque-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--on-surface-variant);
    font-size: 14px;
    width: 100%;
}
.mosque-fav-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--on-surface);
    margin-top: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-subtle);
}
.mosque-detail-head {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 22px 18px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.mosque-detail-title { font-size: 21px; font-weight: 700; margin-top: 8px; font-family: 'Amiri', serif; line-height: 1.5; }
.mosque-detail-dist { font-size: 13px; margin-top: 6px; opacity: .95; font-weight: 600; }
.mosque-detail-body { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
.mosque-info-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14px; color: var(--on-surface); line-height: 1.6; border-bottom: 1px solid var(--surface-border); }
.mosque-info-row i { color: #1a3a5c; margin-top: 3px; width: 16px; text-align: center; }
.mosque-detail-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.mosque-sheet-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn .2s;
}
.mosque-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 18px 24px;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.2);
    animation: slideUp .25s;
}
.mosque-mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: #1a3a5c;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.mosque-mode-btn i { font-size: 20px; }
.mosque-mode-btn:hover { background: var(--primary-subtle); border-color: #1a3a5c; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
body.dark-mode .mosque-card, body.dark-mode .mosque-detail-body,
body.dark-mode .mosque-perm-card, body.dark-mode .mosque-error-card,
body.dark-mode .mosque-sheet {
    border-color: var(--white-subtle);
}
body.dark-mode .mosque-tab, body.dark-mode .mosque-chip { border-color: var(--white-subtle); }
body.dark-mode .mosque-card-icon { background: rgba(42, 95, 143, 0.25); color: #7fb3d9; }
body.dark-mode .mosque-card-dist, body.dark-mode .mosque-info-row i { color: #7fb3d9; }
body.dark-mode .mosque-fab { border-color: var(--white-subtle); color: #7fb3d9; }
body.dark-mode .mosque-offline-banner { background: rgba(245, 158, 11, 0.15); }

/* ── QIBLA ────────────────────────────────────────── */
.qibla-wrap { text-align: center; padding: 20px 0; }
.compass {
    display: inline-block;
    position: relative;
    width: 240px;
    height: 240px;
}
.compass-ring {
    width: 240px;
    height: 240px;
    border: 8px solid var(--secondary);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease-out;
}
.compass-north {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    color: var(--error);
    font-size: 14px;
    z-index: 1;
}
.compass-needle-qibla {
    position: absolute;
    width: 6px;
    height: 100px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    top: 20px;
    left: calc(50% - 3px);
    transform-origin: bottom center;
    z-index: 2;
}
.qibla-pointer-wrap {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.kaaba-icon-small {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    z-index: 3;
}
.qibla-info-cards {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}
.qibla-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 12px;
    flex: 1;
    max-width: 140px;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--secondary);
}
.qibla-card-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.qibla-card-lbl {
    font-size: 11px;
    color: var(--on-surface-variant);
}

/* ── QIBLA PREMIUM CARD ───────────────────────────── */
.qibla-premium-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--on-primary);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.qibla-premium-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.qibla-premium-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 24px var(--primary-subtle);
}

.qibla-premium-card:active {
    transform: scale(0.98);
}

.qpc-content {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.qpc-icon {
    width: 64px;
    height: 64px;
    backdrop-filter: blur(5px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    flex-shrink: 0;
}

.prayer-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin-top: 15px;
  border: 1px solid rgba(27,77,62,0.1);
}

.next-prayer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.compact-prayer {
  flex: 1;
  padding: 4px;
}

.banner-icon-top {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ar-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.qpc-text h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--secondary);
}

.qpc-text p {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.4;
    margin-bottom: 8px;
}

.qpc-btn {
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qpc-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.qibla-premium-card:hover .qpc-btn i {
    transform: translateX(-4px);
}

.qibla-status {
    margin-top: 20px;
    font-size: 14px;
    color: var(--on-surface-variant);
    max-width: 300px;
    margin-inline: auto;
}

/* ── VIDEO LIST ───────────────────────────────────── */
.video-list { display: flex; flex-direction: column; gap: 12px; }
.video-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .2s;
}
.video-card:hover { transform: translateX(-4px); }
.video-thumb {
    font-size: 32px;
    width: 56px;
    height: 56px;
    background: var(--primary-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.video-info { flex: 1; }
.video-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.video-meta { font-size: 11px; color: var(--on-surface-variant); }
.video-play {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
}

/* ── SETTINGS ─────────────────────────────────────── */
.settings-list { display: flex; flex-direction: column; gap: 10px; }
.setting-row {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.setting-label { font-size: 15px; }
.settings-footer { text-align: center; margin-top: 30px; color: var(--on-surface-variant); font-size: 12px; }
.app-version { font-weight: 600; margin-bottom: 4px; }
.dar-al-ifta-link { text-align: center; margin: 20px 16px 10px; padding: 12px; background: var(--surface-container-high); border-radius: var(--radius-lg); font-size: 13px; }
.dar-al-ifta-link a { color: var(--secondary); text-decoration: none; font-weight: 600; }
.dar-al-ifta-link a:hover { text-decoration: underline; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0;
    background: var(--outline);
    border-radius: 24px;
    transition: .3s;
    cursor: pointer;
}
.slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider::before { transform: translateX(20px); }

/* ── MISC ─────────────────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.header-icon-btn:active {
    transform: scale(0.92);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: #fff;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--primary);
    line-height: 1;
}

/* ── NOTIFICATIONS ────────────────────────────────── */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--primary);
}

.ni-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-faint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ni-content {
    flex: 1;
}

.ni-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--on-surface);
    margin-bottom: 4px;
}

.ni-time {
    font-size: 11px;
    color: var(--on-surface-variant);
    opacity: 0.7;
}

body.dark-mode .notification-item {
    border-right-color: var(--secondary);
}

/* ── ADHAN CONTROL ────────────────────────────────── */
.adhan-control {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--primary-overlay);
    backdrop-filter: blur(10px);
    color: var(--on-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: none;
}

.ac-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-content i {
    font-size: 20px;
    color: var(--secondary);
    animation: pulse-ring 2s infinite;
}

.ac-content span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.ac-content button {
    background: var(--surface);
    color: var(--primary);
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-content button:hover {
    background: var(--secondary);
    color: white;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.prayer-location {
    font-size: 12px;
    opacity: .75;
    margin-top: 4px;
}

/* ── Video Cards with YouTube Thumbnails ─────────── */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 4px;
}

.video-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.video-card:active {
    transform: scale(0.97);
}

/* ── CHALLENGES (Gamification) ───────────────────── */
.challenge-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.challenge-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.challenge-card:active {
    transform: scale(0.98);
}

.challenge-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--secondary);
    color: var(--on-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.challenge-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.challenge-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}

.challenge-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.challenge-info p {
    font-size: 12px;
    color: var(--on-surface-variant);
}

.challenge-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.challenge-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.challenge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--tertiary));
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.challenge-stats {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.day-tracker {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    gap: 6px;
}

.day-dot {
    flex: 1;
    aspect-ratio: 1/1;
    border-radius: 8px;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.day-dot.active {
    background: var(--primary);
    color: var(--on-primary);
}

.day-dot.completed {
    background: var(--secondary);
    color: var(--on-primary);
}

.rank-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--secondary-subtle);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    margin-top: 12px;
    width: fit-content;
}

.check-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.check-item {
    background: var(--surface-hover);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.check-item.checked {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 600;
}

.check-item i {
    font-size: 14px;
    color: var(--outline);
}

.check-item.checked i {
    color: var(--primary);
}

body.dark-mode .challenge-card {
    background: var(--surface);
    border-color: var(--white-subtle);
}

body.dark-mode .day-dot {
    background: var(--white-subtle);
}

body.dark-mode .check-item {
    background: var(--white-subtle);
}

.video-thumb-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.video-thumb-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
}

.video-card:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 0, 0, 1);
}

.video-duration-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-main);
}

.video-card .video-info {
    padding: 12px 16px;
}

.video-card .video-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 4px;
    line-height: 1.4;
}

.video-card .video-meta {
    font-size: 13px;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Video Player Overlay ────────────────────────── */
.video-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.video-overlay.active {
    display: flex;
}

.video-modal {
    width: 100%;
    max-width: 800px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.video-header {
    padding: 12px 20px;
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--outline);
}

#videoTitleLabel {
    font-weight: 600;
    font-size: 14px;
    color: var(--on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.video-close-btn {
    background: none;
    border: none;
    color: var(--on-surface-variant);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s;
}

.video-close-btn:hover {
    background: rgba(255,0,0,0.1);
    color: var(--error);
}

.video-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.video-footer {
    padding: 20px;
    background: var(--surface);
}

.video-footer h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
}

.video-footer p {
    margin: 4px 0 15px;
    color: var(--on-surface-variant);
    font-size: 14px;
}

.video-actions {
    display: flex;
    gap: 10px;
}

.yt-btn {
    background: #ff0000;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.yt-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

/* ── QURAN MODE TABS ──────────────────────────────── */
.quran-mode-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  justify-content: center;
}
.quran-mode-tab {
  flex: 1;
  max-width: 200px;
  padding: 10px 16px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--primary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.quran-mode-tab.active {
  background: var(--primary);
  color: var(--on-primary);
}
.quran-mode-tab:not(.active):hover {
  background: var(--primary-subtle);
}

/* ── QURAN TEXT & HIGHLIGHTING ────────────────────── */
.quran-content {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    max-height: 500px;
    overflow-y: auto;
    margin-top: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) transparent;
}

.uthmani-text {
    font-family: var(--font-quran);
    font-size: 26px;
    line-height: 2.2;
    text-align: center;
    color: var(--on-surface);
    direction: rtl;
    padding: 10px;
}

.ayah {
    display: inline;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.ayah.highlight {
    background-color: var(--secondary-subtle);
    color: var(--secondary);
    font-weight: 700;
    box-shadow: 0 0 10px var(--secondary-subtle);
}

.ayah-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23c5a059" stroke-width="2" stroke-dasharray="5,5"/></svg>') no-repeat center;
    background-size: contain;
    font-size: 12px;
    font-family: var(--font-main);
    color: var(--secondary);
    margin: 0 4px;
    vertical-align: middle;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--outline);
    font-size: 14px;
}

/* -- PREMIUM IMAGE ENHANCEMENTS ------------------ */
.grid-icon.has-img {
    background: none;
    padding: 0;
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
}

.grid-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--secondary-subtle);
}

.page-banner {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.page-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--primary-overlay) 0%, var(--primary-subtle) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: var(--on-primary);
}

.banner-overlay h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--secondary);
}

.banner-overlay p {
    font-size: 14px;
    opacity: 0.9;
}

.settings-banner .banner-overlay {
    background: linear-gradient(to top, var(--primary-overlay) 0%, var(--primary-subtle) 100%);
}

.grid-item:hover .grid-card-img {
    border-color: var(--secondary);
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Enhancing grid card titles when using images */
.grid-item:has(.has-img) .grid-label {
    margin-top: 4px;
    color: var(--primary);
}

body.dark-mode .grid-card-img {
    border-color: rgba(197, 160, 89, 0.1);
}

.ayah { cursor: pointer; transition: background-color 0.2s; }
.ayah:hover { background-color: rgba(197, 160, 89, 0.1); }
.ayah.highlight { background-color: rgba(197, 160, 89, 0.2) !important; }
/* ── AYAH CONTEXT MENU ───────────────────────────── */
.ayah-menu-container {
    position: absolute;
    z-index: 2000;
    width: 280px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.ayah-toolbar {
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--on-surface-variant);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.tool-btn:hover {
    background: #f5f5f5;
    color: var(--primary);
}

.ayah-list-menu {
    padding: 8px 0;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 15px;
    font-weight: 500;
}

.menu-item:hover {
    background: #f9f9f9;
}

.menu-item span {
    color: var(--on-surface);
}

.menu-item i {
    font-size: 18px;
}

/* ── AYAH DETAIL MODAL ───────────────────────────── */
.ayah-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ayah-modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 450px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: #fff;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    flex: 1;
    text-align: center;
    color: var(--primary);
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    color: var(--outline);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    font-family: var(--font-main);
    line-height: 1.8;
}

.tafsir-content {
    font-size: 17px;
    color: var(--on-surface-variant);
    text-align: justify;
}

.word-meanings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fbf9;
    border-radius: var(--radius-sm);
    border-right: 3px solid var(--primary);
}

.word-arabic {
    font-family: var(--font-quran);
    font-size: 22px;
    color: var(--primary);
}

.word-trans {
    font-size: 14px;
    color: var(--on-surface-variant);
    max-width: 60%;
    text-align: left;
}

/* Dark mode adjustments for menu */
body.dark-mode .ayah-menu-container,
body.dark-mode .ayah-modal-content,
body.dark-mode .ayah-toolbar,
body.dark-mode .modal-header {
    background: var(--surface);
    border-color: var(--surface-border);
}

body.dark-mode .menu-item:hover {
    background: var(--surface-hover);
}

body.dark-mode .word-item {
    background: var(--surface-hover);
    border-right-color: var(--secondary);
}

body.dark-mode .tool-btn:hover {
    background: var(--surface-hover);
}

/* Fix text display in Uthmani */
.uthmani-text {
    font-family: 'Amiri', serif;
    font-size: 28px;
    line-height: 2.4;
    text-align: center;
    direction: rtl;
    padding: 10px;
}

.ayah {
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 4px;
    padding: 4px;
    position: relative;
    display: inline;
}

.ayah:hover {
    background: rgba(197, 160, 89, 0.1);
}

.ayah-num {
    font-size: 18px;
    font-family: var(--font-main);
    color: var(--secondary);
    display: inline-block;
    margin: 0 4px;
}

/* HADITH SECTION */
.hadith-search-box { display: flex; gap: 10px; margin-bottom: 20px; }
.hadith-search-box input { flex: 1; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--outline); background: var(--surface); color: var(--on-surface); font-family: var(--font-main); }
.hadith-search-box button { width: 50px; background: var(--primary); color: var(--on-primary); border: none; border-radius: var(--radius-md); cursor: pointer; transition: all .3s ease; }
.hadith-search-box button:hover { background: var(--secondary); transform: translateY(-2px); }

.hadith-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--outline-variant); }
.tab-btn { padding: 10px 15px; background: none; border: none; border-bottom: 3px solid transparent; color: var(--on-surface-variant); cursor: pointer; font-family: var(--font-main); font-weight: 600; transition: all .3s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.hadith-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 15px; border-right: 4px solid var(--secondary); box-shadow: var(--shadow-sm); }
.hadith-title { font-weight: 700; color: var(--primary); margin-bottom: 12px; font-size: 16px; }
.hadith-text { line-height: 1.8; font-size: 15px; margin-bottom: 15px; color: var(--on-surface); text-align: justify; }
.hadith-meta { font-size: 12px; color: var(--outline); font-style: italic; margin-bottom: 15px; }
.hadith-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--outline-variant); padding-top: 10px; }
.hadith-actions button { background: none; border: none; color: var(--secondary); cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* SIGN LANGUAGE SECTION */
@keyframes sign-hands-wave {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-4deg); }
  50% { transform: scale(1) rotate(0deg); }
  75% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.sign-hands-animated {
  display: inline-block;
  animation: sign-hands-wave 2s ease-in-out infinite;
  color: var(--secondary);
}

.grid-icon .sign-hands-animated {
  font-size: 32px;
  animation: sign-hands-wave 1.8s ease-in-out infinite;
}

.sign-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #2e7d32 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--on-primary);
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.sign-banner::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.sign-banner-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

.sign-banner h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
}

.sign-banner p {
  font-size: 13px;
  opacity: 0.9;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

.sign-links-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 20px;
}

.sign-link-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sign-link-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
  background: var(--secondary-faint);
}

.sign-link-card i {
  font-size: 24px;
  color: var(--primary);
}

.sign-link-card span {
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
}

body.dark-mode .sign-link-card {
  background: var(--surface);
  border-color: var(--white-faint);
}



/* ── PRAYER TIMES SCREEN ─────────────────────────── */
.prayer-box {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--primary-subtle);
}

.prayer-box-header {
    background: var(--emerald-gradient);
    color: var(--on-primary);
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--secondary-subtle);
}

.pb-next-title {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.pb-next-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}

.pb-next-time {
    font-size: 16px;
    opacity: 0.95;
}

.prayer-times-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prayer-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.prayer-time-row.next-active {
    background: var(--secondary-subtle);
    border-right: 4px solid var(--secondary);
}

.prayer-time-row.next-active .pt-name {
    color: var(--primary);
    font-weight: 700;
}

.prayer-time-row.next-active .pt-time {
    color: var(--secondary-variant);
    font-weight: 700;
}

.pt-name {
    font-weight: 500;
    font-size: 15px;
    color: var(--on-surface);
}

.pt-time {
    font-size: 15px;
    color: var(--outline);
}

/* --- Tribute Splash Screen Overlay --- */
.tribute-splash {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 100vh;
    height: 100dvh;
    z-index: 10000;
    background: linear-gradient(135deg, #0d2820 0%, #153c30 50%, #0d2820 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: var(--spacing-md);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    box-sizing: border-box;
}

.tribute-splash.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.96) translateY(-10px);
}

.tribute-slide {
    display: none;
    width: 100%;
    max-width: 420px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-sizing: border-box;
}

.tribute-slide.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
}

.tribute-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--secondary-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

/* Image Frame Design */
.tribute-image-frame {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    padding: 6px;
    background: var(--gold-gradient);
    box-shadow: 0 8px 30px var(--secondary-border), 0 0 0 1px rgba(255, 255, 255, 0.2);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: visible;
}

.tribute-image-frame::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px dashed var(--secondary-border);
    animation: rotate-slow 25s linear infinite;
    pointer-events: none;
}

.tribute-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #103429;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

/* Typography & Ornaments */
.tribute-ornament {
    color: var(--secondary);
    font-size: 24px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--secondary-border);
}

.tribute-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.tribute-text {
    color: var(--on-primary);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 16px;
}

.highlight-name {
    font-family: var(--font-quran);
    font-size: 28px;
    color: var(--secondary);
    font-weight: 700;
    display: inline-block;
    margin-top: 4px;
    text-shadow: 0 2px 10px var(--secondary-subtle);
}

.tribute-divider {
    display: flex;
    align-items: center;
    width: 80%;
    margin: 16px 0;
    color: var(--secondary-border);
}

.tribute-divider .divider-line {
    flex: 1;
    height: 1px;
    background: var(--secondary-subtle);
}

.tribute-divider i {
    margin: 0 10px;
    font-size: 12px;
}

.tribute-prayer {
    color: var(--white-semi);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 18px;
}

.quran-quote {
    font-family: var(--font-quran);
    color: var(--secondary-border);
    font-size: 16px;
    line-height: 1.5;
    background: var(--secondary-faint);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--secondary);
    border-right: 2px solid var(--secondary);
    margin-bottom: 24px;
}

/* Slide 2 Specific Styling */
.app-logo-splash {
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
}

.app-logo-splash img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.credit-intro {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

.developer-info-box {
    background: rgba(27, 77, 62, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}

.developer-text {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
}

.whatsapp-link {
    display: inline-block;
    color: #25d366 !important; /* Green name */
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(37, 211, 102, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.whatsapp-link:hover {
    background: rgba(37, 211, 102, 0.18);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
}

.whatsapp-link i {
    margin-right: 6px;
    font-size: 18px;
    vertical-align: middle;
}

.contact-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
}

.consultants-box {
    width: 100%;
    text-align: right;
    padding: 0 8px;
    margin-top: 8px;
}

.consultants-title {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin-bottom: 10px;
    text-align: center;
}

.consultant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-right: 3px solid var(--secondary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.consultant-item i {
    color: var(--secondary);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.consultant-item span {
    font-size: 14px;
    font-weight: 500;
}

/* Actions & Buttons */
.tribute-actions {
    width: 100%;
    margin-top: var(--spacing-sm);
}

.btn-tribute-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--emerald-gradient);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(27, 77, 62, 0.3);
}

.btn-tribute-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 77, 62, 0.45);
}

.btn-tribute-primary:active {
    transform: translateY(1px);
}

.btn-tribute-primary.gold-btn {
    background: var(--gold-gradient);
    color: var(--primary-variant);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.35);
}

.btn-tribute-primary.gold-btn:hover {
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.5);
}

/* Keyframes */
@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: rotate-slow 15s linear infinite;
}

@keyframes pulse-subtle {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(197, 160, 89, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 8px 35px rgba(197, 160, 89, 0.55); }
}

/* --- Qibla Compass UI --- */
.qibla-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--primary-subtle);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

body.dark-mode .qibla-container {
    border-color: var(--white-subtle);
}

.compass-area {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer Ring */
.compass-outer-ring {
    position: absolute;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    border: 2px solid var(--secondary-border);
    box-shadow: 0 0 15px var(--secondary-faint);
    pointer-events: none;
}

/* Compass Dial */
.compass-dial {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-faint) 0%, var(--primary-subtle) 100%);
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-lg), inset 0 0 20px var(--primary-subtle);
    position: relative;
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
    will-change: transform;
}

body.dark-mode .compass-dial {
    background: radial-gradient(circle, var(--white-subtle) 0%, rgba(27, 77, 62, 0.08) 100%);
    border-color: var(--primary-light);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 0 20px var(--primary-subtle);
}

/* Cardinal Directions on Dial */
.compass-direction {
    position: absolute;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}
body.dark-mode .compass-direction {
    color: #fff;
}
.direction-n { top: 8px; left: 50%; transform: translateX(-50%); color: var(--error) !important; font-weight: 900; }
.direction-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.direction-e { right: 12px; top: 50%; transform: translateY(-50%); }
.direction-w { left: 12px; top: 50%; transform: translateY(-50%); }

/* Degree notches */
.compass-ticks {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    pointer-events: none;
}
.tick {
    position: absolute;
    width: 2px;
    height: 6px;
    background: var(--outline);
    opacity: 0.3;
    left: calc(50% - 1px);
    transform-origin: 50% 120px;
}
.tick.major {
    height: 10px;
    background: var(--secondary);
    opacity: 0.7;
}

/* Center Kaaba Icon */
.kaaba-center {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #0f1c18;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 12px var(--secondary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
body.dark-mode .kaaba-center {
    background: #050c09;
}
.kaaba-center i {
    color: var(--secondary);
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Qibla Needle */
.qibla-needle {
    position: absolute;
    width: 20px;
    height: 240px;
    top: 0; left: calc(50% - 10px);
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
    z-index: 5;
    will-change: transform;
}
.needle-pointer {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 30px solid var(--secondary);
    position: absolute;
    top: -12px;
    left: 0;
    filter: drop-shadow(0 4px 6px var(--secondary-border));
}

/* Glowing Target Indicator on Outer Ring */
.qibla-target-glow {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--gold-gradient);
    border-radius: 50%;
    top: 3px;
    left: calc(50% - 14px);
    box-shadow: 0 0 12px var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-variant);
    font-size: 12px;
    font-weight: bold;
    transform-origin: 50% 135px;
    z-index: 6;
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
    will-change: transform;
}
.qibla-target-glow i {
    font-size: 13px;
}

/* Geolocation Info Cards */
.qibla-info-panel {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-top: 8px;
}

.qibla-info-card {
    background: var(--primary-faint);
    border: 1px solid var(--primary-subtle);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s;
}

body.dark-mode .qibla-info-card {
    background: var(--white-subtle);
    border-color: var(--white-subtle);
}

.qibla-info-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}
body.dark-mode .qibla-info-val {
    color: var(--secondary);
}
.qibla-info-lbl {
    font-size: 11px;
    color: var(--outline);
}

/* Heading Alignment Indicator */
.qibla-alignment-indicator {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin-top: 4px;
    transition: all 0.3s;
}
.qibla-aligned {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.25);
    animation: qibla-glow 2s infinite;
}
.qibla-not-aligned {
    background: rgba(197, 160, 89, 0.08);
    color: var(--secondary-variant);
    border: 1px solid var(--secondary-subtle);
}

@keyframes qibla-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.3); }
    50% { box-shadow: 0 0 8px 2px rgba(46, 125, 50, 0.15); }
}

/* Fallback Selector */
.qibla-fallback-box {
    width: 100%;
    margin-top: var(--spacing-sm);
    text-align: center;
    border-top: 1px dashed var(--primary-subtle);
    padding-top: var(--spacing-sm);
}
body.dark-mode .qibla-fallback-box {
    border-color: var(--white-faint);
}
.qibla-fallback-title {
    font-size: 12px;
    color: var(--outline);
    margin-bottom: 8px;
}
.qibla-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--outline);
    font-family: var(--font-main);
    font-size: 13px;
    background: var(--surface);
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s;
}
.qibla-select:focus {
    border-color: var(--primary);
}

/* Status Message and Button styling */
.qibla-status {
    font-size: 12px;
    color: var(--outline);
    text-align: center;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}
.qibla-btn-primary {
    padding: 10px 24px;
    background: var(--emerald-gradient);
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin: 8px auto 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.qibla-btn-primary:active {
    transform: scale(0.96);
}

/* ─── Floating Reminder Bar ──────────────────────────────────────── */
.floating-reminder {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 32px);
    max-width: 468px;
    background: var(--primary-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--secondary-border);
    border-radius: var(--radius-md);
    padding: 14px 44px 14px 18px; /* Extra right padding for close button */
    color: var(--on-primary);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1005;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: right;
    line-height: 1.5;
}

.floating-reminder.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.floating-reminder-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--white-semi);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.floating-reminder-close:hover {
    color: var(--on-primary);
}

body.dark-mode .floating-reminder {
    background: var(--primary-overlay);
    border-color: var(--secondary-border);
}

/* ── Exit confirm dialog (Android back on home) ── */
.exit-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.exit-confirm-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 22px 22px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--surface-border);
}

.exit-confirm-icon {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 12px;
}

.exit-confirm-box h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--on-surface);
    margin-bottom: 8px;
}

.exit-confirm-box p {
    font-size: 14px;
    color: var(--on-surface-variant);
    line-height: 1.6;
    margin: 0;
}

.exit-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-direction: row-reverse;
}

.exit-confirm-actions button {
    flex: 1;
    min-height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.exit-btn-yes {
    background: var(--danger);
    color: var(--on-primary);
}

.exit-btn-no {
    background: var(--primary);
    color: var(--on-primary);
}

body.dark-mode .exit-confirm-box {
    background: var(--surface);
    border-color: var(--white-faint);
}

body.dark-mode .exit-confirm-box h3 {
    color: #f5f5f5;
}

body.dark-mode .exit-confirm-box p {
    color: rgba(255, 255, 255, 0.75);
}

/* ── HIJRI CALENDAR ────────────────────────────────── */
.calendar-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(27, 77, 62, 0.08);
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}
.calendar-month-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--outline);
    background: var(--surface);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.calendar-nav-btn:hover {
    background: var(--primary);
    color: var(--on-primary);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
}
.calendar-day-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--outline);
    padding-bottom: 6px;
}
.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-faint);
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.calendar-cell:hover {
    background: var(--secondary-subtle);
    border-color: var(--secondary);
}
.calendar-cell.today {
    background: var(--primary);
    color: var(--on-primary);
}
.calendar-cell.today .gregorian-num {
    color: rgba(255, 255, 255, 0.7);
}
.calendar-cell.has-occasion {
    background: var(--secondary-subtle);
    border-color: var(--secondary-border);
}
.calendar-cell.has-occasion::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--secondary);
    position: absolute;
    bottom: 4px;
}
.hijri-num {
    font-size: 16px;
    font-weight: 700;
}
.gregorian-num {
    font-size: 9px;
    color: var(--outline);
    margin-top: 2px;
}
.occasions-list {
    margin-top: var(--spacing-md);
}
.occasion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--secondary);
}
.occasion-date {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    font-size: 13px;
}
.occasion-title {
    font-weight: 600;
    font-size: 14px;
}
.calendar-adj-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--primary-faint);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    font-size: 13px;
}
.calendar-adj-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
}
body.dark-mode .calendar-card,
body.dark-mode .occasion-item {
    border-color: var(--white-subtle);
}
body.dark-mode .calendar-adj-row {
    background: var(--white-subtle);
}
body.dark-mode .calendar-adj-select {
    border-color: var(--white-faint);
}
body.dark-mode .calendar-cell {
    background: var(--white-subtle);
}
body.dark-mode .calendar-cell.today {
    background: var(--primary-light);
}
body.dark-mode .calendar-nav-btn {
    border-color: var(--white-faint);
    background: var(--surface);
    color: var(--on-surface);
}
body.dark-mode .calendar-nav-btn:hover {
    background: var(--primary-light);
    color: white;
}

/* ═══════════════════════════════════════════════════════
   LTR MODE (English, French, German)
═══════════════════════════════════════════════════════ */
[dir="ltr"] body { font-family: 'Figtree', 'Tajawal', sans-serif; }
[dir="ltr"] .section-title { text-align: left; }
[dir="ltr"] .back-btn { margin-right: 0; margin-left: auto; }
[dir="ltr"] .bottom-nav { direction: ltr; }
[dir="ltr"] .bottom-nav .nav-item { direction: ltr; }
[dir="ltr"] .home-hero-text { text-align: left; }
[dir="ltr"] .prayer-card { text-align: left; }
[dir="ltr"] .grid-item { text-align: left; }
[dir="ltr"] .settings-list .setting-row { direction: ltr; }
[dir="ltr"] .settings-list .setting-row .setting-label { direction: ltr; text-align: left; }
[dir="ltr"] .settings-list .setting-row .setting-control { direction: ltr; }
[dir="ltr"] .qibla-info-card { direction: ltr; text-align: left; }
[dir="ltr"] .floating-reminder { direction: ltr; text-align: left; }
[dir="ltr"] .exit-confirm-box { direction: ltr; text-align: center; }
[dir="ltr"] .ayah-menu-container { direction: ltr; text-align: left; }
[dir="ltr"] .ayah-toolbar { direction: ltr; text-align: left; }
[dir="ltr"] .ayah-modal-content { direction: ltr; text-align: left; }
[dir="ltr"] .modal-header { direction: ltr; text-align: left; }
[dir="ltr"] .footer { direction: ltr; text-align: center; }
[dir="ltr"] .prayer-box-header { direction: ltr; }
[dir="ltr"] .hifz-study-container { direction: ltr; text-align: left; }
[dir="ltr"] .reciter-controls { direction: ltr; text-align: left; }
[dir="ltr"] .surah-nav-row { direction: ltr; }
[dir="ltr"] .report-card { direction: ltr; text-align: left; }
[dir="ltr"] .settings-banner .banner-overlay { direction: ltr; text-align: left; }
[dir="ltr"] .calendar-card { direction: ltr; text-align: left; }
[dir="ltr"] .sign-banner { direction: ltr; text-align: left; }
[dir="ltr"] .credit-intro { direction: ltr; text-align: center; }
[dir="ltr"] .developer-text { direction: ltr; }
[dir="ltr"] .consultants-title { direction: ltr; text-align: center; }
[dir="ltr"] .tribute-splash { direction: ltr; text-align: center; }
[dir="ltr"] .tribute-text { direction: ltr; text-align: center; }
[dir="ltr"] .tribute-prayer { direction: ltr; text-align: center; }
[dir="ltr"] .quran-quote { direction: ltr; text-align: center; }
[dir="ltr"] .notification-list { direction: ltr; text-align: left; }
[dir="ltr"] .challenge-card { direction: ltr; text-align: left; }

/* ═══════════════════════════════════════════════════════
   THEMES
═══════════════════════════════════════════════════════ */

/* ─── Royal Blue ─── */
body.theme-blue {
    --primary: #1a3a5c;
    --primary-variant: #0f2640;
    --primary-light: #2a5f8f;
    --secondary: #c9a96e;
    --secondary-variant: #a8894f;
    --accent: #4da6ff;
    --emerald-gradient: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
    --gold-gradient: linear-gradient(135deg, #c9a96e 0%, #e8d5a8 50%, #c9a96e 100%);
    --shadow-sm: 0 2px 8px rgba(26, 58, 92, 0.08);
    --shadow-md: 0 4px 16px rgba(26, 58, 92, 0.12);
    --shadow-lg: 0 8px 32px rgba(26, 58, 92, 0.16);
    --primary-subtle: rgba(26, 58, 92, 0.08);
    --primary-faint: rgba(26, 58, 92, 0.03);
    --primary-overlay: rgba(26, 58, 92, 0.92);
    --secondary-subtle: rgba(201, 169, 110, 0.12);
    --secondary-faint: rgba(201, 169, 110, 0.05);
    --secondary-border: rgba(201, 169, 110, 0.3);
}
body.theme-blue.dark-mode {
    --primary: #3a7bd5;
    --primary-variant: #1a3a5c;
    --primary-light: #5a9be6;
    --background: #0a1520;
    --surface: #122840;
    --on-surface: #e8f0ff;
    --on-surface-variant: #a0b8d8;
    --outline: #3a5570;
    --accent: #4da6ff;
    --emerald-gradient: linear-gradient(135deg, #0a1520 0%, #1a3a5c 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --primary-subtle: rgba(58, 123, 213, 0.1);
    --primary-faint: rgba(58, 123, 213, 0.04);
    --primary-overlay: rgba(26, 58, 92, 0.95);
    --secondary-subtle: rgba(201, 169, 110, 0.1);
    --secondary-faint: rgba(201, 169, 110, 0.04);
    --secondary-border: rgba(201, 169, 110, 0.25);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.03);
    --white-faint: rgba(255, 255, 255, 0.08);
    --white-subtle: rgba(255, 255, 255, 0.04);
}
body.theme-blue.dark-mode header { background: linear-gradient(135deg, #050d18 0%, #1a3a5c 100%); }
body.theme-blue.dark-mode .bottom-nav { background: #050d18; }
body.theme-blue.dark-mode .grid-item { background: var(--surface); border-color: var(--primary-subtle); }
body.theme-blue.dark-mode .floating-reminder { background: var(--primary-overlay); border-color: var(--secondary); }
body.theme-blue.dark-mode .exit-confirm-box { background: var(--surface); }
body.theme-blue.dark-mode .ayah-modal-content { background: var(--surface); }
body.theme-blue.dark-mode .ayah-menu-container { background: var(--surface); border-color: var(--surface-border); }
body.theme-blue.dark-mode .word-item { background: var(--surface-hover); }
body.theme-blue.dark-mode .modal-header { background: var(--surface); border-color: var(--surface-border); }
body.theme-blue.dark-mode .tool-btn:hover { background: var(--surface-hover); }
body.theme-blue.dark-mode .menu-item:hover { background: var(--surface-hover); }

/* ─── Royal Purple ─── */
body.theme-purple {
    --primary: #3d1a5c;
    --primary-variant: #2a0f42;
    --primary-light: #6b3fa0;
    --secondary: #d4a8e8;
    --secondary-variant: #b88ac0;
    --accent: #c77dff;
    --emerald-gradient: linear-gradient(135deg, #3d1a5c 0%, #6b3fa0 100%);
    --gold-gradient: linear-gradient(135deg, #d4a8e8 0%, #f0d8ff 50%, #d4a8e8 100%);
    --shadow-sm: 0 2px 8px rgba(61, 26, 92, 0.08);
    --shadow-md: 0 4px 16px rgba(61, 26, 92, 0.12);
    --shadow-lg: 0 8px 32px rgba(61, 26, 92, 0.16);
    --primary-subtle: rgba(61, 26, 92, 0.08);
    --primary-faint: rgba(61, 26, 92, 0.03);
    --primary-overlay: rgba(61, 26, 92, 0.92);
    --secondary-subtle: rgba(212, 168, 232, 0.12);
    --secondary-faint: rgba(212, 168, 232, 0.05);
    --secondary-border: rgba(212, 168, 232, 0.3);
}
body.theme-purple.dark-mode {
    --primary: #9b59d0;
    --primary-variant: #3d1a5c;
    --primary-light: #b07de6;
    --background: #120a1c;
    --surface: #1e1230;
    --on-surface: #f0e8ff;
    --on-surface-variant: #b8a0d0;
    --outline: #4a3560;
    --accent: #c77dff;
    --emerald-gradient: linear-gradient(135deg, #120a1c 0%, #3d1a5c 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --primary-subtle: rgba(155, 89, 208, 0.1);
    --primary-faint: rgba(155, 89, 208, 0.04);
    --primary-overlay: rgba(61, 26, 92, 0.95);
    --secondary-subtle: rgba(212, 168, 232, 0.1);
    --secondary-faint: rgba(212, 168, 232, 0.04);
    --secondary-border: rgba(212, 168, 232, 0.25);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.03);
    --white-faint: rgba(255, 255, 255, 0.08);
    --white-subtle: rgba(255, 255, 255, 0.04);
}
body.theme-purple.dark-mode header { background: linear-gradient(135deg, #0a0514 0%, #3d1a5c 100%); }
body.theme-purple.dark-mode .bottom-nav { background: #0a0514; }
body.theme-purple.dark-mode .grid-item { background: var(--surface); border-color: var(--primary-subtle); }
body.theme-purple.dark-mode .floating-reminder { background: var(--primary-overlay); border-color: var(--secondary); }
body.theme-purple.dark-mode .exit-confirm-box { background: var(--surface); }
body.theme-purple.dark-mode .ayah-modal-content { background: var(--surface); }
body.theme-purple.dark-mode .ayah-menu-container { background: var(--surface); border-color: var(--surface-border); }
body.theme-purple.dark-mode .word-item { background: var(--surface-hover); }
body.theme-purple.dark-mode .modal-header { background: var(--surface); border-color: var(--surface-border); }
body.theme-purple.dark-mode .tool-btn:hover { background: var(--surface-hover); }
body.theme-purple.dark-mode .menu-item:hover { background: var(--surface-hover); }

/* ─── Luxury Red ─── */
body.theme-red {
    --primary: #5c1a1a;
    --primary-variant: #400f0f;
    --primary-light: #8f2a2a;
    --secondary: #c9a06e;
    --secondary-variant: #a8854f;
    --accent: #ff6b6b;
    --emerald-gradient: linear-gradient(135deg, #5c1a1a 0%, #8f2a2a 100%);
    --gold-gradient: linear-gradient(135deg, #c9a06e 0%, #e8d0a0 50%, #c9a06e 100%);
    --shadow-sm: 0 2px 8px rgba(92, 26, 26, 0.08);
    --shadow-md: 0 4px 16px rgba(92, 26, 26, 0.12);
    --shadow-lg: 0 8px 32px rgba(92, 26, 26, 0.16);
    --primary-subtle: rgba(92, 26, 26, 0.08);
    --primary-faint: rgba(92, 26, 26, 0.03);
    --primary-overlay: rgba(92, 26, 26, 0.92);
    --secondary-subtle: rgba(201, 160, 110, 0.12);
    --secondary-faint: rgba(201, 160, 110, 0.05);
    --secondary-border: rgba(201, 160, 110, 0.3);
}
body.theme-red.dark-mode {
    --primary: #d44040;
    --primary-variant: #5c1a1a;
    --primary-light: #e06060;
    --background: #1c0a0a;
    --surface: #2c1212;
    --on-surface: #ffe8e8;
    --on-surface-variant: #d8a0a0;
    --outline: #603535;
    --accent: #ff6b6b;
    --emerald-gradient: linear-gradient(135deg, #1c0a0a 0%, #5c1a1a 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --primary-subtle: rgba(212, 64, 64, 0.1);
    --primary-faint: rgba(212, 64, 64, 0.04);
    --primary-overlay: rgba(92, 26, 26, 0.95);
    --secondary-subtle: rgba(201, 160, 110, 0.1);
    --secondary-faint: rgba(201, 160, 110, 0.04);
    --secondary-border: rgba(201, 160, 110, 0.25);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.03);
    --white-faint: rgba(255, 255, 255, 0.08);
    --white-subtle: rgba(255, 255, 255, 0.04);
}
body.theme-red.dark-mode header { background: linear-gradient(135deg, #140505 0%, #5c1a1a 100%); }
body.theme-red.dark-mode .bottom-nav { background: #140505; }
body.theme-red.dark-mode .grid-item { background: var(--surface); border-color: var(--primary-subtle); }
body.theme-red.dark-mode .floating-reminder { background: var(--primary-overlay); border-color: var(--secondary); }
body.theme-red.dark-mode .exit-confirm-box { background: var(--surface); }
body.theme-red.dark-mode .ayah-modal-content { background: var(--surface); }
body.theme-red.dark-mode .ayah-menu-container { background: var(--surface); border-color: var(--surface-border); }
body.theme-red.dark-mode .word-item { background: var(--surface-hover); }
body.theme-red.dark-mode .modal-header { background: var(--surface); border-color: var(--surface-border); }
body.theme-red.dark-mode .tool-btn:hover { background: var(--surface-hover); }
body.theme-red.dark-mode .menu-item:hover { background: var(--surface-hover); }

/* ─── Earthy Brown ─── */
body.theme-brown {
    --primary: #4a3728;
    --primary-variant: #33261a;
    --primary-light: #6d5440;
    --secondary: #c9a96e;
    --secondary-variant: #a8894f;
    --accent: #d4a050;
    --emerald-gradient: linear-gradient(135deg, #4a3728 0%, #6d5440 100%);
    --gold-gradient: linear-gradient(135deg, #c9a96e 0%, #e8d5a8 50%, #c9a96e 100%);
    --shadow-sm: 0 2px 8px rgba(74, 55, 40, 0.08);
    --shadow-md: 0 4px 16px rgba(74, 55, 40, 0.12);
    --shadow-lg: 0 8px 32px rgba(74, 55, 40, 0.16);
    --primary-subtle: rgba(74, 55, 40, 0.08);
    --primary-faint: rgba(74, 55, 40, 0.03);
    --primary-overlay: rgba(74, 55, 40, 0.92);
    --secondary-subtle: rgba(201, 169, 110, 0.12);
    --secondary-faint: rgba(201, 169, 110, 0.05);
    --secondary-border: rgba(201, 169, 110, 0.3);
}
body.theme-brown.dark-mode {
    --primary: #8d6e50;
    --primary-variant: #4a3728;
    --primary-light: #a08060;
    --background: #14100c;
    --surface: #221a14;
    --on-surface: #f8f0e8;
    --on-surface-variant: #c0a890;
    --outline: #5a4838;
    --accent: #d4a050;
    --emerald-gradient: linear-gradient(135deg, #14100c 0%, #4a3728 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --primary-subtle: rgba(141, 110, 80, 0.1);
    --primary-faint: rgba(141, 110, 80, 0.04);
    --primary-overlay: rgba(74, 55, 40, 0.95);
    --secondary-subtle: rgba(201, 169, 110, 0.1);
    --secondary-faint: rgba(201, 169, 110, 0.04);
    --secondary-border: rgba(201, 169, 110, 0.25);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.03);
    --white-faint: rgba(255, 255, 255, 0.08);
    --white-subtle: rgba(255, 255, 255, 0.04);
}
body.theme-brown.dark-mode header { background: linear-gradient(135deg, #0c0806 0%, #4a3728 100%); }
body.theme-brown.dark-mode .bottom-nav { background: #0c0806; }
body.theme-brown.dark-mode .grid-item { background: var(--surface); border-color: var(--primary-subtle); }
body.theme-brown.dark-mode .floating-reminder { background: var(--primary-overlay); border-color: var(--secondary); }
body.theme-brown.dark-mode .exit-confirm-box { background: var(--surface); }
body.theme-brown.dark-mode .ayah-modal-content { background: var(--surface); }
body.theme-brown.dark-mode .ayah-menu-container { background: var(--surface); border-color: var(--surface-border); }
body.theme-brown.dark-mode .word-item { background: var(--surface-hover); }
body.theme-brown.dark-mode .modal-header { background: var(--surface); border-color: var(--surface-border); }
body.theme-brown.dark-mode .tool-btn:hover { background: var(--surface-hover); }
body.theme-brown.dark-mode .menu-item:hover { background: var(--surface-hover); }

/* ─── Turquoise ─── */
body.theme-teal {
    --primary: #0e5c5c;
    --primary-variant: #084040;
    --primary-light: #148080;
    --secondary: #c9a96e;
    --secondary-variant: #a8894f;
    --accent: #4dd9d9;
    --emerald-gradient: linear-gradient(135deg, #0e5c5c 0%, #148080 100%);
    --gold-gradient: linear-gradient(135deg, #c9a96e 0%, #e8d5a8 50%, #c9a96e 100%);
    --shadow-sm: 0 2px 8px rgba(14, 92, 92, 0.08);
    --shadow-md: 0 4px 16px rgba(14, 92, 92, 0.12);
    --shadow-lg: 0 8px 32px rgba(14, 92, 92, 0.16);
    --primary-subtle: rgba(14, 92, 92, 0.08);
    --primary-faint: rgba(14, 92, 92, 0.03);
    --primary-overlay: rgba(14, 92, 92, 0.92);
    --secondary-subtle: rgba(201, 169, 110, 0.12);
    --secondary-faint: rgba(201, 169, 110, 0.05);
    --secondary-border: rgba(201, 169, 110, 0.3);
}
body.theme-teal.dark-mode {
    --primary: #20b0b0;
    --primary-variant: #0e5c5c;
    --primary-light: #40d0d0;
    --background: #0a1818;
    --surface: #122c2c;
    --on-surface: #e0f8f8;
    --on-surface-variant: #a0c8c8;
    --outline: #356060;
    --accent: #4dd9d9;
    --emerald-gradient: linear-gradient(135deg, #0a1818 0%, #0e5c5c 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --primary-subtle: rgba(32, 176, 176, 0.1);
    --primary-faint: rgba(32, 176, 176, 0.04);
    --primary-overlay: rgba(14, 92, 92, 0.95);
    --secondary-subtle: rgba(201, 169, 110, 0.1);
    --secondary-faint: rgba(201, 169, 110, 0.04);
    --secondary-border: rgba(201, 169, 110, 0.25);
    --surface-border: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.03);
    --white-faint: rgba(255, 255, 255, 0.08);
    --white-subtle: rgba(255, 255, 255, 0.04);
}
body.theme-teal.dark-mode header { background: linear-gradient(135deg, #050e0e 0%, #0e5c5c 100%); }
body.theme-teal.dark-mode .bottom-nav { background: #050e0e; }
body.theme-teal.dark-mode .grid-item { background: var(--surface); border-color: var(--primary-subtle); }
body.theme-teal.dark-mode .floating-reminder { background: var(--primary-overlay); border-color: var(--secondary); }
body.theme-teal.dark-mode .exit-confirm-box { background: var(--surface); }
body.theme-teal.dark-mode .ayah-modal-content { background: var(--surface); }
body.theme-teal.dark-mode .ayah-menu-container { background: var(--surface); border-color: var(--surface-border); }
body.theme-teal.dark-mode .word-item { background: var(--surface-hover); }
body.theme-teal.dark-mode .modal-header { background: var(--surface); border-color: var(--surface-border); }
body.theme-teal.dark-mode .tool-btn:hover { background: var(--surface-hover); }
body.theme-teal.dark-mode .menu-item:hover { background: var(--surface-hover); }


/* ---------------------------------------------------------------
   DIGITAL TASBEEH 3D � ?????? ??????? ?????? ???????
   --------------------------------------------------------------- */
.dt-page { animation: dtFadeIn .4s ease; }

.dt-topbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; gap: 8px; }
.dt-title { font-size: 19px; font-weight: 700; color: var(--primary); font-family: var(--font-main); display: flex; align-items: center; gap: 8px; }
.dt-top-actions { display: flex; gap: 8px; }
.dt-top-actions button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--secondary-border);
  background: var(--surface); color: var(--secondary); font-size: 17px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.dt-top-actions button:active { transform: scale(.9); }

/* -- Stage ----------------------------------------------- */
.dt-stage-wrap {
  position: relative; width: 100%; max-width: 340px; margin: 0 auto;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}

/* -- Tasbih image ------------------------------------ */
.dt-img {
  position: relative; width: 100%; border-radius: 18px; overflow: hidden;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.dt-img img { display: block; width: 100%; height: auto; }
.dt-img.dt-tap img { animation: dtImgPop .35s ease; }
@keyframes dtImgPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.dt-bead-pos {
  position: absolute; width: 4.5%; height: 4.5%;
  transform: translate(-50%,-50%); border-radius: 50%;
  cursor: pointer; -webkit-tap-highlight-color: transparent; z-index: 3;
}
.dt-bead-pos::after {
  content: ''; position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,.95) 0%, rgba(255,170,0,.55) 45%, rgba(255,215,0,0) 72%);
  box-shadow: 0 0 12px 2px rgba(255,200,0,.9);
  opacity: 0; transform: scale(.4); transition: opacity .25s ease, transform .25s ease;
}
.dt-bead-pos.dt-active::after { opacity: 1; transform: scale(1); animation: dtBeadPulse 1.1s ease-in-out infinite; }
.dt-bead-pos.dt-active { z-index: 4; }
@keyframes dtBeadPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.28); }
}
.dt-readout { text-align: center; margin-top: 14px; padding: 0 6px; }
.dt-readout .dt-dhikr-name { font-size: 17px; font-weight: 700; color: var(--primary); font-family: var(--font-quran); line-height: 1.4; min-height: 24px; }
.dt-readout .dt-count { font-size: 44px; font-weight: 800; line-height: 1.1; color: var(--primary-variant); font-variant-numeric: tabular-nums; margin: 2px 0; }
body.dark-mode .dt-readout .dt-count { color: #e8f5ee; }
.dt-readout .dt-goal { font-size: 13px; color: var(--on-surface-variant); }

/* -- Controls ------------------------------------------- */
.dt-controls { display: flex; justify-content: center; gap: 10px; margin: 14px auto 6px; }
.dt-control-btn {
  min-width: 118px; padding: 11px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--secondary-border); background: var(--surface); color: var(--primary);
  font-family: var(--font-main); font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.dt-control-btn:active { transform: scale(.94); }
.dt-control-btn.dt-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: var(--on-primary); border: none; }

/* -- Panels --------------------------------------------- */
.dt-panel {
  background: var(--surface); border: 1px solid var(--secondary-border); border-radius: 18px;
  padding: 14px; margin: 12px auto 6px; max-width: 420px; box-shadow: var(--shadow-md);
  animation: dtFadeIn .25s ease;
}
.dt-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dt-panel-title { font-weight: 700; color: var(--primary); font-size: 15px; display: flex; align-items: center; gap: 7px; }
.dt-panel-close { border: none; background: transparent; color: var(--outline); font-size: 16px; cursor: pointer; padding: 4px; }

.dt-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--surface-border); }
.dt-setting-row:last-child { border-bottom: none; }
.dt-setting-label { font-size: 14px; color: var(--on-surface); font-weight: 600; display: flex; align-items: center; gap: 8px; }

.dt-input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--surface-border);
  background: var(--surface-faint, rgba(0,0,0,.03)); color: var(--on-surface); font-family: var(--font-main); font-size: 14px; outline: none;
}
.dt-input:focus { border-color: var(--primary); }

/* -- Azkar list ----------------------------------------- */
.dt-azkar-item { display: flex; align-items: center; gap: 8px; padding: 9px 6px; border-bottom: 1px solid var(--surface-border); }
.dt-azkar-item:last-child { border-bottom: none; }
.dt-azkar-name { flex: 1; font-size: 14px; color: var(--on-surface); font-weight: 600; text-align: right; }
.dt-azkar-name.dt-azkar-default { color: var(--secondary-variant); }
.dt-azkar-name.dt-azkar-default::before { content: '? '; }
.dt-azkar-actions { display: flex; gap: 4px; }
.dt-azkar-actions button { border: none; background: transparent; color: var(--outline); cursor: pointer; font-size: 14px; padding: 5px; border-radius: 8px; transition: background .15s, color .15s; }
.dt-azkar-actions button:hover { background: var(--surface-hover); }
.dt-azkar-actions .dt-edit-btn { color: var(--primary); }
.dt-azkar-actions .dt-del-btn { color: var(--error); }
.dt-azkar-add { width: 100%; margin-top: 10px; }

/* -- Stats & achievements ------------------------------- */
.dt-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dt-stat-card { background: var(--surface); border: 1px solid var(--secondary-border); border-radius: 18px; padding: 16px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.dt-stat-ico { font-size: 24px; margin-bottom: 6px; }
.dt-stat-val { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
body.dark-mode .dt-stat-val { color: #7fd0a8; }
.dt-stat-label { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; }
.dt-stat-hero { grid-column: 1 / -1; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-color: transparent; }
.dt-stat-hero .dt-stat-val { color: #fff; }
.dt-stat-hero .dt-stat-label { color: rgba(255,255,255,.85); }
.dt-stat-hero .dt-stat-ico { filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }

.dt-ach-list { display: flex; flex-direction: column; gap: 10px; }
.dt-ach-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; padding: 13px; box-shadow: var(--shadow-sm); }
.dt-ach-card .dt-ach-ico { font-size: 30px; filter: grayscale(0); }
.dt-ach-card.locked .dt-ach-ico { filter: grayscale(1); opacity: .45; }
.dt-ach-card.locked { opacity: .75; }
.dt-ach-info { flex: 1; }
.dt-ach-name { font-weight: 700; font-size: 14px; color: var(--on-surface); }
.dt-ach-desc { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; }
.dt-ach-state { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full); }
.dt-ach-card.unlocked .dt-ach-state { background: rgba(46,125,50,.12); color: var(--success); }
.dt-ach-card.locked .dt-ach-state { background: var(--surface-hover); color: var(--outline); }

.dt-section-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.dt-section-head h3 { font-size: 15px; font-weight: 700; color: var(--primary); margin: 0; }

.dt-empty { text-align: center; color: var(--outline); font-size: 13px; padding: 16px; }

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

@media (max-width: 380px) {
  .dt-stage-wrap { max-width: 320px; }
  .dt-count { font-size: 32px; }
}

/* -- Home widget (embedded on home page) ──────────────── */
.dt-home-top-actions { position: absolute; top: 8px; right: 8px; z-index: 6; }
.dt-home-top-actions button { width: 34px; height: 34px; font-size: 14px; }
body.ltr-mode .dt-home-top-actions { right: auto; left: 8px; }
