/* ===========================================
   ICELABSOFT - Header & Navigation CSS (Premium Edition)
   =========================================== */

/* Animation Entrée */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: var(--z-header);
    transition: all var(--duration-normal) var(--ease-smooth);
    display: flex;
    align-items: center;
    animation: slideDown 0.8s var(--ease-out-expo);

    /* Premium Glass Effect */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

/* Bordure Gradient Animée en bas */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            var(--color-primary-electric),
            var(--color-accent-emerald),
            var(--color-accent-amber),
            var(--color-primary-electric));
    background-size: 300% 100%;
    animation: gradientMove 10s linear infinite;
    opacity: 0.8;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 0%;
    }
}

.header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    height: 90px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.container {
    /* Assure que le contenu du header suit les règles globales */
    display: flex;
    /* Si container est utilisé comme flex wrapper direct */
    width: 100%;
    margin: 0 auto;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    z-index: var(--z-header);
    padding: 5px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header.is-scrolled .logo-img {
    height: 50px;
}

/* Desktop Menu - Premium Pills */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-left: auto;
    margin-right: var(--spacing-6);
    background: rgba(255, 255, 255, 0.5);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-link {
    font-weight: 600;
    color: var(--color-gray-600);
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    color: var(--color-primary-electric);
    background: rgba(59, 130, 246, 0.08);
}

.nav-link.active {
    color: var(--color-white);
    background: var(--color-primary-electric);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Supprime l'ancien effet underline */
.nav-link::after {
    display: none;
}

/* Item CTA dans le menu - Desktop */
.nav-item-cta {
    margin-left: var(--spacing-4);
}

/* Bouton Contact Premium */
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.nav-cta:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: var(--z-overlay);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-gray-800);
    position: relative;
    transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--color-gray-800);
    transition: transform 0.3s, top 0.3s, bottom 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.nav-toggle.is-active .hamburger {
    background: transparent;
}

.nav-toggle.is-active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.is-active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 0;
        background: none;
        border: none;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .header {
        height: var(--header-height-mobile);
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 100px 24px 40px;
        gap: 12px;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
        transition: right 0.4s var(--ease-bounce);
        z-index: var(--z-dropdown);
        overflow-y: auto;
    }

    .nav-menu.is-open {
        right: 0;
    }

    /* Animation stagger pour les items */
    .nav-menu.is-open .nav-item {
        animation: slideInRight 0.4s ease forwards;
        opacity: 0;
    }

    .nav-menu.is-open .nav-item:nth-child(1) { animation-delay: 0.1s; }
    .nav-menu.is-open .nav-item:nth-child(2) { animation-delay: 0.15s; }
    .nav-menu.is-open .nav-item:nth-child(3) { animation-delay: 0.2s; }
    .nav-menu.is-open .nav-item:nth-child(4) { animation-delay: 0.25s; }
    .nav-menu.is-open .nav-item:nth-child(5) { animation-delay: 0.3s; }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        font-weight: 600;
        width: 100%;
        text-align: center;
        padding: 16px 20px;
        background: var(--color-white);
        border-radius: var(--radius-card);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid var(--color-gray-100);
        color: var(--color-gray-700);
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        background: var(--color-primary-electric);
        color: var(--color-white);
        transform: scale(1.02);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    }

    .nav-link.active {
        background: var(--color-primary-electric);
        color: var(--color-white);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    }

    /* CTA Item en mobile */
    .nav-item-cta {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-gray-200);
    }

    .nav-menu.is-open .nav-item-cta {
        animation-delay: 0.35s;
    }

    /* CTA Button visible en mobile */
    .nav-cta {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 18px 24px;
        font-size: 1rem;
        border-radius: var(--radius-card);
    }

    /* Overlay sombre */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        z-index: var(--z-header);
        backdrop-filter: blur(5px);
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Logo dans le header mobile */
    .logo-img {
        height: 45px;
    }
}