/* assets/css/mistakes.css */

/* ... (rest of the file content) ... */

/* ============================ */
/* New Surah Navigation Cards   */
/* ============================ */

/* Grid Layout for Surah Selection */
#nav_sura_grid,
#nav_juz_grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem;
}

.surah-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* background-color: var(--pico-background-color); */
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.surah-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* background-color: var(--pico-card-background-color); */
}

.surah-card:active {
    transform: translateY(0);
}

/* Right Section: Number + Titles */
.surah-card__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.surah-card__number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #285e61;
    /* Dark Cyan/Teal border from image */
    /* color: var(--pico-color); */
    font-family: system-ui, -apple-system, sans-serif;
    /* Simplified for number */
    font-weight: bold;
    font-size: 1.1rem;
    background: transparent;
    background-color: var(--pico-color);
    color: var(--pico-primary-inverse);
}

.surah-card__titles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.surah-card__name {
    /* font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui; */
    /* Usint the Arabic font */
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--pico-color);
    /* line-height: 1.2; */
}

/* Left Section: Info (Page, Verses) */
.surah-card__left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.surah-card__info {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    font-family: system-ui, -apple-system, sans-serif;
    /* Cleaner font for small info */
}

/* Colors for Dark Mode adjustments if needed */
body[data-theme="dark"] .surah-card {
    background-color: var(--pico-card-background-color);
    border-color: var(--pico-muted-border-color);
}

body[data-theme="dark"] .surah-card:hover {
    background-color: var(--pico-background-color);
}

body[data-theme="dark"] .surah-card__number {
    border-color: #649dd6;
    /* Lighter color for dark mode */
}

/* Sticky Header Styles */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--pico-background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

body[data-theme="dark"] .sticky-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


.sticky-header nav {
    width: 100%;
    padding: 5px;
}

.sticky-header nav ul {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    width: 100%;
}

.sticky-header nav ul li {
    padding: 0;
    margin: 2px 5px;
}

.sticky-header nav ul li:last-child {
    margin-right: auto;
    margin-left: 0;
}

/* إخفاء السهم من القائمة المنسدلة */
.sticky-header nav details summary {
    list-style: none;
}

.sticky-header nav details summary::marker,
.sticky-header nav details summary::-webkit-details-marker {
    display: none;
}

.sticky-header nav ul li a,
.sticky-header nav ul li summary {
    padding: 0.25rem 0.5rem;
}


/* تحسين مظهر القائمة المنسدلة في الـ header */
.sticky-header nav details[class~="dropdown"] ul {
    min-width: 180px;
    left: 0;
    right: auto;
}

.sticky-header nav details[class~="dropdown"] ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticky-header nav details[class~="dropdown"] ul li a svg {
    flex-shrink: 0;
}

/* Mistake Highlights on Words */
.mistake {
    border-bottom-width: 3px;
    border-bottom-style: solid;
    padding-bottom: 2px;
}

.mistake.error {
    /* border-bottom-color: #ef5350; */
    /* Red */
    background-color: rgba(239, 83, 80, 0.1);
}

.mistake.hesitation {
    /* border-bottom-color: #ffca28; */
    /* Amber */
    background-color: rgba(255, 202, 40, 0.1);
}

.mistake.alert {
    /* border-bottom-color: #42a5f5; */
    /* Blue */
    background-color: rgba(66, 165, 245, 0.1);
}

.quran-word {
    cursor: pointer;
    /* ensure clickability */
    border-radius: 4px;
    transition: background-color 0.2s;
}


/* Modal Styles */
.mistake-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mistake-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mistake-modal__content {
    position: relative;
    background: var(--pico-card-background-color);
    padding: 1.5rem;
    border-radius: var(--pico-border-radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--pico-box-shadow);
    border: 1px solid var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mistake-modal__content h3 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.mistake-modal__types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mistake-btn {
    padding: 0.5rem;
    border: 2px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-background-color);
    cursor: pointer;
    /* font-weight: 500; */
    transition: all 0.2s;
    color: var(--pico-color);
}

.mistake-btn.error {
    /* color: #d32f2f; */
    border-color: #d32f2f;
}

.mistake-btn.hesitation {
    /* color: #f57c00; */
    border-color: #f57c00;
}

.mistake-btn.alert {
    /* color: #1976d2; */
    border-color: #1976d2;
}

.mistake-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* font-weight: 600; */
}

.mistake-btn.selected.error {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.mistake-btn.selected.hesitation {
    background: #f57c00;
    color: white;
    border-color: #f57c00;
}

.mistake-btn.selected.alert {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* Character Selection Styles */
.word-chars-container {
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    min-height: 60px;
    direction: rtl;
    padding: 0.5rem;
}

#word_text_selection {
    font-family: 'Hafs', serif;
}

#word_text_selection mark {
    border-radius: 4px;
    padding: 2px 4px;
}

#mistake_note {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    resize: vertical;
    background: var(--pico-background-color);
    color: var(--pico-color);
}

.mistake-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-save,
.btn-cancel,
.btn-delete {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    /* font-weight: 500; */
}

.btn-save {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
}

.btn-save:hover {
    background: var(--pico-primary-hover);
}

.btn-cancel {
    background: var(--pico-secondary);
    color: var(--pico-secondary-inverse);
    border: 1px solid var(--pico-muted-border-color);
}

.btn-cancel:hover {
    background: var(--pico-secondary-hover);
}

.btn-delete {
    background: #d32f2f;
    color: white;
    margin-left: auto;
    /* push to left (rtl: right) */
}

.btn-delete:hover {
    background: #b71c1c;
}

/* assets/css/word-menu.css */

/* ============================ */
/* Compact Word Menu - Icon Style */
/* ============================ */
.word-compact-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}

.word-compact-menu[hidden] {
    display: none !important;
}

.word-compact-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.word-compact-menu__content {
    position: fixed;
    background: var(--pico-background-color);
    border-radius: 8px;
    padding: 0.6rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 280px;
}

body[data-theme="dark"] .word-compact-menu__content {
    border-color: rgba(255, 255, 255, 0.15);
}

/* قسم معنى الكلمة */
.word-meaning-section {
    padding: 0.6rem;
    /* background: var(--pico-card-background-color); */
    /* border-radius: 6px; */
    text-align: center;
    /* border: 1px solid var(--pico-muted-border-color); */
}

.word-meaning-text {
    font-size: calc(1.8rem * var(--verses-font-scale));
    line-height: calc(3.1rem * var(--verses-font-scale));
    color: var(--pico-color);
    font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui;
}

/* مجموعة الأزرار */
.word-menu-buttons {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.word-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 18px;
    padding: 0;
    position: relative;
}

.word-menu-btn .icon {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-menu-btn .label {
    display: none;
}

/* Tooltip on hover */
.word-menu-btn[data-action="note"]:hover::after {
    content: "ملاحظة";
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
}

.word-menu-btn[data-action="audio"]:hover::after {
    content: "قراءة";
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
}

/* ============================ */
/* Compact Ayah Menu - Icon Style */
/* ============================ */
.ayah-compact-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}

.ayah-compact-menu[hidden] {
    display: none !important;
}

.ayah-compact-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.ayah-compact-menu__content {
    position: fixed;
    background: var(--pico-background-color);
    border-radius: 8px;
    padding: 0.4rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    gap: 0.4rem;
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-theme="dark"] .ayah-compact-menu__content {
    border-color: rgba(255, 255, 255, 0.15);
}

.ayah-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    /* border: none; */
    /* border-radius: 6px; */
    /* background: transparent; */
    cursor: pointer;
    transition: all 0.15s ease;
    /* color: var(--pico-color); */
    font-size: 1.5rem;
    padding: 0;
    position: relative;
}

/* .ayah-menu-btn:hover {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    transform: scale(1.1);
} */

.ayah-menu-btn .icon {
    font-size: 1.5rem;
    line-height: 1;
}

.ayah-menu-btn .label {
    display: none;
}

/* Tooltip on hover */
.ayah-menu-btn[data-action="tafseer"]:hover::after {
    content: "تفسير";
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
}

.ayah-menu-btn[data-action="audio"]:hover::after {
    content: "قراءة";
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
}

/* assets/css/keen-slider.min.css */
.keen-slider:not([data-keen-slider-disabled]) {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    align-content: flex-start;
    display: flex;
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -khtml-user-select: none;
    width: 100%
}

.keen-slider:not([data-keen-slider-disabled]) .keen-slider__slide {
    min-height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%
}

.keen-slider:not([data-keen-slider-disabled])[data-keen-slider-reverse] {
    flex-direction: row-reverse
}

.keen-slider:not([data-keen-slider-disabled])[data-keen-slider-v] {
    flex-wrap: wrap
}

:root {
    --verses-font-scale: 1;
    --pico-font-size: 100% !important;
    --container-max-width: 100%;

    /* ألوان خلفية الآيات (الوضع الفاتح الافتراضي) */
    --bg_color_0: #E3F2FD;
    --bg_color_1: #E8F5E9;
    --hesitation-color: #f57c00;
    --error-color: #d32f2f;
    --alert-color: #1976d2;
}


:root[data-theme="light"] {
    --gold: #9e9300;
    --bg_color_0: #E3F2FD;
    --bg_color_1: #E8F5E9;
    --hesitation-color: #f57c00;
    --error-color: #d32f2f;
    --alert-color: #1976d2;
}

:root[data-theme="dark"] {
    --gold: #ffd700;
    --bg_color_0: #001e25;
    --bg_color_1: #0c1b14;
    --hesitation-color: #e3e283;
    --error-color: #ff8787;
    --alert-color: #649dd6;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --gold: #ffd700;
        --bg_color_0: #001e25;
        --bg_color_1: #0c1b14;
        --hesitation-color: #e3e283;
        --error-color: #ff8787;
        --alert-color: #649dd6;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --gold: #9e9300;
        --bg_color_0: #E3F2FD;
        --bg_color_1: #E8F5E9;
        --hesitation-color: #e3e283;
        --error-color: #ff8787;
        --alert-color: #649dd6;
    }
}


/* اجعل النص يمين بشكل افتراضي على RTL */
html body :where(h1, h2, h3, h4, h5, h6, p, label, small, figcaption) {
    text-align: right;
}

/* محاذاة خلايا الجدول لليمين */
html body table :where(th, td) {
    text-align: right;
}

/* مساحة صغيرة بين أزرار الجداول */
html body .actions,
html body .grid-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

/* وسم صغير للحالة (إن رغبت بمظهر ألطف من tag الافتراضي) */
.tag {
    display: inline-block;
    padding-inline: .6rem;
    padding-block: .25rem;
    border-radius: 999px;
    font-size: .875rem;
}


@font-face {
    font-family: 'KFGQPC_Uthman_Taha_Naskh';
    src: url('/assets/font/KFGQPCUthmanTahaNaskh.woff2') format('woff2'),
        url('/assets/font/KFGQPCUthmanTahaNaskh.woff') format('woff'),
        url('/assets/font/KFGQPCUthmanTahaNaskh.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* @font-face {
    font-family: 'kfgqpc_uthmanic_script_hafs';
    src: url('/assets/font/uthmanichafs1_ver18.woff2') format('woff2'),
        url('/assets/font/uthmanichafs1_ver18.woff') format('woff'),
        url('/assets/font/uthmanichafs1_ver18.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
} */
@font-face {
    font-family: 'kfgqpc_uthmanic_script_hafs';
    src: url('/assets/font/uthmanic_hafs_v20/uthmanic_hafs_v20.woff2') format('woff2'),
        url('/assets/font/uthmanic_hafs_v20/uthmanic_hafs_v20.woff') format('woff'),
        url('/assets/font/uthmanic_hafs_v20/uthmanic_hafs_v20.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.uthman_font {
    font-family: "kfgqpc_uthmanic_script_hafs", system-ui;
    font-weight: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui;
}

html,
body {
    direction: rtl;
}

body {
    font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui;
    font-size: 1.2rem;
    margin: auto;
    -webkit-tap-highlight-color: transparent;
}


input,
optgroup,
select,
textarea {
    font-size: 1.2rem;
}

body.quran .container {
    max-width: var(--container-max-width, 1560px);
    /*margin: 0 auto;*/
}


a,
button,
[role="button"],
input,
textarea,
label,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}

/* خيار إضافي: لا تغيّر الخلفية عند :active */
a:active,
button:active {
    background-color: inherit !important;
}


#raka1_start,
#raka1_end,
#raka2_start,
#raka2_end {

    font-family: "kfgqpc_uthmanic_script_hafs", system-ui;
}

.verses {
    text-align: justify;
    text-align-last: center;
    font-family: "kfgqpc_uthmanic_script_hafs", system-ui;
    font-size: calc(1.8rem * var(--verses-font-scale));
    line-height: calc(3.1rem * var(--verses-font-scale));
    color: var(--pico-color);
    /*font-size: 1.8rem;*/
    /*line-height: 2;*/
}

/* كلمات الغريب */
.ghareeb-word {
    position: relative;
    /*text-decoration: underline solid 1px rgba(184, 160, 98, 0.75);*/
    text-decoration: underline solid 1px var(--pico-secondary-background);
    text-underline-offset: 0.5em;
    cursor: help;
    font-size: calc(1.8rem * var(--verses-font-scale));
    line-height: calc(3rem * var(--verses-font-scale));
    padding: 0;
    background: none;
    border: none;
    color: var(--pico-color);
}

/*.settings-sample-text {*/
/*    font-size: calc(1.8rem * var(--verses-font-scale));*/
/*    line-height: calc(3rem * var(--verses-font-scale));*/
/*}*/

.ayah {
    display: inline;
    padding: 0;
    /*background: var(--card);*/
    /*padding: .85rem;*/
    /*border-radius: .9rem;*/
    /*margin: .5rem 0;*/
}

/* .ayah-colored .ayah-text {
    padding: 0.2em 0.3em;
    border-radius: 0.3em;
    transition: background-color 0.3s ease;
} */


/* على أجهزة اللمس */
@media (hover: none) {
    .ghareeb-word {
        cursor: pointer;
    }
}

.basmalah {
    text-align: center;
    display: block;
    color: #16a085;
}

.sura_name {
    text-align: center;
    display: block;
    background-color: var(--pico-primary-background);
    color: var(--pico-color);
    font-size: 100%;
    /* padding: 5px; */
    /* background-image: url(http://catnaps.org/islamic/islamgraphics/threepanel.png); */
    opacity: 0.9;
    position: relative;
}

.sura_name:after {
    content: "";
    display: block;
    top: 0;
    left: 0;
    background-image: url(/assets/images/threepanel.png);
    background-repeat: repeat;
    width: 100%;
    height: 100%;
    opacity: 0.07;
    z-index: -1;
    position: absolute;
}

.ayah-break {
    display: block;
}

/* صندوق التولتيب حق Isotip */
.tooltip {
    font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui;
    /*background: var(--pico-background-color);*/
    /*background: color-mix(in srgb, var(--pico-background-color), black 10%);*/
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-color);
    color: var(--pico-color);
    padding: 15px 10px 0 10px;
    border-radius: 0.5rem;
    /*font-size: 0.85rem;*/
    /*line-height: 1.6;*/
    font-size: calc(1.6rem * var(--verses-font-scale));
    /*line-height: calc(2.5rem * var(--verses-font-scale));*/
    text-align: center;
    /*max-width: min(260px, 80vw);*/
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.15s ease-out;
}

.tooltip-content {
    text-align: center;
}

/* لما Isotip يفتح التولتيب يحط كلاس visible */
.tooltip.visible {
    opacity: 1;
}

/* الزر اللي تحت التولتيب (السهم) */
.tooltip .tooltip-accent {
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
}

/* حسب الاتجاهات اللي يستخدمها Isotip */
.tooltip-top .tooltip-accent {
    bottom: -5px;
    right: 50%;
    transform: translateX(50%) rotate(45deg);
}

.tooltip-bottom .tooltip-accent {
    top: -5px;
    right: 50%;
    transform: translateX(50%) rotate(45deg);
}

/* يمين/يسار لو احتجتها */
.tooltip-right .tooltip-accent {
    left: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.tooltip-left .tooltip-accent {
    right: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}


.ayah-text {
    color: var(--pico-color);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    position: relative;
    /* display: inline; */
}

/* Marker Highlighting */
.ayah-number.marker-start {
    background-color: #4CAF50 !important;
    /* Green for Start (Go) */
    color: white !important;
    border-color: #4CAF50 !important;
}

.ayah-number.marker-end {
    background-color: #F44336 !important;
    /* Red for End (Stop) */
    color: white !important;
    border-color: #F44336 !important;
}

.ayah-number.marker-overlap {
    background-color: #2196F3 !important;
    /* Blue for Switch (End R1 / Start R2) */
    color: white !important;
    border-color: #2196F3 !important;
}

/* Remove old highlighting if any remains */
.highlighted-segment {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* مستطيل عمودي لعلامة بداية المقطع في الحالات الخاصة */
/* (عندما يبدأ المقطع عند أول آية في الصفحة أو السورة) */
.segment-marker-vertical {
    width: 8px;
    /* ارتفاع مسافتين بنفس line-height خط الآيات */
    height: calc(1rem * var(--verses-font-scale) * 2);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
    /* animation: pulse-glow-marker 2s ease-in-out infinite; */
}

@keyframes pulse-glow-marker {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 4px 16px rgba(76, 175, 80, 0.7);
    }
}

/* في الوضع الداكن */
body[data-theme="dark"] .segment-marker-vertical {
    background: linear-gradient(135deg, #66bb6a 0%, #4CAF50 100%);
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.6);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .segment-marker-vertical {
        background: linear-gradient(135deg, #66bb6a 0%, #4CAF50 100%);
        box-shadow: 0 2px 8px rgba(102, 187, 106, 0.6);
    }
}

/* Adjustments to distinguish Raka 1 and Raka 2 further if needed */


.rub-el-hizb-symbol {
    color: var(--gold);
    font-size: 140%;
    line-height: 10px;
    text-shadow: 0 0 7px #919191;
}

/* النصوص القرآنية في التفسير */
.quranic-text {
    font-family: "kfgqpc_uthmanic_script_hafs", system-ui;
    color: var(--pico-primary)
}

.ayah-number {
    margin: 0;
    /* display: inline-flex; */
    align-items: center;
    justify-content: center;
    /* border-radius: 999px; */
    /* border: 1px solid transparent; */
    /* padding: 0.05rem 0.35rem; */
    cursor: pointer;
    /* font-size: 0.85em; */
    /* line-height: 1; */
    /* user-select: none; */
    /* transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; */
    white-space: nowrap;
    display: inline;
}

/* منع رقم الآية من الظهور في بداية السطر - يبقى ملاصقاً لآخر كلمة */
.ayah-text {
    position: relative;
}

/* نضيف مسافة غير قابلة للكسر قبل رقم الآية */
.ayah-text::after {
    content: '';
}

.ayah-number:hover,
.ayah-number:focus {
    border-color: rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.05);
}

.ayah-number:focus-visible {
    outline: 2px solid var(--pico-primary, #0f766e);
    outline-offset: 2px;
}

body[data-theme="dark"] .ayah-number:hover,
body[data-theme="dark"] .ayah-number:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.08);
}

#slider {
    width: 100%;
}

/* يساعد الـ GPU ويقلل الوميض */
.keen-slider__track {
    will-change: transform;
}

/* خله يتمدّد قد ما يحتاج طولي */
.keen-slider__slide {
    padding: 1rem;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.page-info-bar {
    font-size: 0.9rem;
    margin: 0.5rem 0 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
}

/* ============================ */
/* لوحة التنقّل الموحّدة للمصحف */
.nav-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
}

.nav-panel.is-open {
    display: block;
}

.nav-panel[hidden] {
    display: none !important;
}

.nav-panel__backdrop {
    position: absolute;
    inset: 0;
    /* background: rgba(0, 0, 0, 0.35); */
}

.nav-panel__dialog {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    background: var(--pico-background-color);
    color: var(--pico-color);
    padding: 0.75rem 1rem 1rem;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /*background: var(--pico-background-color);*/
}

@media (min-width: 768px) {
    .nav-panel__dialog {
        inset-block: 10vh auto;
        inset-inline: 20vw;
        border-radius: 16px;
        max-height: 80vh;
    }
}

.nav-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.nav-panel__header h2 {
    margin: 0;
    font-size: 1rem;
}

.nav-panel__close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
}

.nav-panel__tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 0.5rem;
}

body[data-theme="dark"] .nav-panel__tabs {
    border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="light"] .nav-tab {
    color: #333;
}

.nav-tab {
    flex: 1;
    border: none;
    /* backgr.search-result-text markound: transparent; */
    /* color: var(--pico-color); */
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    text-align: center;
}

.nav-tab.is-active {
    border-bottom: 2px solid var(--pico-primary, #0f766e);
    /* font-weight: 600; */
}

/* ============================ */
/* نافذة عرض التفسير */
.tafseer-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;

}

.tafseer-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.tafseer-modal[hidden] {
    display: none !important;
}

.tafseer-modal__backdrop {
    position: absolute;
    inset: 0;
}

.tafseer-modal__dialog {
    position: relative;
    background: var(--pico-background-color);
    color: var(--pico-color);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    padding: 1rem 1.25rem;
    max-width: 640px;
    width: min(90vw, 640px);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
}

.tafseer-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.tafseer-modal__subtitle {
    display: none;
    margin: 0;
    font-size: calc(1.8rem * var(--verses-font-scale));
    /* font-size: 0.8rem; */
    color: var(--pico-muted-color, #666);
}

.tafseer-modal__title {
    display: none;
    margin: 0.2rem 0 0;
    font-size: calc(1.8rem * var(--verses-font-scale));
    /* font-size: 1.1rem; */
}

.tafseer-modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    color: inherit;
}

.tafseer-modal__body {
    font-family: "KFGQPC_Uthman_Taha_Naskh", system-ui;
    font-size: calc(1.8rem * var(--verses-font-scale));
    line-height: calc(3rem * var(--verses-font-scale));
    white-space: pre-line;
    text-align: justify;
    text-align-last: center;
}

.nav-panel__body {
    overflow: auto;
    padding-top: 0.25rem;
}

.nav-tab-panel {
    display: none;
}

.nav-tab-panel.is-active {
    display: block;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.4rem;
}

.nav-item {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.35rem 0.6rem;
    background: var(--pico-card-background-color, var(--pico-background-color));
    color: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.nav-item:hover {
    filter: brightness(0.97);
}

body[data-theme="dark"] .nav-item {
    border-color: rgba(255, 255, 255, 0.15);
}

.nav-page-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-page-form input[type="number"] {
    max-width: 120px;
}

/* * {
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
} */

/* ============================ */
/* صفحة البحث */
/* ============================ */
.search-form {
    margin: 2rem 0;
}

.search-form input[type="text"] {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.search-status {
    margin: 1rem 0;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--pico-muted-color);
}

.search-status.has-results {
    color: var(--pico-primary);
}

.search-status.no-results {
    color: var(--pico-del-color, #c00);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.search-result-item {
    padding: 1rem 1.25rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.5rem;
    background: var(--pico-card-background-color, var(--pico-background-color));
    color: var(--pico-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--pico-switch-background-color);
    border-color: var(--pico-primary);
    /* outline: 2px solid var(--pico-primary); */
    /* outline-offset: 2px; */
}

.search-result-item:active {
    transform: scale(0.98);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.search-result-sura {
    /* font-weight: 600; */
    font-size: 1.1rem;
    color: var(--pico-primary);
}

.search-result-aya {
    /* font-size: 0.9rem; */
    /* color: var(--pico-muted-color); */
    white-space: nowrap;
}

.search-result-text {
    font-family: "kfgqpc_uthmanic_script_hafs", system-ui;
    font-size: calc(1.8rem * var(--verses-font-scale));
    line-height: calc(3rem * var(--verses-font-scale));
    text-align: right;
    color: var(--pico-color);
    text-align: justify;
    text-align-last: center;
    /* text-justify: inter-word; */
}

.search-result-text mark {
    background: var(--pico-mark-background-color);
    color: var(--pico-mark-color, inherit);
    /* padding: 0.1em 0.2em; */
    border-radius: 0.2em;
    /* font-weight: 600; */
}


/* تمييز الكلمة في صفحة المصحف */
.ayah-text mark,
.verses mark {
    background: var(--pico-mark-background-color);
    color: var(--pico-mark-color, inherit);
    /* padding: 0.1em 0.2em; */
    /* border-radius: 0.2em; */
    /* font-weight: 600; */
    /* animation: highlight-fade 2s ease-out; */
}


@keyframes highlight-fade {
    0% {
        background: var(--pico-mark-background-color);
        box-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
    }

    100% {
        background: var(--pico-mark-background-color);
        box-shadow: none;
    }
}

/* ============================ */
/* Mistake Highlights & Modal */
/* ============================ */
.mistake {
    border-bottom-width: 3px;
    border-bottom-style: solid;
    padding-bottom: 2px;
}

.mistake.error {
    /* background-color: rgba(239, 83, 80, 0.1);    */
    color: var(--error-color)
        /* user-defined colors for lines can be handled here if needed */
}

.mistake.hesitation {
    /* background-color: rgba(255, 202, 40, 0.1); */
    color: var(--hesitation-color)
}

.mistake.alert {
    /* background-color: rgba(66, 165, 245, 0.1); */
    color: var(--alert-color)
}

.quran-word {
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

/* Modal Styles */
.mistake-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.mistake-modal[hidden] {
    display: none !important;
}

.mistake-modal:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.mistake-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mistake-modal__content {
    position: relative;
    background: var(--pico-card-background-color);
    padding: 1.5rem;
    border-radius: var(--pico-border-radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--pico-box-shadow);
    border: 1px solid var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.mistake-modal__content h3 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.mistake-modal__types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Type Buttons customization on top of Pico */
button.mistake-type-btn {
    padding: 0.3rem;
    margin-bottom: 0;
    font-weight: normal;
    transition: all 0.2s;
    font-size: 1.3rem;
}

/* Color modifiers for the outline buttons */
button.mistake-type-btn.error {
    --pico-color: var(--error-color);
    --pico-border-color: var(--error-color);
}

button.mistake-type-btn.hesitation {
    --pico-color: var(--hesitation-color);
    --pico-border-color: var(--hesitation-color);
}

button.mistake-type-btn.alert {
    --pico-color: var(--alert-color);
    --pico-border-color: var(--alert-color);
}

/* Active state for these buttons (solid background) */
button.mistake-type-btn.selected.error {
    background-color: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

button.mistake-type-btn.selected.hesitation {
    background-color: var(--hesitation-color);
    border-color: var(--hesitation-color);
    color: white;
}

button.mistake-type-btn.selected.alert {
    background-color: var(--alert-color);
    border-color: var(--alert-color);
    color: white;
}


.word-chars-container {
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    min-height: 60px;
    direction: rtl;
    padding: 0.5rem;
}

#word_text_selection {
    font-family: 'Hafs', serif;
}

#word_text_selection mark {
    border-radius: 4px;
    padding: 2px 4px;
}

#mistake_note {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    resize: vertical;
    background: var(--pico-background-color);
    color: var(--pico-color);
    margin-bottom: 0;
}

.mistake-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Action buttons will rely mostly on Pico utility classes in HTML */

/* ============================ */
/* العلامات المرجعية */
/* ============================ */
.bookmarks-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.add-bookmark-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--pico-card-background-color, var(--pico-background-color));
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 12px;
}

.add-bookmark-form input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--pico-color);
}

.color-options {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.color-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.color-options input {
    display: none;
}

.color-options span {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-options input:checked+span {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--pico-color);
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: var(--pico-card-background-color, var(--pico-background-color));
    border: 1px solid var(--pico-muted-border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.bookmark-item:hover {
    background: var(--pico-muted-border-color);
    /* Light hover effect */
}

.bookmark-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.bookmark-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bookmark-text {
    display: flex;
    flex-direction: column;
}

.bookmark-title {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--pico-primary);

}

.bookmark-page {
    font-size: 1rem;
    /* color: var(--pico-muted-color); */
}

.bookmark-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.bookmark-update {
    background: transparent;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 4px;
    color: var(--pico-primary);
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bookmark-update:hover {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary);
}

.bookmark-delete {
    background: transparent;
    border: none;
    color: var(--pico-del-color);
    font-size: 1.4rem;
    padding: 0 0.5rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
}

.bookmark-delete:hover {
    color: var(--error-color, #d32f2f);
    background: rgba(211, 47, 47, 0.1);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--pico-muted-color);
    font-style: italic;
}

/* ============================ */
/* رسالة تنبيهية للعلامات المرجعية */
/* ============================ */
.bookmarks-login-notice {
    background: var(--pico-card-background-color, var(--pico-background-color));
    border: 2px solid var(--pico-primary);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.bookmarks-login-notice[hidden] {
    display: none;
}

.notice-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.notice-content {
    flex: 1;
}

.notice-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--pico-primary);
}

.notice-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notice-content ul {
    margin: 0 0 1rem 0;
    padding-right: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.notice-content li {
    margin-bottom: 0.4rem;
}

.notice-login-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.notice-login-btn:hover {
    background: var(--pico-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================ */
/* Audio Player UI */
/* ============================ */

/* Sticky Player Container */
.audio-player-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--pico-card-background-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(110%);
    transition: transform 0.3s ease-in-out;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

.audio-player-sticky.is-visible {
    transform: translateY(0);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.audio-btn {
    padding: 0;
    border: 1px solid var(--pico-muted-border-color);
    background: var(--pico-secondary-background);
    color: var(--pico-color);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    margin: 0;
}

.audio-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.audio-btn:hover {
    background: var(--pico-secondary-background);
    border-color: var(--pico-primary-background);
}

.audio-btn.primary {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary-background);
}

.audio-btn.primary:hover {
    background: var(--pico-primary-hover-background);
}

/* Audio Menu Overlay */
.audio-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.audio-menu-overlay.is-open {
    display: block;
}

.audio-menu-content {
    background: var(--pico-background-color);
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.audio-menu-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
}

.audio-menu-list {
    margin-bottom: 1rem;
}

.audio-menu-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 4px;
    text-align: right;
    cursor: pointer;
    font-size: 0.95rem;
    display: block;
    width: 100%;
    transition: all 0.2s;
}

.audio-menu-item:last-child {
    margin-bottom: 0;
}

.audio-menu-item:hover,
.audio-menu-item.is-selected {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary-background);
}

.audio-menu-close {
    width: 100%;
    margin-top: 1rem;
}

/* ============================ */
/* Page Navigation Grid         */
/* ============================ */

.page-quick-jumps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    /* Add padding for visual breathing room */
    margin-bottom: 0.5rem;
    direction: rtl;
    position: sticky;
    top: -5px;
    background-color: var(--pico-background-color);
    z-index: 5;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.quick-jump-btn {
    padding: 0.3rem 0.8rem;
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--pico-color);
    transition: all 0.2s;
}

.quick-jump-btn:hover {
    /* background: var(--pico-card-background-color); */
    /* border-color: var(--pico-primary-background); */
}

:root {
    --page-grid-cols: 5;
}

.nav-page-grid {
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(var(--page-grid-cols), 1fr);
    gap: 0.5rem;
    direction: rtl;
    /* margin-top: 1rem; */
}

.page-card {
    aspect-ratio: 1;
    /* Square */
    display: flex;
    justify-content: center;
    align-items: center;
    /* background: var(--pico-background-color); */
    /* border: 1px solid var(--pico-muted-border-color); */
    border-radius: 50%;
    /* font-weight: bold; */
    font-size: 1.3rem;
    cursor: pointer;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); */
    /* transition: all 0.2s; */
    padding: 0;
    width: 50px;
    /* color: var(--pico-color); */
}

.page-card:hover {
    /* background-color: var(--pico-card-background-color); */
    /* transform: translateY(-2px); */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    /* border-color: var(--pico-primary-background); */
}

/* Adjust for smaller screens if needed */
@media (max-width: 480px) {
    :root {
        --page-grid-cols: 5;
        /* Keep 5 as requested */
    }

    /* .page-card {
        font-size: 0.9rem;
    } */
}

/* تقليل الهوامش الجانبية في وضع الجوال */
@media (max-width: 768px) {
    body.quran .container {
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }
}

/* ============================ */
/* Custom Dropdown Component    */
/* ============================ */

/* حاوية القائمة المنسدلة المخصصة */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

/* إخفاء العنصر الأصلي <select> */
.custom-select-wrapper select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}

/* الزر الذي يظهر القيمة المختارة */
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    font-size: 1rem;
    color: var(--pico-color);
    transition: all 0.2s ease;
    user-select: none;
    font-family: inherit;
}

.custom-select-trigger:hover {
    border-color: var(--pico-primary);
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--pico-primary);
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.1);
}

/* السهم في نهاية الزر */
.custom-select-trigger::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    color: var(--pico-muted-color);
}

.custom-select-wrapper.open .custom-select-trigger::after {
    transform: rotate(180deg);
}

/* القائمة المنسدلة */
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 0.25rem;
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

body[data-theme="dark"] .custom-select-dropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.custom-select-wrapper.open .custom-select-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* خيارات القائمة */
.custom-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
    color: var(--pico-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
    user-select: none;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: var(--pico-primary-background);
}

.custom-select-option.selected {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    font-weight: 500;
}

.custom-select-option.selected:hover {
    background: var(--pico-primary-hover);
}

/* حالة التعطيل */
.custom-select-trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-select-trigger:disabled:hover {
    border-color: var(--pico-muted-border-color);
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .custom-select-dropdown {
        max-height: 250px;
    }

    .custom-select-option {
        padding: 1rem;
        font-size: 1.1rem;
    }
}