/* الألوان الأساسية */
:root {
    --bg-main: #141414;
    --sidebar-bg: #1c1c1c;
    --card-bg: #1e1e1e;
    --accent-orange: #ff8c32;
    /* لون برتقالي أكثر وضوحاً */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    /* لون رمادي فاتح للنصوص الفرعية */
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

/* القائمة الجانبية - الافتراضي للشاشات الكبيرة */
.sidebar {
    width: 80px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-left: 1px solid #333;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}

.content-area {
    margin-right: 80px;
    /* ترك مساحة للسايدبار في الديسكتوب */
    padding: 40px 60px;
    min-height: 100vh;
}

/* ============================================================
   التجاوب - Tablet (768px - 991px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 991px) {
    .sidebar {
        display: flex !important;
        width: 70px !important;
    }

    .content-area {
        margin-right: 70px !important;
        padding: 25px 30px !important;
    }

    .mobile-top-bar {
        display: none !important;
    }
}

/* ============================================================
   التجاوب - Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* إخفاء السايدبار الجانبي كلياً في الموبايل */
    .sidebar {
        display: none !important;
    }

    /* المحتوى يأخذ العرض الكامل */
    .content-area {
        margin-right: 0 !important;
        padding: 15px 15px 90px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* إظهار هيدر الموبايل */
    .mobile-top-bar {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1040;
        width: 100%;
        background-color: rgba(20, 20, 20, 0.97);
        backdrop-filter: blur(10px);
    }

    /* إخفاء عنوان الهيدر الديسكتوب في الموبايل */
    .responsive-header h4.d-md-none {
        display: block !important;
    }

    .responsive-header h4.d-none.d-md-block,
    .responsive-header span.d-none.d-md-block {
        display: none !important;
    }

    /* حقل البحث */
    .search-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 52px !important;
    }

    .search-input {
        padding-right: 55px !important;
        padding-left: 45px !important;
        font-size: 13px !important;
        height: 52px !important;
    }

    .db-icon-right {
        right: 5px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
    }

    .search-icon-left {
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 1rem !important;
    }

    /* أزرار الفلترة - تمرير أفقي */
    .filter-scroll-container .d-flex {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding: 8px 5px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    /* القائمة المنسدلة الرئيسية في الموبايل */
    .main-custom-menu {
        position: fixed !important;
        right: 15px !important;
        left: 15px !important;
        top: 65px !important;
        width: calc(100% - 30px) !important;
    }
}

/* القائمة المنسدلة للديسكتوب (حتى تبقى ثابتة عند التمرير) */
@media (min-width: 769px) {
    .main-custom-menu {
        position: fixed !important;
        top: 25px !important;
        right: 100px !important; /* عرض السايدبار + مسافة */
        width: 250px;
    }
}

/* العناوين والنصوص */
@media (max-width: 768px) {
    header h4 {
        font-size: 1rem !important;
    }

    .placeholder-title {
        font-size: 20px;
    }

    .placeholder-subtitle {
        font-size: 14px;
    }

    .search-icon-box {
        width: 70px;
        height: 70px;
    }

    /* البطاقات */
    .knowledge-update-card,
    .knowledge-card {
        margin-bottom: 10px;
    }
}

/* أيقونات الجنب */
.side-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.3s;
}

.side-icon.active {
    background-color: var(--accent-orange);
    color: white;
    box-shadow: 0 0 20px rgba(255, 140, 50, 0.4);
}

/* صندوق البحث */
.search-container {
    max-width: 850px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 15px;
    height: 60px;
    display: flex;
    align-items: center;
}

.search-input {
    background: transparent !important;
    border: none !important;
    color: white !important;
    width: 100%;
    padding: 0 70px 0 50px;
    font-size: 1.1rem;
}

.search-input::placeholder {
    color: #666;
}

.db-icon-right {
    position: absolute;
    right: 10px;
    background: var(--accent-orange);
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
}

.search-icon-left {
    position: absolute;
    left: 20px;
    color: #888;
    font-size: 1.2rem;
}

/* الأزرار */
.filter-btn {
    background: #2a2a2a;
    color: var(--text-secondary);
    border: 1px solid #444;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.filter-btn:hover {
    color: white;
    border-color: var(--accent-orange);
}

.filter-btn.active {
    background: var(--accent-orange);
    color: white;
    border: none;
}

/* البطاقات */
.update-card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.badge-custom {
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: white;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* زر المساعدة */
.help-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* تنسيق الزر عند الفتح */
.custom-dropdown-btn.show {
    background: var(--accent-orange) !important;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(255, 140, 50, 0.5);
}

/* القائمة المنسدلة */
.custom-dropdown-menu {
    background: rgba(30, 30, 30, 0.95);
    /* لون داكن شفاف */
    backdrop-filter: blur(10px);
    /* تأثير زجاجي */
    border: 1px solid #444;
    border-radius: 15px;
    padding: 10px;
    min-width: 220px;
    margin-top: 10px !important;
    text-align: right;
}

/* عناصر القائمة */
.custom-dropdown-menu .dropdown-item {
    color: #b0b0b0;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: 0.3s;
}

.custom-dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* العنصر النشط داخل القائمة (كل الأحكام) */
.active-item {
    color: #a885f7 !important;
    /* اللون البنفسجي الفاتح النصي */
    background: transparent !important;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: #a885f7;
    border-radius: 50%;
    display: inline-block;
}

/* أيقونات ملونة */
.text-purple {
    color: #a885f7;
}

/* إزالة سهم البوتستراب الافتراضي */
.dropdown-toggle::after {
    display: none;
}

/* تأثير التوهج للزر النشط */
.filter-btn.active {
    background: linear-gradient(135deg, #ff8c32, #ff5e3a);
    color: white;
}

/* تنسيق العناصر داخل القائمة */
.custom-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    flex-direction: row;
    /* يضمن الترتيب من اليمين لليسار لأننا في وضع RTL */
    padding: 10px 15px;
    color: #b0b0b0;
    text-align: right;
    border-radius: 10px;
}

/* جعل النص يأخذ المساحة المتاحة في الوسط */
.flex-grow-1 {
    flex-grow: 1;
}

/* النقطة البنفسجية في اليسار */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: #a885f7;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(168, 133, 247, 0.6);
}

/* مساحة فارغة للعناصر غير النشطة لضمان توازي النصوص */
.dot-placeholder {
    width: 8px;
    height: 8px;
    display: inline-block;
}

/* تعديل لون النص للعنصر النشط */
.active-item {
    color: #a885f7 !important;
}

/* أيقونة المطرقة في العنصر النشط */
.active-item i {
    color: #a885f7;
}

.text-end {
    text-align: right !important;
}

/* الحالة الافتراضية للسهم (يشير للأسفل) */
.arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    /* سرعة ونعومة الحركة */
    margin-right: 10px;
    /* مسافة بسيطة من النص */
    font-size: 0.8rem;
}

/* عندما تفتح القائمة (Bootstrap يضيف كلاس show للزر) */
.custom-dropdown-btn.show .arrow-icon {
    transform: rotate(180deg);
    /* قلب السهم للأعلى */
}

/* الحالة العادية للزر */
.filter-btn {
    background: #2a2a2a;
    color: #b0b0b0;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

/* الحالة عند الضغط والبقاء عليه (بدون جافا سكربت) */
.filter-btn:focus {
    background: linear-gradient(135deg, #ff8c32, #ff5e3a) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(255, 140, 50, 0.5);
    outline: none;
    /* لإخفاء إطار التركيز الافتراضي للمتصفح */
}

/* لجعل اللون يظهر أيضاً في اللحظة التي تضغط فيها بالفأرة */
.filter-btn:active {
    transform: scale(0.98);
    /* تأثير ضغطة بسيطة */
}

.filter-btn {
    /* التأكد من ثبات الحجم */
    box-sizing: border-box;
    border: 1px solid #444 !important;
    transition: none !important;
    /* إلغاء أي انيميشن ناعم قد يسبب اهتزاز */
}

.filter-btn:focus,
.filter-btn:active {
    /* منع المتصفح من تحريك الصفحة للتركيز على الزر */
    outline: none !important;
    box-shadow: none !important;
    /* إلغاء الظل إذا كان يسبب حركة بصرية */

    /* المحافظة على نفس حدود الزر لكي لا يتحرك */
    border: 1px solid transparent !important;

    /* تغيير اللون فقط */
    background: #ff8c32 !important;
    /* استخدم لون سادة بدل التدرج إذا استمرت الحركة */
}

.icon-container {
    width: 45px;
    height: 45px;
    background-color: #ff8c32;
    /* اللون البرتقالي الأساسي */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* حواف دائرية ناعمة */
    color: white;
    /* لون أيقونة الميزان */
    box-shadow: 0 4px 12px rgba(255, 140, 50, 0.3);
    /* توهج بسيط */
}

.icon-container svg {
    width: 28px;
    /* حجم الأيقونة داخل المربع */
    height: 28px;
}

/* الخلفية العامة للموقع (إذا لم تكن موجودة) */
body {
    background-color: #1a1a1a;
}

/* تنسيق البطاقة */
.knowledge-card {
    background-color: #2a2a2a;
    border-radius: 15px;
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.knowledge-card:hover {
    border-color: #a885f7;
    /* توهج بسيط عند التحويم */
    transform: translateY(-5px);
}

/* اللون البنفسجي للأيقونات */
.text-purple {
    color: #a885f7 !important;
}

/* شارة "جديد" الخضراء */
.badge-new {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* خطوط الفصل والوثائق */
.border-secondary {
    border-color: #444 !important;
}

.text-purple {
    color: #a885f7 !important;
}

.knowledge-card {
    background-color: #2a2a2a;
    border-radius: 15px;
    border: 1px solid #383838;
}

.me-3 {
    margin-right: 1rem !important;
}

/* تأكد من أن الحاوية الرئيسية لا تحصر العرض */
.main-wrapper {
    width: 100%;
    max-width: none !important;
}

/* لجعل حقل البحث يأخذ مساحة أكبر كما في الفيجما */
.search-container {
    width: 100%;
    max-width: 1200px;
    /* يمكنك تكبير هذه القيمة أو جعلها 100% */
}

/* تحسين شكل السكرول بار للأزرار */
.filter-scroll-container .d-flex::-webkit-scrollbar {
    display: none;
}

/* تحسين شكل السكرول بار للأزرار المنزلقة على الموبايل */
.search-section .d-flex::-webkit-scrollbar {
    display: none;
}







/* ===== إصلاح القوائم المنسدلة ===== */

/* السماح للدروب داون بالظهور خارج حاوية السكرول */
.filter-scroll-container {
    overflow: visible !important;
}

.custom-scrollbar-hide {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: visible !important;
}

/* ضمان أن القائمة تظهر فوق العناصر الأخرى */
.dropdown-menu {
    z-index: 9999 !important;
    /* لا تضع position هنا - Popper يحتاج يتحكم فيها */
}

.dropdown {
    position: relative !important;
}

/* شريط السكرول الأفقي */
.mobile-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    padding-top: 10px;
    padding-bottom: 20px;
}

.mobile-scroll::-webkit-scrollbar {
    height: 0px;
    display: none;
}

/* القائمة المنسدلة - تنسيق فقط، بدون تدخل في التموضع */
.custom-dropdown-menu {
    /* لا تضع position أو transform هنا - Popper يتحكم فيها */
    min-width: 220px !important;
    z-index: 9999 !important;
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    border-radius: 12px !important;
    padding: 8px !important;
}

/* تصميم القائمة المنسدلة الرئيسي */


/* حجم الخطوط الصغير */
.smaller {
    font-size: 11px;
    color: #888;
}

/* تنسيق العناصر عند التمرير */
.main-custom-menu .dropdown-item {
    transition: 0.3s;
    font-size: 14px;
    color: #bbb !important;
}

.main-custom-menu .dropdown-item:hover {
    background-color: #333;
    color: #fff !important;
}

/* العنصر النشط (بنفسجي من الصورة) */
.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
}

.active-link .dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* إيقونة العناصر */
.main-custom-menu i {
    font-size: 1.1rem;
    color: inherit;
}

/* محاذاة القائمة لليسار قليلاً بالنسبة للسايدبار */
.dropdown-menu[aria-labelledby="mainMenu"] {
    left: 70px !important;
    right: auto !important;
}

/* تأثير الظل */
.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.main-custom-menu {
    display: none;
    /* بوتستراب سيغيرها إلى block عند الضغط */
    position: absolute !important;
    z-index: 9999 !important;
    /* لضمان ظهورها فوق كل شيء */
}

.main-custom-menu.show {
    display: block !important;
}

.main-custom-menu {
    display: none;
    position: absolute !important;
    transform: translate3d(70px, 0px, 0px) !important;
    /* تحريكها بجانب السايدبار */
    z-index: 99999 !important;
}

/* الكلاس الذي سيتحكم فيه الجافا سكريبت */
.main-custom-menu.show {
    display: block !important;
}

.main-custom-menu {
    display: none;
    position: absolute !important;
    /* ضبط التموضع ليظهر بجانب الشريط الجانبي الأيمن */
    top: 0 !important;
    right: 150px !important;
    /* هذه المسافة تبعدها عن الشريط الجانبي الأيمن */
    left: auto !important;

    /* ضبط الاتجاه ليكون من اليمين لليسار */
    direction: rtl !important;
    text-align: right !important;

    background-color: #262626 !important;
    border: 1px solid #333 !important;
    border-radius: 15px !important;
    width: 260px;
    padding: 0;
    z-index: 99999 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

@media (max-width: 767px) {
    .main-custom-menu {
        /* تظهر فقط عند إضافة كلاس الفتح بالجافا سكريبت، وإذا كنت تريدها تظهر مباشرة غيرها لـ block */
        display: none;

        position: absolute !important;
        /* ضبط التموضع ليظهر بجانب الشريط الجانبي الأيمن */
        top: 0 !important;
        right: 70px !important;
        /* هذه المسافة تبعدها عن الشريط الجانبي الأيمن */
        left: auto !important;

        /* ضبط الاتجاه ليكون من اليمين لليسار */
        direction: rtl !important;
        text-align: right !important;

        background-color: #262626 !important;
        border: 1px solid #333 !important;
        border-radius: 15px !important;
        width: 260px;
        padding: 0;
        z-index: 99999 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    }
}


/* التأكد من محاذاة العناصر داخل القائمة */
.main-custom-menu .dropdown-item {
    display: flex !important;
    flex-direction: row-reverse !important;
    /* لضمان الأيقونة على اليسار والنص يمين */
    justify-content: flex-end !important;
    align-items: center;
    padding: 10px 15px !important;
    color: #bbb !important;
    font-size: 14px;
}

.main-custom-menu .dropdown-item i {
    margin-right: 10px;
    /* مسافة بين النص والأيقونة */
    margin-left: 0;
}

/* تنسيق العنصر النشط */
.active-link {
    background-color: #9d7dfa !important;
    color: white !important;
    flex-direction: row !important;
    /* لإظهار النقطة البيضاء على اليمين */
    justify-content: space-between !important;
}

.me-2 {
    margin-right: .5rem !important;
}

/* تنسيق العنصر النشط مع نقل النقطة لأقصى اليسار */
.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    /* عكس الاتجاه لنقل النقطة لليسار */
    justify-content: space-between !important;
    /* توزيع المحتوى بين الطرفين */
    align-items: center !important;
    padding: 10px 15px !important;
}

/* حاوية النص والأيقونة لضمان بقائهما سوياً على اليمين */
.menu-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    /* المسافة بين النص والأيقونة */
}

/* تنسيق النقطة البيضاء */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    flex-shrink: 0;
    /* منع انكماش النقطة */
}

.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
    direction: rtl !important;
    /* لضمان أن الترتيب يبدأ من اليمين */
    border-radius: 0 !important;
    /* إذا كنت تريدها مستطيلة كما في الصورة */
}

/* الأيقونة جهة اليمين */
.active-link i {
    order: 1;
    /* يضمن ظهورها أولاً جهة اليمين */
}

/* النص بجانب الأيقونة */
.active-link span:not(.dot-indicator) {
    order: 2;
    font-size: 14px;
    font-weight: 500;
}

/* النقطة أقصى اليسار */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    order: 3;
    /* تظهر في الأخير (جهة اليسار في RTL) */
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    /* وهج خفيف مثل الصورة */
}

.search-placeholder-section {
    padding: 100px 20px;
    text-align: center;
    background-color: transparent;
    /* لكي يأخذ خلفية الموقع الداكنة */
}

/* تنسيق حاوية الأيقونة (المربع البنفسجي الداكن) */
.search-icon-box {
    width: 85px;
    height: 85px;
    background-color: #2d283e;
    /* لون بنفسجي غامق جداً متناسق مع الصورة */
    border: 1.5px solid #4a3f6b;
    /* إطار خفيف */
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9d7dfa;
    /* لون الأيقونة البنفسجي الفاتح */
    box-shadow: 0 0 30px rgba(157, 125, 250, 0.1);
    /* توهج خفيف جداً */
    transition: transform 0.3s ease;
}

.search-icon-box:hover {
    transform: translateY(-5px);
}

/* تنسيق العناوين */
.placeholder-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.placeholder-subtitle {
    color: #888888;
    /* لون رمادي للنص الفرعي */
    font-size: 16px;
    max-width: 500px;
    line-height: 1.6;
}

/* تعديل للموبايل */
@media (max-width: 768px) {
    .placeholder-title {
        font-size: 20px;
    }

    .placeholder-subtitle {
        font-size: 14px;
    }

    .search-icon-box {
        width: 70px;
        height: 70px;
    }
}

/* ========================================================================= */
/* CSS لصفحة نتائج البحث (search.html) */
/* ========================================================================= */

.search-results-section {
    padding: 20px 0;
}

/* الأزرار العلوية */
.btn-dark-custom {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 10px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-dark-custom:hover {
    background-color: #3a3a3a;
    border-color: #555;
    color: #fff;
}

/* أيقونة قاعدة البيانات بجانب عدد النتائج */
.results-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(168, 133, 247, 0.1);
    color: #a885f7;
    border: 1px solid rgba(168, 133, 247, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* بطاقة نتيجة البحث */
.search-result-card {
    background-color: #242424;
    border: 1px solid #333;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-color: #444;
}

/* مربع الصلة (Relevance) */
.relevance-badge {
    width: 65px;
    height: 75px;
    background-color: transparent;
    border: 1px solid rgba(168, 133, 247, 0.4);
    border-radius: 12px;
}

.text-purple {
    color: #a885f7 !important;
}

/* شارة الحالة (ساري) */
.badge-active {
    background-color: var(--accent-orange);
    color: white;
    border-radius: 8px;
    font-weight: 500;
}

/* ========================================================================= */
/* CSS للقائمة الجانبية (البحث المتقدم - Offcanvas) */
/* ========================================================================= */

.custom-offcanvas {
    background-color: #1e1e1e !important;
    border-left: 1px solid #333 !important;
    width: 350px !important;
}

.custom-offcanvas .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5;
}

.custom-offcanvas .btn-close-white:hover {
    opacity: 1;
}

/* القائمة الجانبية للفلاتر (الخط العمودي) */
.custom-checkbox-list {
    border-right: 2px solid #333;
    /* الخط العمودي على اليمين في اللغة العربية */
}

/* تخصيص الـ Checkbox */
.custom-checkbox {
    background-color: transparent !important;
    border: 2px solid #555 !important;
    border-radius: 4px !important;
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background-color: #a885f7 !important;
    border-color: #a885f7 !important;
}

.custom-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(168, 133, 247, 0.25) !important;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.95rem;
}

/* تخصيص حقل التاريخ */
.custom-date-input {
    background-color: #242424 !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 10px 15px !important;
    font-size: 0.95rem;
    color-scheme: dark;
    /* يضمن أن أيقونة التقويم الافتراضية تظهر بلون مناسب للخلفية الداكنة */
    transition: all 0.3s ease;
}

.custom-date-input:focus {
    border-color: #a885f7 !important;
    box-shadow: 0 0 0 0.25rem rgba(168, 133, 247, 0.25) !important;
    outline: none;
}

.custom-date-input::placeholder {
    color: #888;
}

.ms-3 {
    margin-left: 1rem !important;
}

.ms-2 {
    margin-left: .5rem !important;
}

/* جعل القوائم المنسدلة قابلة للتمرير */
.custom-dropdown-menu {
    max-height: 50vh;
    overflow-y: auto;
    /* إخفاء شريط التمرير إذا لم يكن ضرورياً */
    scrollbar-width: thin;
    scrollbar-color: #555 #1e1e1e;
}

.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 10px;
}

/* تخصيص ألوان شريط التمرير للمظهرين الفاتح والسيبيا */
body.light-theme .custom-dropdown-menu {
    scrollbar-color: #ced4da transparent !important;
}
body.light-theme .custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent !important;
}
body.light-theme .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #ced4da !important;
}
body.light-theme .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd !important;
}

body.sepia-theme .custom-dropdown-menu {
    scrollbar-color: #c9b097 transparent !important;
}
body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent !important;
}
body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #c9b097 !important;
}
body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: #bfa68f !important;
}


/* =========================================
   تنسيقات صفحة الوثيقة (document.html)
   ========================================= */

.sticky-top-custom {
    position: sticky;
    top: 30px;
    height: auto;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* تخصيص السكرول بار للأعمدة الثابتة */
.sticky-top-custom::-webkit-scrollbar {
    width: 4px;
}

.sticky-top-custom::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.bg-card-dark {
    background-color: #1e1e1e !important;
}

.bg-darker {
    background-color: #161616 !important;
}

/* التبويبات */
.custom-doc-tabs .nav-link {
    color: #b0b0b0;
    background: #2a2a2a;
    border: none;
    border-radius: 4px 4px 0 0;
    margin-left: 2px;
    padding: 12px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-doc-tabs .nav-link.active {
    background-color: #9d4edd !important;
    color: #ffffff !important;
    border: none !important;
}

.custom-doc-tabs .nav-link:hover:not(.active) {
    color: #fff;
    background-color: #333;
}

/* تكبير الخط */
.document-content-area {
    transition: font-size 0.2s ease;
}

/* أيقونات الإجراءات */
.action-icons i {
    cursor: pointer;
    transition: color 0.3s;
    font-size: 1.1rem;
}

.action-icons i:hover {
    color: #fff;
}

.link-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #2a2a2a;
}

.link-icon-wrapper.active {
    background-color: #9d4edd;
    color: white;
}

/* قائمة الشجرة (الارتباطات) */
.tree-list li {
    margin-bottom: 12px;
}

.tree-list li a {
    font-size: 0.9rem;
    color: #e0e0e0;
    transition: color 0.3s;
}

.tree-list li a:hover {
    color: #9d4edd;
}

/* الفهرس */
.index-item {
    transition: all 0.3s;
    border-right: 4px solid transparent;
}

.index-item.active {
    background-color: #252525;
    border-right-color: #9d4edd;
}

.index-item:hover:not(.active) {
    background-color: #2a2a2a;
}

.index-sub-items {
    background-color: #1a1a1a;
}

.index-sub-item {
    padding: 10px 45px 10px 15px;
    font-size: 0.85rem;
    color: #b0b0b0;
    cursor: pointer;
    transition: color 0.3s;
}

.index-sub-item:hover {
    color: #9d4edd;
}

.accordion-button:not(.collapsed) {
    color: #fff;
    background-color: rgba(157, 78, 221, 0.1);
    box-shadow: none;
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-button:focus {
    box-shadow: none;
}

/* أدوات التكبير */
.zoom-icons i {
    cursor: pointer;
}

.icon-box-dark {
    background: #252525;
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
}

/* البحث المحلي */
.custom-dark-input {
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 12px 45px 12px 15px !important;
}

.custom-dark-input::placeholder {
    color: #666;
}

.hover-white:hover {
    color: white !important;
}

/* أنيميشن الطي */
.transition-width {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden-panel {
    width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* تبويبات الأيقونات الجانبية */
.icon-tabs .nav-link {
    background: none;
    border: none;
    color: #888;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 0;
    font-size: 1.2rem;
}

.icon-tabs .nav-link.active {
    background-color: #9d4edd !important;
    color: #fff !important;
}

.icon-tabs .nav-link:hover:not(.active) {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* التايم لاين (سجل التعديلات) */
.timeline-container {
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    margin-top: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* تحسين السايدبار في الموبايل */
@media (max-width: 991.98px) {
    #rightColumn {
        padding: 15px !important;
    }

    .sidebar-header-wrapper {
        flex-direction: row !important;
        /* ترتيب طبيعي: إكس على اليمين والأيقونات بجانبه */
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        gap: 10px !important;
    }

    .icon-tabs {
        width: auto;
        justify-content: flex-end !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        /* منع القطع */
    }

    .icon-tabs .nav-link {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }

    #hideRightPanelBtn {
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        order: 2;
        /* إبقاء الإكس في أقصى اليسار في RTL */
    }

    #hideRightPanelBtn i {
        margin: 0 !important;
        font-size: 1.2rem !important;
    }
}

/* تحسين السكرول بار (Scrollbar) في القوائم الجانبية */
#rightColumn,
#leftColumn,
.accordion-body {
    scrollbar-width: thin;
    scrollbar-color: #9d4edd transparent;
}

#rightColumn::-webkit-scrollbar,
#leftColumn::-webkit-scrollbar,
.accordion-body::-webkit-scrollbar {
    width: 6px;
}

#rightColumn::-webkit-scrollbar-track,
#leftColumn::-webkit-scrollbar-track,
.accordion-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

#rightColumn::-webkit-scrollbar-thumb,
#leftColumn::-webkit-scrollbar-thumb,
.accordion-body::-webkit-scrollbar-thumb {
    background-color: rgba(157, 78, 237, 0.4);
    border-radius: 20px;
    border: 2px solid transparent;
}

#rightColumn::-webkit-scrollbar-thumb:hover,
#leftColumn::-webkit-scrollbar-thumb:hover {
    background-color: rgba(157, 78, 237, 0.8);
}

/* إضافة مسافة جانبية لمنع السكرول من ملامسة المحتوى */
@media (max-width: 991.98px) {

    #rightColumn,
    #leftColumn {
        padding-left: 10px !important;
        /* مسافة إضافية لجهة السكرول */
        overflow-y: auto;
    }
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -25px;
    top: 5px;
    width: 10px;
    height: 10px;
    background-color: #9d4edd;
    border-radius: 50%;
    z-index: 1;
}

.timeline-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-edit {
    background: rgba(255, 140, 50, 0.2);
    color: #ff8c32;
}

.badge-add {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.badge-delete {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.timeline-date {
    color: #9d4edd;
    font-size: 0.8rem;
    margin-left: 10px;
}

.timeline-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 12px 0 8px 0;
}

.timeline-meta {
    color: #888;
    font-size: 0.75rem;
}

.timeline-desc {
    color: #b0b0b0;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 10px;
}

.timeline-icon {
    font-size: 1.1rem;
    color: #888;
    margin-left: 10px;
}

/* تم دمج التجاوب في بداية الملف لضمان الأولوية */

@media (max-width: 991.98px) {

    #rightColumn,
    #leftColumn {
        position: fixed !important;
        top: 0;
        bottom: 0;
        z-index: 1050;
        background: #121212;
        width: 300px !important;
        max-width: 85vw;
        padding: 20px !important;
        transition: transform 0.3s ease-in-out;
    }

    #rightColumn {
        right: 0;
        transform: translateX(100%);
    }

    #leftColumn {
        left: 0;
        transform: translateX(-100%);
    }

    #rightColumn.show-mobile {
        transform: translateX(0);
    }

    #leftColumn.show-mobile {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1040;
        display: none;
    }

    .mobile-overlay.show {
        display: block;
    }

    .zoom-icons,
    .custom-doc-tabs {
        font-size: 0.8rem;
    }

    .custom-doc-tabs .nav-link {
        padding: 8px 10px;
    }
}

@media (max-width: 576px) {
    .custom-doc-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        flex-wrap: nowrap;
    }

    .custom-doc-tabs .nav-item {
        flex: 0 0 auto;
    }

    .document-content-area {
        padding: 15px !important;
    }

    .card.bg-card-dark {
        padding: 15px !important;
    }
}

/* الأحكام المرتبطة */
.article-header {
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    margin: 25px 0 15px 0;
}

.article-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #9d4edd;
    border-radius: 50%;
    margin-left: 10px;
}

.judgment-card {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.judgment-card:hover {
    background-color: #222;
    border-color: rgba(157, 78, 221, 0.3);
}

.judgment-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.judgment-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

.judgment-meta b {
    color: #666;
    font-weight: 500;
}

/* القوالب */
.template-card {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.template-card:hover {
    background-color: #222;
    border-color: rgba(157, 78, 221, 0.3);
}

.template-info {
    flex-grow: 1;
    text-align: right;
    padding-right: 15px;
}

.template-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.template-title-row span {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 10px;
}

.template-meta-row {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.template-meta-row b {
    color: #666;
    font-weight: 500;
}

.download-icon {
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.download-icon:hover {
    color: #fff;
}

/* واجهة الدردشة الذكية */
.chat-assistant-container {
    padding: 10px 0;
}

.assistant-status-card {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.chat-bubble-ai {
    background-color: #252525;
    border-radius: 18px 4px 18px 18px;
    padding: 15px;
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    margin-right: 45px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-avatar-wrapper {
    position: absolute;
    right: -55px;
    top: 0;
    width: 35px;
    height: 35px;
    background-color: #ff8c32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 10px;
    text-align: left;
}

.text-end {
    text-align: right !important;
}

/* قسم تحديثات قواعد المعرفة الجديد */
.updates-header-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.updates-main-icon-box {
    width: 48px;
    height: 48px;
    background-color: rgba(157, 78, 237, 0.1);
    border: 1px solid rgba(157, 78, 237, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9d4edd;
    font-size: 1.4rem;
}

.count-badge-light {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1c1c1c;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pulse-dot-green {
    width: 10px;
    height: 10px;
    background-color: #2ec4b6;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(46, 196, 182, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 196, 182, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0);
    }
}

.knowledge-update-card {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
}

.bg-dark-soft {
    background-color: rgba(255, 255, 255, 0.03);
}

.mobile-menu-toggle {
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}



.knowledge-update-card:hover {
    transform: translateY(-5px);
    border-color: rgba(157, 78, 237, 0.3);
    background-color: #222;
}

.card-badge-new {
    background-color: rgba(46, 196, 182, 0.1);
    color: #2ec4b6;
    border: 1px solid rgba(46, 196, 182, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.card-info-item i {
    font-size: 1.1rem;
    color: #555;
}

.card-doc-id {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.main-custom-menu {
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    min-width: 260px;
    z-index: 2000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: fixed;
    right: 90px;
    /* مسافة عن الشريط الجانبي */
    top: 20px;
}

.main-custom-menu.show {
    display: block !important;
}

.menu-header {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item {
    transition: all 0.2s ease;
    color: #b0b0b0 !important;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff !important;
}

.active-link {
    background-color: rgba(157, 78, 237, 0.1) !important;
    color: #9d4edd !important;
}
/* إلغاء الإطار الأزرق عند الضغط (Focus) على حقل الإدخال */
.search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    /* إذا كنت تستخدم Bootstrap وتريد إبقاء حدود بلون هادئ بدلاً من الأزرق يمكنك تفعيل السطر التالي: */
    /* border-color: #ccc; */
}

/* تنسيق حاوية البحث لتحديد المواقع بدقة */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* حقل الإدخال: إضافة مسافات من اليمين واليسار حتى لا يتداخل النص مع الأيقونات */
.search-input {
    width: 100%;
    padding-right: 45px; /* مسافة للعدسة على اليمين */
    padding-left: 55px;  /* مسافة لأيقونة قاعدة البيانات على اليسار */
    text-align: right;   /* محاذاة النص للغة العربية */
}

/* أيقونة العدسة على اليمين */
.search-icon-right {
    position: absolute;
    right: 15px;
    color: #6c757d; /* لون رمادي للأيقونة */
    z-index: 5;
    pointer-events: none; /* تجعل الضغط يمر مباشرة للحقل */
}

/* أيقونة قاعدة البيانات باللون البرتقالي على اليسار */
.db-icon-left {
    position: absolute;
    left: 5px;
    background-color: #ff851b; /* اللون البرتقالي */
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    justify-content: center;
}

/* ============================================================
   المظهر الفاتح (Light Theme)
   ============================================================ */
body.light-theme {
    --bg-main: #f8f9fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
}

body.light-theme .text-white {
    color: #212529 !important;
}

body.light-theme .text-secondary {
    color: #6c757d !important;
}

body.light-theme .bg-dark-soft {
    background-color: #e9ecef !important;
}

body.light-theme .border-secondary {
    border-color: #dee2e6 !important;
}

body.light-theme .knowledge-card,
body.light-theme .knowledge-update-card,
body.light-theme .settings-card,
body.light-theme .pricing-card,
body.light-theme .profile-card,
body.light-theme .stats-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body.light-theme .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

body.light-theme .dropdown-item {
    color: #212529 !important;
}

body.light-theme .dropdown-item:hover {
    background-color: #f8f9fa !important;
}

body.light-theme .search-container {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .search-input {
    color: #212529 !important;
}

body.light-theme .filter-btn {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

body.light-theme .theme-card {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-theme .theme-card.active {
    background-color: rgba(157, 78, 237, 0.1) !important;
    border-color: #9d4edd !important;
    color: #9d4edd !important;
}

body.light-theme .side-icon {
    color: #495057 !important;
}

body.light-theme .side-icon:hover {
    background-color: #e9ecef !important;
}

body.light-theme .menu-header .text-white {
    color: #212529 !important;
}

body.light-theme .pricing-header h1,
body.light-theme .pricing-header h4,
body.light-theme .pricing-header h5,
body.light-theme h1, 
body.light-theme h2, 
body.light-theme h3, 
body.light-theme h4, 
body.light-theme h5, 
body.light-theme h6 {
    color: #212529 !important;
}

body.light-theme .table-dark {
    background-color: #ffffff !important;
    color: #212529 !important;
}

body.light-theme .form-control,
body.light-theme .form-select {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .table td,
body.light-theme .table th {
    border-color: #dee2e6 !important;
}

body.light-theme .nav-tabs .nav-link {
    color: #6c757d !important;
}

body.light-theme .nav-tabs .nav-link.active {
    color: #212529 !important;
    border-bottom-color: var(--accent-orange) !important;
}

body.light-theme hr {
    border-color: #dee2e6 !important;
}

body.light-theme .btn-primary,
body.light-theme .btn-secondary {
    color: #ffffff !important;
}

/* ============================================================
   السمة الانسيابية (Sepia Theme)
   ============================================================ */
body.sepia-theme {
    --bg-main: #fcf8e3;
    --sidebar-bg: #fdf8e3;
    --card-bg: #fdf8e3;
    --text-primary: #5c4b37;
    --text-secondary: #8c7b67;
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
}

body.sepia-theme .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .text-secondary {
    color: #8c7b67 !important;
}

body.sepia-theme .bg-dark-soft {
    background-color: #f5eed6 !important;
}

body.sepia-theme .border-secondary {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .knowledge-card,
body.sepia-theme .knowledge-update-card,
body.sepia-theme .settings-card,
body.sepia-theme .pricing-card,
body.sepia-theme .profile-card,
body.sepia-theme .stats-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    box-shadow: none !important;
}

body.sepia-theme .dropdown-menu {
    background-color: #fcf8e3 !important;
    border: 1px solid #e8dfc5 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
}

body.sepia-theme .dropdown-item {
    color: #5c4b37 !important;
}

body.sepia-theme .dropdown-item:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .search-container {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .search-input {
    color: #4a3f35 !important;
}

body.sepia-theme .filter-btn {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}

body.sepia-theme .theme-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}

body.sepia-theme .theme-card.active {
    background-color: #f5eed6 !important;
    border-color: #4a3f35 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .side-icon {
    color: #5c4b37 !important;
}

body.sepia-theme .side-icon:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .menu-header .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .pricing-header h1,
body.sepia-theme .pricing-header h4,
body.sepia-theme .pricing-header h5,
body.sepia-theme h1, 
body.sepia-theme h2, 
body.sepia-theme h3, 
body.sepia-theme h4, 
body.sepia-theme h5, 
body.sepia-theme h6 {
    color: #4a3f35 !important;
}

body.sepia-theme .table-dark {
    background-color: #fcf8e3 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .form-control,
body.sepia-theme .form-select {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .table td,
body.sepia-theme .table th {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .nav-tabs .nav-link {
    color: #8c7b67 !important;
}

body.sepia-theme .nav-tabs .nav-link.active {
    color: #4a3f35 !important;
    border-bottom-color: var(--accent-orange) !important;
}

body.sepia-theme hr {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-primary,
body.sepia-theme .btn-secondary {
    color: #ffffff !important;
}

/* ============================================================
   تنسيقات صفحة الوثيقة (document.html) للمظهر الفاتح والسبيا
   ============================================================ */

/* Light Theme - Document */
body.light-theme .bg-card-dark,
body.light-theme .bg-darker {
    background-color: #ffffff !important;
}

body.light-theme .custom-doc-tabs .nav-link {
    background-color: #f8f9fa;
    color: #495057;
}

body.light-theme .custom-doc-tabs .nav-link.active {
    background-color: #9d4edd !important;
    color: #ffffff !important;
}

body.light-theme .custom-doc-tabs .nav-link:hover:not(.active) {
    background-color: #e9ecef;
    color: #212529;
}

body.light-theme .index-item {
    background-color: #ffffff;
}

body.light-theme .index-item.active {
    background-color: #f8f9fa;
}

body.light-theme .index-item:hover:not(.active) {
    background-color: #e9ecef;
}

body.light-theme .index-sub-items {
    background-color: #f8f9fa;
}

body.light-theme .index-sub-item {
    color: #495057;
}

body.light-theme .index-sub-item:hover {
    color: #9d4edd;
}

body.light-theme .accordion-button {
    background-color: transparent !important;
    color: #212529 !important;
}

body.light-theme .accordion-button:not(.collapsed) {
    color: #9d4edd !important;
    background-color: rgba(157, 78, 221, 0.1) !important;
}

body.light-theme .accordion-button::after {
    filter: none;
}

body.light-theme .custom-dark-input {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .icon-box-dark,
body.light-theme .link-icon-wrapper {
    background-color: #f8f9fa;
    color: #495057;
}

body.light-theme .link-icon-wrapper.active {
    background-color: #9d4edd;
    color: white;
}

body.light-theme .tree-list li a {
    color: #495057;
}

body.light-theme .tree-list li a:hover {
    color: #9d4edd;
}

body.light-theme .icon-tabs .nav-link {
    color: #6c757d;
}

body.light-theme .icon-tabs .nav-link:hover:not(.active) {
    background-color: #e9ecef;
    color: #212529;
}

body.light-theme .action-icons i {
    color: #6c757d;
}

body.light-theme .action-icons i:hover {
    color: #212529;
}

/* Sepia Theme - Document */
body.sepia-theme .bg-card-dark,
body.sepia-theme .bg-darker {
    background-color: #fcf8e3 !important;
}

body.sepia-theme .custom-doc-tabs .nav-link {
    background-color: #f5eed6;
    color: #5c4b37;
}

body.sepia-theme .custom-doc-tabs .nav-link.active {
    background-color: #8c7b67 !important;
    color: #ffffff !important;
}

body.sepia-theme .custom-doc-tabs .nav-link:hover:not(.active) {
    background-color: #e8dfc5;
    color: #4a3f35;
}

body.sepia-theme .index-item {
    background-color: #fcf8e3;
}

body.sepia-theme .index-item.active {
    background-color: #f5eed6;
    border-right-color: #8c7b67;
}

body.sepia-theme .index-item:hover:not(.active) {
    background-color: #e8dfc5;
}

body.sepia-theme .index-sub-items {
    background-color: #f5eed6;
}

body.sepia-theme .index-sub-item {
    color: #5c4b37;
}

body.sepia-theme .index-sub-item:hover {
    color: #4a3f35;
}

body.sepia-theme .accordion-button {
    background-color: transparent !important;
    color: #4a3f35 !important;
}

body.sepia-theme .accordion-button:not(.collapsed) {
    color: #4a3f35 !important;
    background-color: rgba(140, 123, 103, 0.1) !important;
}

body.sepia-theme .accordion-button::after {
    filter: none; 
}

body.sepia-theme .custom-dark-input {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .icon-box-dark,
body.sepia-theme .link-icon-wrapper {
    background-color: #f5eed6;
    color: #5c4b37;
}

body.sepia-theme .link-icon-wrapper.active {
    background-color: #8c7b67;
    color: white;
}

body.sepia-theme .tree-list li a {
    color: #5c4b37;
}

body.sepia-theme .tree-list li a:hover {
    color: #4a3f35;
}

body.sepia-theme .icon-tabs .nav-link {
    color: #8c7b67;
}

body.sepia-theme .icon-tabs .nav-link:hover:not(.active) {
    background-color: #e8dfc5;
    color: #4a3f35;
}

body.sepia-theme .action-icons i {
    color: #8c7b67;
}

body.sepia-theme .action-icons i:hover {
    color: #4a3f35;
}

/* ============================================================
   تكملة لتنسيقات صفحة الوثيقة للمظهر الفاتح
   ============================================================ */
body.light-theme .article-header {
    color: #212529 !important;
}

body.light-theme .judgment-card,
body.light-theme .template-card,
body.light-theme .assistant-status-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .judgment-card:hover,
body.light-theme .template-card:hover {
    background-color: #f8f9fa !important;
    border-color: rgba(157, 78, 221, 0.5) !important;
}

body.light-theme .judgment-title,
body.light-theme .template-title-row span,
body.light-theme .timeline-title {
    color: #212529 !important;
}

body.light-theme .judgment-meta,
body.light-theme .template-meta-row,
body.light-theme .timeline-meta,
body.light-theme .timeline-desc {
    color: #6c757d !important;
}

body.light-theme .judgment-meta b,
body.light-theme .template-meta-row b {
    color: #495057 !important;
}

body.light-theme .download-icon,
body.light-theme .timeline-icon {
    color: #6c757d !important;
}

body.light-theme .download-icon:hover {
    color: #212529 !important;
}

/* ============================================================
   تكملة لتنسيقات صفحة الوثيقة للمظهر السيبيا
   ============================================================ */
body.sepia-theme .article-header {
    color: #4a3f35 !important;
}

body.sepia-theme .judgment-card,
body.sepia-theme .template-card,
body.sepia-theme .assistant-status-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .judgment-card:hover,
body.sepia-theme .template-card:hover {
    background-color: #f5eed6 !important;
    border-color: rgba(140, 123, 103, 0.5) !important;
}

body.sepia-theme .judgment-title,
body.sepia-theme .template-title-row span,
body.sepia-theme .timeline-title {
    color: #4a3f35 !important;
}

body.sepia-theme .judgment-meta,
body.sepia-theme .template-meta-row,
body.sepia-theme .timeline-meta,
body.sepia-theme .timeline-desc {
    color: #8c7b67 !important;
}

body.sepia-theme .judgment-meta b,
body.sepia-theme .template-meta-row b {
    color: #5c4b37 !important;
}

body.sepia-theme .download-icon,
body.sepia-theme .timeline-icon {
    color: #8c7b67 !important;
}

body.sepia-theme .download-icon:hover {
    color: #4a3f35 !important;
}

/* ============================================================
   تنسيقات فقاعة المحادثة للذكاء الاصطناعي للمظهرين الفاتح والسيبيا
   ============================================================ */
body.light-theme .chat-bubble-ai {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.sepia-theme .chat-bubble-ai {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

/* ============================================================
   تنسيقات صفحة الملف الشخصي (profile.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - Profile */
body.light-theme .profile-header-card,
body.light-theme .profile-form-card,
body.light-theme .notification-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .form-group-custom label,
body.light-theme .notification-info h6,
body.light-theme .profile-header-card h4 {
    color: #212529 !important;
}

body.light-theme .input-with-icon input {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .input-with-icon i {
    color: #8c98a5 !important;
}

body.light-theme .btn-cancel-profile {
    color: #495057 !important;
    border-color: #ced4da !important;
}

body.light-theme .btn-cancel-profile:hover {
    background-color: #f8f9fa !important;
}

/* Sepia Theme - Profile */
body.sepia-theme .profile-header-card,
body.sepia-theme .profile-form-card,
body.sepia-theme .notification-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .form-group-custom label,
body.sepia-theme .notification-info h6,
body.sepia-theme .profile-header-card h4 {
    color: #4a3f35 !important;
}

body.sepia-theme .input-with-icon input {
    background-color: #f5eed6 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .input-with-icon i {
    color: #8c7b67 !important;
}

body.sepia-theme .btn-cancel-profile {
    color: #5c4b37 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-cancel-profile:hover {
    background-color: #f5eed6 !important;
}

/* ============================================================
   تنسيقات صفحة الإعدادات (settings.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - Settings */
body.light-theme .settings-sidebar {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .settings-nav-section-title {
    color: #8c98a5 !important;
}

body.light-theme .settings-nav-link {
    color: #495057 !important;
}

body.light-theme .settings-nav-link:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

body.light-theme .settings-nav-link.active {
    background-color: rgba(157, 78, 237, 0.1) !important;
    color: #9d4edd !important;
    border-color: rgba(157, 78, 237, 0.2) !important;
}

body.light-theme .settings-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .settings-card-title,
body.light-theme .info-label h6,
body.light-theme .settings-content-header h2,
body.light-theme .settings-nav-header h5 {
    color: #212529 !important;
}

body.light-theme .info-row {
    border-bottom-color: #ced4da !important;
}

body.light-theme .info-label p {
    color: #6c757d !important;
}

body.light-theme .language-select-card {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
}

body.light-theme .language-select-card.active {
    border-color: rgba(157, 78, 237, 0.3) !important;
    background-color: rgba(157, 78, 237, 0.05) !important;
}

body.light-theme .form-check-input {
    border-color: #ced4da !important;
}

body.light-theme .btn-reset {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border-color: #ced4da !important;
}

body.light-theme .btn-reset:hover {
    background-color: #e9ecef !important;
}

/* Sepia Theme - Settings */
body.sepia-theme .settings-sidebar {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .settings-nav-section-title {
    color: #8c7b67 !important;
}

body.sepia-theme .settings-nav-link {
    color: #5c4b37 !important;
}

body.sepia-theme .settings-nav-link:hover {
    background-color: #f5eed6 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .settings-nav-link.active {
    background-color: rgba(140, 123, 103, 0.1) !important;
    color: #8c7b67 !important;
    border-color: rgba(140, 123, 103, 0.2) !important;
}

body.sepia-theme .settings-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .settings-card-title,
body.sepia-theme .info-label h6,
body.sepia-theme .settings-content-header h2,
body.sepia-theme .settings-nav-header h5 {
    color: #4a3f35 !important;
}

body.sepia-theme .info-row {
    border-bottom-color: #e8dfc5 !important;
}

body.sepia-theme .info-label p {
    color: #8c7b67 !important;
}

body.sepia-theme .language-select-card {
    background-color: #f5eed6 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .language-select-card.active {
    border-color: rgba(140, 123, 103, 0.3) !important;
    background-color: rgba(140, 123, 103, 0.05) !important;
}

body.sepia-theme .form-check-input {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-reset {
    background-color: #f5eed6 !important;
    color: #5c4b37 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-reset:hover {
    background-color: #e8dfc5 !important;
}

/* ============================================================
   تنسيقات صفحة من نحن (about.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - About */
body.light-theme .about-hero {
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.9)), url('about_hero_image_1778059600190.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border-color: #ced4da !important;
}

body.light-theme .about-hero h1 {
    color: #212529 !important;
}

body.light-theme .about-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .about-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(157, 78, 221, 0.4) !important;
}

body.light-theme .gradient-border>div {
    background: #ffffff !important;
}

body.light-theme .about-card h3,
body.light-theme .about-card h5,
body.light-theme .gradient-border h3,
body.light-theme .about-card .text-white {
    color: #212529 !important;
}

body.light-theme .vision-text {
    color: #495057 !important;
}

/* Sepia Theme - About */
body.sepia-theme .about-hero {
    background: linear-gradient(rgba(253, 248, 227, 0.85), rgba(253, 248, 227, 0.9)), url('about_hero_image_1778059600190.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .about-hero h1 {
    color: #4a3f35 !important;
}

body.sepia-theme .about-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .about-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(140, 123, 103, 0.4) !important;
}

body.sepia-theme .gradient-border>div {
    background: #fcf8e3 !important;
}

body.sepia-theme .about-card h3,
body.sepia-theme .about-card h5,
body.sepia-theme .gradient-border h3,
body.sepia-theme .about-card .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .vision-text {
    color: #5c4b37 !important;
}

/* ============================================================
   تنسيقات القائمة الجانبية (Sidebar Menu) لجميع الثيمات
   ============================================================ */

/* إضافة دائرة الدعم والمساعدة "?" للملف الشخصي */
.sidebar a[href="profile.html"] > div {
    position: relative !important;
}


/* Light Theme - Sidebar Overrides */
body.light-theme .sidebar {
    border-left: 1px solid #dee2e6 !important;
}

body.light-theme .sidebar > div[style*="height: 1px"] {
    background-color: #dee2e6 !important;
}

body.light-theme #triggerMenu > div {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    box-shadow: none !important;
}

body.light-theme #triggerMenu > div svg {
    color: #495057 !important;
}

body.light-theme #triggerMenu > div:hover {
    background-color: #f8f9fa !important;
}

body.light-theme .sidebar .side-icon a[href="settings.html"],
body.light-theme .sidebar .side-icon a[href="settings.html"] i {
    color: #495057 !important;
}

body.light-theme .sidebar .side-icon a[href="settings.html"]:hover i {
    color: #212529 !important;
}

body.light-theme .sidebar a[href="profile.html"] > div {
    box-shadow: none !important;
}

/* Sepia Theme - Sidebar Overrides */
body.sepia-theme .sidebar {
    border-left: 1px solid #e8dfc5 !important;
}

body.sepia-theme .sidebar > div[style*="height: 1px"] {
    background-color: #e8dfc5 !important;
}

body.sepia-theme #triggerMenu > div {
    background-color: #fcf8e3 !important;
    border: 1px solid #e8dfc5 !important;
    color: #4a3f35 !important;
    box-shadow: none !important;
}

body.sepia-theme #triggerMenu > div svg {
    color: #4a3f35 !important;
}

body.sepia-theme #triggerMenu > div:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .sidebar .side-icon[style*="background-color: #a882f0"] {
    background-color: #c9b097 !important;
}

body.sepia-theme .sidebar .side-icon[style*="background-color: #a882f0"]:hover {
    background-color: #bfa68f !important;
}

body.sepia-theme .sidebar .side-icon a[href="settings.html"],
body.sepia-theme .sidebar .side-icon a[href="settings.html"] i {
    color: #4a3f35 !important;
}

body.sepia-theme .sidebar .side-icon a[href="settings.html"]:hover i {
    color: #3b322a !important;
}

body.sepia-theme .sidebar a[href="profile.html"] > div {
    background-color: #c9b097 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.sepia-theme .sidebar a[href="profile.html"] > div:hover {
    background-color: #bfa68f !important;
}

/* ============================================================
   تحسينات التباين للمظهر الفاتح والسيبيا (النقطة النشطة ورقم الأمر)
   ============================================================ */

/* استعادة اللون البنفسجي للنقطة النشطة في القوائم المنسدلة للفلترة لجميع الثيمات لزيادة التباين */
.active-item .dot-indicator {
    background-color: #9d4edd !important;
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.6) !important;
}

/* تعديل لون رقم الأمر (رقم الوثيقة) في الكروت */
body.light-theme .card-doc-id {
    color: #495057 !important;
}

body.sepia-theme .card-doc-id {
    color: #5c4b37 !important;
}

/* تعديل لون خلفية وأيقونة قاعدة البيانات في شريط البحث للمظهرين الفاتح والسيبيا */
body.light-theme .db-icon-left,
body.light-theme .db-icon-right {
    background-color: #f8f9fa !important;
    border: 1.5px solid #dee2e6 !important;
    color: #495057 !important;
}
body.light-theme .db-icon-left:hover,
body.light-theme .db-icon-right:hover {
    background-color: #e9ecef !important;
}

body.sepia-theme .db-icon-left,
body.sepia-theme .db-icon-right {
    background-color: #fffdf0 !important;
    border: 1.5px solid #ffd885 !important;
    color: #4a3f35 !important;
}
body.sepia-theme .db-icon-left:hover,
body.sepia-theme .db-icon-right:hover {
    background-color: #ffeeb3 !important;
}