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

/* ============================================
   تصميم الجامع — زمردي + ذهبي + إعدادات
   ============================================ */

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

/* ============ المتغيرات ============ */
:root {
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --surface-hover: #F7F7F2;
    --border: #E5E7EB;
    --border-light: #F3F4F6;

    --text: #1F2937;
    --text-secondary: #374151;
    --text-muted: #6B7280;

    --primary: #059669;
    --primary-hover: #047857;
    --primary-soft: #ECFDF5;
    --primary-border: #A7F3D0;

    --gold: #B8860B;
    --gold-hover: #966F08;
    --gold-soft: #FAF3DD;
    --gold-border: #E0CC94;

    --danger: #DC2626;
    --danger-soft: #FEF2F2;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

    --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
    --kufi-font: 'Amiri', serif;

    --sidebar-width: 240px;
    --sidebar-gap: 16px;
    --sidebar-total: calc(var(--sidebar-width) + var(--sidebar-gap) + 16px);

    --sidebar-bg: #047857;
    --sidebar-bg-hover: #065F46;
    --sidebar-border: rgba(255, 255, 255, 0.15);
    --sidebar-text: #FFFFFF;
    --sidebar-icon: #FCD34D;
    --sidebar-active-bg: rgba(255, 255, 255, 0.15);
    --sidebar-active-stripe: #FCD34D;
}

/* ============ الجسم ============ */
body {
    font-family: var(--font-arabic);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-right: var(--sidebar-total);
    transition: background 0.25s ease, color 0.25s ease;
}

/* كلاسات تبديل الخط */
body.font-amiri {
    --font-arabic: 'Amiri', serif;
    --kufi-font: 'Amiri', serif;
}

body.font-kufi {
    --font-arabic: 'Reem Kufi', 'Noto Kufi Arabic', sans-serif;
    --kufi-font: 'Reem Kufi', 'Noto Kufi Arabic', sans-serif;
}

/* ============ الحاويات ============ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.hero {
    text-align: center;
    padding: 16px;
    width: 100%;
    max-width: 720px;
}

.hero-title {
    font-family: var(--font-arabic);
    font-weight: 700;
    font-size: clamp(2rem, 7vw, 4rem);
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ============ الأزرار ============ */
.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
}

.main-btn {
    font-family: var(--font-arabic);
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    font-weight: 600;
    color: #fff;
    padding: 14px 24px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.main-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.main-btn:focus { outline: none; }
.main-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 8px 12px;
    font-family: var(--font-arabic);
    font-size: clamp(0.82rem, 1.8vw, 0.92rem);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
    background: var(--surface-hover);
    border-color: #D1D5DB;
}

.back-btn:focus { outline: none; }
.back-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.back-btn svg { flex-shrink: 0; }

/* ============ الشريط العلوي ============ */
.page-topbar {
    position: fixed;
    top: 0;
    right: var(--sidebar-total);
    left: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    padding: 0 clamp(16px, 3vw, 32px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.page-topbar .back-btn { flex-shrink: 0; }

.page-topbar-title {
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-arabic);
    font-weight: 600;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--text);
    margin: 0;
}

/* ============ شريط البحث ============ */
.search-container {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 480px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 38px 9px 14px;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.25s ease;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* ============ المحتوى ============ */
.quran-wrapper {
    padding-top: 120px;
    align-items: flex-start;
    justify-content: flex-start;
}

.surah-grid {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.surah-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: clamp(18px, 3vw, 24px);
    text-align: center;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.15s ease, background 0.15s ease;
    transition-delay: var(--stagger-delay, 0ms);
    cursor: pointer;
}

.surah-card.is-visible { opacity: 1; transform: translateY(0); }

.surah-card.is-visible:hover {
    border-color: #D1D5DB;
    background: var(--surface-hover);
}

.surah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    margin-bottom: 12px;
    font-family: var(--font-arabic);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--gold-border);
    border-radius: 999px;
}

.surah-name {
    font-family: var(--font-arabic);
    font-weight: 700;
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
}

.surah-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: clamp(0.82rem, 1.8vw, 0.92rem);
    color: var(--text-muted);
}

.surah-ayahs, .surah-type {
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 999px;
}

.loading-message, .error-message, .no-results-message {
    text-align: center;
    font-family: var(--font-arabic);
    font-size: 1rem;
    color: var(--text-muted);
    padding: 40px 20px;
}

a.surah-card {
    color: var(--text);
    text-decoration: none;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

a.surah-card:focus { outline: none; }
a.surah-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============ أزرار الخط ============ */
.font-controls { display: flex; align-items: center; gap: 10px; }

.font-btn {
    width: 40px; height: 40px; padding: 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-arabic);
    font-size: 1rem; font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.font-btn:hover:not(:disabled) { background: var(--surface-hover); border-color: #D1D5DB; }
.font-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.font-btn:focus { outline: none; }
.font-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.font-display {
    font-family: var(--font-arabic);
    font-size: 0.85rem; font-weight: 500;
    min-width: 48px; text-align: center;
    color: var(--text-muted);
}

.font-controls-bar {
    position: fixed; bottom: 0; right: var(--sidebar-total); left: 0; z-index: 100;
    height: 60px; padding: 0 20px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

/* ============ صفحة السورة ============ */
.surah-topbar { height: 52px; min-height: 52px; }

.surah-topbar .page-topbar-title {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 160px);
    text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem); margin: 0; pointer-events: none;
}

.surah-main {
    min-height: 100vh;
    padding: 52px clamp(12px, 4vw, 48px) 60px;
    display: flex; flex-direction: column; align-items: stretch;
}

.ayahs-container {
    width: 100%; max-width: 900px; margin: 0 auto;
    padding: clamp(16px, 3vw, 28px);
    text-align: justify; line-height: 2.4;
}

.ayah {
    font-family: var(--font-arabic);
    font-size: calc(1.3rem * var(--font-scale, 1));
    color: var(--text);
    transition: font-size 0.2s ease;
}

.ayah-number {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.8em; height: 1.8em; padding: 0 0.3em;
    margin: 0 0.35em 0 0.55em;
    font-family: var(--font-arabic);
    font-size: calc(0.7rem * var(--font-scale, 1));
    font-weight: 700; color: var(--gold); line-height: 1;
    background: var(--gold-soft);
    border: 1px solid var(--gold-border);
    border-radius: 999px;
    vertical-align: middle;
    transition: font-size 0.2s ease;
}

/* ============ مربع الحوار ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(31, 41, 55, 0.45);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.modal {
    position: relative; width: 100%; max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease, background 0.25s ease;
}

.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }

.modal-title {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    color: var(--text); text-align: center; margin-bottom: 20px;
}

.modal-options { display: flex; flex-direction: column; gap: 10px; }

.modal-option {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text); text-decoration: none;
    font-family: var(--font-arabic);
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-option:hover { background: var(--surface-hover); border-color: #D1D5DB; }
.modal-option svg { flex-shrink: 0; color: var(--primary); }

.modal-close {
    position: absolute; top: 12px; left: 12px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--border);
    font-size: 0.9rem; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}

.modal-close:hover { background: var(--border-light); }

/* ============ عناوين السور ============ */
.surah-heading {
    display: block; text-align: center;
    font-family: var(--font-arabic); font-weight: 700;
    font-size: calc(1.15rem * var(--font-scale, 1));
    color: var(--text);
    margin: 28px 0 14px; padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: font-size 0.2s ease;
}

.surah-heading:first-child { margin-top: 0; }

/* ============ التبويبات ============ */
.index-tabs {
    position: fixed; top: 60px; right: var(--sidebar-total); left: 0; z-index: 99;
    height: 44px; padding: 6px 8px;
    display: flex; gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.index-tab {
    flex: 1; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-arabic);
    font-size: clamp(0.82rem, 2vw, 0.92rem);
    font-weight: 500; color: var(--text-muted);
    text-decoration: none; border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.index-tab.active { color: #fff; font-weight: 600; background: var(--primary); }
.index-tab:hover:not(.active) { background: var(--bg); color: var(--text); }
.index-tab:focus { outline: none; }
.index-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============ إصلاح البطاقات ============ */
#surah-grid, #juz-grid, #hizb-grid, .surah-grid {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 10px; width: 100%;
}

#surah-grid > *, #juz-grid > *, #hizb-grid > *, .surah-grid > * {
    display: block; width: 100%; box-sizing: border-box; flex-shrink: 0;
}

/* ============ الأحاديث ============ */
.hadith-topbar { gap: 12px; }

.hadith-wrapper {
    padding-top: 84px;
    align-items: flex-start; justify-content: flex-start;
    flex-direction: column; gap: 14px;
}

.hadith-container {
    width: 100%; max-width: 900px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 12px;
}

.hadith-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: clamp(16px, 3vw, 22px);
    box-shadow: var(--shadow-sm);
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease;
}

.hadith-card.is-visible { opacity: 1; transform: translateY(0); }

.hadith-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}

.hadith-number {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    font-family: var(--font-arabic); font-size: 0.9rem; font-weight: 700;
    color: var(--gold); background: var(--gold-soft);
    border: 1px solid var(--gold-border); border-radius: 999px;
}

.hadith-source {
    font-family: var(--font-arabic); font-size: clamp(0.78rem, 1.8vw, 0.88rem);
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--gold-border);
    border-radius: 999px; padding: 3px 10px;
}

.hadith-text {
    font-family: var(--font-arabic);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 2.1; color: var(--text); text-align: justify;
    margin-bottom: 12px; max-width: 820px; margin-left: auto; margin-right: auto;
}

.hadith-meta {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    font-family: var(--font-arabic); font-size: clamp(0.75rem, 1.7vw, 0.85rem);
    color: var(--text-muted);
}

.hadith-ref {
    padding: 3px 10px; background: var(--bg);
    border: 1px solid var(--border-light); border-radius: 999px;
}

/* ============ قائمة اختيار الكتاب ============ */
.book-select-wrapper {
    position: relative; flex-shrink: 0;
    width: min(260px, calc(100vw - 110px));
}

.book-select {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px;
    font-family: var(--font-arabic); font-size: 0.88rem; font-weight: 500;
    color: var(--text); text-align: right;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; outline: none;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.book-select:hover { background: var(--surface-hover); border-color: #D1D5DB; }
.book-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.book-select-icon { flex-shrink: 0; color: var(--primary); }
.book-select-label { flex: 1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-select-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s ease; }
.book-select[aria-expanded="true"] .book-select-arrow { transform: rotate(180deg); }

.book-select-menu {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 200;
    list-style: none; margin: 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: min(320px, 60vh); overflow-y: auto;
    scrollbar-width: none; -ms-overflow-style: none;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.book-select-menu::-webkit-scrollbar { display: none; }
.book-select-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.book-option {
    padding: 10px 12px;
    font-family: var(--font-arabic); font-size: 0.88rem;
    color: var(--text); text-align: right;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.12s ease;
}

.book-option:hover { background: var(--bg); }
.book-option.is-selected { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ============ القراء ============ */
.reciter-main {
    min-height: 100vh; padding-top: 60px; padding-bottom: 150px;
    display: flex; align-items: center; justify-content: center;
}

.reciter-circle-wrap {
    position: relative; width: min(80vw, 380px); aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
}

.visualizer-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.reciter-name-overlay {
    position: relative; z-index: 2; text-align: center; padding: 20px;
    display: flex; flex-direction: column; gap: 4px; pointer-events: none;
}

.reciter-name-display {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.25rem, 4.5vw, 1.8rem); line-height: 1.5; color: var(--text);
}

.reciter-surah-kufi {
    font-family: var(--font-arabic); font-size: clamp(0.82rem, 2.5vw, 1rem);
    color: var(--text-muted);
}

.reciter-player-bar {
    position: fixed; bottom: 0; right: var(--sidebar-total); left: 0; z-index: 100;
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px clamp(16px, 4vw, 28px) 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.reciter-player-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }

.custom-select { position: relative; flex: 1; min-width: 130px; }

.custom-select-trigger {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 42px;
    padding: 0 12px;
    font-family: var(--font-arabic); font-size: 0.85rem; font-weight: 500;
    color: var(--text); text-align: right;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.custom-select-trigger:hover:not(:disabled) { background: var(--surface-hover); border-color: #D1D5DB; }
.custom-select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.custom-select-trigger > svg:first-child { flex-shrink: 0; color: var(--primary); }
.custom-select-label { flex: 1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s ease; }
.custom-select-trigger[aria-expanded="true"] .custom-select-arrow { transform: rotate(180deg); }

.custom-select-menu {
    position: absolute; bottom: calc(100% + 6px); right: 0; left: 0; z-index: 300;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.custom-select-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select-search { padding: 8px; border-bottom: 1px solid var(--border-light); }

.custom-select-search input {
    width: 100%; padding: 8px 10px;
    font-family: var(--font-arabic); font-size: 0.82rem;
    color: var(--text); background: var(--bg);
    border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    outline: none;
}

.custom-select-search input:focus { border-color: var(--primary); background: var(--surface); }

.custom-select-list {
    list-style: none; margin: 0; padding: 6px;
    max-height: 240px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.custom-select-item {
    padding: 9px 12px;
    font-family: var(--font-arabic); font-size: 0.85rem;
    color: var(--text); text-align: right;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.12s ease;
}

.custom-select-item:hover { background: var(--bg); }
.custom-select-item.is-selected { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.reciter-toggles { display: flex; gap: 6px; flex-shrink: 0; }

.toggle-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 42px; padding: 0 12px;
    font-family: var(--font-arabic); font-size: 0.8rem; font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toggle-btn:hover { background: var(--surface-hover); border-color: #D1D5DB; }
.toggle-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.toggle-btn svg { flex-shrink: 0; }

.reciter-controls { display: flex; align-items: center; gap: 10px; }

.player-btn {
    width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
    border: none; background: var(--primary); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.player-btn:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.player-btn:disabled { opacity: 0.35; cursor: not-allowed; background: #D1D5DB; }
.player-btn:focus { outline: none; }
.player-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.seek-bar { flex: 1; height: 6px; accent-color: var(--primary); cursor: pointer; }

.time-display {
    font-family: var(--font-arabic); font-size: 0.78rem; color: var(--text-muted);
    min-width: 84px; text-align: center; white-space: nowrap;
}

/* ============ الإذاعة ============ */
.radio-main {
    min-height: 100vh; padding: 60px 16px 120px;
    display: flex; align-items: center; justify-content: center;
}

.radio-circle-wrap {
    position: relative; width: min(85vw, 380px); aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
}

.radio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.radio-name-overlay {
    position: relative; z-index: 2; text-align: center; padding: 24px;
    display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}

.radio-live-badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    align-self: center; padding: 4px 10px;
    font-family: var(--font-arabic); font-size: 0.7rem; font-weight: 500;
    color: var(--primary-hover);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: 999px;
}

.radio-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary);
    animation: radio-pulse 1.6s ease-in-out infinite;
}

@keyframes radio-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.radio-station-name {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.3rem, 5vw, 1.9rem); line-height: 1.4; color: var(--text);
}

.radio-player-bar {
    position: fixed; bottom: 0; right: var(--sidebar-total); left: 0; z-index: 100;
    padding: 14px clamp(16px, 4vw, 28px) 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.radio-controls { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; }
.player-btn-small { width: 40px; height: 40px; }
.radio-volume-slider { flex: 1; max-width: 160px; height: 6px; accent-color: var(--primary); cursor: pointer; }

.radio-status {
    font-family: var(--font-arabic); font-size: 0.78rem; color: var(--text-muted);
    min-width: 100px; text-align: center; white-space: nowrap;
}

/* ============ مواقيت الصلاة ============ */
.prayer-main {
    min-height: 100vh; padding: 60px clamp(16px, 4vw, 32px) 32px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    max-width: 760px; margin: 0 auto;
}

.prayer-location-selector { width: 100%; display: flex; justify-content: center; }
#city-dropdown { width: min(340px, 100%); position: relative; }
#city-dropdown .custom-select-trigger { height: 46px; font-size: 0.92rem; }
#city-dropdown .custom-select-menu { bottom: auto; top: calc(100% + 6px); max-height: 320px; }
#city-dropdown .custom-select-list { max-height: 240px; }

.prayer-date-card {
    width: 100%; text-align: center;
    padding: clamp(18px, 4vw, 28px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 4px;
}

.prayer-hijri {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.15rem, 4vw, 1.5rem); color: var(--text);
}

.prayer-gregorian { font-family: var(--font-arabic); font-size: clamp(0.88rem, 2.2vw, 1rem); color: var(--text-muted); }

.prayer-location {
    font-family: var(--font-arabic); font-size: clamp(0.82rem, 2vw, 0.95rem);
    color: var(--text-muted); padding-top: 4px; border-top: 1px solid var(--border-light);
}

.prayer-grid { width: 100%; display: flex; flex-direction: column; gap: 8px; }

.prayer-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: clamp(14px, 3vw, 20px) clamp(16px, 3vw, 24px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.prayer-card.is-next { background: var(--primary-soft); border-color: var(--primary-border); }

.prayer-name {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.05rem, 2.8vw, 1.3rem); color: var(--text);
}

.prayer-card.is-next .prayer-name { color: var(--primary-hover); }

.prayer-time {
    font-family: var(--font-arabic); font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--text);
    direction: ltr; unicode-bidi: embed;
}

.refresh-prayer-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px;
    font-family: var(--font-arabic); font-size: clamp(0.88rem, 2.2vw, 0.98rem); font-weight: 600;
    color: #fff; background: var(--primary); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.refresh-prayer-btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.refresh-prayer-btn:focus { outline: none; }
.refresh-prayer-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============ السيرة ============ */
.seerah-main {
    min-height: 100vh; padding: 60px clamp(16px, 4vw, 32px) 32px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    max-width: 860px; margin: 0 auto;
}

.seerah-intro {
    font-family: var(--font-arabic); font-size: clamp(0.88rem, 2.2vw, 1rem);
    color: var(--text-muted); text-align: center; line-height: 1.8; max-width: 560px;
}

.seerah-grid { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.seerah-category-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: clamp(16px, 4vw, 24px) clamp(18px, 3vw, 28px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none; color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.seerah-category-card:hover { background: var(--surface-hover); border-color: #D1D5DB; }

.seerah-category-title {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(1.05rem, 3vw, 1.25rem); flex: 1;
}

.seerah-category-count {
    font-family: var(--font-arabic); font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--gold); white-space: nowrap; padding: 3px 10px;
    background: var(--gold-soft); border: 1px solid var(--gold-border);
    border-radius: 999px;
}

.seerah-chapter-main {
    min-height: 100vh; padding: 60px clamp(16px, 4vw, 32px) 130px;
    max-width: 860px; margin: 0 auto;
}

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

.episode-card {
    display: flex; align-items: center; gap: 12px;
    padding: clamp(12px, 3vw, 18px) clamp(14px, 3vw, 20px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.episode-card:hover { background: var(--surface-hover); border-color: #D1D5DB; }
.episode-card.is-playing { background: var(--primary-soft); border-color: var(--primary-border); }

.episode-number {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    min-width: 34px; height: 34px; padding: 0 8px;
    font-family: var(--font-arabic); font-size: 0.82rem; font-weight: 700;
    color: var(--gold); background: var(--gold-soft);
    border: 1px solid var(--gold-border); border-radius: 999px;
}

.episode-title {
    flex: 1; font-family: var(--font-arabic); font-weight: 500;
    font-size: clamp(0.88rem, 2.2vw, 1rem); color: var(--text); line-height: 1.5;
}

.episode-duration {
    flex-shrink: 0; font-family: var(--font-arabic); font-size: 0.75rem;
    color: var(--text-muted); direction: ltr; white-space: nowrap;
}

.seerah-player-bar {
    position: fixed; bottom: 0; right: var(--sidebar-total); left: 0; z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px clamp(16px, 4vw, 28px) 14px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.seerah-player-info { max-width: 860px; margin: 0 auto; width: 100%; }

.seerah-now-playing {
    font-family: var(--font-arabic); font-size: 0.82rem; font-weight: 500;
    color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}

.seerah-player-controls { display: flex; align-items: center; gap: 8px; max-width: 860px; margin: 0 auto; width: 100%; }

.transcript-btn {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 38px; padding: 0 12px;
    font-family: var(--font-arabic); font-size: 0.78rem; font-weight: 500;
    color: var(--text-secondary); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.transcript-btn:hover:not(:disabled) { background: var(--surface-hover); border-color: #D1D5DB; }
.transcript-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.transcript-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(31, 41, 55, 0.45);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}

.transcript-overlay[hidden] { display: none; }

.transcript-modal {
    position: relative; width: 100%; max-width: 640px; max-height: 80vh;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.transcript-title {
    font-family: var(--font-arabic); font-size: 1.05rem; font-weight: 700;
    color: var(--text); padding: 16px 48px 10px 18px;
    border-bottom: 1px solid var(--border-light);
}

.transcript-content {
    padding: 16px 20px; overflow-y: auto;
    font-family: var(--font-arabic);
    font-size: clamp(0.98rem, 2.3vw, 1.1rem); line-height: 1.9;
    color: var(--text); text-align: justify; white-space: pre-wrap;
}

.transcript-close {
    position: absolute; top: 10px; left: 10px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.transcript-close:hover { background: var(--border-light); }

/* ============ الأذان ============ */
.adhan-main {
    min-height: 100vh; padding: 60px clamp(16px, 4vw, 32px) 140px;
    max-width: 860px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 14px;
}

.adhan-search-wrap { position: relative; width: 100%; margin-top: 12px; }

.adhan-search-input {
    width: 100%; padding: 11px 40px 11px 14px;
    font-family: var(--font-arabic); font-size: 0.92rem;
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    outline: none; box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.25s ease;
}

.adhan-search-input::placeholder { color: var(--text-muted); }
.adhan-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }

.adhan-search-wrap .search-icon {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

.adhan-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.adhan-card {
    display: flex; align-items: center; gap: 12px;
    padding: clamp(12px, 3vw, 16px) clamp(14px, 3vw, 20px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.adhan-card:hover { background: var(--surface-hover); border-color: #D1D5DB; }
.adhan-card.is-playing { background: var(--primary-soft); border-color: var(--primary-border); }

.adhan-card-play {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    border: none; background: var(--primary); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}

.adhan-card-play:hover { background: var(--primary-hover); }
.adhan-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }

.adhan-card-title {
    font-family: var(--font-arabic); font-weight: 700;
    font-size: clamp(0.9rem, 2.3vw, 1.05rem); color: var(--text); line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.adhan-card-location {
    font-family: var(--font-arabic); font-size: clamp(0.72rem, 1.8vw, 0.82rem);
    color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.adhan-card-download {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-sm);
    border: 1px solid var(--gold-border); background: var(--gold-soft);
    color: var(--gold); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.adhan-card-download:hover { background: #F5EAC4; border-color: var(--gold); }
.adhan-card-download:disabled { opacity: 0.5; cursor: wait; }

.adhan-player-bar {
    position: fixed; bottom: 0; right: var(--sidebar-total); left: 0; z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px clamp(16px, 4vw, 28px) 14px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.adhan-player-info { max-width: 860px; margin: 0 auto; width: 100%; }

.adhan-now-playing {
    font-family: var(--font-arabic); font-size: 0.82rem; font-weight: 500;
    color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}

.adhan-player-controls { display: flex; align-items: center; gap: 8px; max-width: 860px; margin: 0 auto; width: 100%; }

.download-btn {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 38px; padding: 0 12px;
    font-family: var(--font-arabic); font-size: 0.78rem; font-weight: 600;
    color: #fff; background: var(--gold); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease;
}

.download-btn:hover:not(:disabled) { background: var(--gold-hover); }
.download-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ المحفوظات ============ */
.bookmark-ribbon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bookmark-ribbon:hover:not(:disabled) { background: var(--surface-hover); border-color: #D1D5DB; color: var(--text); }
.bookmark-ribbon.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.bookmark-ribbon.is-active:hover { background: var(--primary-hover); }
.bookmark-ribbon:disabled { opacity: 0.35; cursor: not-allowed; }
.bookmark-ribbon:focus { outline: none; }
.bookmark-ribbon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.resume-bar {
    position: fixed; top: 60px; right: var(--sidebar-total); left: 0; z-index: 101;
    display: none; align-items: center; gap: 10px; height: 44px;
    padding: 0 clamp(16px, 3vw, 24px);
    background: var(--primary); color: #fff;
    font-family: var(--font-arabic); font-size: 0.85rem;
}

.resume-bar.is-visible { display: flex; }
.resume-bar-icon { flex-shrink: 0; display: flex; align-items: center; }
.resume-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }

.resume-bar-title {
    font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.88rem;
}

.resume-bar-subtitle {
    font-size: 0.72rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.resume-bar-action {
    flex-shrink: 0; height: 30px; padding: 0 14px;
    font-family: var(--font-arabic); font-size: 0.78rem; font-weight: 600;
    color: var(--primary); background: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
}

.resume-bar-action:hover { background: var(--primary-soft); }

.resume-bar-remove {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.4); background: transparent;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.resume-bar-remove:hover { background: rgba(255, 255, 255, 0.15); }

body.has-resume-bar .surah-main { padding-top: calc(52px + 44px + 12px); }
body.has-resume-bar .reciter-main,
body.has-resume-bar .seerah-chapter-main,
body.has-resume-bar .bookmarks-main { padding-top: calc(60px + 44px + 12px); }

.bookmark-count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px; margin-inline-start: 8px;
    font-family: var(--font-arabic); font-size: 0.75rem; font-weight: 700;
    color: #fff; background: rgba(255, 255, 255, 0.25); border-radius: 999px;
}

.bookmark-count-badge.is-empty { display: none; }

.bookmarks-main {
    min-height: 100vh; padding: 60px clamp(16px, 4vw, 32px) 32px;
    max-width: 760px; margin: 0 auto;
}

#bookmarks-content { padding-top: 16px; }

.bookmarks-empty {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.bookmarks-empty svg { opacity: 0.35; color: var(--primary); }

.bookmarks-empty h2 {
    font-family: var(--font-arabic); font-size: 1.15rem; color: var(--text); margin: 0;
}

.bookmarks-empty p {
    font-family: var(--font-arabic); font-size: 0.88rem; margin: 0;
    max-width: 320px; line-height: 1.6;
}

.bookmarks-group-title {
    font-family: var(--font-arabic); font-weight: 700; font-size: 1.05rem;
    color: var(--text); margin: 24px 0 10px;
    display: flex; align-items: center; gap: 10px;
}

.bookmarks-group-title:first-child { margin-top: 0; }

.bookmarks-group-count {
    font-size: 0.75rem; font-weight: 500; color: var(--gold);
    background: var(--gold-soft); border: 1px solid var(--gold-border);
    padding: 2px 9px; border-radius: 999px;
}

.bookmarks-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }

.bookmark-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-right: 3px solid var(--primary);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}

.bookmark-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.bookmark-item-title {
    font-family: var(--font-arabic); font-weight: 600; font-size: 0.92rem;
    color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bookmark-item-subtitle {
    font-family: var(--font-arabic); font-size: 0.78rem;
    color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bookmark-item-time { font-family: var(--font-arabic); font-size: 0.7rem; color: var(--text-muted); }
.bookmark-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.bookmark-item-open {
    padding: 7px 14px;
    font-family: var(--font-arabic); font-size: 0.78rem; font-weight: 600;
    color: #fff; background: var(--primary); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease;
}

.bookmark-item-open:hover { background: var(--primary-hover); }

.bookmark-item-remove {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.bookmark-item-remove:hover { background: var(--danger-soft); color: var(--danger); border-color: #FECACA; }

.clear-bookmarks-btn {
    display: block; margin: 28px auto 8px; padding: 10px 22px;
    font-family: var(--font-arabic); font-size: 0.82rem;
    color: var(--danger); background: var(--surface);
    border: 1px solid #FECACA; border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s ease;
}

.clear-bookmarks-btn:hover { background: var(--danger-soft); }

/* ============ إصلاحات الأحاديث ============ */
body.has-resume-bar .hadith-wrapper { padding-top: calc(84px + 44px + 8px); }

@media (max-width: 700px) {
    .hadith-topbar { height: 60px; min-height: 60px; padding: 0 12px; flex-wrap: nowrap; }
    .hadith-topbar .page-topbar-title { display: none; }
    .book-select-wrapper { flex: 1; max-width: none; }
    .hadith-wrapper { padding-top: 76px; }
    body.has-resume-bar .hadith-wrapper { padding-top: calc(60px + 44px + 8px); }
}

/* ============================================
   صفحة الهبوط
   ============================================ */
.landing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px clamp(16px, 3vw, 32px) 60px;
}

.landing-hero {
    position: relative;
    text-align: center;
    padding: 60px 20px 40px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    font-family: var(--font-arabic);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: 999px;
}

.landing-title {
    font-family: var(--kufi-font);
    font-weight: 700;
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    color: var(--gold);
    line-height: 1.15;
    margin: 20px 0 10px;
    letter-spacing: 1px;
}

.landing-tagline {
    font-family: var(--font-arabic);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.landing-description {
    font-family: var(--font-arabic);
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 36px;
    line-height: 1.9;
}

.landing-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.landing-hero-image {
    margin: 0 auto;
    max-width: 800px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    background: var(--surface);
}

.landing-hero-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: cover;
}

.landing-hero-image figcaption {
    padding: 12px 16px;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
}

/* ============ أزرار الهبوط ============ */
.landing-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    font-family: var(--font-arabic);
    font-size: clamp(0.92rem, 2vw, 1rem);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.landing-btn-primary {
    color: #fff;
    background: var(--primary);
    border: none;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.landing-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.landing-btn-ghost {
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.landing-btn-ghost:hover {
    background: var(--surface-hover);
    border-color: #D1D5DB;
}

/* ============ شريط الإحصائيات ============ */
.landing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 20px 0 80px;
    box-shadow: var(--shadow-sm);
}

.landing-stat {
    background: var(--surface);
    padding: 26px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.landing-stat-number {
    font-family: var(--font-arabic);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.landing-stat-label {
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============ الميزات ============ */
.landing-features {
    margin-bottom: 80px;
}

.landing-section-head {
    text-align: center;
    margin-bottom: 40px;
}

.landing-section-head h2 {
    font-family: var(--font-arabic);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.landing-section-head p {
    font-family: var(--font-arabic);
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.feature-card:hover {
    border-color: var(--primary-border);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12);
    transform: translateY(-3px);
}

.feature-card:hover .feature-arrow {
    opacity: 1;
    transform: translateX(-4px);
    color: var(--primary);
}

.feature-image {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: var(--border-light);
    position: relative;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.feature-card:hover .feature-image img {
    transform: scale(1.06);
}

.feature-card h3 {
    font-family: var(--font-arabic);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    font-weight: 700;
    color: var(--text);
    margin: 18px 20px 6px;
}

.feature-card p {
    font-family: var(--font-arabic);
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 20px 16px;
    flex: 1;
}

.feature-arrow {
    margin: 0 20px 18px;
    align-self: flex-end;
    font-size: 1.15rem;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

/* ============ عن المنصة ============ */
.landing-about {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 80px;
}

.landing-about-image {
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.landing-about-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.landing-about-content {
    padding: clamp(24px, 4vw, 40px);
}

.landing-about-content h2 {
    font-family: var(--font-arabic);
    font-size: clamp(1.3rem, 3.5vw, 1.7rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.landing-about-content p {
    font-family: var(--font-arabic);
    font-size: clamp(0.92rem, 2.1vw, 1.02rem);
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 14px;
}

.landing-about-content p strong {
    color: var(--primary);
    font-weight: 700;
}

.landing-about-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.landing-about-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.landing-about-list svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* ============ الختام ============ */
.landing-cta {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--gold-soft) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.landing-cta h2 {
    font-family: var(--font-arabic);
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    position: relative;
}

.landing-cta p {
    font-family: var(--font-arabic);
    font-size: clamp(0.92rem, 2.2vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 28px;
    line-height: 1.8;
    position: relative;
}

.landing-cta-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ============ الشريط الجانبي ============ */
.sidebar {
    position: fixed;
    top: var(--sidebar-gap);
    right: var(--sidebar-gap);
    bottom: var(--sidebar-gap);
    width: var(--sidebar-width);
    z-index: 90;

    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;

    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(4, 120, 87, 0.25);
    overflow-y: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar-logo {
    display: block;
    text-align: center;
    padding: 12px 8px 18px;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 12px;
}

.sidebar-logo-text {
    font-family: var(--kufi-font);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--sidebar-icon);
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    font-family: var(--font-arabic);
    font-size: 0.92rem;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.sidebar-item:hover { background: rgba(255, 255, 255, 0.1); }

.sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-icon);
    font-weight: 700;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--sidebar-active-stripe);
    border-radius: 4px 0 0 4px;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--sidebar-icon);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg { width: 100%; height: 100%; }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--gold);
    z-index: 96;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-toggle svg { width: 22px; height: 22px; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 85;
    backdrop-filter: blur(2px);
}

/* ============================================
   زر الإعدادات + اللوحة
   ============================================ */
.settings-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 95;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-toggle.has-player {
    bottom: 84px;
}

.settings-toggle:hover {
    background: var(--surface-hover);
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15);
}

.settings-toggle svg {
    width: 22px;
    height: 22px;
    transition: transform 0.4s ease;
}

.settings-toggle.is-open svg {
    transform: rotate(90deg);
}

.settings-toggle:focus { outline: none; }
.settings-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(2px);
}

.settings-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 1000;
    width: min(300px, calc(100vw - 40px));
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);

    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transform-origin: bottom left;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.settings-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.settings-toggle.has-player ~ .settings-panel,
body:has(.settings-toggle.has-player) .settings-panel {
    bottom: 144px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.settings-title {
    font-family: var(--font-arabic);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.settings-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}

.settings-close:hover {
    background: var(--surface-hover);
}

.settings-group {
    margin-bottom: 14px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    font-family: var(--font-arabic);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.settings-options {
    display: flex;
    gap: 8px;
}

.settings-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-arabic);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-option:hover {
    background: var(--surface-hover);
    border-color: #D1D5DB;
}

.settings-option.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.settings-option svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   الوضع الليلي
   ============================================ */
body.theme-dark {
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-hover: #273449;
    --border: #334155;
    --border-light: #1E293B;
    --text: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --primary-soft: #064E3B;
    --primary-border: #065F46;
    --gold-soft: #422006;
    --gold-border: #713F12;
    --danger-soft: #450A0A;
    --sidebar-bg: #065F46;
    --sidebar-bg-hover: #047857;
    --sidebar-border: rgba(255, 255, 255, 0.1);
}

body.theme-dark .page-topbar,
body.theme-dark .font-controls-bar,
body.theme-dark .index-tabs,
body.theme-dark .reciter-player-bar,
body.theme-dark .radio-player-bar,
body.theme-dark .seerah-player-bar,
body.theme-dark .adhan-player-bar {
    background: rgba(15, 23, 42, 0.95);
}

body.theme-dark .landing-cta {
    background: linear-gradient(135deg, #064E3B 0%, #422006 100%);
}

body.theme-dark .modal-overlay,
body.theme-dark .transcript-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.theme-dark .sidebar {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.theme-dark .settings-panel {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ============================================
   التجاوب العام
   ============================================ */
@media (max-width: 900px) {
    :root { --sidebar-total: 0px; }

    body { padding-right: 0; }

    .sidebar {
        width: 270px;
        top: 0;
        right: 0;
        bottom: 0;
        border-radius: 20px 0 0 20px;
        transform: translateX(100%);
        z-index: 200;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    }

    body.sidebar-open .sidebar { transform: translateX(0); }

    .sidebar-toggle { display: flex; }

    body.sidebar-open .sidebar-backdrop { display: block; }

    .page-topbar,
    .index-tabs,
    .resume-bar,
    .font-controls-bar,
    .reciter-player-bar,
    .radio-player-bar,
    .seerah-player-bar,
    .adhan-player-bar {
        right: 0 !important;
    }

    .settings-toggle {
        width: 44px;
        height: 44px;
        bottom: 16px;
        left: 16px;
    }
    .settings-toggle.has-player {
        bottom: 76px;
    }
    .settings-panel {
        bottom: 70px;
        left: 16px;
    }
    body:has(.settings-toggle.has-player) .settings-panel {
        bottom: 130px;
    }
}

@media (max-width: 820px) {
    .landing-about {
        grid-template-columns: 1fr;
    }
    .landing-about-image {
        min-height: 220px;
    }
}

@media (max-width: 720px) {
    .landing {
        padding: 24px 14px 40px;
    }
    .landing-hero {
        padding: 30px 8px 20px;
    }
    .landing-title {
        margin: 16px 0 8px;
    }
    .landing-hero-image img {
        max-height: 240px;
    }
    .landing-stats {
        margin: 10px 0 50px;
    }
    .landing-features,
    .landing-about {
        margin-bottom: 50px;
    }
    .landing-cta {
        padding: 40px 16px;
    }
    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
    .feature-image {
        height: 150px;
    }
}

@media (max-width: 700px) {
    .page-wrapper { padding: 16px 12px; }
    .hero { padding: 12px 8px; }
    .quran-wrapper { padding-top: 112px; }
    .surah-number { min-width: 40px; height: 40px; font-size: 1rem; margin-bottom: 10px; }
    .surah-name { margin-bottom: 10px; }
    .hadith-number { min-width: 32px; height: 32px; font-size: 0.85rem; }
    .hadith-card { padding: 14px 12px; }
}

@media (max-width: 600px) {
    .surah-topbar { height: 50px; min-height: 50px; }
    .surah-topbar .page-topbar-title { max-width: calc(100% - 120px); font-size: clamp(0.82rem, 3.5vw, 1rem); }
    .surah-main { padding: 50px 10px 58px; }
    .font-controls-bar { height: 56px; padding: 0 12px; }
    .font-btn { width: 34px; height: 34px; font-size: 0.9rem; }
    .font-display { min-width: 44px; font-size: 0.78rem; }
    .ayahs-container { padding: 16px 14px; line-height: 2.3; }
    .ayah { font-size: calc(1.1rem * var(--font-scale, 1)); }
    .ayah-number { font-size: calc(0.65rem * var(--font-scale, 1)); }

    .reciter-main { padding-bottom: 180px; }
    .reciter-player-bar { padding: 10px 12px 12px; gap: 8px; }
    .custom-select-trigger { height: 38px; font-size: 0.8rem; padding: 0 10px; gap: 5px; }
    .toggle-btn { height: 38px; padding: 0 10px; font-size: 0.72rem; }
    .toggle-btn span { display: none; }
    .reciter-toggles { flex-basis: 100%; justify-content: center; }
    .player-btn { width: 42px; height: 42px; }
    .time-display { min-width: 68px; font-size: 0.7rem; }
    .custom-select-list { max-height: 200px; }

    .radio-main { padding-bottom: 110px; }
    .radio-player-bar { padding: 10px 12px 12px; }
    .radio-controls { gap: 8px; flex-wrap: wrap; justify-content: center; }
    .radio-volume-slider { max-width: 100px; }
    .radio-status { min-width: 0; flex-basis: 100%; font-size: 0.7rem; }

    .prayer-main { padding-top: 76px; padding-left: 12px; padding-right: 12px; gap: 12px; }
    #city-dropdown .custom-select-trigger { height: 42px; font-size: 0.86rem; }

    .seerah-main { padding-top: 76px; padding-left: 12px; padding-right: 12px; }
    .seerah-chapter-main { padding-top: 76px; padding-bottom: 120px; padding-left: 12px; padding-right: 12px; }
    .seerah-player-bar { padding: 8px 12px 12px; }
    .episode-number { min-width: 28px; height: 28px; font-size: 0.72rem; }
    .transcript-btn span { display: none; }
    .transcript-btn { width: 38px; padding: 0; justify-content: center; }

    .adhan-main { padding-top: 76px; padding-bottom: 130px; padding-left: 12px; padding-right: 12px; }
    .adhan-player-bar { padding: 8px 12px 12px; }
    .adhan-card-play { width: 32px; height: 32px; }
    .adhan-card-download { width: 30px; height: 30px; }
    .download-btn span { display: none; }
    .download-btn { width: 38px; padding: 0; justify-content: center; }

    body.has-resume-bar .surah-main { padding-top: calc(50px + 44px + 10px); }
    .resume-bar { height: 42px; font-size: 0.8rem; padding: 0 12px; gap: 8px; }
    .resume-bar-action { padding: 0 10px; font-size: 0.75rem; }
    .bookmark-item { padding: 10px 12px; }
    .bookmark-item-open { padding: 6px 10px; font-size: 0.75rem; }
}

@media (max-width: 500px) {
    .page-topbar .back-btn span { display: none; }
}

@media (max-width: 420px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .landing-hero-actions .landing-btn,
    .landing-cta-actions .landing-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
/* ============================================
   شعار الصفحة الرئيسية
   ============================================ */
   .landing-logo-wrap {
    margin: 30px auto 20px;
    width: clamp(180px, 25vw, 240px); /* حجم متجاوب مع الشاشات */
    aspect-ratio: 1 / 1;
    border-radius: 32px; /* حواف دائرية تتناسب مع شكل الشعار */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(4, 120, 87, 0.15); /* ظل زمردي خفيف */
    transition: transform 0.3s ease;
}

.landing-logo-wrap:hover {
    transform: translateY(-5px); /* حركة خفيفة عند تمرير الماوس */
}

.landing-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* تعديل الوصف ليكون أوسع قليلاً ومقروءاً */
.landing-description {
    font-family: var(--font-arabic);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem); /* خط أكبر قليلاً لأنه يمثل المنصة */
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 36px;
    line-height: 1.9;
    font-weight: 500;
}

/* دعم الوضع الليلي للشعار */
body.theme-dark .landing-logo-wrap {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
/* ============================================
   تنسيقات إضافية لصفحة كتب السيرة
   ============================================ */

/* زر الانتقال لكتب السيرة */
.seerah-books-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--surface);
    border: 1.5px solid var(--gold);
    border-radius: var(--radius-md);
    color: var(--gold);
    font-family: var(--font-arabic);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.seerah-books-btn:hover {
    background: var(--gold-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* تصميم بطاقات الكتب */
.book-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.book-cover {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* خط عمودي يحاكي كعب الكتاب */
.book-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 20px;
    width: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.book-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-info h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--text);
}

.book-info p {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

.book-info .feature-arrow {
    margin: 0;
    align-self: flex-start;
    font-weight: 700;
    color: var(--gold);
    opacity: 1;
    font-size: 0.95rem;
}

/* الوضع الليلي */
body.theme-dark .seerah-books-btn:hover {
    background: var(--gold-soft);
    color: var(--gold-hover);
}
/* ============================================
   زر تثبيت التطبيق في الإعدادات
   ============================================ */
   .settings-install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--primary-soft);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-install-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-style: solid;
}

.settings-install-btn:disabled {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
    cursor: default;
}