/*
 * Lazy Loading CSS
 * These styles control the appearance of lazy-loaded images and their placeholders
 */

/* Image placeholder - gray background with shimmer effect */
.img-placeholder {
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
    margin: 0 auto;
}

/* Dark mode version of placeholder */
[data-bs-theme="dark"] .img-placeholder {
    background: #2a2a2a;
}

/* Shimmer animation effect for placeholders */
.img-placeholder::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

/* Dark mode version of shimmer */
[data-bs-theme="dark"] .img-placeholder::before {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Images inside placeholders */
.img-placeholder img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
}

/* Once the image is loaded */
.img-placeholder.loaded::before {
    display: none;
}

.img-placeholder img.loaded, 
.img-placeholder.loaded img {
    opacity: 1;
}

/* Shimmer animation */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* For small screens, ensure placeholders don't take too much space */
@media (max-width: 576px) {
    .img-placeholder {
        max-width: 100%;
    }
}