/* شريط التنقل الموحد لمنصة ميداني */

/* إعدادات الخط الأساسية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* متغيرات الألوان */
:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --secondary-blue: #3b82f6;
    --text-gray: #374151;
    --text-light: #6b7280;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --yellow-400: #fbbf24;
    --yellow-500: #f59e0b;
}

/* شريط التنقل الرئيسي */
.navbar-main {
    background: var(--white);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
    font-family: 'Cairo', sans-serif;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    position: relative;
}

@media (min-width: 768px) {
    .navbar-container {
        padding: 1rem 2rem;
    }
}

/* شعار الموقع */
.navbar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
    z-index: 51;
}

.navbar-logo:hover {
    color: var(--primary-blue-hover);
}

/* قائمة التنقل - تظهر فقط على الشاشات الكبيرة */
.navbar-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .navbar-menu {
        display: flex;
    }
}

.navbar-menu li a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.navbar-menu li a:hover {
    color: var(--primary-blue);
}

.navbar-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.navbar-menu li a:hover::after {
    width: 100%;
}

/* أزرار تسجيل الدخول والتسجيل - تظهر فقط على الشاشات الكبيرة */
.navbar-auth {
    display: none;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .navbar-auth {
        display: flex;
    }
}

.navbar-user-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-user-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-user-links a:hover {
    color: var(--primary-blue);
}

.navbar-user-links .separator {
    color: var(--text-light);
    font-weight: 400;
}

/* أزرار تسجيل الدخول والتسجيل */
.btn-login {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-login:hover {
    color: var(--primary-blue);
}

.btn-dashboard {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.btn-dashboard:hover {
    color: var(--primary-blue-hover);
}

.btn-logout {
    background: var(--red-600);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--red-700);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* زر القائمة للموبايل */
.navbar-mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    z-index: 51;
    position: relative;
}

@media (min-width: 1024px) {
    .navbar-mobile-btn {
        display: none;
    }
}

.navbar-mobile-btn:hover {
    background-color: var(--gray-100);
    color: var(--primary-blue);
}

.navbar-mobile-btn:active {
    transform: scale(0.95);
}

.mobile-menu-icon {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.3s ease;
}

.navbar-mobile-btn.active .mobile-menu-icon {
    transform: rotate(90deg);
}

/* القائمة المنسدلة للموبايل كـ dropdown تحت الهيدر */
.navbar-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    z-index: 49;
}

/* عند التفعيل تظهر وتمتد للأسفل */
.navbar-mobile-menu.active {
    display: block;
    max-height: 80vh; /* حد أقصى لطول القائمة */
    opacity: 1;
}

/* محتوى القائمة داخل الدراوب داون بعرض كامل */
.navbar-mobile-menu .mobile-menu-content {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: auto;
    background: var(--white);
    box-shadow: none;
    overflow-y: auto;
    transform: none;
    transition: none;
    padding-bottom: 0.5rem;
}

/* رأس القائمة */
.mobile-menu-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.mobile-menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.mobile-menu-header:hover::before {
    transform: translateX(100%);
}

.mobile-menu-title {
    font-size: 1.25rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* أقسام القائمة المنسدلة */
.mobile-menu-section {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s ease;
}

.mobile-menu-section:hover {
    background-color: var(--gray-50);
}

.mobile-menu-section:last-child {
    border-bottom: none;
}

.mobile-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.mobile-section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.mobile-menu-section:hover .mobile-section-title::after {
    width: 100%;
}

/* قائمة الروابط في القائمة المنسدلة */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    margin-bottom: 0.25rem;
}

.mobile-menu-link {
    display: block;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin: 0.125rem 0;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-link:hover::before {
    left: 100%;
}

.mobile-menu-link:hover {
    color: var(--primary-blue);
    background: var(--gray-50);
    padding-left: 0.75rem;
    transform: translateX(3px);
}

/* أنماط خاصة للروابط المهمة */
.mobile-menu-link-primary {
    color: var(--primary-blue) !important;
    font-weight: 600 !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.mobile-menu-link-primary:hover {
    background: rgba(37, 99, 235, 0.15) !important;
    color: var(--primary-blue-hover) !important;
}

.mobile-menu-link-danger {
    color: var(--red-600) !important;
    font-weight: 600 !important;
    background: rgba(220, 38, 38, 0.1) !important;
}

.mobile-menu-link-danger:hover {
    background: rgba(220, 38, 38, 0.15) !important;
    color: var(--red-700) !important;
}

/* أزرار القائمة المنسدلة */
.mobile-menu-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.mobile-btn-primary {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin: 0.5rem 0;
}

.mobile-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-btn-primary:hover::before {
    left: 100%;
}

.mobile-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-hover), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mobile-btn-danger {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin: 0.5rem 0;
}

.mobile-btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-btn-danger:hover::before {
    left: 100%;
}

.mobile-btn-danger:hover {
    background: linear-gradient(135deg, var(--red-700), var(--red-600));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* تحسين الأداء */
.navbar-main {
    will-change: transform;
    transform: translateZ(0);
}

/* تحسين إمكانية الوصول */
.navbar-menu a:focus,
.navbar-mobile-menu a:focus,
.btn-login:focus,
.btn-dashboard:focus,
.btn-logout:focus,
.navbar-mobile-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* تأثيرات إضافية للقائمة المنسدلة */
@media (max-width: 1023px) {
    body.menu-open {
        overflow: auto;
    }
    
    .navbar-mobile-menu {
        animation: fadeIn 0.3s ease;
    }
    
    .navbar-mobile-menu .mobile-menu-content {
        animation: slideIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .navbar-container {
        padding: 0.5rem 1rem;
    }
    
    .navbar-logo {
        font-size: 1.25rem;
    }
    
    .navbar-mobile-menu .mobile-menu-content {
        width: 100%;
        max-width: none;
    }
    
    .navbar-mobile-menu.active {
        max-height: 70vh; /* تصغير أكثر للهواتف الصغيرة */
    }
    
    .mobile-menu-link {
        padding: 0.875rem 0.75rem;
        font-size: 1rem;
        margin: 0.25rem 0;
    }
    
    .mobile-menu-section {
        padding: 1rem;
    }
    
    .mobile-menu-list li {
        margin-bottom: 0.375rem;
    }
    
    .mobile-menu-subsection {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .mobile-menu-subsection .mobile-menu-link {
        padding: 0.75rem 0.625rem;
        font-size: 0.95rem;
    }
}

/* تحسينات للشاشات المتوسطة */
@media (min-width: 481px) and (max-width: 1023px) {
    .navbar-mobile-menu .mobile-menu-content {
        width: 75%;
        max-width: 300px;
    }
}

/* أزرار خاصة بالجامعات */
.btn-university {
    color: var(--teal-600);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-university:hover {
    color: var(--teal-700);
}

.btn-university-register {
    background: var(--teal-600);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.btn-university-register:hover {
    background: var(--teal-700);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* أزرار خاصة بالمؤسسات */
.btn-organization {
    color: var(--yellow-500);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-organization:hover {
    color: var(--yellow-400);
}

.btn-organization-register {
    background: var(--yellow-400);
    color: var(--text-gray);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.btn-organization-register:hover {
    background: var(--yellow-500);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* تحسينات إضافية للتفاعل */
.navbar-main.hidden {
    transform: translateY(-100%);
}

.navbar-main.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* تأثيرات التحميل */
.navbar-main.loading {
    opacity: 0;
    transform: translateY(-20px);
}

.navbar-main.loaded {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* أقسام فرعية في القائمة المنسدلة */
.mobile-menu-subsection {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.mobile-menu-subsection:last-child {
    margin-bottom: 0;
}

.mobile-subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-300);
    position: relative;
}

.mobile-subsection-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.mobile-menu-subsection:hover .mobile-subsection-title::after {
    width: 100%;
}

/* تحسين أنماط الروابط في الأقسام الفرعية */
.mobile-menu-subsection .mobile-menu-link {
    font-size: 0.875rem;
    padding: 0.625rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: 0.25rem;
    background: var(--white);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.mobile-menu-subsection .mobile-menu-link:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* زر سحب للأعلى */
.scroll-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

.scroll-to-top-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.3s ease;
}

.scroll-to-top-btn:hover svg {
    transform: translateY(-2px);
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .scroll-to-top-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

@media (max-width: 480px) {
    .scroll-to-top-btn {
        bottom: 1rem;
        right: 1rem;
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .scroll-to-top-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

 