@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #121212;
        --bs-body-color: #e0e0e0;
}


[data-bs-theme="dark"] {
    --bs-body-bg: #000000;       /* خلفية سوداء تماماً */
    --bs-body-color: #ffffff;    /* نص أبيض ناصع */
    --bs-emphasis-color: #ffffff; /* تلوين العناصر المهمة بالأبيض */
    --bs-secondary-bg: #1a1a1a;  /* رمادي غامق جداً للبطاقات أو القوائم */
}


/* تنسيق عام للقائمة الجانبية لضمان التباين */
.offcanvas {
    transition: background-color 0.3s ease;
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* إزالة الألوان الثابتة من الروابط داخل القائمة */
.offcanvas .list-group-item a {
    color: inherit; /* يأخذ لون النص المعتمد في النظام */
}
     
.list-group-item {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

/* زر القائمة الجانبية المخصص */
.btn-sidebar {
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
    border: 1px solid var(--bs-border-color);
}

.lesson-card {
    background: #1e1e1e !important;
    border-right-color: #3d8bfd !important;
    border-radius:2 25px;
    padding: 25px;
    margin-bottom: 25px;
    borborder-right: 8px solid #0d6efd;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}


/* لزيادة الأمان: نؤكد على المتصفح أن أي "بداية" هي اليمين 
[dir="rtl"] .lesson-card {
    border-right: 6px solid #0d6efd !important;
    border-left: 0 !important;
}*/

/* تنسيق الرياضيات العالمي (يسار إلى يمين) */
.math-block { 
    direction: ltr; 
    background: #252525 !important; 
    padding: 20px; 
    border: 1px solid #333 !important;
    border-radius: 8px; 
    margin: 15px 0; 
    text-align: center; 
    color: #75b5ff !important;
    font-size: 1.3rem; 
    /* الحل السحري للـ débordement */
    overflow-x: auto; /* السماح بالتمرير الأفقي فقط عند الحاجة */
    white-space: nowrap; /* منع انكسار المعادلة بشكل مشوه */
    max-width: 100%; /* ضمان عدم خروج الصندوق عن حدود الأب */
    scrollbar-width: auto;
    scrollbar-color: #0d6efd #e9ecef;
}

/* تحسين مظهر شريط التمرير ليكون ناعماً */
.math-block::-webkit-scrollbar {
    height: 6px;
}
.math-block::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

/* جعل الشريط مرئياً دائماً في متصفحات Chrome و Safari */
.math-block::-webkit-scrollbar {
    height: 8px; /* سمك الشريط */
    display: block !important;
}

.math-block::-webkit-scrollbar-track {
    background: #e9ecef; /* لون خلفية المجرى */
    border-radius: 10px;
}

/* تسميات الأسئلة */
.question-label {
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* أزرار التنقل السفلية */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.btn-next { 
    background-color: #198754; 
    color: white; flex: 1; 
    font-weight: bold; 
    padding: 12px; 
    border-radius: 8px; 
    text-decoration: none; 
    text-align: center; 
}

.btn-back { 
    background-color: #6c757d; 
    color: white; 
    flex: 1; 
    font-weight: bold; 
    padding: 12px; 
    border-radius: 8px; 
    text-decoration: none; 
    text-align: center; 
}

.math-wrapper {
    direction: ltr !important; 
    padding: 15px; 
    border-radius: 8px; 
    margin: 15px 0; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}

.choices {
    direction:"ltr"; 
    margin-left:30px;
}

.equation-line{
    margin-right:30px;
}

.bi-list-ul {
    color: #66b2ff !important;
}

/* تحسينات الشاشات الصغيرة (الهواتف) */
@media (max-width: 600px) {
    .lesson-card { padding: 15px; }
    .nav-buttons { flex-direction: column; }
    .math-block { font-size: 1.1rem; }
}












/**/

