/* ============================================
   NAVBAR COMPONENT STYLES
   ============================================ */

/* Navbar Container - Fixed sticky positioning */
header[style*="sticky"] {
    z-index: 9999 !important;
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure Navbar is always accessible */
header {
    pointer-events: auto !important;
}

/* Navigation Links - Absolute positioning for URL paths */
.navbar-link,
nav a {
    position: relative;
    display: inline-block;
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

.navbar-link:hover,
nav a:hover {
    opacity: 0.8;
}

.navbar-link:active,
nav a:active {
    transform: scale(0.98);
}

/* Navbar Buttons - Optimized for clickability */
.navbar-button,
header button,
header a[class*="button"] {
    position: relative;
    z-index: 10000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    border: none !important;
    outline: none !important;
    background-clip: padding-box !important;
    /* Allow text selection for accessibility */
    user-select: auto;
    transition: all 0.2s ease-in-out;
}

/* Login Button - Primary CTA */
button[style*="bg-primary"],
a[style*="bg-primary"][class*="navbar"],
header .bg-primary,
header [class*="login"] {
    z-index: 10001 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Focus States for Accessibility */
.navbar-button:focus,
.navbar-link:focus,
header button:focus,
header a:focus,
header button:focus-visible,
header a:focus-visible {
    outline: 2px solid var(--primary-color, #005C99) !important;
    outline-offset: 2px !important;
    border-radius: 6px !important;
}

/* Remove tap highlight on mobile */
.navbar-button,
.navbar-link,
header button,
header a {
    -webkit-tap-highlight-color: transparent !important;
}

/* Mobile Menu Toggle */
button[onclick*="toggleMobileMenu"],
#mobile-menu {
    pointer-events: auto !important;
}

/* Dropdown Menus */
header [x-show],
header [x-cloak] {
    pointer-events: auto !important;
}

header .absolute {
    z-index: 50 !important;
    pointer-events: auto !important;
}

/* Ensure user menu dropdown is clickable */
.relative[x-data*="userMenuOpen"] {
    position: relative;
    z-index: 10000;
}

.relative[x-data*="userMenuOpen"] > .absolute {
    pointer-events: auto !important;
}

/* Notification Bell */
.relative[x-data*="notifOpen"] {
    position: relative;
    z-index: 10000;
}

.relative[x-data*="notifOpen"] > .absolute {
    pointer-events: auto !important;
}

/* Disable pointer-events blocking */
header * {
    pointer-events: auto !important;
}

/* Override any conflicting Tailwind utilities */
@supports (display: grid) {
    header .lg\:flex {
        pointer-events: auto !important;
    }
}

/* Ensure modals don't interfere with navbar */
header::before,
header::after {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* ============================================
   RESPONSIVE NAVBAR
   ============================================ */

/* Desktop Navigation */
@media (min-width: 1024px) {
    nav.hidden.lg\:flex {
        display: flex !important;
        pointer-events: auto !important;
    }
    
    nav.hidden.lg\:flex > * {
        pointer-events: auto !important;
    }
}

/* Mobile Navigation */
@media (max-width: 1023px) {
    #mobile-menu {
        pointer-events: auto !important;
    }
    
    #mobile-menu * {
        pointer-events: auto !important;
    }
    
    /* Ensure mobile menu toggle is always accessible */
    button[onclick*="toggleMobileMenu"] {
        z-index: 10002 !important;
        pointer-events: auto !important;
    }
}

/* ============================================
   LINK HOVER STATES
   ============================================ */

/* Dashboard Link */
a[href*="/dashboard"],
a[href*="dashboard"] {
    pointer-events: auto !important;
    text-decoration: none;
}

/* Admin Link */
a[href*="/admin"],
a[href*="admin"] {
    pointer-events: auto !important;
    text-decoration: none;
}

/* Logout Link */
a[href*="/logout"],
a[href*="logout"],
a[href*="auth/logout"] {
    pointer-events: auto !important;
    text-decoration: none;
}

/* ============================================
   FIX FOR COMMON LAYOUT ISSUES
   ============================================ */

/* Prevent margin collapse */
header {
    margin: 0 !important;
}

/* Prevent padding issues */
header > * {
    margin: 0 !important;
}

/* Sticky positioning helper */
body > header,
body > header.sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
}

/* ============================================
   DEBUGGING CLASSES
   ============================================ */

/* Uncomment to debug navbar issues */
/*
header {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border: 2px solid red !important;
}

.navbar-button {
    border: 1px solid blue !important;
}

.navbar-link {
    border: 1px solid green !important;
}
*/
