/* =====================================================
   ENLA 2.0 — MODULE DOS
   Fichier : assets/css/sidebar.css
   Style du menu latéral
===================================================== */

/* =====================================================
   1. VARIABLES DE COULEURS ET DIMENSIONS
===================================================== */

:root {
    --enla-primary: #165BFB;
    --enla-dark: #003366;
    --enla-background: #f6f4fc;
    --enla-white: #ffffff;
    --enla-text: #333333;
    --enla-text-secondary: #444444;
    --enla-border: #cccccc;

    --sidebar-width: 260px;
    --navbar-height: 70px;

    --transition: 0.25s ease;
}

/* =====================================================
   2. CONTENEUR DU MENU
===================================================== */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;

    display: flex;
    flex-direction: column;

    width: 260px;
    height: 100vh;
    height: 100dvh;

    overflow-x: hidden;
    overflow-y: auto;

    color: var(--enla-white, #ffffff);
    background: var(--enla-dark, #003366);

    transition: transform 0.25s ease;
}

.sidebar-container {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-height: 100%;
}

/* =====================================================
   3. EN-TÊTE ET LOGO
===================================================== */

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 85px;
    padding: 18px 20px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.sidebar-logo-icone {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 44px;
    height: 44px;

    color: var(--enla-dark, #202b46);
    background: var(--enla-white, #ffffff);

    border-radius: 10px;
    font-size: 25px;
}

.sidebar-logo-texte {
    min-width: 0;
}

.sidebar-logo-titre {
    margin: 0;

    color: var(--enla-white, #ffffff);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-logo-sous-titre {
    display: block;
    margin-top: 4px;

    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}

/* =====================================================
   4. NAVIGATION
===================================================== */

.sidebar-navigation {
    flex: 1 0 auto;
    padding: 20px 12px;
}

.sidebar-section-titre {
    padding: 8px 12px;
    margin-bottom: 8px;

    color: rgba(255, 255, 255, 0.6);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* =====================================================
   5. LIENS DU MENU
===================================================== */

#sidebar .menu-link {
    display: flex;
    align-items: center;
    gap: 13px;

    width: 100%;
    min-height: 46px;

    padding: 12px 14px;
    margin-bottom: 5px;

    color: rgba(255, 255, 255, 0.85);
    background: transparent;

    border: 0;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 500;
    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

#sidebar .menu-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 20px;

    font-size: 18px;
}

#sidebar .menu-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#sidebar .menu-link:hover {
    color: var(--enla-white, #ffffff);
    background: rgba(255, 255, 255, 0.1);
}

#sidebar .menu-link:focus-visible {
    outline: 2px solid var(--enla-white, #ffffff);
    outline-offset: 2px;
}

/* =====================================================
   6. LIEN ACTIF
===================================================== */

#sidebar .menu-link.active {
    color: var(--enla-white, #ffffff);
    background: var(--enla-primary, #165BFB);
    font-weight: 600;
}

#sidebar .menu-link.active:hover {
    background: var(--enla-primary, #165BFB);
}

/* =====================================================
   7. ZONE INFÉRIEURE ET PARAMÈTRES
===================================================== */

.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 12px 14px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-parametres {
    padding-bottom: 12px;
}

/* =====================================================
   8. PIED DU MENU
===================================================== */

.sidebar-footer {
    padding: 16px 6px;

    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer p {
    margin: 0;

    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    line-height: 1.6;
}

/* =====================================================
   9. RESPONSIVE — TABLETTES ET MOBILES
===================================================== */

@media (max-width: 991px) {
    #sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    #app.sidebar-open #sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 576px) {
    .sidebar-header {
        min-height: 75px;
        padding: 14px 16px;
    }

    .sidebar-navigation {
        padding: 16px 10px;
    }

    #sidebar .menu-link {
        min-height: 44px;
        padding: 11px 12px;
    }
}

/* =====================================================
   10. ACCESSIBILITÉ
===================================================== */

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    #sidebar .menu-link {
        transition: none;
    }
}
