/* === Theme tokens (Light as default) === */
/* === Base (مشترك) === */
:root {
    --bg_green: #a6d5ad;
    --selection: #0ea5e9;
    --selection-text: #ffffff;

    /* Light (افتراضي) */
    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --card: #f7fafc;
    --border: #e5e7eb;
    --hover: rgba(0, 0, 0, .05);

    --primary: #26a69a;
    --primary-contrast: #ffffff;

    --link: #0ea5e9;
    --link-hover: #0284c7;

    --shadow-1: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    --shadow-0: none;

    /* قرآن (لايت) */
    --aya-end: #002bff;
    --aya-start: #bf00ff;
    --aya-number: #00865b;
    --sura-name-text: #ffffff;
    --aya-highlight: #0000003b;

    /* استخدم الخلفية مباشرة كـ theme-color */
    --theme-color: var(--bg);
    color-scheme: light;
}

/* === احترام تفضيل النظام === */
@media (prefers-color-scheme: dark) {
    :root {
        --bg_green: #377c41;
        --bg: #212a32;
        --text: #e5e7eb;
        --muted: #9aa6b2;
        --card: #2b3540;
        --border: #3b4652;
        --hover: rgba(255, 255, 255, .06);

        --primary: #1abc9c;
        --primary-contrast: #001318;

        --link: #66b3ff;
        --link-hover: #99c8ff;

        --shadow-1: none; /* بس اللي يختلف */

        /* قرآن (دارك) */
        --aya-end: #7889df;
        --aya-start: #e595ff;
        --aya-number: #ffffff;
        --sura-name-text: var(--bg);
        --aya-highlight: #00000082;

        --theme-color: var(--bg);
        color-scheme: dark;
    }
}

/* === تجاوز يدوي عبر data-theme === */
/* لاحظ: ما كررنا المتغيرات الثابتة (bg_green/selection/...) */
:root[data-theme="light"] {
    color-scheme: light;
    --bg_green: #a6d5ad;
    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --card: #f7fafc;
    --border: #e5e7eb;
    --hover: rgba(0, 0, 0, .05);
    --primary: #26a69a;
    --primary-contrast: #ffffff;
    --link: #0ea5e9;
    --link-hover: #0284c7;
    --shadow-1: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);

    --aya-end: #002bff;
    --aya-start: #bf00ff;
    --aya-number: #00865b;
    --sura-name-text: #ffffff;
    --aya-highlight: #0000003b;

    --theme-color: var(--bg);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg_green: #377c41;
    --bg: #212a32;
    --text: #e5e7eb;
    --muted: #9aa6b2;
    --card: #2b3540;
    --border: #3b4652;
    --hover: rgba(255, 255, 255, .06);
    --primary: #1abc9c;
    --primary-contrast: #001318;
    --link: #66b3ff;
    --link-hover: #99c8ff;
    --shadow-1: none;

    --aya-end: #7889df;
    --aya-start: #e595ff;
    --aya-number: #ffffff;
    --sura-name-text: var(--bg);
    --aya-highlight: #00000082;

    --theme-color: var(--bg);
}


/* Base theme application */
html, body {
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
}

::selection {
    background: var(--selection);
    color: var(--selection-text);
}

@font-face {
    font-family: 'Al_Jass_ZQ';
    src: url('/assets/font/Al_Jass_ZQ.woff2') format('woff2'),
    url('/assets/font/Al_Jass_ZQ.woff') format('woff'),
    url('/assets/font/Al_Jass_ZQ.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KFGQPC_Uthman_Taha_Naskh';
    src: url('/assets/font/KFGQPCUthmanTahaNaskh.woff2?v=1') format('woff2'),
    url('/assets/font/KFGQPCUthmanTahaNaskh.woff?v=1') format('woff'),
    url('/assets/font/KFGQPCUthmanTahaNaskh.ttf?v=1') 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?v=1') format('woff2'),
    url('/assets/font/uthmanichafs1_ver18.woff?v=1') format('woff'),
    url('/assets/font/uthmanichafs1_ver18.ttf?v=1') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    direction: rtl;
}

.btn {
    -webkit-appearance: button;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 2px;
    display: inline-block;
    height: 32px;
    line-height: 30px;
    padding: 0 16px;
    vertical-align: middle;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
    outline: 0;
    text-decoration: none;
    color: #fff;
    background-color: var(--primary);
    text-align: center;
    transition: background-color .2s ease-out;
    cursor: pointer;
}

select {
    box-sizing: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: rgba(255, 255, 255, 0.9);
    width: 100%;
    padding: 5px;
    border: 1px solid #f2f2f2;
    border-radius: 2px;
    height: 2.4rem;
    display: block;
}

.row {
    margin: 5px 0;
    /*height: 37px;*/
}

.row .col {
    line-height: 1.5;
    font-size: 16px;
    float: right;
    box-sizing: border-box;
    padding: 0 0.75rem;
    min-height: 1px;
    margin-left: auto;

}

.s2 {
    width: 16.6666666667%;
}

.s10 {
    width: 83.3333333333%;
}

.s12 {
    width: 100%;
}

.container {
    margin: 0 auto;
    max-width: 520px;
    width: 98%;
}

iframe {
    border: none;
}

/* Quran css*/

/*@font-face {
    font-family: 'kfgqpc_uthman_taha_naskh';
    src: url('/font/uthmantn1_ver10.eot');
    src: url('/font/uthmantn1_ver10.eot?#iefix') format('embedded-opentype'),
    url('/font/uthmantn1_ver10.woff2') format('woff2'),
    url('/font/uthmantn1_ver10.woff') format('woff'),
    url('/font/uthmantn1_ver10.ttf') format('truetype'),
    url('/font/uthmantn1_ver10.svg#kfgqpc_uthman_taha_naskhRg') format('svg');
    font-weight: normal;
    font-style: normal;
}*/
/*@import url(https://fonts.googleapis.com/earlyaccess/droidarabicnaskh.css);*/

body {
    font-family: 'kfgqpc_uthmanic_script_hafs';
    font-size: 30px;
    /* text-align: justify; */
}

.quran p {
    margin: 0;
    text-align: justify;
    line-height: 1;
}

.quran .aya:hover {
    background-color: var(--aya-highlight);
}

/*.aya{*/
/*    cursor:pointer;*/
/*}*/
.aya.active {
    background-color: var(--aya-highlight);
}

.quran .basmalah {
    text-align: center;
    display: block;
    color: #16a085;
}

span.basmalah {
}

.quran .aya_number {
    color: var(--aya-number);
}

/*.aya_start::before {
    content: '\a';
    display: block;
}
.aya_end::after {
    content: '\a';
    display: block;
}*/
.quran .sura_name {
    text-align: center;
    display: block;
    background-color: #1abc9c;
    color: var(--sura-name-text);
    font-size: 100%;
    /* padding: 5px; */
    /* background-image: url("http://catnaps.org/islamic/islamgraphics/threepanel.png"); */
    opacity: 0.9;
    position: relative;
}

.quran {
    max-width: 703px;
    /* border: 1px solid #1abc9c; */
    padding: 5px;
    line-height: 50px;
    text-align: justify;
    text-align-last: center;
}

.quran .last-line {
    text-align: center;
}

.quran p:after {
    content: " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    line-height: 0;
    visibility: hidden;
}

.quran p.sura_name:after {
    content: '';
    line-height: 50px;
}

.quran p.basmalah:after {
    content: '';
}

.btn.arrow {
    /*padding: 5px 15px;*/
    /*height: auto;*/
    font-size: 20px;
}

.quran .sura_name:after {
    content: "";
    display: block;
    top: 0;
    left: 0;
    background-image: url(/assets/image/threepanel.png);
    width: 100%;
    height: 100%;
    opacity: 0.07;
    z-index: -1;
    position: absolute;
}

/* spn css */

.spn-direction-sign {
    position: fixed;
    display: inline-block;
    border: 0;
    width: 66px;
    height: 68px;
    top: 50%;
    margin-top: -34px;
    z-index: 121;
    color: white;
    font-size: 32px;
    text-align: center;
    line-height: 68px;
    background-color: #0d3b2f;
    opacity: 0;
    -moz-opacity: 0;
    -webkit-transition: opacity 0.3s linear, -webkit-transform 0.3s linear;
    -moz-transition: opacity 0.3s linear, -mox-transform 0.3s linear;
    -ms-transition: opacity 0.3s linear, -ms-transform 0.3s linear;
    -o-transition: opacity 0.3s linear, -o-transform 0.3s linear;
    transition: opacity 0.3s linear, transform 0.3s linear;
}

.spn-direction-sign.next {
    right: 0;
    -webkit-transform: translate(100%);
    -moz-transform: translate(100%);
    -ms-transform: translate(100%);
    -o-transform: translate(100%);
    transform: translate(100%);

}

.spn-direction-sign.next::after {
    content: "\25b6";
}

.spn-direction-sign.prev {
    left: 0;
    -webkit-transform: translate(-100%);
    -moz-transform: translate(-100%);
    -ms-transform: translate(-100%);
    -o-transform: translate(-100%);
    transform: translate(-100%);
}

.spn-direction-sign.prev::after {
    content: "\25c0";
}

.spn-direction-sign.visible {
    opacity: 1;
    -webkit-transform: translate(0);
    -moz-transform: translate(0);
    -ms-transform: translate(0);
    -o-transform: translate(0);
    transform: translate(0);

}

.spn-freezing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    opacity: 0.5;
    -moz-opacity: 0.5;
    -khtml-opacity: 0.5;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
    filter: alpha(opacity=50);
}

.spn-freezing-overlay::after {
    position: absolute;
    width: 100%;
    top: 50%;
    font-size: 32px;
    text-align: center;
    color: white;
    content: "تحميل..."
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

label, [type="checkbox"] + span:not(.lever) {
    font-size: 20px;
    font-family: KFGQPC_Uthman_Taha_Naskh, serif;;
}

audio {
    width: 100%;
}

note {
    cursor: pointer
}

.fixed_box {
    display: block;
    position: fixed;
    /*position: absolute;*/
    top: 0;
    background-color: var(--card);
    /*margin: 0 15px 5px 15px;*/
    border: 1px solid var(--border);
    box-shadow: 0 5px 8px 0 #c5c5c5fa;
}

.pop_up_menu {
    padding: 0 10px;
    position: absolute;
    background-color: rgb(0, 13, 18);
    border: 1px solid #4b4b4b;
}

.pop_up_menu .item {
    border-bottom: 1px solid #444;
    padding: 0px 2px 9px 2px;
    font-size: 24px;
    cursor: pointer;
}

.pop_up_menu .item:hover {
    background-color: #1d1d1d;
}

.aya_error {
    color: red;
}

.aya_hesitate {
    color: chocolate;
}

.aya_focus {
    color: royalblue;
}

.aya_number.aya_end {
    color: var(--aya-end);
    font-size: 120%;
}

.aya_number.aya_start {
    color: var(--aya-start);
    font-size: 120%;
}

.ghareeb {
    border-bottom: 1px solid #c5c58a;
    cursor: pointer;
}

/* ToolTip */

.material-tooltip {
    font-size: 28px;
    font-family: KFGQPC_Uthman_Taha_Naskh, serif;
    background-color: #253648;
    border: 1px solid #FFF;
    border-radius: 8px;
    line-height: 48px;
    text-align: center;
}

.tippy-box {
}

/* ========== Theme tokens ========== */
/* ========== Base ========== */
body {
    background: var(--bg);
    color: var(--text);
}

/* ========== Links ========== */
a {
    text-decoration: none;
    color: var(--link);
}

a:hover {
    text-decoration: underline;
}

/* ========== Containers / Cards / Nav / Footer ========== */
.card, .collection, .fixed_box, .modal, .dropdown-content, .select-dropdown,
.collapsible, .chip, .tabs, .sidenav, .material-tooltip, nav, .page-footer {
    background-color: var(--card) !important;
    color: var(--text);
    border-color: var(--border);
}

/* عناصر القائمة المنسدلة */
.dropdown-content li > a, .dropdown-content li > span {
    color: inherit !important;
}

/* ========== Inputs ========== */
input, select, textarea {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

::placeholder {
    color: var(--muted);
    opacity: .9;
}

/* ========== Tables ========== */
table.striped > tbody > tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, .03);
}

/* ========== Text selection ========== */
::selection {
    background: var(--selection);
    color: var(--selection-text);
}

/* ========== Modal overlay ========== */
.modal-overlay {
    background: rgba(0, 0, 0, .6);
}

/* ========== إصلاح بسيط لعناوين السور في الداكن ========== */
/* بدل ما تكون بنفس لون الخلفية */

/* === Pop-up Menu theme-aware === */
.pop_up_menu {
    background-color: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 1000;
}

/* عناصر البوب أب (تتبع لون الحاوية) */
.pop_up_menu .item,
.pop_up_menu .item a,
.pop_up_menu .item span {
    color: inherit !important;
}

/* Hover */
.pop_up_menu .item:hover {
    background-color: var(--hover) !important; /* فاتح */
}

/* Dark mode */
/* شفافية زر تبديل الثيم حتى مع كلاس btn-floating */
.theme-toggle.btn-floating {
    background: transparent !important;
    box-shadow: none !important;
    border: 1px solid transparent !important;
    color: var(--text) !important;
}

.theme-toggle {
    margin: auto;
    width: 46px;
    height: 46px;
    line-height: 46px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* تأثير بسيط عند الهوفر */
.theme-toggle:hover {
    background: var(--hover) !important;
}

/* مؤشر تركيز واضح لسهولة الوصول */
.theme-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@supports (padding: env(safe-area-inset-bottom)) {
    /* شريط لوني خلف شريط التنقّل */
    body::after {
        content: "";
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: env(safe-area-inset-bottom);
        background: var(--bg);
        pointer-events: none;
    }

}

body select.colored_select {
    background-color: var(--bg_green);
}
#close_tafseer, #close_ghareeb, #close_audio {
    position: fixed;
    font-size: 14px;
    background-color: #607d8b;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 0 6px 0px #686868;
    border: 1px solid #7c96a3;
    cursor: pointer;
    font-family: serif;
    font-weight: bold;
    line-height: 19px;
}