/* ============================================
   SIDEBAR USER MENU - Menu utilisateur intégré
   ============================================ */

/* Footer de la sidebar (en bas) */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* Menu utilisateur */
.sidebar-user-menu {
    position: relative;
}

/* Trigger (élément cliquable) */
.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    width: 100%;
}

.sidebar-user-trigger:hover {
    background: rgba(59, 130, 246, 0.1);
}

.sidebar-user-trigger.active {
    background: rgba(59, 130, 246, 0.15);
}

/* Avatar */
.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.5);
    object-fit: cover;
    flex-shrink: 0;
}

/* Infos utilisateur */
.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-plan {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Flèche */
.sidebar-user-arrow {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar-user-trigger.active .sidebar-user-arrow {
    transform: rotate(180deg);
}

/* Dropdown (s'ouvre vers le haut) */
.sidebar-user-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.sidebar-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.user-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.user-dropdown-details {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-email {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
}

/* Links */
.user-dropdown-links {
    padding: 0.5rem;
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-dropdown-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
}

.user-dropdown-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.user-dropdown-link:hover i {
    color: #3b82f6;
}

/* Logout button */
.user-dropdown-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: none;
    background: transparent;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 12px 12px;
    transition: all 0.3s ease;
    text-align: left;
}

.user-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-logout i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Sidebar collapsed (réduite) */
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-arrow {
    display: none;
}

.sidebar.collapsed .sidebar-user-trigger {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-user-dropdown {
    left: calc(100% + 0.5rem);
    right: auto;
    bottom: 0;
    width: 280px;
    transform: translateX(-10px);
}

.sidebar.collapsed .sidebar-user-dropdown.active {
    transform: translateX(0);
}

/* Dark mode */
body.dark-mode .sidebar-user-dropdown {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .sidebar-user-trigger:hover {
    background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .user-dropdown-divider {
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar-footer {
        position: relative;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0.75rem;
    }
    
    .sidebar-user-dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    
    .sidebar-user-dropdown.active {
        transform: translateY(0);
    }
}

/* Animation supplémentaire */
@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-user-dropdown.active {
    animation: slideUpFadeIn 0.3s ease;
}