/**
 * Avatar Tooltip Styles
 * Universal avatar display with hover tooltips
 * Version: 1.0
 * Date: 2025-11-27
 */

/* ===== Avatar Sizes ===== */

.user-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #e2e8f0);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.avatar-tiny {
    width: 24px;
    height: 24px;
    border-width: 1px;
}

.avatar-small {
    width: 36px;
    height: 36px;
}

.avatar-medium {
    width: 48px;
    height: 48px;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-width: 3px;
}

/* ===== Avatar with Tooltip Container ===== */

.avatar-with-tooltip {
    position: relative;
    display: inline-block;
}

/* ===== Tooltip Styles ===== */

.avatar-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.avatar-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-tooltip.tooltip-top {
    transform: translateY(10px);
}

.avatar-tooltip.tooltip-top.show {
    transform: translateY(0);
}

/* Tooltip arrow */
.avatar-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--card-bg, white);
}

.avatar-tooltip.tooltip-top::before {
    bottom: auto;
    top: 100%;
    border-bottom: none;
    border-top: 8px solid var(--card-bg, white);
}

/* Tooltip content */

.tooltip-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 8px;
}

.tooltip-header strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.tooltip-username {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

.tooltip-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.tooltip-item {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-bio {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    padding: 8px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 6px;
    margin-bottom: 8px;
}

.tooltip-hint {
    font-size: 11px;
    color: var(--primary-color, #6366f1);
    text-align: center;
    font-style: italic;
}

/* ===== Avatar Group (Stacked Avatars) ===== */

.avatar-group {
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.avatar-group .avatar-with-tooltip {
    margin-left: -8px;
    transition: all 0.2s ease;
}

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

.avatar-group .avatar-with-tooltip:hover {
    z-index: 10;
    transform: translateY(-2px);
}

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

.avatar-more {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-left: -8px;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-more:hover {
    transform: scale(1.1);
    background: var(--primary-hover, #5558e3);
}

/* ===== Dark Theme Support ===== */

body.dark-theme .avatar-tooltip {
    background: var(--card-bg-dark, #1e293b);
    border-color: var(--border-color-dark, #334155);
}

body.dark-theme .avatar-tooltip::before {
    border-bottom-color: var(--card-bg-dark, #1e293b);
}

body.dark-theme .avatar-tooltip.tooltip-top::before {
    border-top-color: var(--card-bg-dark, #1e293b);
}

body.dark-theme .tooltip-header {
    border-bottom-color: var(--border-color-dark, #334155);
}

body.dark-theme .tooltip-header strong {
    color: var(--text-primary-dark, #f1f5f9);
}

body.dark-theme .tooltip-bio {
    background: var(--bg-secondary-dark, #0f172a);
}

body.dark-theme .avatar-group .user-avatar {
    border-color: var(--card-bg-dark, #1e293b);
}

body.dark-theme .avatar-more {
    border-color: var(--card-bg-dark, #1e293b);
}

/* ===== Christmas Theme Support ===== */

body.christmas-theme .avatar-tooltip {
    border-color: #fbbf24;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.2);
}

body.christmas-theme .user-avatar:hover {
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .avatar-tooltip {
        min-width: 180px;
        max-width: 240px;
        padding: 10px;
    }
    
    .tooltip-header strong {
        font-size: 14px;
    }
    
    .tooltip-item,
    .tooltip-username {
        font-size: 12px;
    }
    
    .tooltip-bio {
        font-size: 11px;
    }
    
    .tooltip-hint {
        font-size: 10px;
    }
    
    .avatar-large {
        width: 64px;
        height: 64px;
    }
    
    .avatar-medium {
        width: 40px;
        height: 40px;
    }
    
    .avatar-small {
        width: 32px;
        height: 32px;
    }
}

/* ===== Animation ===== */

@keyframes avatarPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.user-avatar.online {
    animation: avatarPulse 2s infinite;
}

/* ===== Status Indicator ===== */

.avatar-with-tooltip .avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--card-bg, white);
    background: #10b981;
}

.avatar-with-tooltip .avatar-status.offline {
    background: #94a3b8;
}

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