.persistent-explain {
    background-color: #1a1d23 !important;
    /* خلفية داكنة جداً لزيادة التباين */
    color: #ffffff !important;
    /* نص أبيض ناصع */
    border: 2px solid #ffcc00 !important;
    /* إطار أصفر فاقع */
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
    line-height: 1.6;
    font-weight: bold;
    /* يجعل الخط أزهى وأوضح */
    display: none;
    /* يختفي ويظهر فقط عند الخطأ */
}

/* لتمييز كلمة "توضيح" بلون أصفر فاقع */
.persistent-explain strong {
    color: #ffcc00 !important;
}

/* النص الذي يظهر في رأس المودال (عنوان السؤال) */
#modalTitle {
    color: #bbce6c !important;
    /* تغيير للون الأبيض الناصع */
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.info-card h4 {
    color: rgb(6, 209, 182) !important;
}

.info-card p {
    color: #bbce6c !important;
}

.bold-text p {
    list-style: none;
    text-align: right;
    color: rgb(200, 9, 9) !important;
}

.comparison-card p {
    color: #919497 !important;
}

.comparison-card h4 {
    color: #ffcc00;
}



/* صناديق الشرح الإضافية (📌) */
.explanation-details {
    background: rgba(255, 255, 255, 0.05);
    background-color: #c6c9cd;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid #3b82f6;
    /* إطار أزرق جانبي */
    margin-top: 15px;
}

/* قائمة التفاصيل */
.details-list {
    list-style: none !important;
    padding-right: 10px !important;
}

.details-list li {
    margin-bottom: 10px;
    color: #e2e8f0 !important;
    /* لون رمادي فاتح جداً مقارب للأبيض */
    position: relative;
}

/* تمييز الكلمات التقنية باللون الأصفر الزاهي */
.highlight {
    color: #b82c10 !important;
    /* نفس أصفر الملخص الذهبي */
    background: rgba(255, 204, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}



/* صندوق الملاحظة (Tip Box) لكسر البهتان */
.tip-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #1a1d23;
    /* خلفية داكنة جداً للتباين */
    border: 1px solid #10b981;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    color: #ffffff !important;
    /* نص أبيض ناصع */


    /* عشان العربي يفضل مظبوط */

}

.tip-box .icon {
    font-size: 1.5rem;
}

.tip-box p {
    margin: 0;
    line-height: 1.5;
}

/* صندوق الفكرة (التباين العالي) */
.concept-box {
    background: #1a1d23;
    /* خلفية داكنة لمنع البهتان */
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-bottom: 2px solid #a855f7;
}

.highlight-param,
.analogy-item .C {
    color: #3b82f6 !important;
    font-weight: bold;
}

/* أزرق للمعامل */
.highlight-arg,
.analogy-item .W {
    color: #10b981 !important;
    font-weight: bold;
}

/* أخضر للوسيط */

/* تنسيق التشبيه البسيط */
.analogy-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    background: #1a1d23;
    border-radius: 8px;

}

.analogy-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px dashed #a855f7;
}

.analogy-item .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* لوحة تحليل المثال لزيادة الفهم البصري */
.analysis-panel {
    background: #1a1d23;
    /* خلفية داكنة جداً للتباين */
    border: 1px solid #22c55e;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.analysis-item .label {
    color: #ffcc00 !important;
    /* أصفر زاهي كالملخص */
    font-weight: 900;
}

.analysis-item .value {
    color: #ffffff !important;
    /* أبيض ناصع */
}







/* نظام الشبكة للمقارنة (Arrow Functions & Scope) */
.grid-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.comparison-card {
    background: #1a1d23 !important;
    /* خلفية سوداء عميقة لزيادة التباين */
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #334155;
}

.highlight-card {
    border: 1px solid #ffcc00 !important;
    /* تمييز الجزء الأهم بالذهبي */
}




/* تمييز الـ List داخل الشرح */
.explanation-details ul li {
    margin-bottom: 8px;
    color: #1a1c1b !important;
    /* لون أخضر زاهي للمميزات */
}

.topic-section .bold-textt {
    color: #ffffff;

}


/* منطقة التحكم (الإدخال والزر) */
.quiz-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* حقل إدخال الكود */
#quiz-input,
#string-quiz-input,
.code-1 {
    background: #000000 !important;
    border: 1px solid #444 !important;
    color: #4ade80 !important;
    /* لون أخضر (مثل لون كود البرمجة) */
    padding: 15px !important;
    border-radius: 8px !important;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s ease;
}

#quiz-input:focus {
    border-color: #ffcc00 !important;
}

.bold-text li {
    color: #ffcc00 !important;
}


h3 {
    font-family: 'Cairo', sans-serif;
    /* تأكد من استدعاء الخط */
    font-size: 1.4rem;
    color: #ffffff;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    border-right: 4px solid #6366f1;
    /* خط جانبي بلون البراند */
    border-radius: 4px 12px 12px 4px;
    margin: 25px 0 15px 0;
    position: relative;
    display: flex;
    align-items: center;
    transition: 0.3s ease;
}

/* إضافة أيقونة بسيطة قبل العنوان */
h3::before {
    content: '⚡';
    /* أو أي رمز برمجي */
    margin-left: 10px;
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px #6366f1);
}

h3:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    transform: translateX(-5px);
    /* حركة بسيطة عند الهوفر */
}



/* شبكة البطاقات */
.utilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* تصميم البطاقة الواحدة */
.util-card {
    background: rgba(30, 41, 59, 0.7);
    /* لون شفاف فخم */
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.util-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.9);
}

/* رأس البطاقة */
.util-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.util-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.util-name {
    color: #60a5fa;
    /* أزرق برمجيات */
    font-weight: bold;
    font-size: 1.1rem;
    direction: ltr;
}

/* الوصف */
.util-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* تعديل بلوك الكود الصغير داخل البطاقة */
.small-code {
    padding: 8px !important;
    font-size: 0.85rem !important;
    background: #010c15 !important;
}




/* حاوية عملية التدفق */
.json-flow-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(15, 23, 42, 0.5);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin: 20px 0;
    gap: 10px;
}

.flow-step {
    text-align: center;
    flex: 1;
}

.step-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-box {
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* تمييز الـ Object عن الـ String */
.object-box {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.string-box {
    background: #1e293b;
    color: #10b981;
    /* لون أخضر للنصوص */
    border: 1px solid #10b981;
}

/* تنسيق السهم والعمليات */
.flow-arrow {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--secondary);
}

.arrow-line {
    font-size: 2rem;
    line-height: 1;
}

.arrow-text {
    font-size: 0.75rem;
    background: rgba(168, 85, 247, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    margin: 2px 0;
    font-family: monospace;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 600px) {
    .json-flow-container {
        flex-direction: column;
    }

    .arrow-line {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}

.theory-box {
    border-right: 3px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 10px 10px 0;
}

/* تنسيق النصوص والرموز البرمجية */
.inline-code {
    direction: ltr;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-weight: bold;
    margin: 0 4px;
    background: #1e293b;
    vertical-align: middle;
}

.inline-code.blue {
    color: #60a5fa;
    border: 1px solid #60a5fa44;
}

.inline-code.pink {
    color: #f472b6;
    border: 1px solid #f472b644;
}

.inline-code.gold {
    color: #fbbf24;
    border: 1px solid #fbbf2444;
}

/* تنسيق صندوق المعلومات */
.info-box.accent-border {
    background: rgba(99, 102, 241, 0.05);
    border-right: 4px solid #6366f1;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.comparison-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.term {
    background: #2d3748;
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.proto-text {
    color: #a855f7;
    font-style: italic;
    font-weight: bold;
}

/* تنسيق صندوق النظرية */
.theory-box.gold-border {
    background: rgba(251, 191, 36, 0.05);
    border-right: 4px solid #fbbf24;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.8;
}

.bool-val {
    color: #10b981;
    font-weight: bold;
    text-decoration: underline;
}



/* تنسيق الكلمات المميزة (Badges) */
.badge {
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0 4px;
}

.badge.ref {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid #6366f1;
}

.badge.val {
    background: rgba(244, 114, 182, 0.2);
    color: #f472b6;
    border: 1px solid #f472b6;
}

/* تنسيق القائمة */
.styled-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.styled-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #e2e8f0;
    line-height: 1.6;
}

/* تنسيق الكود الصغير داخل الجمل */
.code-pill {
    direction: ltr;
    background: #0f172a;
    color: #60a5fa;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.mini-code {
    direction: ltr;
    display: inline-block;
    color: #f472b6;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 5px;
    border-radius: 3px;
}

.mini-code.yellow {
    color: #fbbf24;
}

.true-text {
    color: #10b981;
}

/* صندوق الذاكرة */
.memory-box {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-right: 4px solid #818cf8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.theory-title {
    color: #818cf8;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}