/*
 * NoorAlQuran – Design System
 * Premium dark-first, mobile-first Quran reader UI
 * ─────────────────────────────────────────────────
 */

/* ── CSS Custom Properties ───────────────────────── */
:root {
    /* Colors – Dark theme (default) */
    --bg-primary:    #0d1117;
    --bg-secondary:  #161b22;
    --bg-card:       #1c2128;
    --bg-elevated:   #21262d;
    --bg-hover:      #262c36;
    --bg-input:      #0d1117;

    --accent:        #4CAF86;
    --accent-soft:   rgba(76,175,134,.12);
    --accent-hover:  #3d9970;
    --accent-glow:   rgba(76,175,134,.25);

    --text-primary:  #e6edf3;
    --text-secondary:#b1bac4;
    --text-muted:    #8b949e;
    --text-faint:    #484f58;

    --border-color:  rgba(255,255,255,.06);
    --border-focus:  rgba(76,175,134,.45);
    --border-input:  rgba(255,255,255,.1);

    --danger:        #ff5555;
    --warning:       #ffa032;
    --success:       #4CAF86;
    --info:          #58a6ff;

    --shadow-sm:     0 2px 8px rgba(0,0,0,.2);
    --shadow-md:     0 8px 24px rgba(0,0,0,.3);
    --shadow-lg:     0 16px 48px rgba(0,0,0,.4);
    --shadow-glow:   0 0 30px rgba(76,175,134,.15);

    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     20px;
    --radius-full:   50%;

    /* Fonts */
    --font-ui:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic:   'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
    --font-urdu:     'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;

    /* Sizes */
    --header-h:      60px;
    --bottom-nav-h:  68px;
    --arabic-size:   28px;
    --arabic-line:   2.2;

    /* Transitions */
    --t-fast:        .15s ease;
    --t-base:        .25s ease;
    --t-slow:        .4s cubic-bezier(.4,0,.2,1);

    /* Z-indexes */
    --z-header:      100;
    --z-bottom-nav:  100;
    --z-modal:       200;
    --z-toast:       300;
    --z-audio:       90;
}

/* ── Light Theme ─────────────────────────────────── */
[data-theme="light"] {
    --bg-primary:    #f6f8fa;
    --bg-secondary:  #ffffff;
    --bg-card:       #ffffff;
    --bg-elevated:   #f0f2f5;
    --bg-hover:      #e8ecf1;
    --bg-input:      #ffffff;

    --text-primary:  #1c1e21;
    --text-secondary:#4a4f57;
    --text-muted:    #6e7681;
    --text-faint:    #b0b8c1;

    --border-color:  rgba(0,0,0,.08);
    --border-input:  rgba(0,0,0,.15);

    --shadow-sm:     0 2px 8px rgba(0,0,0,.06);
    --shadow-md:     0 8px 24px rgba(0,0,0,.08);
    --shadow-lg:     0 16px 48px rgba(0,0,0,.1);
    --shadow-glow:   0 0 30px rgba(76,175,134,.1);
}

/* ── Sepia Theme ─────────────────────────────────── */
[data-theme="sepia"] {
    --bg-primary:    #f4ead5;
    --bg-secondary:  #faf3e3;
    --bg-card:       #faf3e3;
    --bg-elevated:   #efe5cf;
    --bg-hover:      #e8ddc5;
    --bg-input:      #faf3e3;

    --accent:        #8B6914;
    --accent-soft:   rgba(139,105,20,.1);
    --accent-hover:  #7a5c10;

    --text-primary:  #3d2e1c;
    --text-secondary:#5c4a35;
    --text-muted:    #7a6a54;
    --text-faint:    #b3a48e;

    --border-color:  rgba(0,0,0,.07);
    --border-input:  rgba(0,0,0,.12);

    --shadow-sm:     0 2px 8px rgba(0,0,0,.05);
    --shadow-md:     0 8px 24px rgba(0,0,0,.07);
    --shadow-lg:     0 16px 48px rgba(0,0,0,.08);
}


/* ╔══════════════════════════════════════════════════╗
   ║              GLOBAL RESET & BASE                ║
   ╚══════════════════════════════════════════════════╝ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--header-h);
    padding-bottom: var(--bottom-nav-h);
    transition: background var(--t-slow), color var(--t-slow);
    overflow-x: hidden;
    direction: ltr;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

.skip-link {
    position: absolute;
    top: -100%;
    left: 10px;
    z-index: 999;
    background: var(--accent);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.skip-link:focus { top: 10px; }


/* ╔══════════════════════════════════════════════════╗
   ║                  HEADER                         ║
   ╚══════════════════════════════════════════════════╝ */

.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    z-index: var(--z-header);
    background: rgba(13,17,23,.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--t-slow);
}

[data-theme="light"] .app-header {
    background: rgba(246,248,250,.85);
}
[data-theme="sepia"] .app-header {
    background: rgba(244,234,213,.85);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    flex-shrink: 0;
}
.logo-link:hover { color: var(--accent); }

.logo-icon {
    font-size: 26px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    color: var(--accent);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.header-search-btn {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.header-search-btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}


/* ── Buttons ─────────────────────────────────────── */

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
    color: #fff;
}

.btn-ghost {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover {
    border-color: var(--border-focus);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}


/* ── Theme toggle icons ──────────────────────────── */

.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="sepia"] .icon-sun  { display: block; }
[data-theme="sepia"] .icon-moon { display: none; }


/* ╔══════════════════════════════════════════════════╗
   ║              BOTTOM NAV (MOBILE)                ║
   ╚══════════════════════════════════════════════════╝ */

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    z-index: var(--z-bottom-nav);
    display: flex;
    align-items: stretch;
    background: rgba(13,17,23,.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="light"] .bottom-nav {
    background: rgba(255,255,255,.92);
}
[data-theme="sepia"] .bottom-nav {
    background: rgba(250,243,227,.92);
}

.bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-fast);
    position: relative;
}
.bnav-item:hover,
.bnav-item.active { color: var(--accent); }

.bnav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}

.bnav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.bnav-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .02em;
}

.bnav-center .bnav-icon {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: var(--radius-full);
    color: #fff;
    margin-top: -16px;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: transform var(--t-fast);
}
.bnav-center:hover .bnav-icon { transform: scale(1.08); }
.bnav-center.active .bnav-icon { background: var(--accent-hover); }

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}


/* ╔══════════════════════════════════════════════════╗
   ║               FLASH MESSAGES                    ║
   ╚══════════════════════════════════════════════════╝ */

.flash-message {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown .3s ease;
    max-width: 90%;
}
.flash-success { background: rgba(76,175,134,.15); color: var(--success); border: 1px solid rgba(76,175,134,.2); }
.flash-error   { background: rgba(255,85,85,.12); color: var(--danger); border: 1px solid rgba(255,85,85,.2); }
.flash-info    { background: rgba(88,166,255,.12); color: var(--info); border: 1px solid rgba(88,166,255,.2); }
.flash-close {
    background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; opacity: .7;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}


/* ╔══════════════════════════════════════════════════╗
   ║              CONTAINER & LAYOUT                 ║
   ╚══════════════════════════════════════════════════╝ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-narrow {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
}

.section {
    padding: 24px 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}


/* ╔══════════════════════════════════════════════════╗
   ║                   CARDS                         ║
   ╚══════════════════════════════════════════════════╝ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.card:hover {
    border-color: rgba(76,175,134,.2);
    box-shadow: var(--shadow-sm);
}
.card-clickable:hover {
    transform: translateY(-2px);
}

.glass {
    background: rgba(22,27,34,.7);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,.06);
}

[data-theme="light"] .glass {
    background: rgba(255,255,255,.7);
}


/* ╔══════════════════════════════════════════════════╗
   ║                 HERO SECTION                    ║
   ╚══════════════════════════════════════════════════╝ */

.hero {
    text-align: center;
    padding: 40px 20px 24px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: .5;
}

.hero-bismillah {
    font-family: var(--font-arabic);
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 8px;
    position: relative;
    line-height: 1.8;
}

.hero-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
}

.hero-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
}

/* ── Quick Actions ───────────────────────────────── */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px auto;
    max-width: 400px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    transition: all var(--t-fast);
}
.quick-action:hover {
    color: var(--accent);
    border-color: rgba(76,175,134,.3);
    background: var(--accent-soft);
    transform: translateY(-2px);
}
.quick-action-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-md);
    font-size: 18px;
}


/* ╔══════════════════════════════════════════════════╗
   ║               SURAH LIST                        ║
   ╚══════════════════════════════════════════════════╝ */

.surah-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.surah-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--t-fast);
    cursor: pointer;
}
.surah-item:hover {
    border-color: rgba(76,175,134,.25);
    background: var(--bg-hover);
    transform: translateX(-4px);
}

.surah-number {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 10px;
    flex-shrink: 0;
    transform: rotate(45deg);
}
.surah-number span {
    transform: rotate(-45deg);
}

.surah-info {
    flex: 1;
    min-width: 0;
}

.surah-name-en {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.surah-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.surah-meta .badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.surah-name-ar {
    font-family: var(--font-arabic);
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    line-height: 1.6;
}


/* ╔══════════════════════════════════════════════════╗
   ║                JUZ SCROLLER                     ║
   ╚══════════════════════════════════════════════════╝ */

.juz-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
    scrollbar-width: none;
}
.juz-scroller::-webkit-scrollbar { display: none; }

.juz-chip {
    scroll-snap-align: start;
    flex-shrink: 0;
    min-width: 60px;
    padding: 10px 16px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--t-fast);
}
.juz-chip:hover, .juz-chip.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.juz-chip-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}


/* ╔══════════════════════════════════════════════════╗
   ║               FORM ELEMENTS                     ║
   ╚══════════════════════════════════════════════════╝ */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-ui);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input::placeholder { color: var(--text-faint); }

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
}


/* ╔══════════════════════════════════════════════════╗
   ║               AUTH FORMS                        ║
   ╚══════════════════════════════════════════════════╝ */

.auth-page {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}
.auth-header .logo-icon {
    margin: 0 auto 12px;
    width: 52px; height: 52px;
    font-size: 30px;
}
.auth-title {
    font-size: 20px;
    font-weight: 700;
}
.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.guest-banner {
    background: var(--accent-soft);
    border: 1px solid rgba(76,175,134,.15);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    position: relative;
}


/* ╔══════════════════════════════════════════════════╗
   ║              SEARCH PAGE                        ║
   ╚══════════════════════════════════════════════════╝ */

.search-page { padding: 20px 16px; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px 4px 4px 18px;
    margin-bottom: 24px;
    transition: border-color var(--t-fast);
}
.search-bar:focus-within { border-color: var(--accent); }

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-ui);
}
.search-bar input::placeholder { color: var(--text-faint); }

.search-bar .btn-search {
    width: 42px; height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.search-result {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--t-fast);
}
.search-result:hover {
    border-color: rgba(76,175,134,.25);
    background: var(--bg-hover);
}

.search-result-ref {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}

.search-result-arabic {
    font-family: var(--font-arabic);
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-primary);
    direction: rtl;
    margin-bottom: 6px;
}

.search-result-translation {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

mark, .highlight {
    background: rgba(76,175,134,.2);
    color: var(--accent);
    border-radius: 3px;
    padding: 0 2px;
}


/* ╔══════════════════════════════════════════════════╗
   ║           DASHBOARD / TABS                      ║
   ╚══════════════════════════════════════════════════╝ */

.dash-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 0;
}

.dash-avatar {
    width: 52px; height: 52px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-name { font-size: 18px; font-weight: 600; }
.dash-email { font-size: 12px; color: var(--text-muted); }

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--t-fast);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    padding: 20px 0;
}


/* ╔══════════════════════════════════════════════════╗
   ║                 PROGRESS                        ║
   ╚══════════════════════════════════════════════════╝ */

.progress-ring {
    width: 100px; height: 100px;
    position: relative;
}
.progress-ring svg {
    transform: rotate(-90deg);
}
.progress-ring circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}
.progress-ring .bg { stroke: var(--bg-elevated); }
.progress-ring .fill { stroke: var(--accent); transition: stroke-dashoffset var(--t-slow); }
.progress-ring .label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}


/* ╔══════════════════════════════════════════════════╗
   ║               EMPTY STATE                       ║
   ╚══════════════════════════════════════════════════╝ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .4;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.empty-state-text {
    font-size: 13px;
    max-width: 280px;
    margin: 0 auto;
}


/* ╔══════════════════════════════════════════════════╗
   ║               LOADING                           ║
   ╚══════════════════════════════════════════════════╝ */

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin .7s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,17,23,.8);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}


/* ╔══════════════════════════════════════════════════╗
   ║                MODAL                            ║
   ╚══════════════════════════════════════════════════╝ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(.95);
    transition: transform var(--t-base);
}
.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}


/* ╔══════════════════════════════════════════════════╗
   ║             UTILITY CLASSES                     ║
   ╚══════════════════════════════════════════════════╝ */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-rtl    { direction: rtl; }
.text-ltr    { direction: ltr; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

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

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}


/* ╔══════════════════════════════════════════════════╗
   ║           RESPONSIVE HELPERS                    ║
   ╚══════════════════════════════════════════════════╝ */

@media (max-width: 480px) {
    .hero-bismillah { font-size: 28px; }
    .hero-title { font-size: 18px; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .auth-card { padding: 32px 20px; }
}

@media (min-width: 768px) {
    .container { padding: 0 24px; }
    .hero { padding: 60px 20px 32px; }
    .hero-bismillah { font-size: 44px; }
    .hero-title { font-size: 28px; }
    .surah-item { padding: 16px 20px; }
}

@media (min-width: 1024px) {
    .quick-actions { max-width: 480px; }
}


/* ╔══════════════════════════════════════════════════╗
   ║              ANIMATIONS                         ║
   ╚══════════════════════════════════════════════════╝ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

.animate-in {
    animation: fadeInUp .4s ease both;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* ╔══════════════════════════════════════════════════╗
   ║              SPLASH SCREEN (APP INTRO)          ║
   ╚══════════════════════════════════════════════════╝ */

.splash-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background-color: #ffffff; /* Always light matching image */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    overflow: hidden;
    font-family: var(--font-ui);
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Background Pattern (Stars) */
.splash-bg-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(76,175,134,0.1) 2px, transparent 3px),
                      radial-gradient(circle at 80% 60%, rgba(76,175,134,0.15) 3px, transparent 4px),
                      radial-gradient(circle at 10% 80%, rgba(76,175,134,0.08) 1.5px, transparent 2.5px),
                      radial-gradient(circle at 90% 10%, rgba(76,175,134,0.12) 2.5px, transparent 3.5px);
    background-size: 150px 150px;
    z-index: 1;
}

.splash-top {
    z-index: 2;
    padding-top: 15vh;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.splash-calligraphy {
    width: 250px;
    height: 120px;
    margin: 0 auto;
}

.splash-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 1px;
    margin-top: 15px;
    text-transform: uppercase;
}

.splash-center {
    z-index: 2;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-20px);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.splash-book {
    width: 280px;
    max-width: 80%;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
}

.splash-bottom {
    position: relative;
    width: 100%;
    z-index: 2;
}

.splash-wave {
    width: 100%;
    line-height: 0;
}

.splash-wave svg {
    width: 100%;
    height: auto;
    display: block;
}

.splash-ceo {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.9;
    animation: fadeIn 1.2s ease-out 0.4s both;
}
