@font-face {
    font-family: 'NouariAbdelkabir';
    src: url('font/nouariabdelkabir.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'NouariAbdelkabir', 'Amiri', 'Traditional Arabic', serif;
    background: #0d2818;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ========== القائمة الجانبية اليسرى ========== */
.sidebar {
    width: 280px;
    background: rgba(30, 22, 15, 0.98);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #c9a86b;
    transition: width 0.3s;
    z-index: 100;
}

.sidebar.collapsed { width: 50px; }
.sidebar.collapsed .sidebar-content { display: none; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #c9a86b;
    background: #1f1810;
}

.sidebar-header h3 { color: #e8c67a; font-size: 1rem; }

.toggle-btn {
    background: #c9a86b;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* أزرار الوضع */
.mode-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #c9a86b40;
}

.mode-btn {
    flex: 1;
    background: #3d2c1e;
    border: none;
    padding: 2px 2px;
    border-radius: 30px;
    color: #ecdcaa;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
}

.mode-btn.active {
    background: #c9a86b;
    color: #2e2215;
}

/* شجرة القراء */
.readers-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reader-node {
    background: #2a1f15;
    border-radius: 12px;
    overflow: hidden;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #3d2c1e;
    cursor: pointer;
    color: #f3d998;
}

.reader-toggle { transition: transform 0.2s; }
.reader-node.open .reader-toggle { transform: rotate(90deg); }

.rawis-list {
    display: none;
    padding: 8px;
    gap: 5px;
    flex-direction: column;
}

.reader-node.open .rawis-list { display: flex; }

.rawi-item {
    padding: 8px 12px;
    background: #35281d;
    border-radius: 8px;
    cursor: pointer;
    color: #ecdcaa;
    font-size: 0.85rem;
}

.rawi-item:hover { background: #5a402a; }
.rawi-item.active { background: #c9a86b; color: #2e2215; }

/* ========== المنطقة الرئيسية ========== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fcf7e8;
    overflow: hidden;
}

.top-bar {
    background: #2e241a;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #c9a86b;
}

.surah-name { color: #e8c67a; font-size: 1.2rem; font-weight: bold; }
.juz-number { background: #1f1810; font-size: 1.2rem; padding: 5px 15px; border-radius: 30px; color: #ee8317; }

.view-area {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.view { display: none; height: 100%; }
.view.active { display: block; }

.page-container {
    height: 100%;
    overflow: auto;
    padding: 1cm;
    background: #fffcf0;
    border-radius: 15px;
}

.double-container {
    display: flex;
    gap: 20px;
    height: 100%;
}

.page-box {
    flex: 1;
    overflow: auto;
    padding: 1cm;
    background: #fffcf0;
    border-radius: 15px;
}

.compare-container {
    display: flex;
    gap: 20px;
    height: 100%;
}

.compare-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fffcf0;
    border-radius: 15px;
    overflow: hidden;
}

.compare-title {
    display: flex;
    justify-content: space-between;
    background: #2e241a;
    padding: 10px 15px;
    color: #e8c67a;
}

.select-rawi-btn {
    background: #c9a86b;
    border: none;
    padding: 3px 12px;
    border-radius: 20px;
    cursor: pointer;
}

.compare-page {
    flex: 1;
    overflow: auto;
    padding: 1cm;
}

/* ========== نص القرآن ========== */
.quran-text {
    font-family: 'NouariAbdelkabir', 'Amiri', serif;
    font-size: var(--quran-font-size, 1.4rem);
    line-height: 2.2;
    text-align: justify;
}

.ayah-wrapper, .ayah-text { display: inline; }

.ayah-number {
    display: inline;
    font-size: inherit;
    color: #062264;
    background: none;
    margin: 0 0.1rem;
    padding: 0;
}

.bismillah-line {
    text-align: center;
    font-size: calc(var(--quran-font-size, 1.4rem) * 1.2);
    color: #5a402a;
    font-weight: bold;
    line-height: 2.0;
}

.surah-marker, .bismillah { display: none; }

/* ========== شريط التحكم السفلي ========== */
.control-bar {
    background: #2e241a;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #c9a86b;
    flex-wrap: wrap;
    gap: 10px;
}

.control-buttons-left { display: flex; gap: 8px; flex-wrap: wrap; }

.ctrl-icon {
    background: #c9a86b20;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #e8c67a;
}

.ctrl-icon:hover {
    background: #c9a86b;
    color: #2e2215;
}

.page-controls { display: flex; gap: 15px; align-items: center; }

.ctrl-btn {
    background: #c9a86b;
    border: none;
    padding: 6px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

.page-info { color: #e8c67a; font-weight: bold; }

/* ========== القائمة الجانبية اليمنى (السور) ========== */
.surah-sidebar {
    width: 280px;
    background: rgba(30, 22, 15, 0.95);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #c9a86b40;
    transition: width 0.3s;
    z-index: 100;
}

.surah-sidebar.collapsed { width: 50px; }
.surah-sidebar.collapsed .surah-sidebar-content { display: none; }

.surah-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #c9a86b;
    background: #1f1810;
}

.surah-sidebar-header h3 { color: #e8c67a; font-size: 1rem; }

.surah-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.surah-list { display: flex; flex-direction: column; gap: 4px; }

.surah-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #2a1f15;
    border-radius: 10px;
    cursor: pointer;
    color: #ecdcaa;
}

.surah-item:hover { background: #5a402a; transform: translateX(-4px); }
.surah-item.active { background: #c9a86b; color: #2e2215; }

.surah-number, .surah-name { font-size: 30px; }
.surah-ayahs { font-size: 30px; color: #e69e10; }

/* ========== زر إظهار قائمة السور ========== */
.show-surah-btn {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #c9a86b;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10%;
    cursor: pointer;
    font-size: 1.3rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
}

/* نتحكم بالزر عن طريق JavaScript بدلاً من CSS */
.show-surah-btn.visible {
    display: block;
}

/* ========== مودال ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background: #2e241a;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #1f1810;
    color: #e8c67a;
    border-bottom: 1px solid #c9a86b;
}

.modal-close {
    background: none;
    border: none;
    color: #e8c67a;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.modal-reader-item {
    padding: 12px;
    background: #3d2c1e;
    margin: 5px 0;
    border-radius: 10px;
    cursor: pointer;
    color: #ecdcaa;
}

.modal-reader-item:hover { background: #5a402a; }

/* ========== وضع الليل ========== */
body.dark-mode {
    background: #0a0a0a;
}

body.dark-mode .main-area,
body.dark-mode .page-container,
body.dark-mode .page-box,
body.dark-mode .compare-box {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .ayah-number,
body.dark-mode .bismillah-line {
    color: #e94560;
}

body.dark-mode .control-bar { background: #1a1a2e; border-top-color: #e94560; }
body.dark-mode .ctrl-icon { background: #0f3460; color: #e94560; }
body.dark-mode .surah-sidebar,
body.dark-mode .sidebar { background: rgba(20, 20, 40, 0.98); }
body.dark-mode .surah-item { background: #1a1a2e; }
body.dark-mode .surah-item:hover { background: #e94560; color: #1a1a2e; }
body.dark-mode .show-surah-btn { background: #e94560; color: #1a1a2e; }

/* ========== سكورول ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #e0d5b5; }
::-webkit-scrollbar-thumb { background: #c9a86b; border-radius: 10px; }

/* ========== استجابة ========== */
@media (max-width: 800px) {
    .sidebar, .surah-sidebar { width: 240px; }
    .quran-text { font-size: 1.1rem; line-height: 1.8; }
    .page-container, .page-box, .compare-page { padding: 0.5cm; }
}

/* ========== صندوق إدخال الصفحة ========== */
.page-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1f1810;
    padding: 4px 12px;
    border-radius: 30px;
}

.page-input {
    width: 55px;
    padding: 5px 8px;
    border: 1px solid #c9a86b;
    border-radius: 20px;
    background: #2e241a;
    color: #e8c67a;
    font-family: 'NouariAbdelkabir', 'Amiri', serif;
    font-size: 0.9rem;
    text-align: center;
    direction: ltr;
}

.page-input:focus {
    outline: none;
    border-color: #e8c67a;
    background: #3d2c1e;
}

.page-separator {
    color: #c9a86b;
    font-size: 1rem;
    font-weight: bold;
}

.total-pages {
    color: #a8884a;
    font-size: 0.9rem;
}

/* الوضع الليلي */
.dark-mode .page-input-wrapper {
    background: #0f3460;
}

.dark-mode .page-input {
    background: #1a1a2e;
    border-color: #e94560;
    color: #e94560;
}

.dark-mode .page-separator {
    color: #e94560;
}

.dark-mode .total-pages {
    color: #e94560;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 600px) {
    .page-input {
        width: 45px;
        font-size: 0.8rem;
    }
    
    .page-separator, .total-pages {
        font-size: 0.8rem;
    }
}

/* ========== شريط التحكم السفلي ========== */
.control-bar {
    background: #2e241a;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #c9a86b;
    gap: 15px;
    position: relative;
}

/* ========== زر القائمة المنسدلة ========== */
.dropdown-container {
    position: relative;
    min-width: 50px;
}

.menu-btn {
    background: #c9a86b;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.menu-btn:hover {
    background: #e8c67a;
    transform: scale(1.05);
}

/* القائمة المنسدلة */
.dropdown-menu {
    position: absolute;
    bottom: 55px;
    right: 0;
    background: #2e241a;
    border-radius: 15px;
    min-width: 180px;
    display: none;
    flex-direction: column;
    z-index: 200;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: 1px solid #c9a86b;
    overflow: hidden;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    background: #3d2c1e;
    border: none;
    padding: 12px 20px;
    text-align: right;
    cursor: pointer;
    font-family: 'NouariAbdelkabir', 'Amiri', serif;
    font-size: 0.9rem;
    color: #ecdcaa;
    transition: all 0.2s;
    border-bottom: 1px solid #c9a86b40;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #5a402a;
    transform: translateX(-5px);
}

/* ========== أزرار التنقل (في الوسط) ========== */
.page-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1f1810;
    padding: 4px 12px;
    border-radius: 30px;
}

.page-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #c9a86b;
    border-radius: 20px;
    background: #2e241a;
    color: #e8c67a;
    font-family: 'NouariAbdelkabir', 'Amiri', serif;
    font-size: 0.9rem;
    text-align: center;
    direction: ltr;
}

.page-input:focus {
    outline: none;
    border-color: #e8c67a;
    background: #3d2c1e;
}

.page-separator {
    color: #c9a86b;
    font-size: 1rem;
    font-weight: bold;
}

.total-pages {
    color: #a8884a;
    font-size: 0.9rem;
}

.ctrl-btn {
    background: #c9a86b;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: #e8c67a;
    transform: scale(1.02);
}

/* عنصر فارغ للتوازن */
.empty-space {
    width: 45px;
    visibility: hidden;
}

/* ========== الوضع الليلي ========== */
.dark-mode .control-bar {
    background: #1a1a2e;
    border-top-color: #e94560;
}

.dark-mode .menu-btn {
    background: #e94560;
    color: #1a1a2e;
}

.dark-mode .menu-btn:hover {
    background: #ff6b81;
}

.dark-mode .dropdown-menu {
    background: #1a1a2e;
    border-color: #e94560;
}

.dark-mode .dropdown-item {
    background: #0f3460;
    color: #e94560;
    border-bottom-color: #e94560;
}

.dark-mode .dropdown-item:hover {
    background: #e94560;
    color: #1a1a2e;
}

.dark-mode .page-input-wrapper {
    background: #0f3460;
}

.dark-mode .page-input {
    background: #1a1a2e;
    border-color: #e94560;
    color: #e94560;
}

.dark-mode .page-separator,
.dark-mode .total-pages {
    color: #e94560;
}

.dark-mode .ctrl-btn {
    background: #e94560;
    color: #1a1a2e;
}

.dark-mode .ctrl-btn:hover {
    background: #ff6b81;
}

/* ========== استجابة للشاشات الصغيرة ========== */
@media (max-width: 700px) {
    .control-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .page-controls {
        order: 1;
    }
    
    .dropdown-container {
        order: 0;
    }
    
    .empty-space {
        display: none;
    }
    
    .ctrl-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .page-input {
        width: 50px;
        font-size: 0.8rem;
    }
}
/* ========== تصميم الهواتف ========== */
@media (max-width: 768px) {
    /* إخفاء تصميم الحاسوب */
    .app {
        display: none !important;
    }
    
    /* إظهار تصميم الهواتف */
    .mobile-app {
        display: flex !important;
        flex-direction: column;
        height: 100vh;
        width: 100%;
        background: #fcf7e8;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
    }
    
    /* الشريط العلوي */
    .mobile-top-bar {
        background: #2e241a;
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #c9a86b;
    }
    
    .mobile-top-bar .surah-name {
        color: #e8c67a;
        font-size: 1rem;
        font-weight: bold;
    }
    
    .mobile-top-bar .juz-number {
        background: #1f1810;
        padding: 4px 12px;
        border-radius: 20px;
        color: #c9a86b;
        font-size: 0.8rem;
    }
    
    /* منطقة المصحف */
    .mobile-quran-area {
        flex: 1;
        overflow: auto;
        padding: 10px;
        padding-bottom: 70px;
    }
    
    /* الشريط السفلي */
    .mobile-bottom-bar {
        background: #2e241a;
        padding: 8px 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        border-top: 1px solid #c9a86b;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
    
    .nav-btn {
        background: #c9a86b;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.2rem;
        font-weight: bold;
    }
    
    .nav-btn:active {
        transform: scale(0.95);
    }
    
    /* القوائم الجانبية */
    .side-menu {
        position: fixed;
        top: 0;
        width: 280px;
        height: 100%;
        background: rgba(30, 22, 15, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        transition: transform 0.3s ease;
    }
    
    .right-menu {
        right: 0;
        transform: translateX(100%);
    }
    
    .right-menu.open {
        transform: translateX(0);
    }
    
    .left-menu {
        left: 0;
        transform: translateX(-100%);
    }
    
    .left-menu.open {
        transform: translateX(0);
    }
    
    .menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 1px solid #c9a86b;
        background: #1f1810;
    }
    
    .menu-header h3 {
        color: #e8c67a;
        font-size: 1rem;
    }
    
    .close-menu {
        background: none;
        border: none;
        color: #c9a86b;
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .menu-content {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
    }
    
    /* أزرار فتح القوائم */
    .menu-open-btn {
        position: fixed;
        top: 12px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #c9a86b;
        border: none;
        cursor: pointer;
        font-size: 1.2rem;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    .right-open {
        right: 10px;
    }
    
    .left-open {
        left: 10px;
    }
    
    /* عناصر القائمة */
    .mode-buttons {
        display: flex;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #c9a86b40;
    }
    
    .mode-btn {
        flex: 1;
        background: #3d2c1e;
        border: none;
        padding: 1px 1px;
        border-radius: 30px;
        color: #ecdcaa;
        cursor: pointer;
        font-size: 0.7rem;
    }
    
    .mode-btn.active {
        background: #c9a86b;
        color: #2e2215;
    }
    
    .settings-section {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #c9a86b40;
    }
    
    .menu-item {
        background: #3d2c1e;
        border: none;
        padding: 12px;
        border-radius: 12px;
        text-align: right;
        cursor: pointer;
        font-size: 0.85rem;
        color: #ecdcaa;
    }
    
    .menu-item:active {
        background: #5a402a;
    }
    
    /* قائمة السور */
    .surah-section h4 {
        color: #e8c67a;
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .surah-list-mobile {
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-height: 350px;
        overflow-y: auto;
    }
    
    /* نص المصحف */
    .quran-text {
        font-size: var(--quran-font-size, 1.3rem);
        line-height: 2.2;
    }
    
    /* وضع الليلي للهواتف */
    body.dark-mode .mobile-app {
        background: #1a1a2e;
    }
    
    body.dark-mode .mobile-top-bar,
    body.dark-mode .mobile-bottom-bar {
        background: #1a1a2e;
        border-color: #e94560;
    }
    
    body.dark-mode .quran-text {
        color: #e0e0e0;
    }
    
    body.dark-mode .ayah-number,
    body.dark-mode .bismillah-line {
        color: #e94560;
    }
    
    body.dark-mode .side-menu {
        background: rgba(20, 20, 40, 0.98);
    }
    
    body.dark-mode .menu-item {
        background: #1a1a2e;
    }
    
    body.dark-mode .menu-open-btn {
        background: #e94560;
        color: #1a1a2e;
    }
}
/* الشريط السفلي للهواتف */
.mobile-bottom-bar {
    background: #2e241a;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #c9a86b;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* أزرار التنقل في المنتصف */
.mobile-bottom-bar .nav-btn {
    background: #c9a86b;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

/* حاوية إدخال رقم الصفحة */
.mobile-bottom-bar .page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1f1810;
    padding: 4px 10px;
    border-radius: 30px;
}

/* أزرار القوائم في الشريط السفلي */
.menu-open-btn-bottom {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #c9a86b;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.menu-open-btn-bottom:active {
    transform: scale(0.95);
}

.left-bottom {
    order: 0;
}

.right-bottom {
    order: 2;
}

/* الوضع الليلي */
body.dark-mode .menu-open-btn-bottom {
    background: #e94560;
    color: #1a1a2e;
}

body.dark-mode .mobile-bottom-bar {
    background: #1a1a2e;
    border-color: #e94560;
}

/* إخفاء الأزرار القديمة في الأعلى */
.menu-open-btn {
    display: none !important;
}
/* ========== إطار اسم السورة باستخدام الصورة ========== */
.surah-marker {
    display: block !important;
    text-align: center;
    padding: 5px 20px;
    background: url('image/itar.png') center center no-repeat;
    background-size: 100% 100%;
    min-height: 70px;
    position: relative;
}

/* اسم السورة داخل الإطار */
.surah-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ecaa68;
    background: none;
    padding: 0 1px;
    letter-spacing: 1px;
    font-family: 'NouariAbdelkabir', 'Amiri', serif;
    display: inline-block;
    position: relative;
    z-index: 2;
}

/* ========== الوضع الليلي ========== */
body.dark-mode .surah-name {
    color: #e94560;
}

/* ========== شريط اللمس الشفاف فوق الآيات ========== */
.ayah-wrapper {
    display: inline;
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
}

/* الآية المحددة (مضللة) - بدون إطار */
.ayah-wrapper.highlighted {
    background: rgba(201, 168, 107, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* وضع الليلي - بدون إطار */
body.dark-mode .ayah-wrapper.highlighted {
    background: rgba(233, 69, 96, 0.3);
}

/* تأثير الضغط على الآية */
.ayah-wrapper:active {
    background: rgba(201, 168, 107, 0.1);
    border-radius: 2px;
    transition: 0.15s;
}

/* وضع الليلي لضغط الآية */
body.dark-mode .ayah-wrapper:active {
    background: rgba(233, 69, 96, 0.15);
}

/* تحسين عرض الأرقام */
.ayah-number {
    display: inline-block;
    margin: 0 2px;
}
/* منع التمرير الأفقي */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* التأكد من أن جميع العناصر لا تتسبب في تمرير أفقي */
.app, .main-area, .view-area, .quran-text {
    overflow-x: hidden;
    max-width: 100%;
}


/* ========== إيماءات اللمس للهواتف ========== */
@media (max-width: 768px) {
    .mobile-quran-area {
        touch-action: pan-y pinch-zoom; /* يسمح بالسحب العمودي فقط مع منع السحب الأفقي */
        overflow-x: hidden;
    }
    
    /* مؤشر السحب (اختياري) */
    .swipe-indicator {
        position: fixed;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(201, 168, 107, 0.8);
        color: #2e241a;
        padding: 6px 12px;
        border-radius: 30px;
        font-size: 0.7rem;
        z-index: 200;
        display: none;
        white-space: nowrap;
        font-family: inherit;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    
    body.dark-mode .swipe-indicator {
        background: rgba(233, 69, 96, 0.8);
        color: #1a1a2e;
    }
}

/* ========== إطار بسيط حول الصفحة باستخدام CSS فقط ========== */

/* إطار صفحة واحدة */
#singleView .page-container {
    border: 8px solid #c9a86b;
    border-radius: 20px;
    box-shadow: 0 0 0 4px #c9a86b, 0 8px 25px rgba(0,0,0,0.2);
    background: #fffcf0;
}

/* إطار صفحتين */
#doubleView .page-box {
    border: 8px solid #c9a86b;
    border-radius: 20px;
    box-shadow: 0 0 0 3px #c9a86b, 0 5px 15px rgba(0,0,0,0.1);
    background: #f1f1ed;
}

/* إطار مقارنة */
#compareView .compare-page {
    border: 8px solid #c9a86b;
    border-radius: 20px;
    box-shadow: 0 0 0 3px #c9a86b;
    background: #fffcf0;
}

/* إطار الهواتف */
@media (max-width: 768px) {
    .mobile-app .page-container {
        border: 6px solid #c9a86b;
        border-radius: 15px;
        box-shadow: 0 0 0 3px #c9a86b;
    }
}

/* الوضع الليلي */
body.dark-mode #singleView .page-container,
body.dark-mode #doubleView .page-box,
body.dark-mode #compareView .compare-page,
body.dark-mode .mobile-app .page-container {
    border-color: #e94560;
    box-shadow: 0 0 0 3px #1a1a2e;
    background: #16213e;
}

/* ========== كود الالوان========== */

.c1 { color: #FF0000; }   /*   الكلمات الفرشية  */
.c2 { color: #753701; }   /*   عد الايات  */
.c3 { color: #e2d51f; }
.c4 { color: #ffbb00; }   /*   الامالة والتقليل  */
.c5 { color: #86cbec; }   /*   البسملة بين السورتين   */
.c6 { color: #062264; }   /*   علامات الوقف   */
.c7 { color: #0B9DF4; }   /*   الهمز المفرد والمزدوج   */
.c8 { color: #25FB13; }   /*     اللامات لورش  */
.c9 { color: #0004FF; }   /*   النقل والسكت   */
.c10 { color: #06EED8; } /*    مد البدل لورش  */
.c11 { color: #F98F1F; } /*  الراءات لورش   */
.c12 { color: #EE1E80; } /*  ميم الجمع   */
.c13 { color: #CD12E7; } /*    مد اللين لورش  */
.c14 { color: #880D0D; } /*   الياءات المتطلفة   */
.c15 { color: #1255D6; } /*   الادغام والاظهار   */
.c16 { color: #e2d51f; }
.c17 { color: #602DBA; } /*   الانفرادات   */
.c18 { color: #e2d51f; }
.c19 { color: #e2d51f; }
.c20 { color: #e2d51f; }
.c21 { color: #e2d51f; }
.c22 { color: #e2d51f; }
.c23 { color: #e2d51f; }
.c24 { color: #e2d51f; }
.c25 { color: #e2d51f; }
