/* ========================================
   DESKTOP NAVIGATION FIXES
   St. Lawrence Junior School - Kabowa
   
   Ensures proper desktop navigation behavior:
   - Desktop (≥992px): Full horizontal navigation
   - Tablet (768px-991px): Horizontal navigation, smaller spacing
   - Mobile (≤767px): Hamburger menu only
   ======================================== */

/* ========== DESKTOP NAVIGATION (992px and up) ========== */
@media (min-width: 992px) {
    /* Remove navbar-specific constraints - let it use the header container */
    .navbar {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 30px !important;
        padding: 20px 0 !important;
        height: 85px !important;
        /* Remove max-width and margin - use header container instead */
    }
    
    /* Show desktop navigation items - remove width constraints */
    .nav-menu {
        display: flex !important;
        list-style: none !important;
        gap: 25px !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        transform: none !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        /* Remove max-width constraint */
        flex-wrap: nowrap !important;
        overflow: visible !important;
    }
    
    .nav-menu .desktop-only {
        display: block !important;
    }
    
    .nav-menu .mobile-only {
        display: none !important;
    }
    
    /* Hide hamburger completely on desktop */
    .hamburger,
    #hamburger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Show admin button */
    .nav-actions {
        display: flex !important;
        align-items: center !important;
    }
    
    /* Ensure proper nav link styling */
    .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        font-weight: 500 !important;
        font-size: 15px !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        padding: 8px 16px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }
}

/* ========== TABLET NAVIGATION (768px - 991px) ========== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Remove tablet-specific constraints - use header container */
    .navbar {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 15px 0 !important;
        height: 75px !important;
        /* Remove max-width and margin - use header container instead */
    }
    
    /* Show desktop navigation items on tablet - remove width constraints */
    .nav-menu {
        display: flex !important;
        list-style: none !important;
        gap: 18px !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        transform: none !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        /* Remove max-width constraint */
        flex-wrap: nowrap !important;
        overflow: visible !important;
    }
    
    .nav-menu .desktop-only {
        display: block !important;
    }
    
    .nav-menu .mobile-only {
        display: none !important;
    }
    
    /* Hide hamburger on tablet */
    .hamburger,
    #hamburger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Show admin button on tablet */
    .nav-actions {
        display: flex !important;
        align-items: center !important;
    }
    
    /* Smaller nav links for tablet */
    .nav-link {
        font-size: 14px !important;
        padding: 6px 12px !important;
        white-space: nowrap !important;
    }
    
    /* Adjust dropdown for tablet */
    .nav-dropdown .dropdown-menu {
        min-width: 180px !important;
    }
}

/* ========== MOBILE NAVIGATION (991px and below) ========== */
@media (max-width: 991.98px) {
    /* Mobile navbar layout */
    .navbar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        height: auto !important;
        padding: 12px 0 !important;
        grid-template-columns: none !important;
    }
    
    /* Hide desktop navigation on mobile */
    .nav-menu .desktop-only {
        display: none !important;
    }
    
    .nav-menu .mobile-only {
        display: block !important;
    }
    
    /* Show hamburger on mobile ONLY */
    .hamburger,
    #hamburger {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px !important;
    }
    
    /* Hide admin button on mobile to save space */
    .nav-actions {
        display: none !important;
    }
}

/* ========== OVERRIDE CONFLICTING STYLES ========== */
/* High priority overrides to ensure desktop navigation works */
@media (min-width: 992px) {
    /* Ensure header container matches other sections */
    .header .container {
        /* Use the same container settings as other sections */
        max-width: 1240px !important;
        margin: 0 auto !important;
        padding: 0 24px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Force hide hamburger on all non-mobile devices */
    .hamburger,
    #hamburger,
    button.hamburger,
    [class*="hamburger"],
    [id*="hamburger"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }
    
    /* Force show desktop navigation */
    .nav-menu {
        position: static !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    /* Force show admin button */
    .nav-actions {
        display: flex !important;
    }
}

/* Container constraints to match other sections */
@media (min-width: 1200px) {
    .header .container {
        max-width: 1400px !important;
    }
}

@media (min-width: 1600px) {
    .header .container {
        max-width: 1600px !important;
    }
}

/* ========== LARGE DESKTOP ENHANCEMENTS ========== */
@media (min-width: 1200px) {
    .navbar {
        gap: 35px !important;
        padding: 25px 0 !important;
        /* Remove max-width - use header container (1400px) */
    }
    
    .nav-menu {
        gap: 30px !important;
        /* Remove max-width constraint */
    }
    
    .nav-link {
        font-size: 16px !important;
        padding: 10px 18px !important;
    }
}

/* ========== ULTRA-WIDE DESKTOP ========== */
@media (min-width: 1600px) {
    .navbar {
        gap: 40px !important;
        /* Remove max-width - use header container (1600px) */
    }
    
    .nav-menu {
        gap: 35px !important;
        /* Remove max-width constraint */
    }
}