/* Modern Navigation Styles */

/* Navbar Base Styles */
.navbar {
    background-color: white !important;
    background: white !important;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background-color: white !important;
    background: white !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Brand/Logo Styling — small header mark; works on all pages via navigation.css */
nav.navbar .navbar-brand img.logo,
.navbar.navbar-expand-lg .navbar-brand img.logo,
.navbar-brand img.logo {
    max-height: 24px !important;
    width: auto !important;
    max-width: 82px !important;
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
    vertical-align: middle;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
    color: #2c3e50 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    max-width: 100%;
    min-width: 0;
}

/* Image-only brand: avoid fs-3 / large font-size enlarging the header row */
.navbar .navbar-brand:has(> img.logo) {
    font-size: 0 !important;
    line-height: 0 !important;
}

.navbar-brand:hover {
    transform: scale(1.01);
    color: #2c3e50 !important;
    text-decoration: none !important;
}

.navbar-brand:hover img.logo {
    opacity: 0.92;
}

/* Footer brand logo — larger, rendered white on dark footer */
footer.footer img[src*="logo.png"] {
    max-height: 52px !important;
    width: auto !important;
    max-width: 150px !important;
    height: auto !important;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.96;
    transition: opacity 0.2s ease;
}

footer.footer a:hover img[src*="logo.png"] {
    opacity: 1;
}

.navbar-brand span:first-child {
    color: #2563EB !important;
}

.navbar-brand span:last-child {
    color: #1E40AF !important;
}

/* Navigation Links */
.nav-link {
    color: #2c3e50 !important;
    font-weight: 500 !important;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    text-decoration: none !important;
}

.nav-link:hover {
    color: #2563EB !important;
    background-color: rgba(37, 99, 235, 0.1) !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.nav-link.active {
    background: linear-gradient(135deg, #2563EB, #1E40AF) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Click-only navbar dropdowns: block CSS hover-open patterns; Bootstrap toggles .show on click */
nav.navbar .nav-item.dropdown:hover > .dropdown-menu:not(.show),
nav.navbar li.dropdown:hover > .dropdown-menu:not(.show),
nav.navbar .dropdown:hover > .dropdown-menu:not(.show),
.navbar.navbar-expand-lg .nav-item.dropdown:hover > .dropdown-menu:not(.show),
.navbar.navbar-expand-lg li.dropdown:hover > .dropdown-menu:not(.show),
.navbar.navbar-expand-lg .dropdown:hover > .dropdown-menu:not(.show) {
    display: none !important;
    pointer-events: none !important;
}

/* Dropdown Menus */
.dropdown-menu {
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    border-radius: 1rem !important;
    padding: 1rem !important;
    margin-top: 0.5rem !important;
    min-width: 280px !important;
    animation: dropdownSlide 0.3s ease;
    background-color: white !important;
    background: white !important;
}

/* Force white on all dropdown containers */
.dropdown,
.dropdown-menu,
.dropdown-toggle,
ul.dropdown-menu {
    background-color: white !important;
    background: white !important;
}

/* Force white on Bootstrap dropdown containers */
.dropdown-menu.show {
    background-color: white !important;
    background: white !important;
}

/* Override any Bootstrap dropdown themes */
.dropdown-menu,
.dropdown-menu li,
.dropdown-menu ul {
    background-color: white !important;
    background: white !important;
}

/* Ensure dropdown items container is white */
.dropdown-menu > li,
.dropdown-menu > .dropdown-item {
    background-color: white !important;
    background: white !important;
}

/* Mobile dropdown styling - white background */
@media (max-width: 991.98px) {
    .dropdown-menu {
        border: none !important;
        box-shadow: none !important;
        background-color: white !important;
        background: white !important;
        margin-top: 0.5rem !important;
        margin-left: 1rem !important;
        border-left: 2px solid #2563EB !important;
    }
    
    /* Force white on mobile dropdowns */
    .dropdown,
    .dropdown-menu,
    .dropdown-menu li,
    .dropdown-menu ul {
        background-color: white !important;
        background: white !important;
    }
}

/* User dropdown - force white */
.dropdown-menu-end,
.dropdown-menu-end li,
.dropdown-menu-end ul {
    background-color: white !important;
    background: white !important;
}

/* Override Bootstrap's dropdown dark theme completely */
.dropdown-menu[data-bs-theme="dark"],
.dropdown-menu.dropdown-menu-dark,
.dropdown-menu[data-bs-theme="light"],
.dropdown-menu.dropdown-menu-light {
    background-color: white !important;
    background: white !important;
    border: none !important;
}

/* Additional Bootstrap overrides */
.nav-item .dropdown-menu,
.navbar .dropdown-menu,
.navbar-nav .dropdown-menu {
    background-color: white !important;
    background: white !important;
}

/* Force white background on all possible dropdown selectors */
div[class*="dropdown"] {
    background-color: white !important;
    background: white !important;
}

ul[class*="dropdown"] {
    background-color: white !important;
    background: white !important;
}

li[class*="dropdown"] {
    background-color: white !important;
    background: white !important;
}

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

.dropdown-item {
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.25rem !important;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    color: #2c3e50 !important;
    text-decoration: none !important;
    background: transparent !important;
}

.dropdown-item:last-child {
    margin-bottom: 0 !important;
}

.dropdown-item:hover {
    background-color: #f7fafc !important;
    background: #f7fafc !important;
    color: #2563EB !important;
    transform: translateX(4px);
    text-decoration: none !important;
}

/* Force white background on all dropdown elements */
.dropdown-menu,
.dropdown-menu .dropdown-item {
    background-color: white !important;
    background: white !important;
}

/* Auth Buttons */
.btn-outline-primary {
    border-width: 2px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border-color: #2563EB !important;
    color: #2563EB !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    background-color: #2563EB !important;
    border-color: #2563EB !important;
    color: white !important;
}

.btn-primary {
    background: linear-gradient(135deg, #2563EB, #1E40AF) !important;
    border: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    color: white !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1E40AF, #003b4f) !important;
    color: white !important;
}

/* User Avatar */
.user-avatar {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #2563EB, #1E40AF) !important;
}

/* Mobile Navbar Toggler */
.navbar-toggler {
    padding: 0.5rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0 !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

.navbar-toggler:hover {
    background-color: #f7fafc !important;
    border-color: #2563EB !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2844, 62, 80, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Navigation collapse background fix */
.navbar-collapse {
    background-color: white !important;
    background: white !important;
}

/* Mobile Styles */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white !important;
        background-color: white !important;
        border-radius: 1rem;
        margin-top: 1rem;
        padding: 1.5rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0 !important;
        border-radius: 0.5rem !important;
    }
    
    .dropdown-menu {
        border: none !important;
        box-shadow: none !important;
        background-color: white !important;
        background: white !important;
        margin-top: 0.5rem !important;
        margin-left: 1rem !important;
        border-left: 2px solid #2563EB !important;
    }
    
    .dropdown-item {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Mobile auth buttons */
    .d-flex.gap-2 {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid #e2e8f0;
    }
    
    .btn-outline-primary,
    .btn-primary {
        flex: 1;
        text-align: center;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
    }
}

/* Collapsed navbar / tablet — keep logo from crowding the toggler */
@media (max-width: 991.98px) {
    nav.navbar .navbar-brand img.logo,
    .navbar.navbar-expand-lg .navbar-brand img.logo,
    .navbar-brand img.logo {
        max-height: 22px !important;
        max-width: 76px !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem !important;
    }

    nav.navbar .navbar-brand img.logo,
    .navbar.navbar-expand-lg .navbar-brand img.logo,
    .navbar-brand img.logo {
        max-height: 20px !important;
        max-width: 70px !important;
    }
    
    .container-fluid {
        padding: 0 1rem !important;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Loading animation for dropdowns */
.dropdown-menu.show {
    animation: dropdownSlide 0.3s ease;
}

/* Navbar menus use Bootstrap click/toggle only — do NOT use :hover display here
   (it closes when moving the cursor from the toggle to the menu). */

/* Focus states for accessibility */
.nav-link:focus,
.dropdown-item:focus,
.btn:focus {
    outline: 2px solid #2563EB !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

/* Active states */
.dropdown-item.active,
.dropdown-item:active {
    background-color: #2563EB !important;
    color: white !important;
}

/* User dropdown specific styling */
.dropdown-menu-end {
    background-color: white !important;
    background: white !important;
}

.dropdown-menu-end .dropdown-item {
    color: #2c3e50 !important;
    background-color: transparent !important;
}

.dropdown-menu-end .dropdown-item:hover {
    background-color: #f7fafc !important;
    color: #2563EB !important;
}

.dropdown-menu-end .dropdown-item.text-danger {
    color: #e53e3e !important;
}

.dropdown-menu-end .dropdown-item.text-danger:hover {
    background-color: rgba(229, 62, 62, 0.1) !important;
    color: #e53e3e !important;
}

.dropdown-divider {
    border-color: #e2e8f0 !important;
    margin: 0.5rem 0 !important;
}

/* Success/warning button variants using color scheme */
.btn-success {
    background: linear-gradient(135deg, #2d8653, #2d8653) !important;
    border: none !important;
    color: white !important;
}

.btn-warning {
    background: linear-gradient(135deg, #c05621, #c05621) !important;
    border: none !important;
    color: white !important;
}

.btn-info {
    background: linear-gradient(135deg, #1557cc, #1557cc) !important;
    border: none !important;
    color: white !important;
}

/* Dark mode support (if needed later) */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: var(--bg-white) !important;
    }
    
    .navbar-collapse {
        background: #212529 !important;
        color: white;
    }
    
    .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    
    .dropdown-menu {
        background: #212529 !important;
        color: white;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.85) !important;
    }
}

/* Override any Bootstrap dark theme */
.dropdown-menu[data-bs-theme="dark"],
.dropdown-menu.dropdown-menu-dark {
    background-color: white !important;
    background: white !important;
    border: none !important;
}

.dropdown-menu[data-bs-theme="dark"] .dropdown-item,
.dropdown-menu.dropdown-menu-dark .dropdown-item {
    color: #2c3e50 !important;
    background-color: transparent !important;
}

.dropdown-menu[data-bs-theme="dark"] .dropdown-item:hover,
.dropdown-menu.dropdown-menu-dark .dropdown-item:hover {
    background-color: #f7fafc !important;
    color: #2563EB !important;
}

/* Force white background on all navbar elements */
.navbar,
.navbar-collapse,
.navbar-nav,
#navbarNav {
    background-color: white !important;
    background: white !important;
}

/* Force text colors on all navigation elements */
.navbar .navbar-nav .nav-link,
.navbar .navbar-brand,
.navbar .dropdown-item {
    color: #2c3e50 !important;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .dropdown-item:hover {
    color: #2563EB !important;
}

.navbar .navbar-nav .nav-link.active {
    color: white !important;
}

/* Bootstrap color overrides */
.navbar-light .navbar-nav .nav-link {
    color: #2c3e50 !important;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: #2563EB !important;
}

.navbar-light .navbar-brand {
    color: #2c3e50 !important;
}

.navbar-light .navbar-brand:hover {
    color: #2c3e50 !important;
}

/* Override Bootstrap default colors */
.text-primary {
    color: #2563EB !important;
}

.text-success {
    color: #1E40AF !important;
}

.bg-primary {
    background: linear-gradient(135deg, #2563EB, #1E40AF) !important;
}
