/* تحسينات إضافية للقوائم العلوية - لون أوضح وأسهل للرؤية */

/* تحسين الخلفية العامة للقائمة */
.navbar {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1rem;
    border-bottom: 3px solid #0d47a1;
    position: relative;
    z-index: 1030;
}

/* تحسين روابط القائمة */
.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.7rem 1.2rem !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* تأثير التمرير على الروابط */
.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
}

/* الرابط النشط */
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* تحسين القوائم المنسدلة */
.navbar-nav .dropdown-menu {
    background-color: #ffffff;
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-top: 10px;
    padding: 0.5rem 0;
    min-width: 220px;
    z-index: 9999 !important;
    position: absolute !important;
}

/* عناصر القائمة المنسدلة */
.navbar-nav .dropdown-item {
    color: #1565c0;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

/* تأثير التمرير على عناصر القائمة المنسدلة */
.navbar-nav .dropdown-item:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0d47a1;
    transform: translateX(-5px);
    border-right-color: #1e88e5;
}

/* أيقونات القائمة المنسدلة */
.navbar-nav .dropdown-item i {
    color: #1e88e5;
    width: 24px;
    text-align: center;
    margin-left: 8px;
    font-size: 1.1rem;
}

/* الفاصل في القائمة المنسدلة */
.dropdown-divider {
    border-top: 2px solid #e3f2fd;
    margin: 0.5rem 0;
}

/* تحسين سهم القائمة المنسدلة */
.navbar-nav .dropdown-toggle::after {
    border-top-color: #ffffff;
    margin-right: 0.5rem;
}

/* تحسين شعار النظام */
.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #ffffff !important;
    transform: scale(1.02);
}

.navbar-brand img {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05) rotate(-2deg);
}

/* تحسين زر التبديل للموبايل */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.9);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.3rem rgba(255, 255, 255, 0.4);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5rem;
    height: 1.5rem;
}

/* تحسين قائمة المستخدم */
.navbar-nav .nav-item:last-child .dropdown-menu {
    min-width: 200px;
}

/* تحسين أيقونة المستخدم */
.navbar-nav .bi-person-circle {
    font-size: 1.3rem;
    margin-left: 5px;
}

/* تحسين أيقونة الإشعارات */
.navbar-nav .bi-bell,
.navbar-nav .bi-bell-fill {
    font-size: 1.2rem;
}

/* شارة عدد الإشعارات */
.navbar-nav .badge {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    background-color: #f44336;
    border: 2px solid #1565c0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* تحسين للشاشات الصغيرة */
@media (max-width: 991px) {
    .navbar-nav {
        background-color: rgba(21, 101, 192, 0.95);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        margin: 0.3rem 0;
        border-radius: 6px;
    }
    
    .navbar-nav .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.98);
        margin-right: 1rem;
        margin-top: 0.5rem;
    }
}

/* تحسين الأداء */
.navbar,
.navbar-nav .nav-link,
.navbar-nav .dropdown-item {
    will-change: transform;
}

/* تحسين إمكانية الوصول */
.navbar-nav .nav-link:focus,
.navbar-nav .dropdown-item:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* تحسين الطباعة */
@media print {
    .navbar {
        display: none !important;
    }
}

/* تحسين للوضع المظلم (إذا كان مفعلاً) */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: linear-gradient(135deg, #0d47a1 0%, #01579b 100%) !important;
        border-bottom-color: #000000;
    }
    
    .navbar-nav .dropdown-menu {
        background-color: #263238;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    }
    
    .navbar-nav .dropdown-item {
        color: #90caf9;
    }
    
    .navbar-nav .dropdown-item:hover {
        background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 100%);
        color: #bbdefb;
    }
}

/* تأثيرات إضافية للحركة */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-nav .dropdown-menu.show {
    animation: slideDown 0.3s ease-out;
}

/* تحسين التباين للوصولية */
@media (prefers-contrast: high) {
    .navbar {
        background: #0d47a1 !important;
        border-bottom: 4px solid #ffffff;
    }
    
    .navbar-nav .nav-link {
        border: 2px solid transparent;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        border-color: #ffffff;
    }
}


/* إصلاح z-index للقوائم المنسدلة - تأكد من ظهورها فوق كل العناصر */
.navbar-nav .dropdown {
    position: relative;
    z-index: 1031;
}

.navbar-nav .dropdown-menu.show {
    z-index: 9999 !important;
    display: block;
    position: absolute !important;
}

/* تأكد من أن القائمة العلوية فوق كل شيء */
nav.navbar {
    z-index: 1030 !important;
    position: relative !important;
}

/* تقليل z-index للعناصر الأخرى */
.container-fluid,
.card,
.table-container,
.form-container {
    position: relative;
    z-index: 1;
}

/* تأكد من أن القوائم المنسدلة لا تتأثر بـ overflow */
.navbar-collapse {
    overflow: visible !important;
}

.navbar-nav {
    overflow: visible !important;
}

/* إصلاح للقوائم المنسدلة في Bootstrap 5 */
.dropdown-menu[data-bs-popper] {
    z-index: 9999 !important;
    position: absolute !important;
}

/* تحسين عرض القائمة المنسدلة */
.navbar .dropdown:hover .dropdown-menu {
    display: block;
    z-index: 9999 !important;
}

/* منع أي عنصر من التداخل مع القوائم */
body > * {
    position: relative;
}

body > nav.navbar {
    z-index: 1030 !important;
}

/* إصلاح خاص للجداول والبطاقات */
.dataTables_wrapper,
.card,
.alert,
.modal {
    z-index: auto !important;
}

/* تأكد من أن القائمة المنسدلة تظهر فوق الـ modals */
.navbar-nav .dropdown-menu {
    z-index: 10000 !important;
}
