/* ========================================
   NAVBAR CUSTOM — Style rouge/noir
   Bootstrap gère le comportement burger,
   ce CSS gère uniquement le style visuel.
   ======================================== */

.navbar-custom {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 100%);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.3);
    border-bottom: 2px solid rgba(220, 20, 60, 0.3);
}

/* ---- Layout wrapper ---- */
.container-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ---- Ligne du header (brand + user + burger) ---- */
.nav-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* Sur mobile, le collapse Bootstrap sera juste en dessous,
   donc on retire la marge inférieure du header */
@media (max-width: 991px) {
    .nav-header-row {
        margin-bottom: 0;
    }
}

/* ---- Brand ---- */
.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #dc143c 0%, #ff3366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* ---- Texte utilisateur ---- */
.nav-user {
    color: #c0c0c0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-user strong {
    color: #ff3366;
}

/* ========================================
   BURGER BUTTON (style custom, logique Bootstrap)
   ======================================== */
.burger-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px !important;
    cursor: pointer;
}

.burger-btn:focus,
.burger-btn:active {
    outline: none !important;
    box-shadow: none !important;
}

.burger-bar {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animation croix quand le menu est ouvert */
.burger-btn[aria-expanded="true"] .burger-bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}
.burger-btn[aria-expanded="true"] .burger-bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}
.burger-btn[aria-expanded="true"] .burger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   MENU (ul)
   ======================================== */
.nav-menu {
    list-style: none !important;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 !important;
    margin: 0 !important;
}

.nav-item {
    margin: 0 !important;
    list-style: none;
}

/* ---- Liens ---- */
.nav-link {
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 20px !important;
    border-radius: 8px;
    transition: all 0.3s;
    display: inline-block;
    border: 1px solid transparent;
    background: transparent !important;
}

.nav-link:hover {
    color: #ff3366 !important;
    background: rgba(220, 20, 60, 0.1) !important;
    border-color: rgba(220, 20, 60, 0.3);
}

.nav-link-danger {
    color: #ff3366 !important;
    font-weight: bold;
}

.nav-link-danger:hover {
    background: rgba(220, 20, 60, 0.2) !important;
    border-color: #dc143c;
}

/* ========================================
   RESPONSIVE — mobile sidebar via Bootstrap collapse
   ======================================== */
@media (max-width: 991px) {

    /* Le collapse Bootstrap ajoute/retire display:block ;
       on stylise le panneau ouvert comme une sidebar */
    #navMenu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        padding: 80px 20px 20px;
        overflow-y: auto;
        z-index: 1050;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        transition: right 0.4s ease-in-out;

        /* On override Bootstrap collapse pour gérer via right */
        display: block !important;
    }

    /* Ouvert */
    #navMenu.show {
        right: 0;
    }

    /* Overlay sombre derrière le menu */
    #navMenu.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: calc(100vw - 280px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Menu vertical */
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 !important;
    }

    .nav-item {
        width: 100%;
        margin: 8px 0 !important;
    }

    .nav-link {
        display: block !important;
        width: 100%;
        padding: 15px 20px !important;
        text-align: center !important;
    }
}

@media (max-width: 767px) {
    .nav-brand {
        font-size: 1.2rem;
    }

    #navMenu {
        width: 250px;
    }

    #navMenu.show::before {
        width: calc(100vw - 250px);
    }
}

@media (max-width: 480px) {
    #navMenu {
        width: 100%;
    }

    #navMenu.show::before {
        display: none;
    }
}