/* css/sections/nav.css */
#navbar {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: var(--container-width);
    z-index: 999;
    padding: 0.85rem 1.5rem;
    transition: all 0.3s var(--ease-interactive);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    animation: navSlideDown 0.8s var(--ease-out-smooth);
    animation-delay: 0.1s;
    opacity: 1;
    /* Initialize hidden before animation starts using animation-fill-mode backwards */
    animation-fill-mode: backwards;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 0.7rem 1.5rem;
}

#navbar.nav-hidden {
    transform: translate(-50%, calc(-100% - 3rem));
    pointer-events: none;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    color: var(--text-primary);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

/* Nav Menu */
.nav-menu {
    display: none;
    /* Hidden on very small screens */
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
        align-items: center;
        gap: 2.5rem;
    }
}

.navbar-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.navbar-link:hover {
    color: var(--accent);
}

/* Grovia Style Animated Contact Button */
.nav-btn {
    display: flex;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--accent);
    color: #ffffff;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s var(--ease-interactive);
}

.nav-btn:hover {
    transform: scale(0.98);
}

.button-icon-wrap {
    position: relative;
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.slide-in-icon,
.slide-out-icon {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s var(--ease-interactive);
    width: 100%;
    height: 100%;
}

.slide-in-icon {
    transform: translate3d(-100%, 100%, 0);
}

.slide-out-icon {
    transform: translate3d(0, 0, 0);
}

.nav-btn:hover .slide-out-icon {
    transform: translate3d(100%, -100%, 0);
}

.nav-btn:hover .slide-in-icon {
    transform: translate3d(0, 0, 0);
}

.button-icon-wrap svg {
    width: 16px;
    height: 16px;
}

/* ─── Mobile nav (< 768px) ─── */
@media (max-width: 767px) {
    #navbar {
        top: 1rem;
        width: calc(100% - 2rem);
        padding: 0.7rem 1rem;
    }

    #navbar.scrolled {
        padding: 0.6rem 1rem;
    }

    .brand-name {
        font-size: 1.15rem;
    }

    /* Réduit le bouton à l'icône seule */
    .nav-btn {
        padding: 0.4rem;
        gap: 0;
    }

    .nav-btn .button-text {
        display: none;
    }
}

/* Navbar entry animation */
@keyframes navSlideDown {
    from {
        transform: translate(-50%, -150%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}