/* ===========================
   VARIABLES CSS - SIDEBAR
   =========================== */
:root {
    --sidebar-width: 60px;
    --sidebar-width-expanded: 200px;
    --sidebar-top: 60px;
    --sidebar-item-padding: 12px;
    --sidebar-item-gap: 12px;
    --sidebar-icon-size: 20px;
    --sidebar-animation: 0.3s ease;
    --sidebar-border-radius: 8px;
}

/* ===========================
   BARRE LATÉRALE GAUCHE
   =========================== */
.left-sidebar {
    position: fixed;
    left: 0;
    top: var(--sidebar-top);
    width: var(--sidebar-width);
    height: calc(100vh - var(--sidebar-top));
    background-color: var(--bg-color);
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 4px var(--shadow-color);
    color: var(--text-color);
    transition: width var(--sidebar-animation);
    z-index: 990;
}

/* HOVER : Élargir la sidebar */
.left-sidebar:hover {
    width: var(--sidebar-width-expanded);
}

/* ===========================
   ÉLÉMENTS DE LA SIDEBAR
   =========================== */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--sidebar-item-gap);
    padding: var(--sidebar-item-padding);
    margin: 0 5px;
    border-radius: var(--sidebar-border-radius);
    cursor: pointer;
    transition: all var(--sidebar-animation);
    color: var(--text-color);
    position: relative;
}

.sidebar-item a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--sidebar-item-gap);
    flex: 1;
    width: 100%;
}

/* ===========================
   TITRE ITEM
   =========================== */
.titre-item {
    font-size: var(--taille-text-pc);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--sidebar-animation) 0.1s;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Afficher le titre au hover du parent */
.left-sidebar:hover .titre-item {
    opacity: 1;
}

/* ===========================
   ICÔNES SIDEBAR
   =========================== */
.sidebar-item i {
    font-size: var(--sidebar-icon-size);
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--sidebar-animation);
    color: var(--text-color);
    flex-shrink: 0;
}

.sidebar-item:hover i {
    transform: scale(1.15);
}

/* ===========================
   NOTIFICATIONS
   =========================== */
.sidebar-item .notifi {
    font-size: 9px;
    color: var(--bg-color);
    position: absolute;
    top: 8px;
    right: 5px;
    background-color: #ff4444;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    display: flex;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===========================
   EFFETS HOVER & ACTIVE
   =========================== */
.sidebar-item:hover {
    background-color: var(--hover-bg);
    transform: translateX(4px);
}

.sidebar-item.active {
    background-color: var(--hover-bg);
    box-shadow: inset 3px 0 0 var(--accent-color);
}

.sidebar-item.active i {
    transform: scale(1.2);
}

/* ===========================
   CATALOGUE DROPDOWN
   =========================== */
.catalogue-dropdown {
    display: none;
    position: absolute;
    left: var(--sidebar-width-expanded);
    top: 0;
    background-color: var(--bg-secondary);
    min-width: 200px;
    border-radius: var(--sidebar-border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    overflow: hidden;
    z-index: 1001;
}

.sidebar-item:hover .catalogue-dropdown,
.sidebar-item:focus-within .catalogue-dropdown {
    display: flex;
    flex-direction: column;
}

.catalogue-dropdown a {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--sidebar-animation);
}

.catalogue-dropdown a:hover {
    background-color: var(--hover-bg);
    padding-left: 20px;
}

.catalogue-dropdown p {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
}

/* ===========================
   SCROLLBAR PERSONNALISÉE
   =========================== */
.left-sidebar::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border-radius: 3px;
    opacity: 0.3;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
    opacity: 0.6;
}

/* ===========================
   RESPONSIVE - TABLETTE
   =========================== */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 50px;
        --sidebar-width-expanded: 160px;
        --sidebar-icon-size: 18px;
    }

    .sidebar-item {
        padding: 10px;
    }

    .sidebar-item i {
        width: 20px;
    }
}

/* ===========================
   RESPONSIVE - MOBILE
   =========================== */
@media screen and (max-width: 768px) {
    .left-sidebar {
        display: none !important;
    }
}