.online-users-widget {
    position: fixed;
    bottom: 5.5rem;
    left: 2rem;
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    width: 300px;
    z-index: 999;
    display: none;
    transition: all 0.3s ease;
    margin-top: 250px; /* Espace pour les boutons flottants */
}

.online-users-widget.visible {
    display: block;
}

.online-users-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.online-users-count {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

.online-users-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

/* Style pour le badge de compteur d'utilisateurs en ligne */
.users-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
    z-index: 10;
}

/* Animation de pulsation pour attirer l'attention */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
}

/* Animation pour signaler un changement de valeur */
.pulse-once {
    animation: pulse-once 0.5s ease-out;
}

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

/* Ajuster la position du bouton flottant */
.floating-button {
    position: relative;
}

/* Style pour le widget des utilisateurs en ligne */
.online-users-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
}

.online-users-widget.visible {
    display: flex;
}

.online-users-header {
    padding: 15px;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.online-users-header h3 {
    margin: 0;
    font-size: 16px;
}

.online-users-count {
    background-color: white;
    color: var(--secondary-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.online-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar {
    display: none; /* Masquer l'avatar comme demandé */
}

.user-info {
    flex: 1;
    padding: 3px 0;
}

.user-name-container {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.user-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    background-color: #4CAF50;
}

.status-dot.away {
    background-color: #FFC107;
}

.status-dot.offline {
    background-color: #9E9E9E;
}

.user-activity {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    margin-left: 18px; /* Aligner avec le texte du nom (10px dot + 8px marge) */
    font-style: italic;
}

.no-users, .error-message {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Indicateur de chargement */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #4a6cf7;
    font-size: 14px;
}

.loading-indicator i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style pour les messages d'erreur */
.error-message {
    background-color: #ffebee;
    border-radius: 6px;
    padding: 15px;
    color: #e53935;
    text-align: center;
    margin: 10px;
    font-style: normal;
}

.error-message i {
    font-size: 18px;
    margin-bottom: 8px;
    display: block;
}

.error-details {
    font-size: 12px;
    margin-top: 8px;
    color: #d32f2f;
    word-break: break-word;
} 

.sidebar.collapsed .online-users-widget {
    left: 17px;
}

.sidebar.collapsed .floating-buttons {
    left: 1rem;
}