/* ===================================
   NAVBAR
=================================== */

.custom-navbar {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    z-index: 1000;

    transition: .35s ease;

    padding: 18px 0;

    background: transparent;

}

/* after scrolling */

.custom-navbar.scrolled {

    background: white;

    box-shadow: 0 6px 20px rgba(0,0,0,.08);

    padding: 12px 0;

}

.logo {

    width: 60px;

    margin-right: 14px;

}

.brand-text {

    display: flex;

    flex-direction: column;

}

.brand-title {

    font-family: "Poppins";

    font-weight: 700;

    color: white;

    font-size: 1.2rem;

}

.brand-text small {

    color: white;

    font-size: .75rem;

    letter-spacing: .5px;

}

/* Scrolled state */

.custom-navbar.scrolled .brand-title,

.custom-navbar.scrolled .brand-text small {

    color: var(--dark);

}

.navbar-nav {

    gap: 1.5rem;

}

.nav-link {

    color: white;

    font-weight: 600;

    position: relative;

    transition: .3s;

}

.custom-navbar.scrolled .nav-link {

    color: var(--dark);

}

.nav-link:hover {

    color: var(--primary);

}

.custom-navbar .navbar-nav .nav-link.active, .nav-link:focus {
    color: var(--primary);
    font-weight: 700;
}

.nav-link.active::after {

    content: "";

    position: absolute;

    bottom: -6px;

    left: 0;

    width: 100%;

    height: 3px;

    border-radius: 2px;

    background: var(--primary);

}

.navbar-toggler {

    border: none;

}

.navbar-toggler:focus {

    box-shadow: none;

}

.navbar-toggler-icon {

    filter: invert(1);

}

.custom-navbar.scrolled .navbar-toggler-icon {

    filter: none;

}

/* ===================================
   MOBILE MENU FIX
=================================== */
@media (max-width: 991.98px) {

    .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        padding: 1.5rem;
        border-radius: 12px;
        margin-top: 1rem;
        text-align: left; /* Changed from center to left */
    }

    .custom-navbar.scrolled .navbar-collapse {
        background-color: #FFFFFF;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    /* Force the flex container to align items to the left */
    .navbar-nav {
        align-items: flex-start !important;
        gap: 0.8rem;
    }

    /* Makes the link only as wide as the text so the underline fits perfectly */
    .nav-link {
        display: inline-block;
    }

    /* Fix the active underline to align perfectly on the left */
    .nav-link.active::after {
        width: 100%;
        left: 0;
        transform: none; /* Removes the centering transform */
        bottom: -4px;
    }
}