/**
 * Lazy Loading Styles
 * أنماط للصور التي يتم تحميلها بشكل كسول
 */

/* Lazy Image Base */
img.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #f0f0f0;
    background-image:
        linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Lazy Image Loading */
img.lazy-loading {
    opacity: 0.5;
    filter: blur(5px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Lazy Image Loaded */
img.lazy-loaded {
    opacity: 1;
    filter: none;
    animation: none;
    background: none;
}

/* Lazy Image Error */
img.lazy-error {
    opacity: 1;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

img.lazy-error::after {
    content: '⚠️';
    position: absolute;
    font-size: 2rem;
    opacity: 0.5;
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Dark Mode */
.dark-mode img.lazy-image {
    background: #2a2a2a;
    background-image:
        linear-gradient(90deg, #2a2a2a 0px, #3a3a3a 40px, #2a2a2a 80px);
    background-size: 200px 100%;
}

.dark-mode img.lazy-error {
    background: rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    img.lazy-loading {
        filter: blur(3px);
    }
}