/* =======================================
   استايلات قائمة التنقل الموحدة
   navbar.css - ملف منفصل
   ======================================= */

/* ---- القائمة الرئيسية ---- */
.main-navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.main-navbar:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* ---- الحاوية ---- */
.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* =======================================
   الشعار
   ======================================= */

.navbar-logo {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-logo:hover .logo-img {
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.3));
}

/* =======================================
   روابط التنقل (Desktop)
   ======================================= */

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

/* تأثير الخط السفلي */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #14b8a6);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::after {
    left: 100%;
}

.nav-link:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-link:active {
    transform: translateY(0);
}

/* الرابط النشط */
.nav-link.active {
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-link.active::before {
    display: none;
}

.nav-link.active:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* =======================================
   الأيقونات
   ======================================= */

.nav-icon {
    font-size: 1.25rem;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-link:hover .nav-icon {
    transform: scale(1.2) rotate(12deg);
}

.nav-link.active .nav-icon {
    transform: scale(1.1);
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.3); }
}

/* =======================================
   زر الخروج
   ======================================= */

.nav-link.logout-link {
    color: #dc2626;
}

.nav-link.logout-link:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.nav-link.logout-link:hover::before {
    background: #dc2626;
}

/* =======================================
   زر القائمة المنسدلة (Mobile)
   ======================================= */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid transparent;
    color: #374151;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.menu-icon {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover .menu-icon {
    transform: rotate(90deg);
}

/* =======================================
   القائمة المنسدلة (Mobile)
   ======================================= */

.mobile-menu {
    display: none;
    background: linear-gradient(to bottom, white, #f9fafb);
    border-top: 2px solid rgba(16, 185, 129, 0.2);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-menu.active {
    max-height: 600px;
    padding: 1rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
}

.mobile-nav-link:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    transform: translateX(-8px);
    border-color: rgba(16, 185, 129, 0.3);
}

.mobile-nav-link.active {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateX(-5px);
}

.mobile-nav-link.active:hover {
    transform: translateX(-10px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.mobile-nav-link.logout-link {
    color: #dc2626;
}

.mobile-nav-link.logout-link:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.3);
}

/* =======================================
   Animations
   ======================================= */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu.active .mobile-nav-link {
    animation: slideDown 0.3s ease forwards;
}

.mobile-menu.active .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu.active .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu.active .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu.active .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu.active .mobile-nav-link:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu.active .mobile-nav-link:nth-child(6) { animation-delay: 0.3s; }

/* =======================================
   Responsive Breakpoints
   ======================================= */

/* Large Tablets & Small Desktops */
@media (max-width: 1024px) {
    .navbar-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1.15rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .navbar-container {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .logo-img {
        height: 40px;
    }
    
    .navbar-container {
        padding: 0.6rem 0.8rem;
    }
    
    .mobile-nav-link {
        padding: 0.875rem 1rem;
    }
    
    .nav-icon {
        font-size: 1.4rem;
    }
    
    .mobile-menu.active {
        max-height: 500px;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .logo-img {
        height: 35px;
    }
    
    .navbar-container {
        padding: 0.5rem;
    }
    
    .mobile-nav-link {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem;
    }
}

/* =======================================
   Print Styles
   ======================================= */

@media print {
    .main-navbar {
        display: none;
    }
}

/* =======================================
   Dark Mode Support (Optional)
   ======================================= */

@media (prefers-color-scheme: dark) {
    .main-navbar {
        background: #1f2937;
        border-bottom-color: rgba(16, 185, 129, 0.2);
    }
    
    .nav-link {
        color: #e5e7eb;
    }
    
    .nav-link:hover {
        background: rgba(16, 185, 129, 0.15);
    }
    
    .mobile-menu {
        background: linear-gradient(to bottom, #1f2937, #111827);
    }
    
    .mobile-nav-link {
        color: #e5e7eb;
    }
}

/* =======================================
   Accessibility
   ======================================= */

.nav-link:focus,
.mobile-nav-link:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.nav-link:focus:not(:focus-visible),
.mobile-nav-link:focus:not(:focus-visible),
.mobile-menu-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nav-link,
    .mobile-nav-link {
        border: 2px solid currentColor;
    }
    
    .nav-link.active {
        border-color: white;
    }
}

/* =======================================
   Performance Optimizations
   ======================================= */

.main-navbar,
.nav-link,
.mobile-nav-link {
    will-change: transform;
}

.nav-link::after {
    will-change: left;
}

/* =======================================
   نهاية الملف
   ======================================= */