﻿/* ==========================================================================
   VARIABLES GLOBALES
   ========================================================================== */
   :root {
    --header-height: 64px;
    --sidebar-width: 250px;
    --primary-color: #22D3EE;
    --primary-hover: #0EA5E9;
    --background-darker: rgb(31, 41, 55);
    --text-light: #F9FAFB;
    --text-muted: #9CA3AF;
    --border-color: rgba(6, 182, 212, 0.2);
    --card-bg: rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   RESET DE BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    background-color: var(--background-darker);
    color: var(--text-light);
    font-family: 'Arial', sans-serif;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(31, 41, 55, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    z-index: 50;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .left span {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-light);
    }

.right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px; /* Valeur fixe plutôt que variable pour le debug */
    height: 100%;
    background-color: rgb(31, 41, 55);
    transform: translateX(-250px); /* Valeur fixe correspondant à la largeur */
    transition: all 0.3s ease;
    z-index: 1000;
}

body.sidebar-active .sidebar {
    transform: translateX(0);
}


.sidebar-content {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
}

    .sidebar-logo img {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.5rem;
    }

    .sidebar-logo span {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-light);
    }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    /* ==========================================================================
   SOUS-MENUS
   ========================================================================== */
    .sidebar-nav .menu-item {
        position: relative;
        width: 100%;
    }

        /* Style pour le lien principal dans le menu */
        .sidebar-nav .menu-item > a {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 1rem;
            color: var(--text-muted);
            text-decoration: none;
            border-radius: 0.5rem;
            transition: all 0.2s ease;
            width: 100%;
            position: relative;
        }

            .sidebar-nav .menu-item > a:hover {
                background-color: rgba(55, 65, 81, 0.8);
                color: var(--text-light);
            }

            .sidebar-nav .menu-item > a.active {
                background-color: var(--primary-color);
                color: white;
            }

    /* Icône du sous-menu */
    .sidebar-nav .has-submenu .submenu-icon {
        position: absolute;
        right: 10px;
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
    }

    .sidebar-nav .has-submenu.open .submenu-icon {
        transform: rotate(180deg);
    }

    /* Conteneur du sous-menu */
    .sidebar-nav .submenu {
        display: none;
        padding-left: 1.5rem;
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
    }

    .sidebar-nav .has-submenu.open .submenu {
        display: block;
        animation: fadeIn 0.2s ease;
    }

    /* Style des liens dans le sous-menu */
    .sidebar-nav .submenu a {
        display: flex;
        align-items: center;
        padding: 0.5rem 1rem;
        color: var(--text-muted);
        text-decoration: none;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
        font-size: 0.875rem;
    }

        .sidebar-nav .submenu a:hover {
            background-color: rgba(55, 65, 81, 0.5);
            color: var(--text-light);
        }

        .sidebar-nav .submenu a.active {
            background-color: rgba(34, 211, 238, 0.2);
            color: var(--primary-color);
        }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   OVERLAY
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

body.sidebar-active .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* Vérifier que ces styles sont bien appliqués */
#menuBtn {
    cursor: pointer;
    padding: 8px;
    border: none;
    background: none;
    color: white;
}

/* ==========================================================================
   BARRE DE RECHERCHE
   ========================================================================== */
.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    padding-right: 2.5rem;
    background: rgba(55, 65, 81, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-light);
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* ==========================================================================
   ICÔNES
   ========================================================================== */
.icon {
    width: 24px;
    height: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
}

    .icon:hover {
        color: var(--primary-color);
    }

/* ==========================================================================
   PROFIL UTILISATEUR ET DROPDOWN
   ========================================================================== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .user-profile:hover {
        background-color: rgba(55, 65, 81, 0.5);
    }

    .user-profile img {
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        object-fit: cover;
    }

    .user-profile span {
        color: var(--text-light);
        font-size: 0.875rem;
    }

/* Menu déroulant */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

    .dropdown-trigger:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

.dropdown-icon {
    width: 16px;
    height: 16px;
    margin-left: 5px;
}

.default-avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    color: #fff;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: rgb(31, 41, 55);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
    margin-top: 5px;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

    .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu a i {
        margin-right: 25px; /* Augmenté de 15px à 25px pour plus d'espace */
        width: 18px;
        height: 18px;
    }

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

/* ==========================================================================
   BOUTON DE CONNEXION
   ========================================================================== */
.login-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

    .login-button:hover {
        background-color: var(--primary-hover);
    }

    .login-button i {
        width: 18px;
        height: 18px;
    }

/* ==========================================================================
   STATUS BOX
   ========================================================================== */
.status-box {
    margin-top: auto;
    background: rgba(55, 65, 81, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.status-box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #10B981;
    border-radius: 50%;
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 85%;
        max-width: 320px;
    }

    .search-container {
        display: none;
    }

    .header-content {
        padding: 0 1rem;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .user-profile span {
        display: none;
    }

    .dropdown-menu {
        right: -50px;
    }
}

@media (max-width: 480px) {
    .right {
        gap: 0.75rem;
    }

    .icon {
        width: 20px;
        height: 20px;
    }
}

.dropdown-menu a i[data-lucide] {
    margin-right: 25px !important; /* Augmenté de 15px à 25px avec !important */
    width: 18px;
    height: 18px;
}