/* Sidebar Professionnelle */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.sidebar-header {
    padding: 28px 24px 24px;
    position: relative;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 20px;
    font-weight: 600;
    color: #2563eb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.3px;
}

.logo i {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #1e40af;
    padding: 10px;
    border-radius: 10px;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    position: relative;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    margin: 2px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-left-color: #ffffff;
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border-left-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.nav-item i {
    width: 20px;
    margin-right: 14px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-item:hover i,
.nav-item.active i {
    color: #ffffff;
}

.nav-item span {
    font-size: 14px;
}

/* Badge de notification dans la sidebar */
.sidebar-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Badge grisé quand il n'y a pas de messages */
.sidebar-badge.zero {
    background: #6b7280;
    color: #f3f4f6;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

/* Animation pour le badge */
.sidebar-badge:not(.zero) {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(30, 64, 175, 0.2);
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #1e40af;
    box-shadow: 0 3px 10px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
}

/* Styles spécifiques pour l'avatar de la sidebar */
.sidebar .user-avatar {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #1e40af;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar .user-avatar.avatar-admin {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
}

.sidebar .user-avatar.avatar-partner {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.user-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: white;
}

.user-info span {
    font-size: 12px;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Indicateur de statut en ligne */
.user-profile::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* Dropdown utilisateur dans la sidebar */
.user-profile-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(30, 64, 175, 0.15);
    border-radius: 12px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(30, 64, 175, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 9999;
    margin: 0 16px;
    backdrop-filter: blur(10px);
}

.user-profile-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(30, 64, 175, 0.2), transparent);
}

.user-profile-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.user-profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.user-profile-item:not(:last-child) {
    border-bottom: 1px solid rgba(30, 64, 175, 0.08);
}

.user-profile-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 64, 175, 0.08), transparent);
    transition: left 0.4s ease;
}

.user-profile-item:hover::before {
    left: 100%;
}

.user-profile-item:hover {
    background: rgba(30, 64, 175, 0.05);
    color: var(--primary-color);
    transform: translateX(2px);
}

.user-profile-item i {
    width: 16px;
    color: #64748b;
    transition: color 0.2s ease;
    font-size: 14px;
}

.user-profile-item:hover i {
    color: var(--primary-color);
}

.user-profile-divider {
    height: 1px;
    background: rgba(30, 64, 175, 0.1);
    margin: 4px 0;
}

.logout-profile-item {
    color: #dc2626;
}

.logout-profile-item:hover {
    background: rgba(220, 38, 38, 0.05);
    color: #dc2626;
}

.logout-profile-item i {
    color: #dc2626;
}

/* Mobile sidebar - Seulement pour les très petits écrans */
@media (max-width: 480px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1001;
        width: 300px;
        min-width: 300px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        display: none;
        backdrop-filter: blur(4px);
    }
    
    .sidebar.open + .sidebar-overlay {
        display: block;
    }
    
    /* Bouton hamburger pour mobile */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1002;
        background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
        border: none;
        color: white;
        padding: 10px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    }
}
