/* Styles pour les avatars utilisateur - Responsifs et modernes */

/* ===== AVATAR DE BASE ===== */
.user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== AVATAR AVEC IMAGE ===== */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.user-avatar:hover .avatar-img {
    transform: scale(1.05);
}

/* ===== AVATAR AVEC INITIALE ===== */
.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* ===== AVATAR AVEC STATUT EN LIGNE ===== */
.avatar-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.avatar-status.online {
    background: #10b981;
}

.avatar-status.offline {
    background: #9ca3af;
}

.avatar-status.busy {
    background: #ef4444;
}

.avatar-status.away {
    background: #f59e0b;
}

/* ===== TAILLES D'AVATAR ===== */
.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.avatar-xl {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

.avatar-2xl {
    width: 64px;
    height: 64px;
    font-size: 20px;
}

.avatar-3xl {
    width: 80px;
    height: 80px;
    font-size: 24px;
}

/* ===== COULEURS D'AVATAR PAR DÉFAUT ===== */
.avatar-default {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

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

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

.avatar-user {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

/* ===== AVATAR AVEC BORDURE ===== */
.avatar-bordered {
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-bordered.avatar-bordered-primary {
    border-color: #3b82f6;
}

.avatar-bordered.avatar-bordered-success {
    border-color: #10b981;
}

.avatar-bordered.avatar-bordered-warning {
    border-color: #f59e0b;
}

.avatar-bordered.avatar-bordered-danger {
    border-color: #ef4444;
}

/* ===== AVATAR AVEC BADGE ===== */
.avatar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== AVATAR AVEC LOADING ===== */
.avatar-loading {
    position: relative;
    overflow: hidden;
}

.avatar-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: avatar-shimmer 1.5s infinite;
}

@keyframes avatar-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== AVATAR AVEC TOOLTIP ===== */
.avatar-tooltip {
    position: relative;
    cursor: help;
}

.avatar-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.avatar-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.avatar-tooltip:hover::after,
.avatar-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .avatar-3xl {
        width: 64px;
        height: 64px;
        font-size: 20px;
    }
    
    .avatar-2xl {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }
    
    .avatar-xl {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .avatar-lg {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .avatar-md {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ===== ANIMATIONS ===== */
.avatar-pulse {
    animation: avatar-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes avatar-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.avatar-bounce {
    animation: avatar-bounce 1s infinite;
}

@keyframes avatar-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* ===== AVATAR GROUP (pour afficher plusieurs avatars) ===== */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .user-avatar {
    margin-left: -8px;
    border: 2px solid white;
}

.avatar-group .user-avatar:first-child {
    margin-left: 0;
}

.avatar-group .user-avatar:hover {
    z-index: 10;
    transform: scale(1.1);
}

/* ===== AVATAR AVEC FALLBACK ===== */
.avatar-fallback {
    position: relative;
}

.avatar-fallback .avatar-img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.avatar-fallback .avatar-initial {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-fallback.avatar-fallback-show .avatar-img {
    opacity: 0;
}

.avatar-fallback.avatar-fallback-show .avatar-initial {
    opacity: 1;
}
