/**
 * Lazy Loading CSS
 * Fade-in efekti ve placeholder stilleri
 */

/* Lazy load placeholder */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Yüklenen görsel */
img.lazy-loaded,
img:not([data-src]) {
    opacity: 1;
    animation: none;
    background: none;
}

/* Shimmer animasyonu (skeleton loading) */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Background lazy load */
[data-bg] {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    transition: background-image 0.3s ease-in-out;
}

[data-bg].lazy-loaded {
    animation: none;
}

/* Blur-up placeholder efekti (opsiyonel) */
.blur-up {
    filter: blur(10px);
    transition: filter 0.5s ease-out;
}

.blur-up.lazy-loaded {
    filter: blur(0);
}

/* Aspect ratio koruması */
.lazy-wrapper {
    position: relative;
    overflow: hidden;
}

.lazy-wrapper.ratio-16-9 {
    padding-bottom: 56.25%;
}

.lazy-wrapper.ratio-4-3 {
    padding-bottom: 75%;
}

.lazy-wrapper.ratio-1-1 {
    padding-bottom: 100%;
}

.lazy-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* WebP badge (geliştirme için) */
.webp-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 128, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    z-index: 10;
}
