/**
 * Estilos padronizados para fotos/avatares de usuários
 * Garante consistência em toda a aplicação
 */

/* ===== TAMANHO GRANDE (Perfil, Edição) ===== */
.avatar-lg,
.avatar-large,
.profile-avatar,
#avatarPreview {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    display: block !important;
    flex-shrink: 0;
}

/* ===== TAMANHO MÉDIO (Listas buscáveis, Cards gerenciais) ===== */
.avatar-md,
.avatar-profile {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ===== TAMANHO PEQUENO (Listas, Tabelas) ===== */
.avatar-sm,
.avatar-small {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ===== TAMANHO MICRO (Badges, Thumbnails) ===== */
.avatar-xs,
.avatar-thumb {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ===== TAMANHO ÍCONE (Listas de usuários) ===== */
.avatar-icon,
.avatar-tiny {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ===== PREVIEW DURANTE EDIÇÃO ===== */
.avatar-drop {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 250px;
    overflow: hidden;
}

.avatar-drop:hover,
.avatar-drop.drag-over {
    border-color: #764ba2;
    background: #eef2ff;
}

.avatar-drop img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    margin-bottom: 1rem;
    border: 2px solid #667eea;
    flex-shrink: 0;
}

.avatar-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ===== ESTILOS DE CONTAINER ===== */
.avatar-wrapper {
    display: inline-block;
    flex-shrink: 0;
}

.avatar-with-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-with-name .avatar-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.avatar-with-name .avatar-info .name {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.avatar-with-name .avatar-info .role {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ===== ESTILOS DE PLACEHOLDER ===== */
.avatar-placeholder,
.avatar-placeholder-lg,
.avatar-placeholder-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.avatar-placeholder-lg {
    width: 120px;
    height: 120px;
    font-size: 2rem;
}

.avatar-placeholder-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

/* ===== ESTILOS DE BORDA/DESTAQUE ===== */
.avatar-bordered {
    border: 2px solid #e9ecef;
}

.avatar-highlighted {
    border: 2px solid #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 576px) {
    .avatar-lg {
        width: 80px !important;
        height: 80px !important;
        max-width: 80px !important;
        max-height: 80px !important;
    }
    
    .avatar-placeholder-lg {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
}

/* ===== UTILITÁRIOS ===== */
.avatar-inline {
    display: inline-block;
    margin-right: 0.5rem;
}

.avatar-stack {
    display: flex;
    flex-direction: row;
    gap: -0.5rem;
}

.avatar-stack img {
    margin-left: -0.5rem;
    border: 2px solid white;
}

.avatar-stack img:first-child {
    margin-left: 0;
}
