/* FIXED MAIN NAVBAR */
.main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #364C84;
    z-index: 2000; 
}

/* Prevent content hiding under navbar */
body {
    padding-top: 70px; 
}

#navLinks {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link:hover {
    color: #facc15;
}

.nav-link {
    position: relative;
    color: white;
    padding: 10px 0;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

/* Animated underline */
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0%;
    height: 2px;
    background-color: #facc15; /* Meritedge accent */
    transition: width 0.3s ease-in-out;
    visibility: hidden;
}

/* Hover animation */
.nav-link:hover::after {
    width: 100%;
    visibility: visible;
}

/* Active link (current page) */
.nav-link.active {
    color: #facc15;
}

.nav-link.active::after {
    width: 100%;
    visibility: visible;
}

.user-btn {
    background: none;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    padding: 10px 0;
}

.user-btn:hover {
    color: #facc15;
}


.nav-link:hover { 
    color: #38bdf8;
}

.nav-link.active { 
    color: #facc15; 
    font-weight: bold;

}

.user-btn {
    background: none;
    border: none;
    color: #38bdf8;
    font-weight: bold;
    cursor: pointer;
}

/* DROPDOWN */
.dropdown {
    position: absolute;
    right: 0;
    top: 120%;
    background: white;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    min-width: 190px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1100;
}

.dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: black;
    background: white;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover { background: #f3f4f6; }
.logout-btn { color: #ef4444; }

/* HAMBURGER */
.hamburger {
    display: none;
    width: 30px;
    height: 22px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1200;
}

.hamburger span {
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.active span:nth-child(1) { transform: rotate(45deg); top: 9px; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); bottom: 10px; }

@media (max-width: 768px) {

    #navLinks {
        background: #364C84; /* Brand color instead of dark gradient */
    }

    .nav-link {
        font-size: 16px;
    }

    .nav-link::after {
        bottom: -4px;
    }
}


/* MOBILE DRAWER */
@media (max-width: 768px) {

    .hamburger { display: block; }

    #navLinks {
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        height: 100vh;
        background: linear-gradient(180deg, #0f172a, #1e293b);
        display: flex;
        flex-direction: column;
        padding: 80px 25px;
        gap: 22px;
        transform: translateX(100%);
        transition: transform 0.35s ease;
        z-index: 1100;
    }

    #navLinks.show { transform: translateX(0); }

    #navLinks a,
    #navLinks button,
    #navLinks form {
        pointer-events: auto;
    }
}

/* OVERLAY */
#menuOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

#menuOverlay.show {
    opacity: 1;
    visibility: visible;
}
