/* ================= FONTS ================= */

@font-face {
    font-family: 'Sahel';
    src: url('../fonts/Sahel.woff') format('woff');
    font-weight: 400;
}

@font-face {
    font-family: 'Sahel';
    src: url('./fonts/Sahel-Bold.woff') format('woff');
    font-weight: 500;
}

@font-face {
    font-family: 'Sahel';
    src: url('./fonts/Sahel-Black.woff') format('woff');
    font-weight: 700;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2');
    font-weight: 400;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Medium.woff2') format('woff2');
    font-weight: 500;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: 700;
}

@font-face {
    font-family: 'QuranTaha';
    src: url('../fonts/QuranTaha.ttf') format('truetype');
}

@font-face {
    font-family: 'Nirizi';
    src: url('../fonts/Neirizi.ttf') format('truetype');
}

@font-face {
    font-family: 'Scheherazade New';
    src: url('../fonts/ScheherazadeNew-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/Shabnam.woff2') format('woff2');
}

/* ================= GLOBAL ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sahel', sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6e9 100%);
    min-height: 100vh;
    color: #1e2a2e;
}

select {
    font-family: inherit;
}

/* ================= TITLE ================= */

.title {
    text-align: center;
    padding: 30px 20px;
    font-size: 3rem;
    font-weight: 700;
    color: #00695c;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

/* ================= TOP FRAMES ================= */

.top-frames {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 60px;
    gap: 20px;
}

.islamic-frame {
    width: 160px;
    height: 210px;
    padding: 5px;
    /* background: linear-gradient(145deg, #d4af37, #f5e6a8, #b8962e); */
    background-color: hwb(0 0% 100%);
    border-radius: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.islamic-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* ================= BOOK GRID ================= */

.book-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin: 40px 20px;
}

.book-card {
    width: 180px;
    background: white;
    border-radius: 28px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 25px 15px 20px;
    cursor: pointer;
    transition: all .3s ease;
    border: 1px solid rgba(0, 150, 136, .2);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, .15);
    background: #fef9e6;
    border-color: #009688;
}

.book-card img {
    width: 90px;
    margin-bottom: 15px;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1));
}

.book-card p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #00695c;
}

/* ================= READER ================= */

#reader {
    padding: 20px;
    max-width: 1000px;
    margin: auto;
    background: #fef9e6;
    min-height: 100vh;
}

.reader-header {
    position: sticky;
    top: 0;
    background: #fef9e6;
    padding: 15px 0;
    z-index: 10;
    border-bottom: 2px solid #cfd8dc;
    margin-bottom: 25px;
}

.back-btn {
    background: #009688;
    border: none;
    padding: 8px 20px;
    color: white;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'vazir';
    font-size: .9rem;
    font-weight: 500;
}

#book-title {
    font-size: 1rem;
    border-right: 5px solid #d32f2f;
    padding-right: 15px;
    margin-top: 10px;
    color: #2c3e2f;
}

/* ================= PAGE ================= */

.page {
    background: #fff;
    border-radius: 28px;
    padding: 30px 28px;
    margin-bottom: 35px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.page-num {
    text-align: left;
    font-size: .85rem;
    color: #9e9e9e;
    margin-bottom: 20px;
}

/* ================= ARABIC ================= */

.arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 32px;
    line-height: 2;
    direction: rtl;
    text-align: start;
    color: #1c2a1f;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e0e0e0;
}

.verse-number {
    font-size: .9em;
    color: #b33b2c;
    margin-right: 8px;
}

/* ================= PERSIAN ================= */

.persian {
    font-family: 'Sahel', sans-serif;
    font-size: 18px;
    line-height: 1.9;
    text-align: right;
    color: #b33b2c;
    margin-top: 10px;
}

/* ================= SETTINGS ================= */

.settings-panel {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 150, 136, 0.18);

}

.setting {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #555;
}

.setting select {
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 4px 10px;
    font-family: 'vazir';
    background: #fafafa;
}

/* ================= DARK MODE ================= */

.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

.dark-mode #reader {
    background: #1e1e1e;
}

.dark-mode #book-title {
    font-size: 1rem;
    border-right: 5px solid #d32f2f;
    padding-right: 15px;
    margin-top: 10px;
    color: #ffffff;
}

.dark-mode .page {
    background: #2a2a2a;
    border: 1px solid #333;
}

.dark-mode .arabic {
    color: #f5f5f5;
}

.dark-mode .persian {
    color: #ff8a80;
}

.dark-mode .settings-panel {
    background: rgba(16, 24, 32, 0.9);
    border-color: rgba(0, 150, 136, 0.35);
}

.dark-mode .settings-panel label {
    color: #e0e0e0;
}

.dark-mode .settings-panel select {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}

.dark-mode .reader-header {
    background: #1e1e1e;
}

.dark-mode .title {
    color: #fff;
}

.dark-mode .book-card {
    background: #1e1e1e;
    color: #eee;
    border: 1px solid #333;
}

.dark-mode .book-card p {
    color: #bbb;
}

.dark-mode .audio-toolbar {
    background: rgba(16, 24, 32, 0.9);
    border-color: rgba(0, 150, 136, 0.35);
}

.dark-mode .audio-center label,
.dark-mode .audio-right label,
.dark-mode #audioCurrentTime,
.dark-mode #audioDuration {
    color: #e0f2f1;
}

.dark-mode .audio-toolbar select,
.dark-mode #reciterSelect,
.dark-mode #speedControl {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444;
}


.dark-mode #audioProgress {
    background: linear-gradient(to right,
            #26a69a 0%,
            #26a69a 0%,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.25) 100%);
}

.dark-mode .khatm-item {
    background: #1f1f1f;
    box-shadow: 0 0 0 transparent;
    border: 1px solid #333;
}

.dark-mode .khatm-number {
    color: #36d98f;
}

.dark-mode .khatm-name {
    color: #cfcfcf;
}

.dark-mode .khatm-section-title {
    color: #36d98f;
}


.dark-mode #toast {
    background: #2ecc71;
    color: #0f2e1d;
}

.dark-mode .section-divider {
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
}

.dark-mode .section-divider-text::before,
.dark-mode .section-divider-text::after {
    background: #444;
}

.dark-mode .section-divider-text {
    color: #bbb;
}


/* ================= BUTTON ================= */

.dark-toggle {
    font-family: 'vazir';
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #1e2a2e;
    color: #fff;
    font-size: .9rem;
}

/* ================= SCROLLBAR ================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #e8e8e8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #009688;
    border-radius: 10px;
}

/* ================= UTIL ================= */

.hidden {
    display: none;
}

/* ================= MOBILE ================= */

@media (max-width:768px) {

    .top-frames {
        position: relative;
        flex-direction: column;
        align-items: center;
    }

    .left-frame {
        position: absolute;
        left: 10px;
        top: 10px;
    }

    .right-frame {
        position: absolute;
        right: 10px;
        top: 10px;
    }

    .title {
        margin-top: 190px;
        font-size: 2rem;
    }
}

@media (max-width:700px) {

    .book-grid {
        gap: 20px;
    }

    .book-card {
        width: 150px;
        padding: 20px 10px;
    }

    .book-card img {
        width: 70px;
    }

    .arabic {
        font-size: 26px;
    }

    .persian {
        font-size: 16px;
    }

    .page {
        padding: 20px;
    }
}

@media (max-width:480px) {

    .islamic-frame {
        width: 100px;
        height: 135px;
    }

    .title {
        margin-top: 160px;
        font-size: 2rem;
    }
}

/* ================= AUDIO TOOLBAR ================= */

.audio-toolbar {
    margin: 20px auto 20px;
    max-width: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 150, 136, 0.18);
}

.audio-left,
.audio-center,
.audio-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audio-btn {
    border: none;
    background: #009688;
    color: #fff;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-size: 18px;
}

.audio-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 150, 136, 0.5);
    background: #00897b;
}

.audio-btn:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 150, 136, 0.4);
}

#audioCurrentTime,
#audioDuration {
    font-family: "Vazir", sans-serif;
    font-size: 13px;
    color: #455a64;
    min-width: 40px;
    text-align: center;
}

.audio-center label,
.audio-right label {
    font-size: 13px;
    color: #37474f;
}

#audioToolbar select,
.audio-toolbar select {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 4px 8px;
    font-size: 13px;
    background: #f9fafb;
    cursor: pointer;
}


#reciterSelect,
#speedControl {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 4px 8px;
    font-size: 13px;
    background: #f9fafb;
    cursor: pointer;
}

#audio-toolbar input[type="range"],
#audio-toolbar input[type=range] {
    accent-color: #009688;
}

#audio-toolbar {
    direction: rtl;
}


#audioToolbar,
.audio-toolbar input[type="range"] {
    accent-color: #009688;
}


.audio-toolbar input[type="range"] {
    accent-color: #009688;
}

@media (max-width: 768px) {
    .audio-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }

    .audio-left,
    .audio-center,
    .audio-right {
        justify-content: space-between;
    }
}

/* AUDIO PROGRESS BAR */

.audio-progress-container {
    width: 100%;
    margin-top: 8px;
    direction: ltr;
}

#audioProgress {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(to right,
            #009688 0%,
            #009688 0%,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.15) 100%);
    cursor: pointer;
    outline: none;
}

/* Thumb */
#audioProgress::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #009688;
    box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.2);
    transition: transform 0.15s ease;
}

#audioProgress::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Firefox */
#audioProgress::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #009688;
    border: none;
}

/* Khatm Bar */

.khatm-section-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1e7a45;
    margin-bottom: 25px;
}


.khatm-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 22px;
    max-width: 520px;
    margin: 20px auto 50px auto;
}

.khatm-item {
    background: #fff;
    border-radius: 18px;
    padding: 18px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.khatm-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}


.khatm-number {
    font-size: 38px;
    font-weight: 700;
    color: #1e7a45;
    margin-bottom: 8px;
}

.khatm-name {
    font-size: 13px;
    color: #555;
    text-align: center;
    line-height: 1.4;
}


.khatm_btn {
    background: hwb(148 2% 63%);
    border: none;
    padding: 8px 20px;
    color: white;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'vazir';
    font-size: .9rem;
    font-weight: 500;
}

.khatm_btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}


@media (max-width:600px) {

    .khatm-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        max-width: 100%;
        padding: 0 10px;
        margin: 20px auto 40px auto;
    }

    .khatm-number {
        font-size: 32px;
    }

    .khatm-name {
        font-size: 12px;
        max-width: 100px;
    }

}

/* Toast */
#toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e7a45;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all .35s ease;
    z-index: 9999;
}

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

/* Section Devider */
.section-divider {
    width: 100%;
    max-width: 600px;
    height: 1px;
    margin: 40px auto;
    background: linear-gradient(to right,
            transparent,
            rgba(0, 0, 0, 0.15),
            transparent);
}

/* Section Devider Text */
.section-divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 45px auto;
    max-width: 600px;
    color: #666;
    font-size: 25px;
    font-weight: 500;
}

.section-divider-text::before,
.section-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.section-divider-text span {
    padding: 0 15px;
}