/* ════════════════════════════════════════════
   QURAN INDEX PAGE — uses global palette vars
   from :root / [data-bs-theme="dark"]
   (--gold, --emerald, --cream, --border, etc.)
════════════════════════════════════════════ */

.quran-index-page {
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    background: var(--cream);
}

/* ---- Hero (narrow, centered even in full-width page) ---- */
.quran-hero,
.search-bar-wrapper,
.filter-chips {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.quran-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.bismillah-calligraphy {
    font-family: var(--font-arabic);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--gold-dark);
    margin-bottom: 6px;
    direction: rtl;
}

[data-bs-theme="dark"] .bismillah-calligraphy {
    color: var(--gold-light);
}

.bismillah-sub {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 0.9rem;
}

.quran-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--emerald);
}

[data-bs-theme="dark"] .stat-num {
    color: var(--emerald-light);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* ---- Expandable search ---- */
.search-bar-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    position: relative;
    gap: 10px;
}

.search-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: var(--cream);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
    margin-bottom: 8px;
}

.search-icon-btn:hover {
    background: var(--cream-dark);
}

.surah-search-input {
    width: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: var(--cream-dark);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    overflow: hidden;
    pointer-events: none;
    transition:
        width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.35s ease;
}

.surah-search-input.is-open {
    width: min(100%, 420px);
    opacity: 1;
    padding: 0.6rem 1.2rem;
    pointer-events: auto;
    margin-bottom: 8px;
}

.surah-search-input:focus {
    outline: none;
    border-color: var(--gold-dark);
}

/* ---- Filter chips ---- */
.filter-chips {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    justify-content: center;
}

.chip {
    padding: 6px 12px;
    font-size: 0.72rem;
    font-family: var(--font-body);
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chip.active {
    background: var(--gold);
    color: var(--ink);
    border-color: var(--gold);
    font-weight: 600;
}

/* ---- Juz sections ---- */
.juz-section {
    margin-bottom: 22px;
}

.juz-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 0 4px 6px;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 10px;
}

.juz-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .juz-label {
    color: var(--gold-light);
}

.juz-title-ar {
    font-family: var(--font-arabic);
    font-size: 1rem;
    color: var(--emerald);
    direction: rtl;
}

[data-bs-theme="dark"] .juz-title-ar {
    color: var(--emerald-light);
}

.juz-title {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

/* ---- Surah grid ---- */
.surah-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.surah-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cream);
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.surah-row:hover {
    background: var(--cream-dark);
    border-color: var(--gold);
}

.surah-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cream-dark);
    color: var(--emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .surah-number {
    color: var(--emerald-light);
}

.surah-name-ar {
    font-size: 1.35rem;
    color: var(--emerald);
    font-family: var(--font-arabic);
    min-width: 70px;
    direction: rtl;
}

[data-bs-theme="dark"] .surah-name-ar {
    color: var(--emerald-light);
}

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

.surah-name-en {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}

.surah-ayah-count {
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ayah-count-total {
    color: var(--muted);
    opacity: 0.7;
}

.no-results-msg {
    text-align: center;
    color: var(--muted);
    padding: 2rem 0;
}

/* ---- Progress ring ---- */
.ring-bg {
    stroke: var(--border);
}
.ring-empty .ring-fill {
    stroke: var(--border);
}
.ring-progress .ring-fill {
    stroke: var(--gold-light);
}
.ring-complete .ring-fill {
    stroke: var(--emerald-light);
}
.ring-text {
    font-size: 9px;
    fill: var(--muted);
}

/* ---- Tablet: 2 columns ---- */
@media (max-width: 900px) {
    .surah-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Mobile: single column list ---- */
@media (max-width: 560px) {
    .quran-index-page {
        padding: 2rem 1rem 4rem;
    }

    .surah-list {
        grid-template-columns: 1fr;
        gap: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
    }

    .surah-row {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid var(--border);
    }

    .surah-row:last-child {
        border-bottom: none;
    }

    .bismillah-calligraphy {
        font-size: 1.5rem;
    }

    .surah-name-ar {
        font-size: 1.1rem;
        min-width: 50px;
    }

    .surah-row {
        gap: 10px;
        padding: 10px 12px;
    }

    .surah-search-input.is-open {
        width: 100%;
    }

    .juz-title-ar {
        display: none; /* chhoti screen pe space bachao */
    }
}

.juz-header svg {
    margin-left: auto; /* push ring to the right of the header row */
    flex-shrink: 0;
}

/* ---- Option 1: Continuation marker (upgraded from old badge) ---- */
.continuation-marker {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    color: var(--gold-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: 4px;
}

[data-bs-theme="dark"] .continuation-marker {
    color: var(--gold-light);
}

.ayah-resume-tag {
    font-size: 0.62rem;
    color: var(--emerald);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .ayah-resume-tag {
    color: var(--emerald-light);
}

.ayah-status-done {
    color: var(--emerald);
    font-weight: 600;
    font-size: 0.75rem;
}

[data-bs-theme="dark"] .ayah-status-done {
    color: var(--emerald-light);
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    justify-content: flex-center; /* 👈 right-aligned */
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip i {
    font-size: 0.85rem;
}

@media (max-width: 560px) {
    .chip {
        padding: 8px 10px;
        gap: 0;
    }

    .chip-label {
        display: none;
    }

    .chip i {
        font-size: 1rem;
    }
}

/* Remove old .continuation-badge rule if still present — replaced by .continuation-marker */
