/*-- -------------------------- -->
<---        Navbar          -->
<--- -------------------------- -*/

/* Mobile First - 360px */
@media only screen and (min-width: 0rem)
{
    nav
    {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--secondary);
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 100;
        transition: all 0.3s ease;
        height: 3rem;
        padding: 0.5rem 1rem;
        box-sizing: border-box;
    }
    /* Hamburger toggle button - visible on mobile */
    .nav-toggle
    {
        display: block;
        font-size: 2rem;
        cursor: pointer;
        padding: 0 0.5rem;
        color: black;
        z-index: 101;
        order: -1;
    }
    /* Navigation links - hidden by default on mobile */
    .nav-middle
    {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 100%; /* Position below navbar */
        left: 0;
        width: 100%;
        background: var(--secondary);
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        border-radius: 0 0 8px 8px;
        z-index: 99;
    }

    /* Show dropdown when toggled */
    .nav-middle.show
    {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    /* Navigation link styles */
    nav a
    {
        color: black;
        text-decoration: none;
        font-size: 1.1rem;
        cursor: pointer;
        position: relative;
        padding: 0.8rem 1rem;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    /* Hover effect for links */
    nav a::after
    {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 3px;
        background: var(--primary);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    nav a:hover::after
    {
        width: 100%;
    }

    /* Mobile dropdown links */
    .nav-middle a
    {
        display: block;
        width: 100%;
        padding: 0.8rem 0;
        margin: 0.3rem 0;
        text-align: center;
    }

    /* Icon buttons on the right */
    .nav-right
    {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
        z-index: 101;
    }
    .nav-right a::after
    {
        bottom: 6px;   /* lift the line for icon links only */
    }


    .nav-right a i
    {
        font-size: 1.3rem;
    }

    /* Slide down animation */
    @keyframes slideDown
    {
        0% {
            opacity: 0;
            transform: translateY(-10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Desktop - 1024px */
@media only screen and (min-width: 64rem) {
    nav {
        justify-content: center;
        padding: 0.5rem 2rem;
    }

    /* Hide hamburger on desktop */
    .nav-toggle {
        display: none;
    }

    /* Center navigation links */
    .nav-middle {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        transform: none;
        left: auto;
        top: auto;
    }

    .nav-middle a {
        display: inline-block;
        width: auto;
        margin: 0 1rem;
        padding: 0.5rem 1rem;
    }

    /* Position icon buttons on the right */
    .nav-right {
        position: absolute;
        right: 2rem;
        margin-left: 0;
    }
}