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

/* ================================================================
   ISLAMIC PORTAL — PREMIUM DESIGN SYSTEM
   ================================================================ */

:root {
    /* Day View Palette: Green, Shining Yellow Gold & White Silver */
    --pearl:          #F8FAFC;
    --pearl-warm:     #F1F5F9;
    --pearl-card:     #FFFFFF;
    --text-dark:      #020617; /* Very dark slate for readability */
    --text-muted:     #475569;
    --emerald-deep:   #064E3B; /* Rich Green */
    --emerald:        #10B981; /* Shining Green */
    --emerald-mid:    #34D399;
    --emerald-light:  #D1FAE5;
    --gold-dark:      #D97706;
    --gold:           #FBBF24; /* Shining Yellow Gold */
    --gold-light:     #FEF3C7;
    --silver:         #94A3B8; /* Silver */
    --silver-light:   #F8FAFC; /* White Silver */
    --sidebar-bg:     #064E3B; /* Green Sidebar */
    --sidebar-border: rgba(251, 191, 36, 0.4); /* Gold Border */

    /* Shadows */
    --shadow-gold:    0 4px 20px rgba(217, 119, 6, 0.2);
    --shadow-green:   0 8px 30px rgba(2, 6, 23, 0.15);
    --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.05);

    /* Radii */
    --r-xs: 12px;
    --r-sm: 18px;
    --r-md: 24px;
    --r-lg: 32px;
    --r-xl: 40px;
    --r-full: 9999px;

    /* Prayer-time Sky Gradients */
    --sky-fajr:    linear-gradient(135deg, #020617 0%, #0F172A 100%);
    --sky-sunrise: linear-gradient(135deg, #CBD5E1 0%, #F1F5F9 100%);
    --sky-dhuhr:   linear-gradient(135deg, #F1F5F9 0%, #FFFFFF 100%);
    --sky-asr:     linear-gradient(135deg, #64748B 0%, #94A3B8 100%);
    --sky-maghrib: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    --sky-isha:    linear-gradient(135deg, #020617 0%, #0F172A 100%);
}



/* ================================================================
   BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: #F8FAFC;
    background-image:
        radial-gradient(ellipse at 10% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(ellipse at 90% 0%, rgba(251, 191, 36, 0.15) 0px, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(226, 232, 240, 0.8) 0px, transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.65;
    overflow-x: hidden;
    filter: brightness(1);
}

body.dark {
    --pearl:          #070B14;
    --pearl-warm:     #0F172A;
    --pearl-card:     #121929;
    --text-dark:      #FFFFFF;
    --text-muted:     #CBD5E1;
    --emerald-deep:   #063726;
    --emerald:        #10B981; 
    --emerald-mid:    #34D399;
    --emerald-light:  #6EE7B7;
    --gold-dark:      #D97706;
    --gold:           #F59E0B; 
    --gold-light:     #FCD34D;
    --silver:         #E2E8F0;
    --silver-light:   #1E293B;
    --sidebar-bg:     #090E1A;
    --sidebar-border: rgba(255,255,255,0.08);

    background: #070B14;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 100% 60% at 50% 100%, rgba(11, 15, 25, 0.95) 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--text-dark);
    filter: brightness(1);
}

h1,h2,h3,h4,h5,h6 { font-family:'Cormorant Garamond',serif; font-weight:700; }
.arabic-font  { font-family:'Amiri',serif; }
.cinzel-font  { font-family:'Cinzel',serif; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(197,160,79,0.25); border-radius:20px; }
::-webkit-scrollbar-thumb:hover { background:rgba(197,160,79,0.55); }

/* ================================================================
   SIDEBAR
   ================================================================ */
#main-sidebar {
    background: var(--emerald-deep);
    border-right: 1px solid var(--sidebar-border);
    position: relative;
    overflow: hidden;
}

#main-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(197,160,79,0.06) 1px, transparent 0);
    background-size: 28px 28px;
    pointer-events: none;
}

#main-sidebar::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197,160,79,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-brand-logo {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, rgba(197,160,79,0.15), rgba(197,160,79,0.05));
    border: 1.5px solid rgba(197,160,79,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    position: relative;
    box-shadow: 0 0 0 6px rgba(197,160,79,0.06), var(--shadow-gold);
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%,100% { box-shadow: 0 0 0 6px rgba(197,160,79,0.06); }
    50%      { box-shadow: 0 0 0 12px rgba(197,160,79,0.12); }
}

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 11px 22px;
    border-radius: 0 var(--r-full) var(--r-full) 0;
    margin: 2px 10px 2px 0;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(197,160,79,0.08), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-link:hover { color: white; }
.nav-link:hover::before { opacity: 1; }

.nav-link.active {
    background: linear-gradient(90deg, rgba(197,160,79,0.18) 0%, rgba(197,160,79,0.04) 100%) !important;
    color: var(--gold) !important;
    border-right: 3px solid var(--gold);
    font-weight: 600;
}

.nav-link.active i { color: var(--gold) !important; }
.nav-link.active::before { opacity: 1; }

/* ================================================================
   HEADER
   ================================================================ */
#portal-header {
    background: rgba(250,248,244,0.88);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(197,160,79,0.12);
}

.dark #portal-header {
    background: rgba(11,26,19,0.92);
    border-bottom: 1px solid rgba(197,160,79,0.1);
}

/* ================================================================
   GLASS CARDS
   ================================================================ */
.glass,
.glass-container {
    background: rgba(255,255,255,0.72) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--r-xl) !important;
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

.dark .glass,
.dark .glass-container {
    background: rgba(26,26,26,0.75) !important;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    color: #e2e8f0;
}

.glass-container:hover,
.hover-card-3d:hover {
    transform: translateY(-6px) scale(1.01);
    background: rgba(255,255,255,0.88) !important;
    box-shadow: 0 20px 40px rgba(6,78,59,0.12);
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero-prayer-card {
    background: linear-gradient(135deg, #020617 0%, #0F172A 100%) !important;
    border: 1px solid rgba(217, 119, 6, 0.3) !important;
    border-radius: var(--r-xl);
    position: relative;
    overflow: hidden;
    min-height: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.hero-prayer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(197,160,79,0.12) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
}

.hero-prayer-card::after {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197,160,79,0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Countdown ring glow */
.countdown-wrap {
    position: relative;
    display: inline-block;
}

.countdown-wrap::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: var(--r-lg);
    background: transparent;
    border: 2px solid rgba(197,160,79,0.25);
    animation: pulseRing 2.5s ease-out infinite;
}

.countdown-wrap::after {
    content: '';
    position: absolute;
    inset: -24px;
    border-radius: var(--r-lg);
    background: transparent;
    border: 1px solid rgba(197,160,79,0.1);
    animation: pulseRing 2.5s ease-out infinite 0.6s;
}

@keyframes pulseRing {
    0%   { opacity:1; transform:scale(1); }
    100% { opacity:0; transform:scale(1.12); }
}

/* ================================================================
   PRAYER TIME CARDS — Sky Gradients
   ================================================================ */
.prayer-card-fajr    { background: var(--sky-fajr);    color: white; }
.prayer-card-sunrise { background: var(--sky-sunrise);  color: white; }
.prayer-card-dhuhr   { background: var(--sky-dhuhr);   color: white; }
.prayer-card-asr     { background: var(--sky-asr);      color: #1c1400; }
.prayer-card-maghrib { background: var(--sky-maghrib);  color: white; }
.prayer-card-isha    { background: var(--sky-isha);     color: white; }

.prayer-card {
    border-radius: var(--r-xl) !important;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.45s cubic-bezier(0.4,0,0.2,1);
    border: none !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.prayer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.prayer-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.prayer-card.next-prayer {
    box-shadow: 0 0 0 3px var(--gold), 0 16px 40px rgba(197,160,79,0.4);
    animation: nextPrayerGlow 2.5s ease-in-out infinite;
}

@keyframes nextPrayerGlow {
    0%,100% { box-shadow: 0 0 0 3px var(--gold), 0 16px 40px rgba(197,160,79,0.3); }
    50%     { box-shadow: 0 0 0 6px var(--gold-light), 0 20px 50px rgba(197,160,79,0.5); }
}

.prayer-card .adhan-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--r-full);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s;
}

.prayer-card:hover .adhan-badge,
.prayer-card.next-prayer .adhan-badge { opacity: 1; }

/* ================================================================
   ISLAMIC CALENDAR
   ================================================================ */
.calendar-section {
    background: linear-gradient(135deg, var(--emerald-deep) 0%, var(--emerald) 100%);
    border-radius: var(--r-xl);
    overflow: hidden;
    position: relative;
}

.calendar-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(197,160,79,0.08) 1px, transparent 0);
    background-size: 30px 30px;
    pointer-events: none;
}

.calendar-header {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    padding: 24px 28px;
    border-bottom: 1px solid rgba(197,160,79,0.15);
    position: relative;
    z-index: 1;
}

.cal-day-header {
    color: rgba(197,160,79,0.8);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    padding: 10px 0;
}

.cal-day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px;
    margin: 2px;
}

.cal-day-cell:hover {
    background: rgba(197,160,79,0.12);
    transform: scale(1.08);
}

.cal-day-cell.today {
    background: var(--text-dark);
    color: var(--pearl) !important;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.cal-day-cell.today .hijri-day { color: var(--pearl); }

.cal-day-cell.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #f87171;
}

.cal-day-cell.has-event.is-eid::after { background: var(--gold); }

.hijri-day {
    font-size: 9px;
    color: rgba(197,160,79,0.7);
    font-family: 'Amiri', serif;
    margin-top: 1px;
    line-height: 1;
}

.greg-day {
    font-size: 15px;
    font-weight: 600;
    color: white;
    line-height: 1;
}

.cal-day-cell.other-month .greg-day { color: rgba(255,255,255,0.25); }
.cal-day-cell.other-month .hijri-day { color: rgba(197,160,79,0.2); }

.islamic-event-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ================================================================
   QURAN READER ENHANCEMENTS
   ================================================================ */
.bismillah-header {
    text-align: center;
    padding: 32px 0 24px;
    border-bottom: 1px solid rgba(197,160,79,0.15);
    margin-bottom: 32px;
    position: relative;
}

.bismillah-header::before,
.bismillah-header::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(197,160,79,0.3);
    font-size: 10px;
}
.bismillah-header::before { left: 20px; }
.bismillah-header::after  { right: 20px; }

.bismillah-text {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-shadow: 0 2px 12px rgba(197,160,79,0.3);
    display: block;
    margin-bottom: 6px;
}

.ayah-number-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(197,160,79,0.2), rgba(197,160,79,0.08));
    border: 1.5px solid rgba(197,160,79,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ayah-row:hover .ayah-number-circle,
.ayah-row.playing .ayah-number-circle {
    background: var(--text-dark);
    color: var(--pearl);
    border-color: var(--text-dark);
    box-shadow: 0 0 12px rgba(0,0,0,0.15);
}

.surah-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}
.surah-list-item:hover { background:rgba(197,160,79,0.1); color:white; }
.surah-list-item.active { background:rgba(197,160,79,0.15); color:var(--gold); font-weight:600; }

/* ================================================================
   SECTION HEADINGS
   ================================================================ */
.section-title-wrap {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.section-title-wrap h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--emerald);
    margin-bottom: 8px;
}
.dark .section-title-wrap h2 { color: var(--gold); }

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.ornamental-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px auto 0;
    width: fit-content;
}
.ornamental-line::before,
.ornamental-line::after {
    content: '';
    width: 60px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.ornamental-line::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.ornamental-line span { color:var(--gold); font-size:1.1rem; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
.view-section {
    animation: sectionReveal 0.7s cubic-bezier(0.2,0.8,0.2,1) forwards;
    will-change: transform, opacity;
    transform: translateZ(0);
}

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

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

.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }

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

.shimmer-text {
    background: linear-gradient(90deg, white 30%, rgba(197,160,79,0.9) 50%, white 70%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerSlide 3s linear infinite;
}

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

.float-anim { animation: floatMoon 5s ease-in-out infinite; }

@keyframes crescentGlow {
    0%,100% { filter: drop-shadow(0 0 6px rgba(197,160,79,0.4)); }
    50%     { filter: drop-shadow(0 0 18px rgba(197,160,79,0.8)); }
}

.crescent-glow { animation: crescentGlow 3s ease-in-out infinite; }

/* ================================================================
   ISLAMIC AESTHETICS
   ================================================================ */
.islamic-pattern-bg {
    background-color: var(--emerald-deep);
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 38px 38px;
}

.mihrab-arch {
    background: var(--pearl);
    color: var(--emerald);
    border-radius: 300px 300px 100px 100px !important;
    box-shadow: 0 30px 60px rgba(6,78,59,0.12);
    border: 1px solid rgba(197,160,79,0.1);
}

.ornamental-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--gold);
    margin: 2rem 0;
}
.ornamental-separator::before,
.ornamental-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.ornamental-separator span { padding:0 1.5rem; font-size:1.6rem; font-family:'Amiri',serif; }

.calligraphic-divider {
    height:1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin:2rem auto;
    width:50%;
    opacity:.35;
}

/* ================================================================
   SHIMMER CARD
   ================================================================ */
.shimmer-card { overflow:hidden; position:relative; }
.shimmer-card::before {
    content:'';
    position:absolute; top:0; left:-100%; width:200%; height:100%;
    background:linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition:0.6s ease;
}
.shimmer-card:hover::before { left:100%; }

/* ================================================================
   QURAN READER
   ================================================================ */
.search-highlight {
    background: rgba(197,160,79,0.35) !important;
    color:#fff !important;
    border-radius:3px;
    padding:0 3px;
}

#quran-content::-webkit-scrollbar { width:5px; }
#quran-content::-webkit-scrollbar-thumb { background:rgba(197,160,79,0.2); border-radius:10px; }
#quran-content::-webkit-scrollbar-thumb:hover { background:rgba(197,160,79,0.5); }

#quran-settings-sidebar { transition:all 0.3s ease; }

/* ================================================================
   FORMS & INPUTS
   ================================================================ */
input[type="range"] { -webkit-appearance:none; appearance:none; }
input[type="range"]::-webkit-slider-runnable-track {
    background:rgba(197,160,79,0.15); height:4px; border-radius:2px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance:none; appearance:none;
    background:var(--gold); height:14px; width:14px;
    border-radius:50%; margin-top:-5px;
    box-shadow:0 2px 6px rgba(197,160,79,0.4);
    cursor:pointer;
}

.dark input[type="range"]::-webkit-slider-runnable-track {
    background:rgba(255,255,255,0.08);
}

/* ================================================================
   COMPASS
   ================================================================ */
#qibla-compass-dial { transform-origin:center center; }
#qibla-kaaba-marker { transform-origin:center center; }

/* ================================================================
   RAMADAN / DARK SECTION CARDS
   ================================================================ */
.ramadan-card-glow {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(197,160,79,0.2);
    border-radius: var(--r-md);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
.ramadan-card-glow:hover {
    background: rgba(197,160,79,0.08);
    border-color: rgba(197,160,79,0.4);
    transform: translateY(-3px);
}

/* WhatsApp share button */
.whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border-radius: var(--r-full);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}
.whatsapp-btn:hover { filter:brightness(1.1); transform:translateY(-2px); }

/* ================================================================
   HIJRI DATE BADGE
   ================================================================ */
.hijri-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(197,160,79,0.12);
    border: 1px solid rgba(197,160,79,0.25);
    border-radius: var(--r-full);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    backdrop-filter: blur(8px);
}

/* ================================================================
   NEON GLOW (next prayer highlight)
   ================================================================ */
.neon-glow {
    box-shadow: 0 0 0 3px var(--gold), 0 8px 32px rgba(197,160,79,0.35) !important;
}

/* ================================================================
   MOBILE BOTTOM NAV
   ================================================================ */
@media (max-width: 768px) {
    body { overflow: initial; }
    
    .pb-safe { padding-bottom: env(safe-area-inset-bottom, 20px); }
    .mobile-sub-tabs { bottom: calc(64px + env(safe-area-inset-bottom, 20px)); }

    .mobile-nav-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 9999px;
        font-size: 12px;
        font-weight: 600;
        color: #334155;
        background: transparent;
        border: 1px solid transparent;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        text-decoration: none;
        white-space: nowrap;
        flex-shrink: 0;
        transform: translateZ(0);
        will-change: background, color, border;
    }
    .dark .mobile-nav-item {
        color: #CBD5E1;
    }
    .mobile-nav-item i {
        font-size: 13px;
    }
    .mobile-nav-item:hover {
        color: var(--gold);
        background: rgba(217, 119, 6, 0.08);
    }
    .mobile-nav-item.active {
        color: #92400E !important;
        background: #FEF3C7 !important;
        border: 1px solid #F59E0B !important;
        box-shadow: 0 1px 3px rgba(217, 119, 6, 0.15) !important;
        font-weight: 700 !important;
    }
    .dark .mobile-nav-item.active {
        color: #FCD34D !important;
        background: rgba(217, 119, 6, 0.25) !important;
        border: 1px solid rgba(245, 158, 11, 0.5) !important;
        box-shadow: 0 1px 8px rgba(245, 158, 11, 0.2) !important;
    }
}

/* ================================================================
   DARK MODE OVERRIDES (PREMIUM SAAS & ISLAMIC LUXURY)
   ================================================================ */
body.dark #main-sidebar {
    background: linear-gradient(180deg, #090e1a 0%, #070b14 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark #portal-header {
    background: rgba(7, 11, 20, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark .glass,
body.dark .glass-container,
.dark .glass,
.dark .glass-container {
    background: rgba(18, 25, 41, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.dark .glass-container:hover,
.dark .glass-container:hover {
    background: rgba(26, 36, 56, 0.92) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.12) !important;
}

body.dark .hero-prayer-card {
    background: linear-gradient(135deg, #020617 0%, #0F172A 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px rgba(245, 158, 11, 0.2) !important;
}

body.dark #daily-ayah-block {
    background: rgba(18, 25, 41, 0.85) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
}

/* ================================================================
   AUTHENTIC PHYSICAL QURAN MUSHAF PAGE STYLING (BLACK, SILVER & LIGHTNING GOLD)
   ================================================================ */
.mushaf-page-container {
    background: linear-gradient(180deg, #050811 0%, #0B0F19 100%) !important;
    color: #F8FAFC !important;
    border: 3px double #CBD5E1 !important;
    outline: 1px solid rgba(245, 158, 11, 0.4) !important;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9), 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.15) !important;
    border-radius: 20px !important;
    padding: 28px !important;
    margin-bottom: 24px !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.mushaf-surah-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
    border: 3px double #F59E0B !important;
    border-radius: 16px !important;
    padding: 16px 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.ayah-medallion {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    margin: 0 6px !important;
    font-size: 12px !important;
    font-family: monospace, sans-serif !important;
    border-radius: 9999px !important;
    border: 2px solid #F59E0B !important;
    color: #FCD34D !important;
    background: rgba(15, 23, 42, 0.9) !important;
    font-weight: 700 !important;
    user-select: none !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35) !important;
    vertical-align: middle !important;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.6) !important;
}

body.dark select,
body.dark input {
    background-color: #121929 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.dark .prayer-card-asr { color: #ffffff; }

body.dark .section-title-wrap h2 { color: var(--gold-light); }

/* ================================================================
   UX IMPROVEMENTS - TOASTS & MODALS
   ================================================================ */

.toast-notification {
    background: var(--emerald-deep);
    color: white;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}
.dark .toast-notification {
    background: #ffffff;
    color: #000000;
    border-color: rgba(0,0,0,0.1);
}
.toast-notification.toast-show {
    transform: translateY(0);
    opacity: 1;
}
.toast-notification i {
    color: var(--gold);
    font-size: 16px;
}