/*
 * NoorAlQuran – Quran Reader Styles
 * ─────────────────────────────────
 */

/* ── Reader Layout ───────────────────────────────── */

.reader-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px 100px;
}

/* ── Surah Header ─────────────────────────────────── */

.surah-header {
    text-align: center;
    padding: 28px 20px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.surah-header::before {
    content: '';
    position: absolute;
    top: -50px; left: 50%;
    transform: translateX(-50%);
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: .35;
}

.surah-title-ar {
    font-family: var(--font-arabic);
    font-size: 36px;
    color: var(--accent);
    line-height: 1.8;
    position: relative;
}

.surah-title-en {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    position: relative;
}

.surah-header-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
}

.surah-header-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-faint);
}

/* ── Bismillah ────────────────────────────────────── */

.bismillah {
    text-align: center;
    font-family: var(--font-arabic);
    font-size: 28px;
    color: var(--accent);
    padding: 16px;
    margin: 12px 0;
    line-height: 2;
    opacity: .9;
}

/* ── Ayah List ────────────────────────────────────── */

.ayah-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ayah-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color var(--t-fast), background var(--t-fast);
    position: relative;
}

.ayah-item:hover {
    border-color: rgba(76,175,134,.15);
}

.ayah-item.sajdah {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
}

.ayah-item.highlighted {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.ayah-item.playing {
    background: var(--accent-soft);
    border-color: rgba(76,175,134,.3);
}

/* ── Ayah Number Badge ────────────────────────────── */

.ayah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ayah-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ayah-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 8px;
}

.sajdah-icon {
    font-size: 14px;
    color: var(--accent);
    opacity: .7;
}

/* ── Ayah Actions ─────────────────────────────────── */

.ayah-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--t-fast);
}

.ayah-item:hover .ayah-actions {
    opacity: 1;
}

/* On mobile, always visible */
@media (max-width: 768px) {
    .ayah-actions { opacity: .7; }
}

.ayah-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 14px;
}

.ayah-action-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent);
}

.ayah-action-btn.bookmarked {
    color: var(--accent);
}

/* ── Ayah Text ────────────────────────────────────── */

.ayah-arabic {
    font-family: var(--font-arabic);
    font-size: var(--arabic-size);
    line-height: var(--arabic-line);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    word-spacing: 4px;
    margin-bottom: 12px;
    padding: 4px 0;
}

.ayah-number-ar {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--accent);
    margin: 0 2px;
    direction: ltr;
    display: inline;
}

/* ── Translation ──────────────────────────────────── */

.ayah-translation {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    direction: ltr;
    text-align: left;
}

.ayah-translation[data-lang="ur"] {
    font-family: var(--font-urdu);
    font-size: 16px;
    direction: rtl;
    text-align: right;
}

.translation-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-faint);
    margin-bottom: 4px;
}


/* ── Reader Controls ──────────────────────────────── */

.reader-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.reader-nav-btns {
    display: flex;
    gap: 6px;
}

.reader-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    font-family: var(--font-ui);
}
.reader-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.reader-nav-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Translation Toggle ──────────────────────────── */

.lang-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 3px;
}

.lang-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: var(--font-ui);
}

.lang-btn.active {
    background: var(--accent);
    color: #fff;
}


/* ── Font Size Controls ──────────────────────────── */

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-size-btn {
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: var(--font-ui);
}
.font-size-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.font-size-label {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
}


/* ╔══════════════════════════════════════════════════╗
   ║            FLOATING AUDIO PLAYER                ║
   ╚══════════════════════════════════════════════════╝ */

.audio-player {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: calc(100% - 24px);
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    z-index: var(--z-audio);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.audio-player.active {
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 769px) {
    .audio-player {
        bottom: 20px;
    }
}

.audio-info {
    flex: 1;
    min-width: 0;
}
.audio-info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audio-info-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    transition: all var(--t-fast);
    font-size: 16px;
}
.audio-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-full);
}
.audio-play-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: scale(1.05);
}

.audio-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    transition: all var(--t-fast);
}
.audio-close:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Waveform */
.audio-progress {
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width .1s linear;
}


/* ╔══════════════════════════════════════════════════╗
   ║            SURAH DRAWER (Mobile)                ║
   ╚══════════════════════════════════════════════════╝ */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
}
.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    z-index: 151;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    padding: 20px;
}

.drawer.active {
    transform: translateY(0);
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: var(--text-faint);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.drawer-surah-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-surah-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--t-fast);
}
.drawer-surah-link:hover,
.drawer-surah-link.current {
    background: var(--accent-soft);
    color: var(--accent);
}

.drawer-surah-num {
    width: 28px;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
    font-size: 12px;
}

.drawer-surah-ar {
    font-family: var(--font-arabic);
    font-size: 16px;
    margin-left: auto;
}


/* ╔══════════════════════════════════════════════════╗
   ║            RESPONSIVE READER                    ║
   ╚══════════════════════════════════════════════════╝ */

@media (max-width: 480px) {
    .ayah-arabic {
        font-size: 22px;
    }
    .surah-header {
        padding: 20px 16px;
    }
    .surah-title-ar {
        font-size: 28px;
    }
    .bismillah {
        font-size: 22px;
    }
    .reader-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .reader-controls > * {
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .ayah-arabic {
        font-size: 32px;
        word-spacing: 6px;
    }
    .ayah-item {
        padding: 24px 28px;
    }
}

/* ── Qari Selector ───────────────────────────────── */

.qari-selector {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qari-selector select {
    outline: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color var(--t-fast);
    min-width: 120px;
    max-width: 160px;
    -webkit-appearance: none;
    appearance: none;
}

.qari-selector select:hover,
.qari-selector select:focus {
    border-color: var(--accent);
}

@media (max-width: 480px) {
    .qari-selector {
        display: none; /* Hidden on very small screens, user can pick in settings */
    }
}
