/**
 * Estilos para o Sistema de Fallback de Imagens
 */

/* Imagem de fallback */
.fallback-image {
    opacity: 0.8;
    filter: grayscale(20%);
    border: 2px dashed #ccc;
    position: relative;
}

/* Tooltip para imagens de fallback */
.fallback-image::after {
    content: "🖼️ Imagem padrão";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.fallback-image:hover::after {
    opacity: 1;
}

/* Indicador visual para imagens que falharam */
.fallback-image::before {
    content: "⚠️";
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 100;
}

/* Estilos específicos para diferentes tipos de imagem */
.fallback-image[data-fallback="true"] {
    transition: all 0.3s ease;
}

/* Avatar de fallback */
.fallback-image.profile-avatar,
.fallback-image.img-profile,
.fallback-image.foto-obreiro,
.fallback-image.user-avatar {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* Header de fallback */
.fallback-image.profile-header,
.fallback-image.profile-cover,
.fallback-image.capa-preview {
    background: linear-gradient(135deg, #6c757d, #495057);
}

/* Álbum de fallback */
.fallback-image.album-image,
.fallback-image.foto-album,
.fallback-image.gallery-image {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

/* Logo de fallback */
.fallback-image.logo,
.fallback-image.brand-logo,
.fallback-image.company-logo {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #dee2e6;
}

/* Animações para imagens de fallback */
@keyframes fallbackPulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.fallback-image {
    animation: fallbackPulse 2s ease-in-out infinite;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .fallback-image::after {
        font-size: 8px;
        padding: 1px 6px;
    }
    
    .fallback-image::before {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

/* Estilos para imagens que estão carregando */
img[data-fallback-applied="true"]:not(.fallback-image) {
    transition: opacity 0.3s ease;
}

/* Estilos para imagens com erro */
img[data-fallback-applied="true"].fallback-image {
    cursor: help;
}

/* Estilos para imagens em carregamento */
img:not([data-fallback-applied="true"]) {
    opacity: 0.7;
}

/* Estilos para imagens carregadas com sucesso */
img[data-fallback-applied="true"]:not(.fallback-image) {
    opacity: 1;
}
