/* 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);
    --primary-glow: rgba(16, 185, 129, 0.3);
}

/* Base Utility Classes */
.fw-black {
    font-weight: 800 !important;
}

.fw-blacker {
    font-weight: 900 !important;
}

.smallest {
    font-size: 0.75rem !important;
}

/* Unified small font */
.smaller {
    font-size: 0.85rem !important;
}

.letter-spacing-1 {
    letter-spacing: 1px !important;
}

.letter-spacing-2 {
    letter-spacing: 2px !important;
}

.pointer-none {
    pointer-events: none;
}

.opacity-100 {
    opacity: 1 !important;
}

.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-25 {
    opacity: 0.25 !important;
}

/* Global Text Colors */
.text-main {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-primary-light {
    color: var(--primary-light) !important;
}

* {
    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.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

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

.brand-text-wrapper {
    position: relative;
    height: 38px;
    display: flex;
    align-items: center;
}

.brand-default,
.brand-surah {
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    white-space: nowrap;
}

.brand-surah {
    position: absolute;
    top: 50%;
    left: 0;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

header.scrolled .brand-default {
    opacity: 0;
    transform: translateY(-40px);
}

header.scrolled .brand-surah {
    opacity: 1;
    transform: translateY(-50%);
    pointer-events: auto;
}

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

.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;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 15px 12px 42px;
    color: white;
    font-size: 0.85rem;
    transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

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

/* Grid Layout (Main & Drawer) */
.surah-grid,
.surah-grid-drawer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
}

.surah-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.surah-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Glass & Premium Helpers */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-primary-light {
    color: var(--primary-light) !important;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.03);
}

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

.surah-name {
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.1;
}

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

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

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

.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: 10px;
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
}

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

.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:not(.full-width-page) {
        width: 100% !important;
        max-width: none !important;
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 20px;
    }

    /* Fix: Dashboard squash on desktop */
    .app-container:has(.dashboard-wrapper) {
        display: block !important;
    }

    .app-container.full-width-page {
        width: 100% !important;
        max-width: none !important;
        display: block !important;
    }

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

    #surahList.surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }

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

    .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: 20px 20px 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: 20px 0 0 20px;
    }

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

/* Navigation Buttons - Premium Reader Navigation */
.nav-section {
    padding: 3rem 1rem 5rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    grid-column: 1 / -1;
    /* Ensure spans full width on grid */
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white !important;
    text-decoration: none !important;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-prev {
    opacity: 0.8;
}

.nav-next {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.nav-btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white !important;
    opacity: 1;
}

.nav-next:hover {
    background: #0ea675;
    border-color: #0ea675;
}

.nav-home-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.nav-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-light) !important;
    text-decoration: none !important;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 2px;
    opacity: 0.6;
    transition: 0.4s;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 28px;
    border-radius: 60px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.nav-home-link:hover {
    opacity: 1;
    transform: scale(1.05) translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
}

/* Extra Compact Bio-Style Footer */
footer {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.4), transparent);
}

.footer-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
}

.footer-logo-sm {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
}

.footer-brand-text {
    font-weight: 900;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: white;
}

.footer-dot {
    color: var(--text-muted);
    opacity: 0.25;
    font-size: 0.7rem;
}

.footer-link-lite {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-powered-text {
    font-size: 0.45rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
    opacity: 0.45;
}

.social-links-compact {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.2rem;
}

.social-btn-sm {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: 0.25s;
}

.social-btn-sm:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.disclaimer-text-compact {
    max-width: 500px;
    margin: 0 auto 0.8rem;
    font-size: 0.55rem;
    line-height: 1.5;
    color: var(--text-muted);
    opacity: 0.35;
    text-align: center;
}

.copyright-text-final {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--text-muted);
    opacity: 0.2;
    letter-spacing: 1px;
}

/* BIO-Style Section & Link Cards */
.bio-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2rem 0 1rem 0.5rem;
    text-align: left;
}

.bio-section-icon {
    width: 38px;
    height: 38px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 1.1rem;
}

.bio-section-title h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.2px;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    margin: 0;
}

.bio-section-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bio-link-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: white !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    width: 100%;
}

.bio-link-card:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.bio-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary-light);
    margin-right: 15px;
    flex-shrink: 0;
}

.bio-card-content {
    flex-grow: 1;
}

.bio-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
    display: block;
}

.bio-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.bio-card-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: 0.3s;
    flex-shrink: 0;
}

.bio-link-card:hover .bio-card-arrow {
    background: var(--primary);
    color: white;
    transform: rotate(-15deg) scale(1.1);
}

.badge-status {
    font-size: 0.55rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-soon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Desktop Optimization for BIO Style - FULL WIDTH */
@media (min-width: 992px) {
    .bio-links-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .dashboard-wrapper {
        width: 100%;
        max-width: none !important;
        margin: 0;
        padding: 3rem !important;
    }

    .welcome-banner {
        width: 100%;
        padding: 4rem !important;
        margin-bottom: 3rem !important;
        border-radius: 12px !important;
    }

    .welcome-banner h2 {
        font-size: 3rem !important;
    }

    .stat-card {
        padding: 2.2rem !important;
    }

    .stat-value {
        font-size: 2.2rem !important;
    }
}

/* Tablet Adjustment */
@media (min-width: 768px) and (max-width: 991px) {
    .bio-links-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Floating Verse Navigation Controls */
.verse-nav-controls {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.verse-nav-btn {
    width: 48px;
    height: 48px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.verse-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1) translateY(-3px);
}

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