/**
 * ========================================
 * IMAGES OPTIMIZATION
 * Otimização e tratamento de imagens
 * ========================================
 */

/* ===== IMAGENS GERAIS ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: all 0.4s ease;
}

img:not([src]),
img[src=""],
img.img-broken {
    background: linear-gradient(135deg, #E9C3FA 0%, #DEB3F0 100%);
    background-size: 200% 200%;
    animation: shimmer 2s infinite;
    color: #5D3E8B;
    padding: 2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    min-height: 200px;
    width: 100%;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== CARD IMAGES ===== */
.card-img-top,
.card-img-social {
    object-fit: cover;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-img-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:hover .card-img-top,
.card:hover .card-img-social {
    transform: scale(1.08);
    filter: brightness(1.1) saturate(1.1);
}

/* ===== RESPONSIVE IMAGES ===== */
img.img-fluid {
    max-width: 100%;
    height: auto;
}

img.img-thumbnail {
    border: 2px solid rgba(233, 195, 250, 0.3);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    transition: all 0.3s ease;
}

img.img-thumbnail:hover {
    border-color: #B300E6;
    box-shadow: 0 4px 12px rgba(179, 0, 230, 0.15);
}

/* ===== IMAGENS COM SOMBRAS ===== */
img[class*="shadow"] {
    filter: drop-shadow(0 4px 12px rgba(93, 62, 139, 0.15));
}

img[class*="shadow"]:hover {
    filter: drop-shadow(0 8px 20px rgba(93, 62, 139, 0.25));
}

/* ===== LAZY LOAD PLACEHOLDER ===== */
img[loading="lazy"] {
    background: linear-gradient(90deg, #E9C3FA 33%, #DEB3F0 50%, #E9C3FA 66%);
    background-size: 0% 0%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

img[loading="lazy"] {
    background-color: transparent;
}

/* ===== LOGO IMAGES ===== */
.navbar-brand img {
    transition: none !important;
    filter: none !important;
    background-color: transparent !important;
}

.navbar-brand:hover img {
    filter: none !important;
    transform: none !important;
    background-color: transparent !important;
}

/* ===== HERO IMAGES ===== */
.hero-img,
.section-img {
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(93, 62, 139, 0.15);
    transition: all 0.4s ease;
}

.hero-img:hover,
.section-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(93, 62, 139, 0.25);
}

/* ===== IMAGEM BACKGROUND FALLBACK ===== */
img[style*="background"] {
    background-size: cover;
    background-position: center;
}

/* ===== CAROUSEL IMAGES ===== */
.carousel-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ===== GALLERY IMAGES ===== */
.gallery-img,
.portfolio-img {
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-img:hover,
.portfolio-img:hover {
    transform: scale(1.05) rotate(0.5deg);
    box-shadow: 0 8px 20px rgba(93, 62, 139, 0.2);
}

/* ===== CIRCULAR IMAGES ===== */
img.rounded-circle {
    border: 3px solid rgba(233, 195, 250, 0.5);
    transition: all 0.3s ease;
}

img.rounded-circle:hover {
    border-color: #B300E6;
    box-shadow: 0 0 0 8px rgba(179, 0, 230, 0.1);
    transform: scale(1.05);
}

/* ===== IMAGEM COM OVERLAY ===== */
.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay img {
    display: block;
    width: 100%;
}

.img-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(93, 62, 139, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-overlay:hover::after {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .card-img-top,
    .card-img-social {
        min-height: 180px;
    }

    img[class*="shadow"] {
        filter: drop-shadow(0 2px 8px rgba(93, 62, 139, 0.1));
    }

    .gallery-img:hover,
    .portfolio-img:hover {
        transform: scale(1.02);
    }
}

@media (max-width: 480px) {
    img:not([src]),
    img[src=""] {
        min-height: 150px;
    }

    .card-img-top,
    .card-img-social {
        min-height: 150px;
    }

    .img-thumbnail {
        padding: 0.25rem;
    }
}
