/* style.css - Premium Compact Quran UI System */
:root {
    --primary: #10b981;
    --primary-light: #34d399;
    --bg-dark: #020617;
    --card-bg: rgba(15, 23, 42, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding: 0.5rem;
    /* Compact for Mobile */
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.04) 0px, transparent 50%);
    overflow-x: hidden;
}

.app-container {
    padding: 0 !important;
}

/* Compact Sticky Header */
.sticky-header {
    position: sticky;
    top: 5px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.brand-title {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Surah Cards & Search Area */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 15px 10px 40px;
    color: white;
    font-size: 0.85rem;
    transition: 0.3s;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Grid Layout (Compact) */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* More columns on mobile */
    gap: 10px;
}

.surah-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    /* Vertical for compact small grid */
    align-items: flex-start;
    transition: 0.2s;
    height: 100%;
}

.surah-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.surah-num {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.surah-name {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
}

.surah-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.surah-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-top: 5px;
    align-self: flex-end;
}

/* Reader Mode (Focused & Compact) */
.reader-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(to bottom, rgba(16, 185, 129, 0.05), transparent);
    border-radius: 24px;
}

.reader-title-ar {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: var(--primary-light);
}

.reader-title-id {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.reader-badge-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.reader-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
}

.verse-block {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 18px;
    /* Compact */
    margin-bottom: 10px;
    border: 1px solid var(--glass-border);
}

.verse-num {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.verse-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    line-height: 2;
    text-align: right;
    margin-bottom: 12px;
    direction: rtl;
}

.verse-transliteration {
    font-style: italic;
    color: var(--primary-light);
    opacity: 0.8;
    font-size: 0.85rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.verse-translation {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #cbd5e1;
    text-align: justify;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 10px;
}

/* Default: All Content Visible */
.verse-transliteration,
.verse-translation,
.tafsir-btn-container {
    display: block;
}

/* Hide when focused mode (Pure Arabic) */
body.hide-translation .verse-transliteration,
body.hide-translation .verse-translation,
body.hide-translation .tafsir-btn-container {
    display: none !important;
}

.verse-translation {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e1;
    text-align: justify;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Lighter line */
    padding-top: 12px;
    font-weight: 400;
}

.tafsir-block {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: justify;
}

.bismillah-text {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    color: var(--primary-light);
    text-align: center;
    margin: 20px 0;
}

/* Sidebar Styling (Desktop) */
@media (min-width: 992px) {
    body {
        padding: 1.5rem;
    }

    .app-container {
        max-width: 1100px !important;
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 20px;
    }

    .sticky-header {
        grid-column: span 2;
        top: 15px;
    }

    .surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }

    .surah-card {
        flex-direction: row;
        align-items: center;
        padding: 15px;
    }

    .surah-num {
        margin-bottom: 0;
        margin-right: 15px;
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .surah-name {
        font-size: 1rem;
    }

    .surah-arabic {
        margin-top: 0;
        margin-left: auto;
        font-size: 1.3rem;
    }

    .surah-sidebar {
        position: sticky;
        top: 100px;
        height: calc(100vh - 120px);
        overflow-y: auto;
        padding-right: 12px;
    }

    .verse-arabic {
        font-size: 2.2rem;
    }

    .verse-block {
        padding: 25px;
    }
}

/* Monifi-Style Drawer Logic */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.drawer-container {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px 32px 0 0;
    z-index: 2100;
    transition: 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
}

.drawer-body {
    overflow-y: auto;
    max-height: calc(85vh - 60px);
    scrollbar-width: none;
}

.drawer-body::-webkit-scrollbar {
    display: none;
}

.drawer-header {
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    /* Very subtle highlight */
}

.drawer-handler {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 15px;
}

#drawerTitle {
    color: #f1f5f9 !important;
    /* Brighter Slate */
    font-size: 0.65rem;
    opacity: 0.8;
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
}

body.drawer-open .drawer-overlay {
    opacity: 1;
    visibility: visible;
}

body.drawer-open .drawer-container {
    bottom: 0;
    display: block;
}

body.drawer-open {
    overflow: hidden;
}

/* Desktop Drawer (Slide from Right) */
@media (min-width: 992px) {
    .drawer-container {
        top: 0;
        right: -450px;
        bottom: auto;
        left: auto;
        width: 450px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 32px 0 0 32px;
    }

    body.drawer-open .drawer-container {
        right: 0;
        display: block;
    }
}

footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.f-logo {
    font-weight: 900;
    color: white;
    margin-bottom: 5px;
    display: block;
    font-size: 0.7rem;
    letter-spacing: 2px;
}