/* Al-Quran App Styles - Deenverse Theme */

/* ============================================
   CUSTOM FONT - Al Qalam Quran Majeed
   ============================================ */
@font-face {
    font-family: 'Al Qalam Quran Majeed';
    src: url('/assets/fonts/alqalam.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CUSTOM FONT - Arabic Nasqah
   ============================================ */
@font-face {
    font-family: 'Arabic Nasqah';
    src: url('/assets/fonts/arabicnasqah.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   BODY LAYOUT FIX - Keep footer at bottom
   ============================================ */
body:has(.quran-page) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:has(.quran-page) .site-footer {
    margin-top: auto;
}

/* ============================================
   QURAN PAGE CONTAINER
   ============================================ */
.quran-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.quran-app {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.quran-main {
    padding-top: var(--space-4);
    padding-bottom: 100px;
    /* Space for audio bar */
    flex: 1;
}

/* ============================================
   SUB HEADER (Surah View Controls)
   ============================================ */
.quran-sub-header {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: var(--space-2) 0;
    position: sticky;
    top: 60px;
    z-index: 35;
}

.sub-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
}

.surah-title-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.surah-arabic {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 18px;
    color: var(--gold);
}

.surah-name {
    font-size: var(--font-sm);
    color: var(--muted);
}

.view-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.translation-dropdown {
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--font-sm);
    cursor: pointer;
}

.translation-dropdown:focus {
    outline: none;
    border-color: var(--gold);
}

.view-modes {
    display: flex;
    gap: 4px;
    background: var(--bg-panel);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    background: var(--gold);
    color: var(--bg);
}

.settings-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-icon-btn:hover {
    background: rgba(255, 231, 10, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

/* ============================================
   CHAPTERS VIEW
   ============================================ */
.chapters-view {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapters-header {
    text-align: center;
    margin-bottom: var(--space-5);
}

.page-title {
    font-size: var(--font-xxl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--text) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: var(--font-base);
    color: var(--muted);
    margin-bottom: var(--space-4);
}

.chapters-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tab-buttons {
    display: inline-flex;
    background: var(--bg-panel);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.tab-btn {
    padding: 10px 28px;
    border: none;
    background: transparent;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    background: var(--gold);
    color: var(--bg);
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.chapter-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chapter-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 12px 32px rgba(255, 231, 10, 0.08);
}

.chapter-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-name-en {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--text);
    margin-bottom: 4px;
}

.chapter-name-ar {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 18px;
    color: var(--gold);
}

.chapter-meta {
    font-size: var(--font-xs);
    color: var(--muted);
    margin-top: 4px;
    text-transform: capitalize;
}

/* Juz Grid */
.juz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-2);
}

.juz-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.juz-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.juz-number {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 4px;
}

.juz-label {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 18px;
    color: var(--gold);
}

.juz-surah-info {
    font-size: var(--font-xs);
    color: var(--muted);
    margin-top: 6px;
    opacity: 0.8;
    line-height: 1.4;
}

/* ============================================
   SURAH READING VIEW
   ============================================ */
.surah-view {
    animation: fadeIn 0.3s ease;
}

.surah-content {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    max-width: 900px;
    margin: 0 auto;
}

/* Surah Header */
.surah-header-content {
    text-align: center;
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, rgba(30, 58, 38, 0.8), rgba(19, 42, 28, 0.9));
    border-radius: var(--radius);
    border: 1px solid rgba(255, 231, 10, 0.15);
}

.surah-header-content .surah-name-ar {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 8px;
}

.surah-header-content .surah-name-en {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.surah-header-content .surah-meta {
    font-size: var(--font-sm);
    color: var(--muted);
    text-transform: capitalize;
}

/* Bismillah */
.bismillah {
    text-align: center;
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 32px;
    color: var(--gold);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

/* Verse Styles - Vertical View */
.verse-vertical {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.verse-bookmark-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verse-bookmark-btn:hover {
    color: var(--gold);
    background: rgba(255, 231, 10, 0.1);
}

.verse-bookmark-btn.bookmarked {
    color: var(--gold);
}

.verse-bookmark-btn.bookmarked svg {
    fill: var(--gold);
}

.verse-vertical:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.verse-arabic-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--space-3);
    direction: rtl;
}

.verse-number-circle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verse-number-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 231, 10, 0.3);
}

.verse-arabic {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: var(--font-medium, 28px);
    line-height: 2.2;
    color: var(--text);
    text-align: right;
    flex: 1;
}

/* Font sizes */
:root {
    --font-smallest: 20px;
    --font-smaller: 24px;
    --font-medium: 28px;
    --font-larger: 34px;
    --font-largest: 42px;
}

.verse-arabic.font-smallest {
    font-size: var(--font-smallest);
}

.verse-arabic.font-smaller {
    font-size: var(--font-smaller);
}

.verse-arabic.font-medium {
    font-size: var(--font-medium);
}

.verse-arabic.font-larger {
    font-size: var(--font-larger);
}

.verse-arabic.font-largest {
    font-size: var(--font-largest);
}

.verse-arabic.font-amiri {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
}

.verse-arabic.font-scheherazade {
    font-family: 'Scheherazade New', 'Traditional Arabic', serif;
}

.verse-arabic.font-nastaliq {
    font-family: 'Al Qalam Quran Majeed', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
    line-height: 2.8;
}

.verse-arabic.font-nasqah {
    font-family: 'Arabic Nasqah', 'Traditional Arabic', serif;
    line-height: 2.4;
}

.verse-translation {
    font-size: var(--font-sm);
    line-height: 1.8;
    color: var(--muted);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
    text-align: left;
    direction: ltr;
}

.verse-translator {
    font-size: var(--font-xs);
    color: var(--muted-strong);
    text-transform: uppercase;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* Verse Active/Playing State */
.verse-vertical.active {
    background: rgba(255, 231, 10, 0.03);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: var(--radius-sm);
}

.verse-vertical.playing {
    background: rgba(76, 175, 80, 0.08);
    border-left: 3px solid #4CAF50;
}

/* Block View */
.block-view {
    direction: rtl;
    text-align: justify;
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: var(--font-medium);
    line-height: 2.5;
    padding: var(--space-4);
    color: var(--text);
}

.block-view.font-nastaliq {
    font-family: 'Al Qalam Quran Majeed', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
    line-height: 3;
}

.block-view.font-nasqah {
    font-family: 'Arabic Nasqah', 'Traditional Arabic', serif;
    line-height: 2.8;
}

.block-view .verse-inline {
    display: inline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.block-view .verse-inline:hover {
    color: var(--gold);
}

.block-view .verse-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--gold);
    color: var(--bg);
    border-radius: 50%;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin: 0 4px;
    vertical-align: middle;
}

/* ============================================
   AUDIO BAR
   ============================================ */
.audio-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(30, 58, 38, 0.98), rgba(19, 42, 28, 0.98));
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: var(--space-2) 0;
    z-index: 100;
}

.audio-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.audio-info {
    flex: 1;
}

.audio-verse {
    font-size: var(--font-sm);
    color: var(--muted);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-xs);
    font-weight: 600;
    transition: all 0.2s ease;
}

.audio-btn:hover {
    background: rgba(255, 231, 10, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

.audio-btn.play-btn {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

.audio-btn.play-btn:hover {
    background: var(--gold-soft);
    transform: scale(1.05);
}

.audio-btn.surah-play-btn.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
    color: white;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(76, 175, 80, 0.4);
    }
}

.audio-progress {
    width: 180px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.1s linear;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 99, 99, 0.15);
    color: var(--danger);
}

.modal-content {
    padding: var(--space-4);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

/* Settings Sections */
.settings-section {
    margin-bottom: var(--space-4);
}

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

.settings-section h3 {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-size-grid {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.font-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.03);
}

.radio-label input[type="radio"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

.size-buttons {
    display: flex;
    gap: 6px;
}

.size-btn {
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: var(--bg-panel);
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

.size-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.size-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg);
}

.font-preview {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 28px;
    text-align: center;
    padding: var(--space-4);
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    direction: rtl;
    color: var(--gold);
}

.font-preview.font-nastaliq {
    font-family: 'Al Qalam Quran Majeed', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
    line-height: 2.5;
}

.font-preview.font-nasqah {
    font-family: 'Arabic Nasqah', 'Traditional Arabic', serif;
    line-height: 2.4;
}

.reciter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Goto Modal */
.goto-search {
    margin-bottom: var(--space-3);
}

.goto-search input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: var(--font-base);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

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

.goto-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 231, 10, 0.1);
}

.goto-list {
    max-height: 350px;
    overflow-y: auto;
}

.goto-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.goto-item:hover {
    background: rgba(255, 231, 10, 0.05);
}

.goto-item-number {
    font-weight: 700;
    color: var(--gold);
    min-width: 28px;
}

.goto-item-name {
    flex: 1;
    color: var(--text);
    font-size: var(--font-sm);
}

.goto-item-arabic {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 16px;
    color: var(--muted);
}

/* Search Modal */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: var(--space-4);
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: var(--font-sm);
    color: var(--text);
    outline: none;
}

.search-box input:focus {
    border-color: var(--gold);
}

.search-results {
    max-height: 350px;
    overflow-y: auto;
}

.search-result-item {
    padding: var(--space-3);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 231, 10, 0.03);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-verse {
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 4px;
}

.search-result-text {
    font-size: var(--font-sm);
    color: var(--muted);
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: var(--space-6);
    color: var(--muted);
    font-size: var(--font-base);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .quran-sub-header {
        top: 52px;
    }

    .sub-header-content {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .surah-title-bar {
        order: -1;
        width: 100%;
        margin-bottom: var(--space-2);
    }

    .back-btn span:not(.sr-only) {
        display: none;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
    }

    .surah-content {
        padding: var(--space-3);
    }

    .audio-bar-content {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .audio-controls {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .audio-info {
        text-align: center;
        width: 100%;
    }

    .audio-progress {
        width: 100%;
    }

    .audio-btn span {
        display: none;
    }

    .modal {
        max-height: 90vh;
    }

    .font-size-grid {
        flex-direction: column;
    }

    .reciter-grid {
        grid-template-columns: 1fr;
    }

    .chapters-actions {
        flex-direction: column;
    }
}

/* Custom scrollbar */
.goto-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.goto-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

.goto-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

.goto-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ============================================
   BOOKMARKS
   ============================================ */

/* Verse Bookmark Button */
.verse-bookmark-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: auto;
    direction: ltr;
}

.verse-bookmark-btn:hover {
    background: rgba(255, 231, 10, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

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

/* Bookmarks List */
.bookmarks-list {
    max-height: 400px;
    overflow-y: auto;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    transition: background 0.2s ease;
}

.bookmark-item:last-child {
    border-bottom: none;
}

.bookmark-item:hover {
    background: rgba(255, 231, 10, 0.03);
}

.bookmark-info {
    flex: 1;
    cursor: pointer;
}

.bookmark-surah {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.bookmark-number {
    font-weight: 700;
    color: var(--gold);
    font-size: var(--font-sm);
    min-width: 45px;
}

.bookmark-name {
    color: var(--text);
    font-size: var(--font-sm);
    font-weight: 500;
}

.bookmark-arabic {
    font-family: 'Amiri Quran', 'Traditional Arabic', serif;
    font-size: 16px;
    color: var(--muted);
    margin-left: auto;
}

.bookmark-date {
    font-size: var(--font-xs);
    color: var(--muted-strong);
}

.bookmark-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookmark-delete:hover {
    background: rgba(255, 99, 99, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gold);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: var(--font-sm);
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(255, 231, 10, 0.35);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   THEME TOGGLE BUTTONS
   ============================================ */
.theme-buttons {
    display: flex;
    gap: 8px;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    background: var(--bg-panel);
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.theme-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg);
}

.theme-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   LIGHT MODE THEME
   ============================================ */
.quran-page.light-mode {
    --bg: #f7f1e6;
    --bg-elev: #fffdf7;
    --bg-panel: #fffdf7;
    --text: #2c2721;
    --text-soft: #4a453e;
    --muted: #5f5a52;
    --muted-strong: #6f6a62;
    --line: rgba(92, 74, 52, 0.2);
    --line-soft: rgba(92, 74, 52, 0.12);
    --gold: #c49745;
    --gold-soft: #d4a856;
    --accent-shadow: rgba(196, 151, 69, 0.35);
    --danger: #dc3545;

    background: radial-gradient(120% 120% at 12% 0%, rgba(255, 231, 10, 0.12), transparent 55%),
        linear-gradient(180deg, #f7f1e6 0%, #efe4d2 55%, #e6dbc7 100%);
}

/* Light mode - Sub Header */
.quran-page.light-mode .quran-sub-header {
    background: rgba(255, 253, 247, 0.95);
    border-bottom-color: rgba(92, 74, 52, 0.15);
    backdrop-filter: blur(12px);
}

.quran-page.light-mode .back-btn {
    background: rgba(92, 74, 52, 0.08);
    border-color: rgba(92, 74, 52, 0.2);
    color: #5f5a52;
}

.quran-page.light-mode .back-btn:hover {
    background: rgba(92, 74, 52, 0.12);
    color: #2c2721;
    border-color: rgba(92, 74, 52, 0.35);
}

.quran-page.light-mode .surah-arabic {
    color: #7b5b25;
}

.quran-page.light-mode .translation-dropdown {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
    color: #2c2721;
}

.quran-page.light-mode .translation-dropdown:focus {
    border-color: #c49745;
}

.quran-page.light-mode .view-modes {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
}

.quran-page.light-mode .view-btn {
    color: #5f5a52;
}

.quran-page.light-mode .view-btn:hover {
    color: #2c2721;
    background: rgba(92, 74, 52, 0.08);
}

.quran-page.light-mode .view-btn.active {
    background: linear-gradient(180deg, #c49745, #a67c32);
    color: #fff;
}

.quran-page.light-mode .settings-icon-btn {
    background: rgba(92, 74, 52, 0.08);
    border-color: rgba(92, 74, 52, 0.2);
    color: #5f5a52;
}

.quran-page.light-mode .settings-icon-btn:hover {
    background: rgba(196, 151, 69, 0.15);
    border-color: #c49745;
    color: #7b5b25;
}

/* Light mode - Page Title */
.quran-page.light-mode .page-title {
    background: linear-gradient(135deg, #2c2721 0%, #7b5b25 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quran-page.light-mode .page-subtitle {
    color: #5f5a52;
}

/* Light mode - Tab Buttons */
.quran-page.light-mode .tab-buttons {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
}

.quran-page.light-mode .tab-btn {
    color: #5f5a52;
}

.quran-page.light-mode .tab-btn:hover {
    color: #2c2721;
}

.quran-page.light-mode .tab-btn.active {
    background: linear-gradient(180deg, #c49745, #a67c32);
    color: #fff;
}

/* Light mode - Chapter Cards */
.quran-page.light-mode .chapter-card {
    background: #fffdf7;
    border-color: rgba(186, 165, 122, 0.3);
    box-shadow: 0 8px 24px rgba(68, 56, 40, 0.12);
}

.quran-page.light-mode .chapter-card:hover {
    border-color: #c49745;
    box-shadow: 0 16px 40px rgba(196, 151, 69, 0.2);
}

.quran-page.light-mode .chapter-number {
    background: linear-gradient(135deg, #c49745, #d4a856);
    color: #fff;
}

.quran-page.light-mode .chapter-name-en {
    color: #2c2721;
}

.quran-page.light-mode .chapter-name-ar {
    color: #7b5b25;
}

.quran-page.light-mode .chapter-meta {
    color: #6f6a62;
}

/* Light mode - Juz Cards */
.quran-page.light-mode .juz-card {
    background: #fffdf7;
    border-color: rgba(186, 165, 122, 0.3);
}

.quran-page.light-mode .juz-card:hover {
    border-color: #c49745;
}

.quran-page.light-mode .juz-number {
    color: #7b5b25;
}

.quran-page.light-mode .juz-label {
    color: #5f5a52;
}

/* Light mode - Surah Content */
.quran-page.light-mode .surah-content {
    background: #fffdf7;
    border-color: rgba(186, 165, 122, 0.3);
    box-shadow: 0 12px 40px rgba(68, 56, 40, 0.15);
}

.quran-page.light-mode .surah-header-content {
    background: linear-gradient(135deg, rgba(47, 93, 74, 0.9), rgba(33, 75, 62, 0.95));
    border-color: rgba(47, 93, 74, 0.3);
}

.quran-page.light-mode .surah-header-content .surah-name-ar {
    color: #f7e970;
}

.quran-page.light-mode .surah-header-content .surah-name-en {
    color: #f8f4ea;
}

.quran-page.light-mode .surah-header-content .surah-meta {
    color: rgba(248, 244, 234, 0.75);
}

.quran-page.light-mode .bismillah {
    color: #7b5b25;
    border-bottom-color: rgba(92, 74, 52, 0.15);
}

/* Light mode - Verse Styles */
.quran-page.light-mode .verse-vertical {
    border-bottom-color: rgba(92, 74, 52, 0.12);
}

.quran-page.light-mode .verse-number-circle {
    background: linear-gradient(135deg, #c49745, #d4a856);
    color: #fff;
}

.quran-page.light-mode .verse-number-circle:hover {
    box-shadow: 0 8px 20px rgba(196, 151, 69, 0.4);
}

.quran-page.light-mode .verse-arabic {
    color: #2c2721;
}

.quran-page.light-mode .verse-translation {
    background: rgba(92, 74, 52, 0.05);
    border-left-color: #c49745;
    color: #4a453e;
}

.quran-page.light-mode .verse-translator {
    color: #6f6a62;
}

.quran-page.light-mode .verse-vertical.active {
    background: rgba(196, 151, 69, 0.08);
}

.quran-page.light-mode .verse-vertical.playing {
    background: rgba(47, 93, 74, 0.1);
    border-left-color: #2f5d4a;
}

/* Light mode - Block View */
.quran-page.light-mode .block-view {
    color: #2c2721;
}

.quran-page.light-mode .block-view .verse-inline:hover {
    color: #7b5b25;
}

.quran-page.light-mode .block-view .verse-marker {
    background: #c49745;
    color: #fff;
}

/* Light mode - Audio Bar */
.quran-page.light-mode .audio-bar {
    background: linear-gradient(135deg, rgba(47, 93, 74, 0.98), rgba(33, 75, 62, 0.98));
    border-top-color: rgba(47, 93, 74, 0.3);
}

.quran-page.light-mode .audio-verse {
    color: rgba(248, 244, 234, 0.8);
}

.quran-page.light-mode .audio-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8f4ea;
}

.quran-page.light-mode .audio-btn:hover {
    background: rgba(247, 233, 112, 0.2);
    border-color: #f7e970;
    color: #f7e970;
}

.quran-page.light-mode .audio-btn.play-btn {
    background: #f7e970;
    border-color: #f7e970;
    color: #2f5d4a;
}

.quran-page.light-mode .audio-btn.play-btn:hover {
    background: #fff27a;
}

.quran-page.light-mode .progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.quran-page.light-mode .progress-fill {
    background: #f7e970;
}

/* Light mode - Modals */
.quran-page.light-mode .modal-overlay {
    background: rgba(44, 39, 33, 0.65);
}

.quran-page.light-mode .modal {
    background: #fffdf7;
    border-color: rgba(186, 165, 122, 0.3);
    box-shadow: 0 32px 64px rgba(68, 56, 40, 0.35);
}

.quran-page.light-mode .modal-header {
    border-bottom-color: rgba(92, 74, 52, 0.12);
}

.quran-page.light-mode .modal-header h2 {
    color: #2c2721;
}

.quran-page.light-mode .modal-close {
    background: rgba(92, 74, 52, 0.08);
    color: #5f5a52;
}

.quran-page.light-mode .modal-close:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.quran-page.light-mode .modal-footer {
    border-top-color: rgba(92, 74, 52, 0.12);
}

.quran-page.light-mode .settings-section h3 {
    color: #6f6a62;
}

.quran-page.light-mode .radio-label {
    color: #2c2721;
}

.quran-page.light-mode .radio-label:hover {
    background: rgba(92, 74, 52, 0.06);
}

.quran-page.light-mode .radio-label input[type="radio"] {
    accent-color: #c49745;
}

.quran-page.light-mode .size-btn,
.quran-page.light-mode .theme-btn {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
    color: #5f5a52;
}

.quran-page.light-mode .size-btn:hover,
.quran-page.light-mode .theme-btn:hover {
    border-color: #c49745;
    color: #7b5b25;
}

.quran-page.light-mode .size-btn.active,
.quran-page.light-mode .theme-btn.active {
    background: linear-gradient(180deg, #c49745, #a67c32);
    border-color: #c49745;
    color: #fff;
}

.quran-page.light-mode .font-preview {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
    color: #7b5b25;
}

/* Light mode - Goto Modal */
.quran-page.light-mode .goto-search input {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
    color: #2c2721;
}

.quran-page.light-mode .goto-search input::placeholder {
    color: #6f6a62;
}

.quran-page.light-mode .goto-search input:focus {
    border-color: #c49745;
    box-shadow: 0 0 0 3px rgba(196, 151, 69, 0.15);
}

.quran-page.light-mode .goto-item:hover {
    background: rgba(196, 151, 69, 0.1);
}

.quran-page.light-mode .goto-item-number {
    color: #7b5b25;
}

.quran-page.light-mode .goto-item-name {
    color: #2c2721;
}

.quran-page.light-mode .goto-item-arabic {
    color: #5f5a52;
}

/* Light mode - Search Modal */
.quran-page.light-mode .search-box input {
    background: #fffdf7;
    border-color: rgba(92, 74, 52, 0.2);
    color: #2c2721;
}

.quran-page.light-mode .search-box input:focus {
    border-color: #c49745;
}

.quran-page.light-mode .search-result-item {
    border-bottom-color: rgba(92, 74, 52, 0.12);
}

.quran-page.light-mode .search-result-item:hover {
    background: rgba(196, 151, 69, 0.08);
}

.quran-page.light-mode .search-result-verse {
    color: #7b5b25;
}

.quran-page.light-mode .search-result-text {
    color: #5f5a52;
}

/* Light mode - Bookmarks */
.quran-page.light-mode .verse-bookmark-btn {
    border-color: rgba(92, 74, 52, 0.2);
    color: #5f5a52;
}

.quran-page.light-mode .verse-bookmark-btn:hover {
    background: rgba(196, 151, 69, 0.12);
    border-color: #c49745;
    color: #7b5b25;
}

.quran-page.light-mode .bookmark-item {
    border-bottom-color: rgba(92, 74, 52, 0.12);
}

.quran-page.light-mode .bookmark-item:hover {
    background: rgba(196, 151, 69, 0.06);
}

.quran-page.light-mode .bookmark-number {
    color: #7b5b25;
}

.quran-page.light-mode .bookmark-name {
    color: #2c2721;
}

.quran-page.light-mode .bookmark-arabic {
    color: #5f5a52;
}

.quran-page.light-mode .bookmark-date {
    color: #6f6a62;
}

.quran-page.light-mode .bookmark-delete {
    border-color: rgba(92, 74, 52, 0.2);
    color: #5f5a52;
}

.quran-page.light-mode .bookmark-delete:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

/* Light mode - Toast */
.quran-page.light-mode .toast-message {
    background: linear-gradient(135deg, #2f5d4a, #214b3e);
    color: #f8f4ea;
    box-shadow: 0 8px 24px rgba(47, 93, 74, 0.4);
}

/* Light mode - Loading */
.quran-page.light-mode .loading-spinner {
    color: #5f5a52;
}

/* Light mode - Buttons */
.quran-page.light-mode .btn-ghost {
    color: #2c2721;
    border-color: rgba(92, 74, 52, 0.35);
    background: rgba(255, 255, 255, 0.6);
}

.quran-page.light-mode .btn-ghost:hover {
    border-color: rgba(92, 74, 52, 0.6);
    box-shadow: 0 10px 24px rgba(76, 65, 48, 0.16);
}

.quran-page.light-mode .btn-accent {
    background: linear-gradient(180deg, #2f6a55, #214b3e);
    color: #f7f1e8;
    border: 1px solid rgba(25, 58, 47, 0.45);
}

.quran-page.light-mode .btn-accent:hover {
    filter: brightness(1.05);
}

/* Light mode - Scrollbar */
.quran-page.light-mode .goto-list::-webkit-scrollbar-track,
.quran-page.light-mode .search-results::-webkit-scrollbar-track,
.quran-page.light-mode .modal-content::-webkit-scrollbar-track {
    background: #efe4d2;
}

.quran-page.light-mode .goto-list::-webkit-scrollbar-thumb,
.quran-page.light-mode .search-results::-webkit-scrollbar-thumb,
.quran-page.light-mode .modal-content::-webkit-scrollbar-thumb {
    background: rgba(92, 74, 52, 0.3);
}

.quran-page.light-mode .goto-list::-webkit-scrollbar-thumb:hover,
.quran-page.light-mode .search-results::-webkit-scrollbar-thumb:hover,
.quran-page.light-mode .modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(92, 74, 52, 0.5);
}