/**
 * Styles pour le lazy loading des images
 * Group New Mak Corporation
 * Développé par Yves NSIMBA
 */

/* Image en cours de chargement */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

/* Image chargée */
img.loaded {
    opacity: 1;
    background: none;
    animation: none;
}

/* Image en erreur */
img.error {
    opacity: 0.5;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

/* Animation de chargement */
@keyframes loading {
    0% { 
        background-position: 200% 0; 
    }
    100% { 
        background-position: -200% 0; 
    }
}

/* Placeholder pour les images */
.lazy-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
    min-height: 200px;
}

/* Optimisation pour les images du hero */
.hero-img img.lazy {
    min-height: 400px;
    background: linear-gradient(135deg, #215C5C 0%, #CCE8C9 100%);
}

/* Optimisation pour les images de services */
.service-img img.lazy {
    min-height: 250px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Optimisation pour les images de galerie */
.gallery-img img.lazy {
    min-height: 200px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-img img.lazy {
        min-height: 300px;
    }
    
    .service-img img.lazy {
        min-height: 200px;
    }
    
    .gallery-img img.lazy {
        min-height: 150px;
    }
}

/* Amélioration de l'accessibilité */
img.lazy:focus {
    outline: 2px solid #215C5C;
    outline-offset: 2px;
}

/* Préchargement des images critiques */
.preload-critical {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Optimisation pour les images WebP */
@supports (background-image: url('data:image/webp;base64,UklGRhoBAABXRUJQVlA4TA4BAABwAQCdASoBAAEALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA')) {
    img.lazy {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    }
}
