/* ============================= */
/* Navbar / Header       */
/* ============================= */

.navbar {
    width: 100%;
    background-color: #D9D9D9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    transition: top 0.3s ease;
    z-index: 1000;
}

.logo img {
    max-width: 100px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: #024371;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 550;
    transition: color 0.5s;
}

.nav-links a:hover {
    color: #000000;
}

/* Desktop Dropdown Logic */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #D9D9D9;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    text-align: left;
}

.dropdown-content a {
    color: #024371;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1rem;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a:hover {
    background-color: #c0c0c0;
    color: #000000;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #024371;
    cursor: pointer;
    margin: auto 0;
    padding: 1.5rem;
}

/* ============================= */
/* Navbar Responsiveness     */
/* ============================= */

@media (max-width: 950px) {

    /* 1. Disable Desktop Hover and Shadows */
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .menu-toggle {
        display: block !important;
        position: relative;
        z-index: 1100;
        margin-left: auto;
    }

    /* 2. Full Width Mobile Menu */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        transform: none;
        background-color: #D9D9D9;
        padding: 0;
        gap: 0;
        box-shadow: none !important;
        border: none !important;
    }

    .nav-links.active {
        display: flex;
    }

    /* 3. Centered Content & No Borders */
    .nav-links a,
    .dropbtn {
        padding: 1.2rem 0;
        width: 100%;
        text-align: center;
        border: none !important;
        background-color: transparent;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    /* Arrow for mobile dropdown */
    .dropbtn::after {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        border-right: 2.5px solid #024371;
        border-bottom: 2.5px solid #024371;
        transform: rotate(45deg);
        transition: transform 0.3s ease, top 0.3s ease;
        position: relative;
        top: -2px;
        margin-left: 8px;
    }

    /* Flip arrow when open */
    .dropdown.open .dropbtn::after {
        transform: rotate(225deg);
        /* Base 45deg + 180deg */
        top: 2px;
        /* Slight adjustment when flipped */
    }

    /* 4. The Accordion (Sub-menu) */
    .dropdown-content {
        display: none;
        position: static;
        width: 100%;
        background-color: #D9D9D9;
        box-shadow: none !important;
        padding: 0;
    }

    /* Show when clicked */
    .dropdown.open .dropdown-content {
        display: flex;
        flex-direction: column;
        max-height: none;
    }

    .dropdown-content a {
        padding: 1rem 0;
        text-align: center;
        background-color: #D9D9D9;
    }

    /* Remove any leftover hover background colors on mobile */
    .nav-links a:hover,
    .dropdown-content a:hover {
        background-color: transparent;
        color: #024371;
    }
}