/* 
 * STYLES POUR LA BARRE DE NAVIGATION (TOPBAR)
 * Gestion du menu principal fixe avec sous-menu déroulant animé
 * Auteur: Manley.B
 */

/* ==================== BARRE DE NAVIGATION PRINCIPALE ==================== */
/* Configuration de la topbar fixe en haut de la page */

#topbar {
    user-select: none;
    position: fixed;
    left: -0.1vh;
    width: 100%;
    height: 85px;
    background: transparent;
    color: #242423;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2em;
    transition: top 0.3s, background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
    z-index: 1000;
    backdrop-filter: none;
    box-shadow: none;
}

#topbar.topbar-blur {
    border: 1px solid rgba(255, 255, 255, 0.301);
    background: rgba(9, 0, 29, 0.2);
    box-shadow: 0 2px 16px rgba(44,62,80,0.08);
    backdrop-filter: blur(6px);
}

#topbar span {
    flex: 1;
    text-align: left;
    padding-left: 30px;
}

/* ==================== BOUTON MENU PRINCIPAL ==================== */
/* Styles pour le bouton d'ouverture du menu déroulant */

#topbar nav {
    display: flex;
    align-items: center;
    position: relative;
}

#menu-toggle {
    background: rgba(40, 40, 40, 0.9);
    color: #F5CB5C;
    border: none;
    font-size: 1.5em;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    margin-right: 30px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

#menu-toggle:hover {
    background: #F5CB5C;
    color: #1a1a1a;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 203, 92, 0.4);
}

/* ==================== SOUS-MENU DÉROULANT ==================== */
/* 
 * Menu déroulant avec animations d'apparition/disparition
 * Utilise opacity, visibility et transform pour des transitions fluides
 */

.menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 2.65em;
    right: 0em;
    background: rgba(40, 40, 40, 0.95);
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(44,62,80,0.2);
    z-index: 1001;
    padding: 0;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 203, 92, 0.2);
    
    /* Animation de disparition par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
}

.menu.open {
    /* Animation d'apparition */
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Animation des éléments individuels du menu */
.menu li {
    list-style: none;
    border-bottom: 1px solid rgba(245, 203, 92, 0.1);
    margin: 0.2em;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.2s ease;
}

.menu.open li {
    opacity: 1;
    transform: translateX(0);
}

/* Délai échelonné pour les éléments */
.menu.open li:nth-child(1) { transition-delay: 0.1s; }
.menu.open li:nth-child(2) { transition-delay: 0.15s; }
.menu.open li:nth-child(3) { transition-delay: 0.2s; }
.menu.open li:nth-child(4) { transition-delay: 0.25s; }
.menu.open li:nth-child(5) { transition-delay: 0.3s; }
.menu.open li:nth-child(6) { transition-delay: 0.35s; }

.menu li:last-child {
    border-bottom: none;
}

/* ==================== LIENS DU SOUS-MENU ==================== */
/* Styles pour les éléments de navigation avec effets hover */

.menu a {
    display: block;
    color: #F5CB5C;
    text-decoration: none;
    padding: 15px 20px;
    transition: all 0.3s ease;
    border-radius: 6px;
    background: rgba(245, 203, 92, 0.05);
    border: 1px solid rgba(245, 203, 92, 0.2);
    margin: 2px;
    font-weight: 500;
}

.menu a:hover {
    cursor: pointer;
    background: rgba(245, 203, 92, 0.2);
    color: #F5CB5C;
    transform: translateX(5px) scale(1.02);
    border-color: rgba(245, 203, 92, 0.4);
    box-shadow: 0 3px 10px rgba(245, 203, 92, 0.2);
}
/* ==================== STYLES RESPONSIVES ==================== */
/* Adaptations pour tablettes et mobile */

@media (max-width: 57vh) {
    body {
        padding-top: 60px;
    }

    /* Réduction drastique taille texte topbar pour mobile */
    #topbar span {
        font-size: 1.1em !important;
        text-align: left;
        margin-left: -1.7em;
        max-width: 150px;
    }

    #topbar .menu li a {
        font-size: 1em !important;
    }

    /* Bouton menu identique à l'index avec décalage à droite */
    #menu-toggle {
        font-size: 1em !important;
        margin-right: 0px !important;
        border: none;
        padding: 7px;
        cursor: pointer;
        border-radius: 3px;
        margin-right: 30px;
        transition: all 0.3s ease;
    }

    #topbar {
        padding: 0.5em 1em !important;
        min-height: 50px;
    }

}


