/* ========================================================================
   BARRE D'ICÔNES COMPACTE (Menu fermé)
   ======================================================================== */

/* Conteneur de la barre d'icônes compacte */
.sidebar-icons-compact
{
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    overflow-y: auto;
    padding: 1rem 0.5rem;
    width: 100%;
}

/* Avatar compact en haut */

.compact-user-avatar
{
    align-items: center;
    cursor: default;
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
}

.compact-user-avatar i
{
    transition: transform 0.2s ease, color 0.2s ease;
}

.compact-user-avatar:hover i
{
    transform: scale(1.1);
}

/* Icônes du menu compact */

.compact-menu-icon
{
    align-items: center;
    background: var(--bg-surface, rgba(255, 255, 255, 0.05));
    border: 1px solid transparent;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 1.2rem;
    height: 45px;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 45px;
}

.compact-menu-icon i
{
    color: #ffffff;
}

.compact-menu-icon:hover
{
    background: var(--accent-color, #ff6700);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: white;
    transform: translateY(-3px);
}

.compact-menu-icon:active
{
    transform: translateY(-3px) scale(0.95);
}

/* Icône de déconnexion (bouton) */

.compact-menu-icon.text-danger
{
    background: var(--bg-surface, rgba(255, 255, 255, 0.05));
    border: none;
}

.compact-menu-icon.text-danger:hover
{
    background: var(--bs-danger, #dc3545);
    color: white;
}

/* Séparateur horizontal dans la barre compacte */

.sidebar-icons-compact hr
{
    border-color: var(--border-color, rgba(255, 255, 255, 0.2));
    margin: 0.5rem 0;
    opacity: 0.5;
    width: 60px;
}

/* ========================================================================
   AJUSTEMENT DU CONTENU PRINCIPAL
   ======================================================================== */

/* Décaler uniquement le contenu principal (main), pas la barre supérieure */

body .page .main-content
{
    margin-right: 130px;
    transition: margin-right 0.3s ease-in-out;
}

/* Quand le sidebar est ouvert mais pas épinglé, enlever la marge (overlay) */

body:has(.user-profile-sidebar.open:not(.pinned)) .page .main-content
{
    margin-right: 130px;
}

/* Quand le sidebar est épinglé et ouvert, utiliser la grande marge */

body:has(.user-profile-sidebar.open.pinned) .page .main-content
{
    margin-right: 450px;
    transition: margin-right 0.3s ease-in-out;
}

/* Alternative pour les navigateurs qui ne supportent pas :has() */

body.sidebar-compact .page .main-content
{
    margin-right: 130px;
    transition: margin-right 0.3s ease-in-out;
}

body.sidebar-open:not(.sidebar-pinned) .page .main-content
{
    margin-right: 130px;
}

body.sidebar-pinned .page .main-content
{
    margin-right: 450px;
    transition: margin-right 0.3s ease-in-out;
}

/* Responsive : masquer la barre d'icônes sur mobile */

@media (max-width: 768px)
{
    .sidebar-compact-strip
    {
        display: none;
    }

    body .page .main-content
    {
        margin-right: 0 !important;
    }
}

/* Dark mode adjustments */

.theme-dark .compact-menu-icon
{
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #e0e0e0);
}

.theme-dark .compact-menu-icon:hover
{
    background: var(--accent-color, #ff6700);
    color: white;
}

.theme-dark .sidebar-icons-compact hr
{
    border-color: rgba(255, 255, 255, 0.3);
}