 :root {
        --bg: #0F172A;
        --surface: #1E293B;
        --surface-2: #334155;
        --primary: #D4AF37;
        --accent: #10B981;
        --text: #F8FAFC;
        --text-muted: #94A3B8;
        --border: rgba(255,255,255,0.08);
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
        font-family: 'Readex Pro', 'Cairo', sans-serif;
    }

    body {
        background: var(--bg);
        color: var(--text);
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    ::-webkit-scrollbar { width: 0px; background: transparent; }

    .app-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }

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

    .header-info h1 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
    }

    .header-info p {
        font-size: 0.7rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .header-date {
        background: var(--surface);
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 0.7rem;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        color: var(--text);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

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

    .active-section-bar {
        background: var(--surface);
        padding: 12px 24px;
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid var(--border);
    }

    .active-section-icon {
        width: 40px;
        height: 40px;
        background: var(--primary);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #000;
    }

    .active-section-info { flex: 1; }
    .active-section-title { font-size: 1rem; font-weight: 600; color: var(--primary); }
    .active-section-desc { font-size: 0.7rem; color: var(--text-muted); }
    .active-section-back {
        width: 40px;
        height: 40px;
        background: var(--surface-2);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .view-container {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 120px;
    }

    .fade-in {
        animation: fadeIn 0.4s ease;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .hero-card {
        margin: 10px 24px 24px;
        background: linear-gradient(135deg, #D4AF37 0%, #B49025 100%);
        border-radius: 24px;
        padding: 24px;
        color: #000;
        position: relative;
        overflow: hidden;
    }

    .hero-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0l2.5 7.5L20 10l-7.5 2.5L10 20l-2.5-7.5L0 10l7.5-2.5z' fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
        opacity: 0.6;
    }

    .hero-card h2 { position: relative; font-size: 1.6rem; }
    .hero-card p { position: relative; font-size: 0.95rem; margin-bottom: 20px; }
    .hero-btn {
        position: relative;
        padding: 10px 20px;
        background: #000;
        color: #fff;
        border-radius: 30px;
        border: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .grid-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 24px;
        margin-bottom: 30px;
    }

    .menu-item {
        background: var(--surface);
        padding: 20px;
        border-radius: 20px;
        border: 1px solid var(--border);
        cursor: pointer;
    }
    .menu-item:active { transform: scale(0.98); background: var(--surface-2); }

    .menu-icon {
        width: 45px;
        height: 45px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .menu-item h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
    .menu-item span { font-size: 0.75rem; color: var(--text-muted); }

    .mi-quran .menu-icon { background: rgba(212, 175, 55, 0.15); color: var(--primary); }
    .mi-azkar .menu-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
    .mi-hadith .menu-icon { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
    .mi-dua .menu-icon { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
    .mi-prayer .menu-icon { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
    .mi-questions .menu-icon { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
    .mi-prophets .menu-icon { background: rgba(236, 72, 153, 0.15); color: #EC489A; }
    .mi-radio .menu-icon { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

    .section-head {
        padding: 0 24px 15px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    .section-head h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); }
    .section-head button { background: none; border: none; color: var(--primary); cursor: pointer; }

    .scroll-h {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 0 24px 10px;
    }

    .reciter-pill {
        min-width: 100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }
    .reciter-img {
        width: 75px;
        height: 75px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--surface-2);
    }
    .reciter-name { font-size: 0.8rem; color: var(--text); text-align: center; }

    .track-row {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 12px;
        background: rgba(255,255,255,0.03);
        border-radius: 16px;
        cursor: pointer;
        margin: 0 24px 10px;
    }
    .track-row.playing { border-color: var(--primary); background: rgba(212, 175, 55, 0.05); }
    .track-idx {
        width: 35px;
        height: 35px;
        background: var(--surface);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .track-data { flex: 1; }
    .track-title { font-size: 0.95rem; font-weight: 500; color: var(--text); }
    .track-sub { font-size: 0.75rem; color: var(--text-muted); }

    .mini-player {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        z-index: 90;
        transform: translateY(150%);
        transition: transform 0.4s;
        cursor: pointer;
    }
    .mini-player.show { transform: translateY(0); }
    .mp-img { width: 45px; height: 45px; border-radius: 10px; object-fit: cover; }
    .mp-info { flex: 1; }
    .mp-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
    .mp-sub { font-size: 0.75rem; color: var(--text-muted); }
    .mp-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--primary);
        color: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
    }

    .full-overlay {
        position: fixed;
        inset: 0;
        background: var(--bg);
        z-index: 100;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: 0.4s;
    }
    .full-overlay.active { transform: translateY(0); }
    .fo-head { padding: 30px 24px; display: flex; justify-content: space-between; }
    .fo-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .fo-art-box {
        width: 280px;
        height: 280px;
        border-radius: 50%;
        border: 4px solid rgba(255,255,255,0.05);
        padding: 10px;
        margin-bottom: 40px;
        animation: spin 20s linear infinite paused;
    }
    .fo-art-box.playing { animation-play-state: running; }
    @keyframes spin { 100% { transform: rotate(360deg); } }
    .fo-art { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
    .fo-controls { width: 100%; padding: 0 40px 60px; }
    .progress-area { width: 100%; margin-bottom: 30px; cursor: pointer; }
    .prog-bar { width: 100%; height: 6px; background: var(--surface-2); border-radius: 10px; }
    .prog-fill { height: 100%; width: 0%; background: var(--primary); border-radius: 10px; }
    .times { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }
    .ctrl-btns { display: flex; justify-content: space-between; align-items: center; }
    .c-btn { background: none; border: none; color: var(--text); font-size: 1.8rem; cursor: pointer; }
    .play-btn-lg {
        width: 75px;
        height: 75px;
        background: var(--primary);
        color: #000;
        border-radius: 50%;
        font-size: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: none;
    }

    .azkar-card, .dua-card, .hadith-card, .question-card, .radio-card {
        background: var(--surface);
        border-radius: 20px;
        padding: 20px;
        margin: 0 24px 15px;
        border: 1px solid var(--border);
        cursor: pointer;
    }
    .azkar-card { text-align: center; }
    .azkar-text { font-size: 1.1rem; line-height: 1.8; font-family: 'Amiri', serif; color: var(--text); margin-bottom: 15px; }
    .azkar-count { display: inline-block; padding: 6px 16px; background: var(--surface-2); border-radius: 20px; color: var(--accent); }
    .azkar-card.done { opacity: 0.5; }
    .dua-name { font-size: 0.9rem; color: var(--primary); font-weight: 600; margin-bottom: 10px; }
    .dua-text { font-size: 1rem; color: var(--text-muted); font-family: 'Amiri', serif; }
    .hadith-card { border-right: 4px solid var(--primary); }
    .hadith-text { font-size: 1rem; font-family: 'Amiri', serif; color: var(--text); margin-bottom: 10px; }
    .hadith-source { font-size: 0.75rem; color: var(--text-muted); }
    .hadith-explanation { font-size: 0.85rem; color: var(--accent); padding-top: 10px; border-top: 1px solid var(--border); }
    .question-text { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 20px; }
    .options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
    .option-btn {
        background: var(--surface-2);
        padding: 12px;
        border-radius: 12px;
        text-align: center;
        cursor: pointer;
        color: var(--text);
    }
    .option-btn.correct { background: var(--accent); color: #000; }
    .option-btn.wrong { background: #EF4444; color: #fff; }
    .radio-card { display: flex; align-items: center; gap: 15px; }
    .radio-icon {
        width: 50px;
        height: 50px;
        background: rgba(239, 68, 68, 0.15);
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: #EF4444;
    }
    .radio-info { flex: 1; }
    .radio-name { font-weight: 600; color: var(--text); }
    .radio-desc { font-size: 0.7rem; color: var(--text-muted); }
    .radio-badge {
        display: inline-block;
        width: 8px;
        height: 8px;
        background: #EF4444;
        border-radius: 50%;
        margin-left: 6px;
        animation: pulse 1s infinite;
    }
    @keyframes pulse { 0% { opacity: 0.5; } 100% { opacity: 1; transform: scale(1.2); } }

    .prayer-container { padding: 0 24px; }
    .next-prayer-card {
        background: linear-gradient(135deg, var(--primary) 0%, #B49025 100%);
        border-radius: 24px;
        padding: 24px;
        margin-bottom: 24px;
        text-align: center;
        color: #000;
        position: relative;
        overflow: hidden;
    }
    .next-prayer-icon { font-size: 3rem; margin-bottom: 12px; position: relative; }
    .next-prayer-label { font-size: 0.9rem; opacity: 0.8; }
    .next-prayer-name { font-size: 1.8rem; font-weight: 700; margin: 10px 0; }
    .next-prayer-time { font-size: 1.4rem; font-weight: 600; margin-bottom: 15px; }
    .countdown-timer { background: rgba(0,0,0,0.2); border-radius: 50px; padding: 10px 20px; display: inline-block; font-size: 1.2rem; font-weight: 600; }
    .prayer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
    .prayer-item {
        background: var(--surface);
        border-radius: 20px;
        padding: 16px 12px;
        text-align: center;
        border: 1px solid var(--border);
    }
    .prayer-item.active { background: linear-gradient(135deg, var(--primary), #B49025); color: #000; transform: scale(1.02); }
    .prayer-icon { font-size: 1.8rem; margin-bottom: 8px; color: var(--primary); }
    .prayer-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
    .prayer-time { font-size: 1rem; font-weight: 600; color: var(--text); }
    .compass-section {
        background: var(--surface);
        border-radius: 24px;
        padding: 20px;
        text-align: center;
        margin-top: 10px;
    }
    .compass-title { font-size: 1rem; font-weight: 600; margin-bottom: 15px; color: var(--primary); }
    .qibla-compass {
        width: 200px;
        height: 200px;
        margin: 0 auto;
        position: relative;
        background: var(--surface-2);
        border-radius: 50%;
        border: 4px solid var(--primary);
    }
    .compass-needle {
        position: absolute;
        bottom: 50%;
        left: 50%;
        width: 4px;
        height: 80px;
        background: #EF4444;
        transform-origin: bottom;
        transform: translateX(-50%) rotate(0deg);
    }
    .compass-center {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 14px;
        background: var(--primary);
        border-radius: 50%;
        transform: translate(-50%, -50%);
    }
    .compass-btn {
        margin-top: 15px;
        padding: 10px 20px;
        background: var(--primary);
        color: #000;
        border: none;
        border-radius: 30px;
        font-weight: 600;
        cursor: pointer;
    }

    .category-btns, .tab-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 24px;
        margin-bottom: 20px;
    }
    .cat-btn, .tab-btn {
        background: var(--surface);
        padding: 8px 16px;
        border-radius: 30px;
        cursor: pointer;
        border: 1px solid var(--border);
        color: var(--text);
    }
    .cat-btn.active, .tab-btn.active { background: var(--primary); color: #000; }
    .tab-btn { flex: 1; text-align: center; }

    .modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.8);
        z-index: 200;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    .modal-content {
        background: var(--surface);
        border-radius: 24px;
        max-width: 500px;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        border: 1px solid var(--border);
    }
    .modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
    .modal-header h3 { color: var(--text); }
    .modal-body { padding: 20px; }
    .modal-footer { padding: 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

    .toast {
        position: fixed;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--primary);
        color: #000;
        padding: 12px 24px;
        border-radius: 50px;
        z-index: 150;
        font-weight: 600;
        animation: fadeInUp 0.3s ease;
        white-space: nowrap;
    }
    @keyframes fadeInUp {
        from { opacity: 0; transform: translateX(-50%) translateY(20px); }
        to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }

    .hidden { display: none !important; }
    .text-center { text-align: center; }
    .footer {
        text-align: center;
        padding: 20px;
        font-size: 0.7rem;
        color: var(--text-muted);
        border-top: 1px solid var(--border);
        margin-top: 20px;
    }
    .quran-page {
        font-family: 'Amiri', serif;
        font-size: 1.2rem;
        line-height: 1.8;
        text-align: justify;
        padding: 20px;
        background: var(--surface);
        border-radius: 20px;
        margin: 0 24px;
        color: var(--text);
    }
    .ayah-number {
        display: inline-block;
        width: 28px;
        height: 28px;
        background: var(--primary);
        color: #000;
        border-radius: 50%;
        text-align: center;
        font-size: 0.75rem;
        font-weight: bold;
        line-height: 28px;
        margin: 0 4px;
    }
    .surah-card, .reciter-card {
        background: var(--surface);
        border-radius: 16px;
        padding: 15px;
        text-align: center;
        cursor: pointer;
        border: 1px solid var(--border);
    }
    .surah-number { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
    .surah-name { font-size: 0.9rem; margin-top: 5px; color: var(--text); }
    .reciter-avatar {
        width: 70px;
        height: 70px;
        margin: 0 auto 10px;
        background: var(--surface-2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary);
    }