/* ===== TOP BAR ===== */
.top-bar {
    background: black;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    font-size: 14px;
}

.top-left { display: flex; align-items: center; }

.user-status { position: relative; display: flex; align-items: center; }

.user-icon { font-size: 18px; }

.status-dot {
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online { background: #00c853; }
.status-dot.offline { background: #d50000; }

.top-right a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
}

.top-right a:hover { color: #ccc; }

/* ===== TITRE PRINCIPAL ===== */
.site-title {
    background: white;
    text-align: center;
    padding: 20px 0;
}

.site-title h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
}

.title-black { color: black; }
.title-red { color: #b22222; }

/* ===== MENU DYNAMIQUE ===== */

/* ==== Niveau 1 ==== */
.level-1 {
    list-style: none;
    margin: 0;
    padding: 15px 40px;
    display: flex;
    gap: 40px;
    background: white;
    font-size: 17px;
}

.l1-item {
    position: relative;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.25s ease;
    background-color: white;
}

.l1-link {
    font-weight: bold;
    font-size: 20px;
    color: black;
    text-decoration: none;
    transition: color 0.25s ease;
}

.l1-item:hover {
    background-color: #b22222;
}

.l1-item:hover > .l1-link { color: white; }

/* Affichage sous-menu niveau 2 */
.l1-item:hover > .submenu-block {
    display: flex;
    gap: 40px;
}

/* ==== Niveau 2 ==== */
/* Structure du bloc */
.submenu-block {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 20px 40px;
    min-width: 600px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
    border-radius: 10px;
    z-index: 9999;
}

/* Conteneur niveau 2 */
.l2-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Texte + animation niveau 2 (fonctionne sur <a> ou <span>) */
.l2-item > a,
.l2-item > span {
    font-weight: bold;
    font-size: 20px;
    color: #b22222;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

/* Ligne animée */
.l2-item > a::after,
.l2-item > span::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;  /* sous le texte */
    width: 0%;
    height: 2px;
    background: #b22222;
    transition: width 0.3s ease;
}

.l2-item > a:hover::after,
.l2-item > span:hover::after {
    width: 100%;
}

.l2-item > a:hover,
.l2-item > span:hover {
    color: #8b0000;
}

/* ==== Niveau 3 ==== */
.level-3 {
    display: block;
    margin-top: 10px;
    list-style: none;
}

.level-3 li { margin: 3px 0; }

.level-3 a {
    font-weight: normal;
    font-size: 17px;
    color: #333;
    text-decoration: none;
}

.level-3 a:hover { color: #b22222; }


/* ========================================================= */
/* ================== HAMBURGER MOBILE ===================== */
/* ========================================================= */

/* Bouton hamburger (caché en desktop) */
.hg-hamburger {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
}

/* Structure nav */
.hg-menu {
    position: relative;
}

/* ========================================================= */
/* ====================== MOBILE =========================== */
/* ========================================================= */

@media (max-width: 768px) {

    /* Hamburger visible */
    .hg-hamburger {
        display: block;
    }

    /* Menu masqué par défaut */
    .hg-menu {
        display: none;
        width: 100%;
    }

    .hg-menu.active {
        display: block;
    }

    /* Niveau 1 vertical */
    .level-1 {
        flex-direction: column;
        gap: 10px;
        padding: 10px 20px;
    }

    .l1-item {
        width: 100%;
        border-radius: 8px;
    }

    /* Désactivation hover desktop */
    .l1-item:hover {
        background-color: white;
    }

    .l1-item:hover > .l1-link {
        color: black;
    }

    /* Sous-menu niveau 2 en mode mobile */
    .submenu-block {
        position: static;
        display: none;
        flex-direction: column;
        padding: 10px 15px;
        min-width: auto;
        box-shadow: none;
        border-radius: 0;
        gap: 15px;
    }

    .l1-item.active > .submenu-block {
        display: flex;
    }

    /* Niveau 2 */
    .l2-item {
        gap: 6px;
    }

    /* Niveau 3 caché par défaut */
    .level-3 {
        display: none;
        margin-top: 5px;
        padding-left: 15px;
    }

    .l2-item.active > .level-3 {
        display: block;
    }
}
