:root {
    --accent: #10b981;
    --primary: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #263548;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-ui: 'Outfit', sans-serif;
    --font-arabic: 'Amiri', serif;
    --font-urdu: 'Noori Nastaleeq', 'Amiri', serif;

    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow-soft: 0 4px 24px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 20px rgba(16,185,129,0.12);
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);
    --card-bg: var(--surface-color);
    --button-bg: var(--bg-color);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Themes ─── */
[data-theme="light"] {
    --bg-color: #f1f5f9; --surface-color: #ffffff; --surface-hover: #f8fafc;
    --border-color: rgba(0,0,0,0.08); --text-main: #0f172a; --text-muted: #475569; --text-dim: #94a3b8;
    --shadow-soft: 0 4px 24px rgba(0,0,0,0.06); --glass-bg: rgba(255,255,255,0.85);
    --accent-glow: rgba(16,185,129,0.08);
}
[data-theme="sepia"] {
    --bg-color: #f5ebe0; --surface-color: #fefcf3; --surface-hover: #f7f0e4;
    --border-color: rgba(139,69,19,0.1); --text-main: #3e2723; --text-muted: #6d4c41; --text-dim: #8d6e63;
    --glass-bg: rgba(254,252,243,0.85);
}
[data-theme="night-blue"] {
    --bg-color: #0a1628; --surface-color: #162032; --surface-hover: #1c2d44;
    --text-main: #e2e8f0; --border-color: rgba(255,255,255,0.06);
}
[data-theme="amoled"] {
    --bg-color: #000000; --surface-color: #0a0a0a; --surface-hover: #111111;
    --border-color: #1a1a1a; --text-main: #ffffff; --glass-bg: rgba(10,10,10,0.9);
}

/* ─── Accents ─── */
[data-color="blue"]    { --accent: #3b82f6; --primary: #3b82f6; --accent-hover: #2563eb; --accent-glow: rgba(59,130,246,0.15); }
[data-color="purple"]  { --accent: #8b5cf6; --primary: #8b5cf6; --accent-hover: #7c3aed; --accent-glow: rgba(139,92,246,0.15); }
[data-color="gold"]    { --accent: #f59e0b; --primary: #f59e0b; --accent-hover: #d97706; --accent-glow: rgba(245,158,11,0.15); }
[data-color="soft-red"]{ --accent: #ef4444; --primary: #ef4444; --accent-hover: #dc2626; --accent-glow: rgba(239,68,68,0.15); }

/* ─── Global Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-ui);
    background: var(--bg-color);
    color: var(--text-main);
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.hide-mobile { display: initial; }
.show-mobile { display: none !important; }

/* ─── Typography ─── */
.arabic-text { font-family: var(--font-arabic); font-size: 1.7rem; line-height: 2.4; text-align: right; direction: rtl; }
.urdu-text { font-family: var(--font-urdu); font-size: 1.5rem; line-height: 2.2; text-align: right; direction: rtl; }
.bismillah { font-family: var(--font-arabic); font-size: 2.2rem; text-align: center; color: var(--accent); padding: 1.5rem 0; opacity: 0.9; }

/* ─── Top Header Bar ─── */
.top-header {
    position: sticky; top: 0; z-index: 200;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}
.top-header .brand { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.top-header .brand i { font-size: 1.1rem; }
.top-header .header-actions { display: flex; align-items: center; gap: 0.6rem; }
.header-icon-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-color);
    background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 1rem;
}
.header-icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.header-search {
    flex: 1; max-width: 400px; margin: 0 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-pill); padding: 0.5rem 1rem; transition: var(--transition);
}
.header-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.header-search i { color: var(--text-dim); font-size: 0.9rem; }
.header-search input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-main); font-size: 0.95rem; font-family: inherit;
}
.header-search input::placeholder { color: var(--text-dim); }

/* ─── Page Container ─── */
.page-container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; padding-bottom: 100px; width: 100%; box-sizing: border-box; }

/* ─── Home Hero / Search ─── */
.home-pro-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.22), transparent 32%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.92));
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}
.home-pro-hero::before {
    content: '';
    position: absolute;
    inset: auto -15% -45% auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 70%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}
.bismillah-header {
    font-family: var(--font-arabic);
    color: var(--accent);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    opacity: 0.92;
}
.home-pro-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}
.home-pro-hero p {
    max-width: 680px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}
.global-search-container {
    margin-top: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 0.9rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    cursor: text;
}
.global-search-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.global-search-container .search-icon {
    color: var(--accent);
    font-size: 1rem;
}
.global-search-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}
.global-search-container input::placeholder {
    color: var(--text-dim);
}
.search-hint {
    white-space: nowrap;
    color: var(--text-dim);
    font-size: 0.82rem;
}
.search-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    font: inherit;
    font-weight: 600;
}

/* ─── Hero Section ─── */
.hero-section {
    text-align: center; padding: 2.5rem 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    border-radius: var(--radius-xl); margin-bottom: 2rem;
}
.hero-section .hero-arabic { font-family: var(--font-arabic); font-size: 2.4rem; color: var(--accent); margin-bottom: 0.5rem; opacity: 0.85; }
.hero-section h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.hero-section p { color: var(--text-muted); font-size: 1rem; }

/* ─── Quick Action Cards ─── */
.quick-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 2rem; overflow-x: auto; padding-bottom: 0.5rem; }
.qa-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.2rem 1.8rem; min-width: 120px;
    transition: var(--transition); cursor: pointer;
}
.qa-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.qa-card .qa-icon { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.qa-card span { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* ─── Horizontal Scroll Section ─── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.section-header h2 i { color: var(--accent); }
.section-header .sub-text { color: var(--text-dim); font-size: 0.85rem; }

.h-scroll { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.juz-chip {
    min-width: 60px; text-align: center; padding: 0.7rem 0.5rem;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); cursor: pointer; transition: var(--transition);
}
.juz-chip:hover, .juz-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.juz-chip .juz-num { font-size: 1.1rem; font-weight: 600; }
.juz-chip .juz-label { font-size: 0.7rem; color: var(--text-dim); }

/* ─── Filter Chips ─── */
.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
    padding: 0.4rem 1rem; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500;
    border: 1px solid var(--border-color); background: transparent; color: var(--text-muted);
    transition: var(--transition);
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ─── Surah List Cards ─── */
.surah-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.surah-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1rem;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); transition: var(--transition); cursor: pointer;
    width: 100%; box-sizing: border-box;
}
.surah-item:hover { border-color: var(--accent); background: var(--surface-hover); }
.surah-number {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; color: var(--accent);
    background: var(--accent-glow); border-radius: var(--radius-sm);
}
.surah-info { flex: 1; }
.surah-info .surah-name-en { font-weight: 600; font-size: 0.95rem; }
.surah-info .surah-meta { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.surah-arabic { font-family: var(--font-arabic); font-size: 1.2rem; color: var(--text-muted); }

/* ─── Ayah Cards (Reader View) ─── */
.reader-settings-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
    padding: 0.8rem 1rem; background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}
.reader-settings-bar select, .reader-settings-bar button {
    padding: 0.45rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.85rem;
    background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-main);
    outline: none; transition: var(--transition); font-family: inherit;
}
.reader-settings-bar select:focus, .reader-settings-bar button:hover { border-color: var(--accent); }
.reader-settings-bar button.active { background: var(--accent); color: white; border-color: var(--accent); }

.ayah-card {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.2rem 1rem; margin-bottom: 0.8rem;
    transition: var(--transition); position: relative;
}
.ayah-card:hover { border-color: var(--accent); }
.ayah-card .ayah-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.ayah-num-badge {
    background: var(--accent-glow); color: var(--accent); font-weight: 600; font-size: 0.85rem;
    padding: 0.3rem 0.7rem; border-radius: var(--radius-pill);
}
.ayah-actions { display: flex; gap: 0.4rem; }
.ayah-action-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-color);
    background: transparent; color: var(--text-dim); display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: var(--transition);
}
.ayah-action-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.ayah-card .ayah-arabic { font-family: var(--font-arabic); font-size: 1.6rem; line-height: 2.4; text-align: right; direction: rtl; margin-bottom: 0.5rem; }
.ayah-card .translation-en { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; padding-top: 0.5rem; border-top: 1px dashed var(--border-color); display: none; }
.ayah-card .translation-ur { font-family: var(--font-urdu); color: var(--text-muted); font-size: 1.2rem; line-height: 2; direction: rtl; text-align: right; padding-top: 0.5rem; display: none; }
.ayah-card .translation-en.visible, .ayah-card .translation-ur.visible { display: block; }

/* ─── Floating Audio Player ─── */
.mini-player {
    position: fixed; bottom: 75px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 2rem); max-width: 500px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 0.8rem 1rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3); z-index: 300;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.mini-player.hidden { transform: translate(-50%, 150%); opacity: 0; pointer-events: none; }
.mini-player .player-info { flex: 1; min-width: 0; }
.mini-player .player-info .player-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player .player-info .player-sub { font-size: 0.75rem; color: var(--text-dim); }
.mini-player .player-controls { display: flex; align-items: center; gap: 0.6rem; }
.player-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-main); display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: var(--transition);
}
.player-btn:hover { color: var(--accent); }
.player-btn.play-main {
    width: 42px; height: 42px; background: var(--accent); color: white; font-size: 1.1rem;
}
.player-btn.play-main:hover { background: var(--accent-hover); }
.player-btn.close-player { font-size: 0.85rem; color: var(--text-dim); }

/* ─── FAB Button ─── */
.fab {
    position: fixed; bottom: 85px; right: 1.5rem; z-index: 250;
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: var(--accent); color: white; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(16,185,129,0.4); cursor: pointer;
    transition: var(--transition);
}
.fab:hover { transform: scale(1.08); background: var(--accent-hover); }

/* ─── Bottom Navigation ─── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200;
    display: flex; justify-content: space-around; align-items: center;
    padding: 0.6rem 0; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
}
.bottom-nav .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    color: var(--text-dim); font-size: 0.7rem; transition: var(--transition); padding: 0.3rem 0.6rem;
}
.bottom-nav .nav-item i { font-size: 1.2rem; }
.bottom-nav .nav-item.active { color: var(--accent); }
.bottom-nav .nav-item:hover { color: var(--accent); }

/* ─── Cards / Panels ─── */
.card {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.2rem; transition: var(--transition);
}
.card:hover { border-color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.7rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 500; }
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-info { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; border: none; transition: var(--transition); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Loading ─── */
.loading-spinner { text-align: center; padding: 3rem; color: var(--accent); font-size: 1.5rem; }

/* ─── Modal ─── */
.modal { display: none; position: fixed; z-index: 1000; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.modal-content {
    background: var(--surface-color); margin: 8vh auto; padding: 2rem; border-radius: var(--radius-xl);
    width: 92%; max-width: 460px; border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.close { color: var(--text-muted); font-size: 1.6rem; cursor: pointer; transition: var(--transition); background: none; border: none; }
.close:hover { color: var(--accent); }
.theme-options, .color-options { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0 1.5rem; }
.theme-options button { padding: 0.45rem 0.9rem; border-radius: var(--radius-pill); background: transparent; border: 1px solid var(--border-color); color: var(--text-main); font-size: 0.85rem; transition: var(--transition); }
.theme-options button:hover { border-color: var(--accent); }
.color-options .c-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; transition: var(--transition); }
.color-options .c-btn:hover { transform: scale(1.15); }

/* ─── Hadith Book Cards ─── */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.book-card {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.5rem; cursor: pointer;
    transition: var(--transition); position: relative; overflow: hidden;
}
.book-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.book-card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.book-card p { color: var(--text-dim); font-size: 0.85rem; }
.book-card .icon-bg { position: absolute; right: -15px; bottom: -15px; font-size: 5rem; opacity: 0.04; color: var(--accent); }

/* ─── Hadith Items ─── */
.hadith-list { display: flex; flex-direction: column; gap: 1rem; }
.hadith-item { background: var(--surface-color); padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border-color); }
.hadith-item:hover { border-color: var(--accent); }
.hadith-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-color); }
.hadith-number { font-weight: 700; color: var(--accent); }

/* ─── Search Page ─── */
.search-big-box {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); padding: 2rem; text-align: center; margin-bottom: 2rem;
}
.search-big-input {
    width: 100%; max-width: 500px; margin: 1rem auto 0;
    padding: 0.9rem 1rem 0.9rem 2.8rem; font-size: 1.1rem;
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-pill);
    color: var(--text-main); outline: none; transition: var(--transition); font-family: inherit;
}
.search-big-input:focus { border-color: var(--accent); box-shadow: var(--shadow-glow); }

/* ─── Responsive / Mobile ─── */
@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .page-container { padding-bottom: 2rem; }
    .mini-player { bottom: 1.5rem; }
    .fab { bottom: 2rem; }
}
/* ── Main Layout (Desktop Sidebar) ── */
.app-layout { display: flex; min-height: calc(100vh - 65px); }
@media (max-width: 767px) {
    .app-layout { display: block; }
}
.app-sidebar { 
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0);
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    .app-sidebar {
        position: sticky;
        top: 65px;
        left: 0;
        height: calc(100vh - 65px);
        width: 260px;
        transform: none;
        z-index: 90;
        box-shadow: none;
    }
}
.sidebar-nav { flex: 1; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.side-item { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    padding: 0.9rem 1.2rem; 
    color: var(--text-muted); 
    text-decoration: none; 
    border-radius: var(--radius-md); 
    font-weight: 500;
    transition: 0.2s;
}
.side-item i { font-size: 1.2rem; min-width: 24px; text-align: center; }
.side-item:hover, .side-item.active { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.sidebar-brand-wrap {
    padding: 1.1rem 1rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(16,185,129,0.14), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(16,185,129,0.14);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar-brand-text strong {
    font-size: 1rem;
    line-height: 1.1;
    color: var(--text-main);
}
.sidebar-brand-text small {
    margin-top: 0.2rem;
    color: var(--text-dim);
    font-size: 0.76rem;
    line-height: 1.35;
}
.sidebar-bottom { padding: 1.5rem; border-top: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* ── Collapsed Sidebar ── */
body.sidebar-collapsed .app-sidebar { width: 80px; }
body.sidebar-collapsed .side-item span,
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-bottom p { display: none; }
body.sidebar-collapsed .side-item { justify-content: center; padding: 0.9rem; }
body.sidebar-collapsed .side-item i { font-size: 1.4rem; }
body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0.75rem;
}

/* ── Responsive Refinements ── */
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.sidebar-trigger { border: none; background: transparent; cursor: pointer; display: flex; color: var(--text-muted); font-size: 1.1rem; padding: 0.4rem; }
.sidebar-trigger:hover { color: var(--accent); }
@media (min-width: 768px) {
    .sidebar-trigger { display: flex; } /* Always available for collapse/open */
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .page-container { flex: 1; padding: 2.5rem; max-width: 100%; overflow-x: hidden; }
}

/* Mobile Sidebar Active State */
body.mobile-sidebar-open .app-sidebar { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
body.mobile-sidebar-open #sidebarOverlay { display: block !important; opacity: 1; }

.header-search .hide-mobile { display: block; }
@media (max-width: 767px) {
    .header-search { flex: 0 0 40px; background: transparent !important; border: none !important; margin: 0 !important; padding: 0 !important; }
    .header-search .hide-mobile { display: none !important; }
    .header-search i { font-size: 1.25rem; color: var(--accent); cursor: pointer; padding: 10px; }
}

/* ── Pro Toast Notification System ── */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.toast-item {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 280px;
    animation: toast-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    pointer-events: auto;
}
.toast-item i { font-size: 1.25rem; }
.toast-item.success i { color: #10b981; }
.toast-item.error i { color: #ef4444; }
.toast-item.warning i { color: #f59e0b; }
.toast-item.info i { color: #3b82f6; }

.toast-item.fade-out {
    animation: toast-out 0.5s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

@media (max-width: 767px) {
    .toast-container { top: 1rem; right: 1rem; left: 1rem; }
    .toast-item { min-width: auto; }
}

/* ── Final Layout Tweaks ── */
.app-layout { transition: margin 0.3s ease; }
body.sidebar-collapsed .page-container { max-width: 100vw; }

/* ── Audio Pulse ── */
.playing-pulse {
    animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── More responsive tweaks ── */
/* Mobile Search Icon Perfection */
@media (max-width: 767px) {
    .header-search { background: transparent; border: none; max-width: 40px; margin: 0; box-shadow: none; }
    .header-search .hide-mobile { display: none; }
    .header-search:focus-within { box-shadow: none; border: none; }
    .header-search i { font-size: 1.2rem; color: var(--accent); padding: 0.5rem; }
}
.hidden { display: none !important; }

/* ─── Enhancement Pack ─── */
.header-hijri-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    background: var(--surface-color);
}
.theme-section-title {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.theme-picker-block + .theme-picker-block { margin-top: 1rem; }
.theme-options .t-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.color-options .c-btn.active {
    border-color: white;
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: scale(1.08);
}
.mini-player-toggle {
    position: fixed;
    right: 1.25rem;
    bottom: 150px;
    z-index: 280;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}
.search-result-card {
    display: block;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.85rem;
    transition: var(--transition);
}
.search-result-card:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}
.search-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.search-result-ref { color: var(--text-dim); font-size: 0.8rem; }
.search-result-arabic {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    text-align: right;
    direction: rtl;
    margin-bottom: 0.75rem;
}
.search-result-meta { color: var(--text-muted); font-size: 0.88rem; }
.continue-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.continue-card, .compact-stat {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}
.continue-card h3, .compact-stat h3 { font-size: 1.2rem; margin: 0.65rem 0 0.35rem; }
.continue-card p, .compact-stat p { color: var(--text-dim); font-size: 0.92rem; }
.prayer-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}
.prayer-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
}
.prayer-item i {
    color: var(--accent);
    font-size: 1rem;
}
.prayer-item strong {
    color: var(--text-main);
}
.prayer-item.loading-p {
    width: 100%;
    justify-content: center;
    color: var(--text-muted);
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dua-card h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.dua-arabic {
    font-family: var(--font-arabic);
    font-size: 1.7rem;
    line-height: 2.1;
    text-align: right;
    direction: rtl;
    margin-bottom: 1rem;
}
.dua-translation { color: var(--text-muted); line-height: 1.7; }
.dua-ref { margin-top: 1rem; color: var(--accent); font-size: 0.85rem; display: inline-flex; gap: 0.4rem; align-items: center; }
.event-list { display: flex; flex-direction: column; gap: 0.85rem; }
.event-item {
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.event-item h4 { margin-bottom: 0.2rem; font-size: 1rem; }
.event-item p { color: var(--text-dim); font-size: 0.85rem; }
.event-badge {
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-pill);
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
}
.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.quick-tool-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.quick-tool-card i {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.quick-tool-card h3 { margin-bottom: 0.35rem; }
.quick-tool-card p { color: var(--text-dim); font-size: 0.88rem; line-height: 1.6; }
.reader-subnote {
    margin-bottom: 1rem;
    color: var(--text-dim);
    text-align: center;
    font-size: 0.9rem;
}
.social-like-btn.active,
.ayah-action-btn.active {
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
}
.progress-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    align-items: center;
}
.progress-hero h2 { margin: 0.75rem 0 0.35rem; font-size: 1.75rem; }
.progress-last-read { color: var(--text-dim); font-size: 0.92rem; }
.progress-circle-wrap { display: flex; justify-content: center; }
.progress-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--accent) 0% 0%, var(--accent-glow) 0% 100%);
}
.progress-circle span {
    width: 122px;
    height: 122px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-color);
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 700;
}
.surah-progress-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.surah-progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.88rem;
}
.surah-progress-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.zakat-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
}
.zakat-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}
.zakat-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.zakat-form-grid input {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
}
.zakat-form-grid input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.zakat-switcher {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.zakat-result-card h2 {
    margin: 1rem 0 0.4rem;
    font-size: 2.25rem;
    color: var(--accent);
}
.zakat-result-card > p { color: var(--text-muted); line-height: 1.7; }
.zakat-breakdown {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.zakat-breakdown-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}
.zakat-note {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
}
.zakat-note i { color: var(--accent); margin-top: 0.15rem; }
@media (max-width: 900px) {
    .continue-row,
    .feature-grid,
    .progress-hero,
    .zakat-grid,
    .quick-tools-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: inline-flex !important; }
    .top-header {
        padding: 0.85rem 0.9rem;
        gap: 0.65rem;
    }
    .header-left {
        min-width: 0;
        flex: 1;
    }
    .top-header .brand {
        min-width: 0;
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .home-pro-hero {
        padding: 1.35rem 1rem 1.1rem;
        border-radius: 24px;
    }
    .bismillah-header {
        font-size: 1rem;
    }
    .home-pro-hero h1 {
        font-size: 2.1rem;
    }
    .global-search-container {
        padding: 0.85rem 0.95rem;
        gap: 0.7rem;
        flex-wrap: wrap;
    }
    .search-hint {
        width: 100%;
        font-size: 0.78rem;
    }
    .continue-card, .compact-stat { flex-direction: column; align-items: flex-start; }
    .prayer-strip {
        display: grid;
        grid-template-columns: 1fr;
    }
    .prayer-item {
        width: 100%;
    }
    .zakat-form-grid { grid-template-columns: 1fr; }
    .event-item { align-items: flex-start; flex-direction: column; }
    .header-hijri-pill { display: none; }
    .search-drawer-overlay { padding: 0.75rem; }
    .search-drawer-container {
        height: calc(100vh - 1.5rem);
        max-width: 100%;
        border-radius: 20px;
    }
    .search-drawer-header {
        padding: 1rem;
        align-items: stretch;
    }
    .search-input-wrapper {
        padding: 0.75rem 0.95rem;
    }
    #drawerSearchInput {
        font-size: 1rem;
    }
    .search-close-btn {
        padding: 0.75rem 0.95rem;
    }
    .mini-player-toggle { bottom: 135px; }
}

