/* =========================================
   1. الإعدادات الأساسية لـ Sticky Footer 
   ========================================= */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #fcfcfc;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. منطقة المحتوى الرئيسية 
   ========================================= */
main[role="main"] {
    flex: 1;
    padding-top: 70px;
}

/* =========================================
   3. القائمة العلوية (Navbar) - تم تحديث اللون للأزرق الداكن #2e3192
   ========================================= */
.main-nav {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    /* استخدام الدرجة الزرقاء المطلوبة مع شفافية بسيطة */
    background-color: rgba(46, 49, 146, 0.98) !important;
    margin-bottom: 0 !important;
    min-height: 70px;
    z-index: 1000;
    border-bottom: 3px solid #ed1c24; /* خط ديكوري أحمر نحيف أسفل الناف بار لربط الهوية */
}

.nav-link.active {
    color: #ffffff !important;
    font-weight: bold;
    border-bottom: 2px solid #ed1c24; /* تم تغيير لون النشط للأحمر */
}

/* =========================================
   4. قسم الهيرو (Hero Section) 
   ========================================= */
.hero-section {
    padding: 160px 0 100px 0 !important;
    margin-top: -70px !important;
    min-height: 650px !important;
    display: flex;
    align-items: center;
    color: white;
    /* تحديث التدرج ليعكس الهوية الزرقاء */
    background: linear-gradient(45deg, rgba(29, 31, 89, 0.9), rgba(46, 49, 146, 0.7)), url('../img/hero.png') no-repeat center center / cover fixed !important;
    position: relative;
    z-index: 1;
    margin-bottom: 130px;
}

/* =========================================
   5. الكروت والتنسيقات الجمالية 
   ========================================= */
.card {
    border: 1px solid transparent !important;
    border-radius: 12px;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

    .card:hover {
        transform: none;
        box-shadow: 0 10px 25px rgba(46, 49, 146, 0.15) !important; /* ظل يميل للأزرق */
        border-color: rgba(46, 49, 146, 0.2) !important;
    }

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* =========================================
   6. التنسيقات الخاصة بالفوتر - تم تحديث اللون للأزرق الداكن #2e3192
   ========================================= */
footer {
    margin-top: auto;
    background-color: #2e3192 !important; /* اللون الأزرق الأساسي */
    border-top: 5px solid #ed1c24; /* لمسة ديكورية حمراء */
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

    .footer-link:hover {
        color: #ed1c24 !important; /* اللون الأحمر عند التمرير في الفوتر */
        padding-right: 5px;
    }

/* أيقونات التواصل الاجتماعي */
.social-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .social-icon:hover {
        background: #ed1c24; /* تغيير خلفية الأيقونة للأحمر عند التمرير */
        color: white !important;
        transform: translateY(-3px);
    }

/* =========================================
   7. تأثير الوميض الأبيض الكامل لرابط التدريب (بدون أي أصفر)
   ========================================= */
.training-link-special {
    color: #ffffff !important; /* نص أبيض */
    border: 2px solid #ffffff !important; /* إطار أبيض */
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    animation: white-glow-pulse 3s infinite ease-in-out;
    transition: all 0.3s ease;
}

@keyframes white-glow-pulse {
    0% {
        box-shadow: 0 0 0px rgba(255, 255, 255, 0.2);
        background: transparent;
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
        background: rgba(255, 255, 255, 0.15);
    }

    100% {
        box-shadow: 0 0 0px rgba(255, 255, 255, 0.2);
        background: transparent;
    }
}

/* التعديل هنا: عند الوقوف بالماوس */
.training-link-special:hover {
    background-color: #ffffff !important; /* الخلفية تصبح بيضاء بالكامل */
    color: #2e3192 !important; /* النص يتغير للون الأزرق الملكي */
    border-color: #ffffff !important; /* التأكد من بقاء الحدود بيضاء */
    animation: none; /* إيقاف الوميض أثناء الوقوف */
}

.training-link-special:hover {
    background-color: #ffffff !important; /* عند الوقوف يتحول الزر بالكامل للأبيض */
    color: #2e3192 !important; /* والنص يصبح بلون الناف بار الأزرق */
    animation: none;
}


/* =========================================
   8. القائمة المنسدلة (Dropdown)
   ========================================= */
.bg-dark-custom {
    background-color: #1d1f59 !important; /* درجة أغمق قليلاً من الأزرق للـ Dropdown */
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.dropdown-item:hover {
    background-color: #ed1c24; /* الأحمر عند اختيار عنصر من القائمة */
    color: #fff !important;
}

/* فتح القائمة (Hover للكمبيوتر و Click للموبايل) */
@media (min-width: 992px) {
    .hover-dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        padding-right: 1.5rem;
        box-shadow: none !important;
        margin-bottom: 1rem;
    }

    .dropdown-item {
        color: rgba(255,255,255,0.8) !important;
        padding: 0.7rem 1rem;
    }
}

/* 9. الحركات والبحث */
.animate {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

@keyframes slideIn {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slideIn {
    animation-name: slideIn;
}

.search-bar-nav {
    border: 1px solid rgba(255,255,255,0.2) !important;
    transition: all 0.3s ease;
}

.search-bar-nav:focus-within {
    background-color: rgba(255,255,255,0.15) !important;
    width: 300px !important;
    border-color: #ed1c24 !important; /* حدود حمراء عند البحث */
}

/* كلاسات الهوية اللونية الجديدة */
.text-primary-custom {
    color: #2e3192 !important;
}
/* الأزرق الملكي */
.text-accent-custom {
    color: #ed1c24 !important;
}
/* الأحمر الحيوي */

.bg-primary-custom {
    background-color: #2e3192 !important;
}

.bg-accent-custom {
    background-color: #ed1c24 !important;
}

/* كلاس مخصص للعناوين الفرعية ليظهر تحتها خط أحمر صغير */
.section-title-underlined::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background-color: #ed1c24;
    margin: 15px auto;
}

/* تحسين الكروت لتتماشى مع الهوية */
.card-hover-accent:hover {
    border-color: #2e3192 !important;
    box-shadow: 0 10px 20px rgba(46, 49, 146, 0.1) !important;
}

.card-hover-accent:hover i {
    color: #ed1c24 !important; /* يتغير لون الأيقونة للأحمر عند الوقوف على الكرت */
    transition: 0.3s;
}

/* رابط "اقرأ المزيد" بهوية الموقع */
.read-more-link {
    color: #2e3192;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 2px solid #ed1c24; /* خط أحمر أسفل الرابط */
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

    .read-more-link:hover {
        color: #ed1c24;
        border-bottom-color: #2e3192; /* عكس الألوان عند الوقوف بالماوس */
    }


/* تنسيقات عامة لصفحات التفاصيل */
.article-container {
    border-top: 4px solid #2e3192 !important;
}

.content-body {
    font-size: 1.15rem;
    line-height: 2;
    text-align: justify;
    white-space: pre-line;
    color: #2d2d2d;
}

.sidebar-sticky {
    top: 100px;
}

.sidebar-list-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

    .sidebar-list-item:hover {
        background-color: #f8f9fa;
        border-left-color: #ed1c24; /* خط أحمر عند التمرير */
        transform: translateX(-5px);
    }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}