/* Custom Navigation Bar Styles */

/* Sticky Header */
header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #fff;
}

/* Main Navbar */
.main-navbar {
    position: relative;
    z-index: 1050;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.main-navbar .container {
    max-width: 1200px;
    margin: 0 auto;
}

header.scrolled .main-navbar {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 0.4rem 0;
}

/* Logo Styles */
.logo-container {
    flex-shrink: 0;
}

.logo-container img {
    height: 45px;
    max-width: 100%;
    transition: all 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

.logo-right {
    margin-left: 1rem;
}

header.scrolled .logo-container img {
    height: 38px;
}

/* Main Navigation Links */
.main-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav-links .nav-link {
    color: #3a3a3a;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.main-nav-links .nav-link i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.main-nav-links .nav-link:hover {
    color: #4a89dc;
    background-color: rgba(74, 137, 220, 0.08);
}

.main-nav-links .nav-link.active {
    color: #4a89dc;
    background-color: rgba(74, 137, 220, 0.1);
}

/* Dropdown Menus */
.main-nav-links .dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0;
    min-width: 220px;
    z-index: 1050;
}

/* Create invisible bridge to prevent dropdown from closing */
.main-nav-links .nav-item.dropdown > .nav-link::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.main-nav-links .nav-item.dropdown {
    position: relative;
}

.dropdown-menu-learn {
    min-width: 240px;
}

/* Desktop: Show dropdown on hover */
@media (min-width: 992px) {
    .main-nav-links .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .main-nav-links .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.2s ease;
        pointer-events: none;
    }

    .main-nav-links .nav-item.dropdown:hover > .dropdown-menu {
        pointer-events: auto;
    }

    /* Also handle user menu on hover */
    .user-menu:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .user-menu .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.2s ease;
        pointer-events: none;
    }

    .user-menu:hover > .dropdown-menu {
        pointer-events: auto;
    }
}

/* User menu dropdown */
.user-menu .dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    min-width: 200px;
    z-index: 1050;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #3a3a3a;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-item i {
    color: #4a89dc;
    width: 20px;
    opacity: 0.8;
}

.dropdown-item:hover {
    background-color: rgba(74, 137, 220, 0.1);
    color: #4a89dc;
}

.dropdown-item:hover i {
    opacity: 1;
}

.dropdown-divider {
    margin: 0.4rem 0.5rem;
    border-color: #e9ecef;
}

/* Right Section (Auth & CTA) */
.nav-right-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #3a3a3a;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.user-dropdown-toggle:hover {
    background-color: rgba(74, 137, 220, 0.08);
    color: #4a89dc;
}

.user-dropdown-toggle .fa-user-circle {
    font-size: 1.25rem;
    color: #4a89dc;
}

.user-dropdown-toggle .fa-chevron-down {
    font-size: 0.65rem;
    opacity: 0.6;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auth Login Button */
.btn-auth-login {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #4a89dc;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid #4a89dc;
}

.btn-auth-login:hover {
    background-color: rgba(74, 137, 220, 0.1);
    color: #3a79cc;
}

/* Create Report CTA Button */
.btn-create-report {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, #4a89dc 0%, #3a79cc 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 137, 220, 0.3);
}

.btn-create-report:hover {
    background: linear-gradient(135deg, #3a79cc 0%, #2a69bc 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 137, 220, 0.4);
    color: white;
}

.btn-create-report i {
    font-size: 0.9rem;
}

/* Mobile Styles */
@media (max-width: 991px) {
    .main-navbar {
        padding: 0.5rem 0;
    }

    .logo-container img {
        height: 40px;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        border-radius: 0 0 12px 12px;
        z-index: 1000;
    }

    .main-nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .main-nav-links .nav-link {
        padding: 0.75rem 1rem;
    }

    .nav-right-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
    }

    .btn-auth-login,
    .btn-create-report {
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .user-dropdown-toggle {
        justify-content: center;
    }

    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: 1px solid #e9ecef;
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .logo-container img {
        height: 35px;
    }

    .user-name {
        display: none;
    }
}

/* Navbar Toggler */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
}

.navbar-toggler:focus {
    box-shadow: none;
    background-color: rgba(74, 137, 220, 0.1);
}

.navbar-toggler-icon {
    width: 1.25em;
    height: 1.25em;
}
