/* Enterprise-Grade Navbar Styles */

/* Navbar Container */
nav {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark nav {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Ensure proper flex layout - Navbar container */
nav {
    width: 100%;
}

nav > div.max-w-7xl {
    width: 100% !important;
    max-width: 80rem !important; /* 7xl = 80rem */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Main flex container - forces space-between */
nav > div > div.flex.items-center.justify-between {
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Force right alignment for nav links - Multiple selectors to ensure it works */
nav > div > div > div.hidden.md\:flex,
nav > div > div > div[class*="hidden"][class*="md:flex"],
nav > div > div > div[class*="hidden"][class*="lg:flex"],
div.hidden.md\:flex.items-center,
div.hidden.lg\:flex.items-center,
nav > div.max-w-7xl > div > div[class*="hidden"][class*="md:flex"],
nav > div.max-w-7xl > div > div[class*="hidden"][class*="lg:flex"] {
    margin-left: auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: auto !important;
}

/* Ensure left side doesn't grow */
nav > div > div > div.flex.items-center.gap-3,
nav > div.max-w-7xl > div > div.flex.items-center.gap-3,
nav > div > div > div.flex.items-center.gap-2 {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: auto !important;
}

/* Hide hamburger on medium devices and up (>= 768px) */
@media (min-width: 768px) {
    /* Hide sidebar toggle buttons for authenticated users */
    nav button[data-drawer-target="logo-sidebar"],
    nav button[data-drawer-toggle="logo-sidebar"],
    nav button[aria-controls="logo-sidebar"] {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Hide mobile menu toggle buttons - target by class */
    nav button[class*="md:hidden"] {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Additional selector for mobile menu buttons */
    nav > div > div > div > button.md\:hidden {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Professional spacing */
nav .flex.items-center.gap-1 {
    gap: 0.25rem;
}

/* Ensure logo doesn't shrink */
nav .flex.items-center.gap-3 {
    flex-shrink: 0;
    min-width: fit-content;
}

/* Logo section styling */
nav a[href="/"] {
    text-decoration: none;
}

nav a[href="/"]:hover {
    text-decoration: none;
}

/* Navigation Links - Enterprise Grade */
nav a:not([class*="bg-"]):not([class*="border-"]) {
    position: relative;
    font-weight: 500;
    letter-spacing: -0.01em;
}

nav a:not([class*="bg-"]):not([class*="border-"]):hover {
    text-decoration: none;
}

nav a:not([class*="bg-"]):not([class*="border-"]):after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:not([class*="bg-"]):not([class*="border-"]):hover:after {
    width: calc(100% - 2rem);
}

/* Button Styling */
nav a[class*="bg-vedic-gold"],
nav a[class*="border-purple"] {
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
}

nav a[class*="bg-vedic-gold"]:hover,
nav a[class*="border-purple"]:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

nav a[class*="bg-vedic-gold"]:active,
nav a[class*="border-purple"]:active {
    transform: translateY(0);
}

/* Focus States for Accessibility */
nav a:focus,
nav button:focus {
    outline: 2px solid rgba(217, 119, 6, 0.5);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Tagline Styling */
nav .text-xs {
    font-size: 0.625rem;
    line-height: 1.2;
    letter-spacing: 0.1em;
}

/* Responsive Adjustments for Small Devices */
@media (max-width: 767px) {
    /* Logo sizing on mobile */
    nav a[href="/"] {
        font-size: 1.125rem !important;
        display: flex !important;
        visibility: visible !important;
    }
    
    nav .text-xs {
        font-size: 0.5rem;
    }
    
    /* Ensure hamburger button is visible on mobile */
    nav button.md\:hidden {
        display: inline-flex !important;
        visibility: visible !important;
        flex-shrink: 0 !important;
    }
    
    /* Hide navbar links on mobile - they should be hidden */
    nav > div > div > div.hidden.md\:flex {
        display: none !important;
    }
    
    /* Mobile menu: hidden by default; only visible when .navbar-mobile-menu-open is added by JS */
    nav #navbar-mobile-menu {
        display: none !important;
    }
    
    nav #navbar-mobile-menu.navbar-mobile-menu-open {
        display: block !important;
    }
    
    /* Ensure navbar container doesn't overflow on mobile */
    nav > div {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        overflow-x: hidden !important;
    }
    
    /* Ensure flex container works properly on mobile */
    nav > div > div.flex.items-center.justify-between {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
    }
    
    /* Logo container on mobile - ensure it's visible */
    nav > div > div > div.flex.items-center.gap-2 {
        min-width: 0 !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        display: flex !important;
        visibility: visible !important;
    }
    
    /* Logo link on mobile - ensure visible */
    nav > div > div > div > a[href="/"] {
        min-width: 0 !important;
        display: flex !important;
        visibility: visible !important;
    }
    
    /* Logo text on mobile - ensure visible, allow truncation if needed */
    nav a[href="/"] span {
        display: inline !important;
        visibility: visible !important;
        white-space: nowrap !important;
    }
    
    /* Ensure hamburger button spacing */
    nav button.md\:hidden {
        margin-right: 0.5rem !important;
        flex-shrink: 0 !important;
    }
    
    /* Prevent navbar from breaking layout */
    nav {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }
}

/* Smooth Transitions */
nav * {
    transition-property: color, background-color, border-color, transform, opacity, box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Professional Spacing */
nav .gap-1 > * + * {
    margin-left: 0.25rem;
}

nav .ml-2 {
    margin-left: 0.5rem;
}

/* Enterprise-grade hover effects */
nav a:not([class*="bg-"]):not([class*="border-"]):hover {
    background-color: rgba(243, 244, 246, 0.5);
}

.dark nav a:not([class*="bg-"]):not([class*="border-"]):hover {
    background-color: rgba(55, 65, 81, 0.5);
}
