/* ============================================================================
   navbar.css — NE PAS EDITER A LA MAIN.

   Ce fichier est une copie du bloc navbar de css/style.css, pour les pages qui
   ne chargent pas style.css (product.php, bundle.php, dashboard.php).
   Il avait diverge : il contenait encore la pastille carree, l ancien logo
   44px, les anciennes tailles de texte et le gap:2rem qui creusait des zones
   mortes entre les liens.

   Pour le remettre a jour apres une modif de la navbar dans style.css :
     sed -n "/^\.navbar {/,/^\/\* SECTION HERO/p" css/style.css | head -n -1
   ============================================================================ */

.navbar {
    background-color: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.825rem 1.6rem;
    border-radius: 50px;
    margin: 0 auto;
    max-width: 1050px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    position: fixed;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-links li a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    border: 1px solid transparent;
    background: transparent;
    position: relative;
    z-index: 1;
    transition: color 0.18s ease;
    display: block;
    line-height: 1.4;
}

.nav-links li a:hover,
.nav-links li a.nav-active {
    color: #9b3fe5;
}

/* Sliding pill */
.nav-pill {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: calc(100% - 8px);
    border-radius: 999px;
    border: 1px solid rgba(155, 63, 229, 0.35);
    background: rgba(155, 63, 229, 0.12);
    pointer-events: none;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.18s ease;
    opacity: 0;
    z-index: 0;
}

/* Desktop : on sort les liens du flux pour les centrer sur la barre, et non
   entre deux blocs lateraux de largeurs differentes. Le menu mobile
   (max-width:768px) n est pas concerne. */
@media screen and (min-width: 769px) {
    .nav-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Desktop : les liens sont centres sur la barre, independamment de la largeur
   du logo a gauche et des boutons a droite. UNE SEULE regle fait foi : il en
   trainait une seconde plus bas qui reimposait gap:2rem et creusait 24px de
   vide mort entre chaque lien. */
.center-nav {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 4px 2px;
}

/* L espacement visuel est porte par le padding des <li>, jamais par un gap :
   les zones sensibles se touchent donc bord a bord. En glissant de Products
   vers FAQ la souris ne traverse plus aucun vide, et la pastille ne repart
   plus sur Home. Ecart entre deux liens : 12px + 12px = 24px, identique a
   l ancien rendu (gap 2rem moins les marges negatives). */
.center-nav li {
    margin: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
}
/* :first-of-type / :last-of-type et NON :first-child / :last-child : le script
   nav-pill.js ajoute la pastille en dernier enfant de .center-nav, donc le <li>
   Status n est PAS :last-child. Avec :last-child la regle ne s appliquait a
   personne et les liens se retrouvaient decales de 6px vers la gauche. */
.center-nav li:first-of-type { padding-left: 0; }
.center-nav li:last-of-type  { padding-right: 0; }

/* Un seul lien bleu a la fois : la couleur suit la pastille. Des que le script
   a surligne un lien (.nav-hl), tous les autres repassent en blanc, y compris
   celui de la section courante. En sortant de la barre le script rend le
   surlignage au lien actif, donc le bleu revient tout seul sur la section ou
   l on se trouve. Si le JS ne tourne pas, .has-hl n est jamais pose et
   .nav-active garde son role de repli. */
@media screen and (min-width: 769px) {
    .center-nav.has-hl li a {
        color: rgba(255, 255, 255, 0.72);
    }
    .center-nav.has-hl li a.nav-hl {
        color: #9b3fe5;
    }
}

.login-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.discord-icon {
    text-decoration: none;
    line-height: 1;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8b5cf6;
    border: 1px solid #a855f7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.discord-icon i {
    text-decoration: none;
    display: block;
    line-height: 1;
}

.discord-login {
    background: linear-gradient(145deg, #4c1d95, #9b3fe5);
    border: 1px solid #a855f7;
    color: white;
    font-weight: 500;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.discord-login:hover {
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.8);
    transform: scale(1.02);
}

.discord-icon:hover {
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.8);
    transform: scale(1.02);
}

/* Burger menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    margin-left: 16px;
}

.bar {
    width: 30px;
    height: 4px;
    background-color: white;
    margin: 4px 0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.menu-toggle.active .bar {
    background-color: transparent;
}

.mobile-only {
    display: none;
}

.close-menu {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 35px;
    color: white;
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.2s ease;
}

.close-menu:hover {
    transform: scale(1.1);
}

@media screen and (max-width: 768px) {
    .close-menu {
        display: none; /* géré via JS toggle */
    }

    .navbar {
        padding: 0.55rem 1rem;
        max-width: calc(100% - 24px);
        top: 10px;
        border-radius: 50px;
    }

    .logo {
        width: 38px;
        height: 38px;
    }

    .menu-toggle {
        display: flex;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 50%;
        width: 38px;
        height: 38px;
        padding: 0;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0;
        margin-left: 0;
    }

    .bar {
        width: 18px;
        height: 2px;
        margin: 2.5px 0;
    }

    /* Menu fullscreen centré */
    .nav-links {
        display: flex;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100dvh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 80px 24px 48px;
        background: #0b0c12;
        z-index: 999;
        transform: translateY(-8px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.25s ease;
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Navbar au-dessus du menu — le hamburger devient X */
    .navbar { z-index: 1000; }
    .navbar.menu-open {
        background: #0b0c12 !important;
        border-color: rgba(255,255,255,0.06) !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }

    /* Hamburger → X quand menu ouvert */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        background: #fff;
    }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        background: #fff;
    }
    .menu-toggle .bar { transition: transform 0.25s ease, opacity 0.2s ease; }

    .close-menu { display: none !important; }

    /* Stagger animation */
    .nav-links li,
    .mobile-buttons-row {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 0.28s ease, transform 0.28s ease;
    }
    .nav-links.active li { opacity: 1; transform: translateY(0); }
    .nav-links.active li:nth-child(1) { transition-delay: 0.04s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.08s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.12s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.16s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.20s; }
    .nav-links.active .mobile-buttons-row {
        opacity: 1; transform: translateY(0); transition-delay: 0.26s;
    }

    /* Nav items — boutons pill pleine largeur */
    .nav-links li {
        margin: 0; padding: 0;
        width: 100%;
    }

    .nav-links li a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 1.05rem;
        font-weight: 600;
        padding: 15px 24px;
        border-radius: 999px;
        color: rgba(255,255,255,0.65);
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
        text-align: center;
        transition: color 0.18s, background 0.18s, border-color 0.18s;
    }

    .nav-links li a:hover {
        color: #fff;
        background: rgba(255,255,255,0.09);
        border-color: rgba(255,255,255,0.14);
    }

    .nav-links li a.nav-active {
        color: #c084fc;
        background: rgba(192, 132, 252,0.1);
        border-color: rgba(192, 132, 252,0.35);
    }

    /* Boutons du bas */
    .mobile-only { display: flex !important; }

    .mobile-buttons-row {
        display: flex;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
    }

    .discord-icon.mobile-only {
        width: 54px; height: 54px;
        font-size: 20px;
        border-radius: 999px;
        background: #8b5cf6;
        border: 1px solid rgba(168, 85, 247,0.5);
        flex-shrink: 0;
        align-items: center; justify-content: center;
        color: #fff;
        text-decoration: none;
    }

    .discord-login.mobile-only {
        flex: 1;
        height: 54px;
        background: linear-gradient(145deg, #4c1d95, #9b3fe5);
        border: 1px solid rgba(168, 85, 247,0.4);
        color: white;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 999px;
        align-items: center;
        justify-content: center;
        gap: 8px;
        text-decoration: none;
    }

    .login-buttons { display: none; }

    .nav-pill { display: none !important; }
    .center-nav { display: contents; }
}

@media screen and (max-width: 768px) {
    .center-nav {
        /* display explicite : une regle plus haut passe .center-nav en
           `display: contents`, ce qui supprimerait la boite et rendrait les
           proprietes ci-dessous sans effet (gap, largeur, direction). */
        display: flex;
        position: static;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
}
