/* Sulala Quran reader styles (ported subset of legacy sulala.style.css
   Mushaf section). Legacy var(--sulala-*) replaced with literals — the
   family host theme does not define those tokens. */

@font-face {
  font-family: 'HafsSmart';
  src: url('../quran-fonts/HafsSmart_08.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DigitalKhatt';
  src: url('../quran-fonts/DigitalKhattV2.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DigitalKhattIndoPak';
  src: url('../quran-fonts/DigitalKhattIndoPak.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DigitalKhattQuranic';
  src: url('../quran-fonts/DigitalKhattQuranicV1.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MeQuran';
  src: url('../quran-fonts/me_quran_volt_newmet.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.mushaf-page.font-hafs .mushaf-text, .mushaf-page.font-hafs .quran-word {
  font-family: 'HafsSmart', 'Traditional Arabic', serif;
}

.mushaf-page.font-khatt .mushaf-text, .mushaf-page.font-khatt .quran-word {
  font-family: 'DigitalKhatt', 'Traditional Arabic', 'HafsSmart', serif;
}

.mushaf-page.font-indopak .mushaf-text, .mushaf-page.font-indopak .quran-word {
  font-family: 'DigitalKhattIndoPak', 'Traditional Arabic', 'HafsSmart', serif;
}

.mushaf-page.font-quranic .mushaf-text, .mushaf-page.font-quranic .quran-word {
  font-family: 'DigitalKhattQuranic', 'Traditional Arabic', 'HafsSmart', serif;
}

.mushaf-page.font-mequran .mushaf-text, .mushaf-page.font-mequran .quran-word {
  font-family: 'MeQuran', 'Traditional Arabic', 'HafsSmart', serif;
}

/* ---- Page frame (one Mushaf page = one unit) ------------- */
.mushaf-page {
    background: #FFFDF7;
    border: 1px solid #E5D9B8;
    border-radius: 8px;
    padding: 20px 18px 28px;
    margin: 0 auto;
    max-width: 640px;
    box-shadow: 0 2px 12px rgba(120,90,30,.08);
}

.mushaf-frame {
    border: 2px solid #C9A227;
    border-radius: 6px;
    padding: 4px;
}

.mushaf-frame-inner {
    border: 1px solid #C9A227;
    border-radius: 4px;
    padding: 18px 16px;
}

/* ---- Page header band (page no / juz / surah) ------------ */
.mushaf-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #8A7A4E;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #E5D9B8;
}

    .mushaf-page-head .mid {
        text-align: center;
        flex: 1;
    }

    .mushaf-page-head .surah-name-ar {
        font-family: 'Traditional Arabic', serif;
        font-size: 16px;
        color: #0F6E56;
    }

/* ---- Surah separator + basmala --------- */
.surah-sep {
    text-align: center;
    font-family: 'Traditional Arabic', serif;
    font-size: 18px;
    color: #7A5C0B;
    direction: rtl;
    padding: 8px 0 2px;
    border-top: 1px solid #C9A227;
    margin: 10px 0 4px;
}

.basmala {
    text-align: center;
    font-family: 'Traditional Arabic', serif;
    font-size: 16px;
    color: #1F2A44;
    direction: rtl;
    margin: 0 0 6px;
}

/* ---- Continuous Ayah text flow (justified, RTL) ---------- */
.mushaf-text {
    direction: rtl;
    text-align: justify;
    text-align-last: center;
    line-height: 2.6;
    color: #1A1A1A;
    font-size: 26px;
    font-family: 'Traditional Arabic', serif;
}

/* ---- Ayah-end marker (tap to play) ------------------------ */
.quran-ayah-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 28px;
    height: 28px;
    color: #0F6E56;
    font-size: 10px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    direction: ltr;
    margin: 0 4px;
    cursor: pointer;
    vertical-align: middle;
    z-index: 0;
    transition: color .15s;
}

    .quran-ayah-num::before {
        content: "\06DD";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Traditional Arabic', serif;
        font-size: 28px;
        color: #0F6E56;
        line-height: 1;
        z-index: -1;
        pointer-events: none;
    }

    .quran-ayah-num:hover {
        color: #1F2A44;
    }

    .quran-ayah-num:hover::before {
        color: #1F2A44;
    }

    .quran-ayah-num.playing {
        color: #1F2A44;
    }

    .quran-ayah-num.playing::before {
        color: #C0392B;
        animation: ayahPulse 1.1s ease-in-out infinite;
    }

/* ---- Word (tap for meaning) ----------------------------- */
.quran-word {
    cursor: pointer;
    padding: 0 1px;
    border-radius: 4px;
    transition: background .15s, color .15s;
    font-family: inherit;
}

    .quran-word:hover {
        background: rgba(15,110,86,.08);
    }

    .quran-word.active {
        background: #0F6E56;
        color: #fff;
    }

@keyframes ayahPulse {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

.ayah-playing {
    background: rgba(255,215,0,.25);
    border-radius: 6px;
    outline: 1px solid rgba(255,215,0,.4);
}

.ayah-highlight {
    background: rgba(255,215,0,.2);
    border-radius: 6px;
}

/* ---- Word-meaning popover ------------------------------- */
.quran-word-popover {
    position: absolute;
    z-index: 500;
    width: 200px;
    background: #fff;
    border: 1px solid #E5D9BF;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.16);
    padding: 12px 14px;
    text-align: center;
}

    .quran-word-popover .wp-word {
        font-family: 'Traditional Arabic', serif;
        font-size: 22px;
        color: #0F6E56;
        direction: rtl;
    }

    .quran-word-popover .wp-translit {
        font-size: 12px;
        color: #958DA5;
        font-style: italic;
        margin-top: 2px;
    }

    .quran-word-popover .wp-meaning {
        font-size: 14px;
        color: #1F2A44;
        font-weight: 600;
        margin-top: 6px;
    }

/* ---- Reader toolbar (above the page) -------------------- */
.mushaf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 60;
}

    .mushaf-toolbar .tb-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        border: 1px solid #EDEDF5;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #3A4A63;
        cursor: pointer;
        flex-shrink: 0;
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
    }

    .mushaf-toolbar .tb-spacer {
        flex: 1;
    }

    .mushaf-toolbar .tb-surah {
        font-size: 14px;
        font-weight: 700;
        color: #1F2A44;
        text-align: center;
        cursor: pointer;
        white-space: nowrap;
        flex: 1;
    }

        .mushaf-toolbar .tb-surah small {
            display: inline;
            font-size: 11px;
            color: #958DA5;
            font-weight: 400;
        }

    .mushaf-toolbar .tb-sep {
        width: 1px;
        height: 24px;
        background: #EDEDF5;
        flex-shrink: 0;
    }

    .mushaf-toolbar .tb-size {
        font-size: 12px;
        font-weight: 700;
        color: #3A4A63;
        min-width: 22px;
        text-align: center;
        flex-shrink: 0;
    }

/* ---- Option chips (font / reciter pickers) -------------- */
.qchip {
    padding: 6px 12px;
    border-radius: 99px;
    border: 1px solid #EDEDF5;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #3A4A63;
    cursor: pointer;
}

    .qchip.active {
        background: #0F6E56;
        border-color: #0F6E56;
        color: #fff;
    }

/* ---- Page navigation footer ----------------------------- */
.mushaf-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

    .mushaf-nav .pg-indicator {
        flex: 1;
        text-align: center;
        font-size: 13px;
        color: #958DA5;
    }

/* ---- Full-screen mode ----------------------------------- */
body.mushaf-fullscreen .mushaf-toolbar {
    display: none !important;
}

body.mushaf-fullscreen .mushaf-page {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    margin: 0;
}

body.mushaf-fullscreen .mushaf-fs-exit {
    display: flex !important;
}

.mushaf-fs-exit {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 600;
}

/* ---- Surah index rows ----------------------------------- */
.surah-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #EDEDF5;
    text-decoration: none;
    color: inherit;
}

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

.surah-num {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E7F4EE;
    color: #0F6E56;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transform: rotate(45deg);
}

    .surah-num span {
        transform: rotate(-45deg);
    }

/* ---- Hifz progress + review buttons ---------------------- */
.member-progress-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #EDEDF5;
}

    .member-progress-strip:last-child {
        border-bottom: none;
    }

.member-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: #EDEDF5;
    overflow: hidden;
    flex: 1;
}

.member-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: #0F6E56;
}

.hifz-rate-btn {
    flex: 1;
    padding: 14px 8px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.hifz-rate-knew {
    background: #E7F4EE;
    color: #0F6E56;
}

.hifz-rate-almost {
    background: #FAF3DF;
    color: #7A5C0B;
}

.hifz-rate-forgot {
    background: #FBE9E4;
    color: #993C1D;
}
