/* Styles additionnels pour le lazy loading */
/* Ajoutez ces styles à votre fichier CSS gallery.css existant */

/* Indicateur de chargement */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner p {
    margin: 0;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

/* Animation du spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Informations de pagination */
.pagination-info {
    text-align: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    border-radius: 8px;
    margin: 20px auto;
    max-width: 500px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.pagination-info p {
    margin: 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
}

.load-more-hint {
    color: #3498db;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Optimisations pour les images avec lazy loading */
.gallery .img-link {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery .img-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery .img-link img {
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 100%;
    height: auto;
    display: block;
}

/* État de chargement des images lazy */
.gallery .img-link img[loading="lazy"] {
    min-height: 200px;
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading-background 2s linear infinite;
}

@keyframes loading-background {
    0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
}

/* Amélioration du bouton "more" */
.gallery .img-link .btn.more {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(5px);
}

.gallery .img-link:hover .btn.more {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive design pour mobile */
@media (max-width: 768px) {
    .loading-indicator {
        margin: 10px;
        padding: 30px 15px;
        max-width: 280px;
    }
    
    .pagination-info {
        margin: 15px 10px;
        padding: 12px 15px;
    }
    
    .pagination-info p {
        font-size: 13px;
    }
    
    .gallery .img-link img[loading="lazy"] {
        min-height: 150px;
    }
}

/* Animation d'apparition des nouvelles images */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery .img-link.new-loaded {
    animation: fadeInUp 0.6s ease-out;
}

/* Amélioration de l'état de hover sur les images */
.gallery .img-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery .img-link:hover::before {
    opacity: 1;
}

/* Style pour les messages d'erreur de chargement */
.loading-error {
    text-align: center;
    padding: 20px;
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: #c0392b;
    margin: 20px auto;
    max-width: 400px;
}

.loading-error p {
    margin: 0;
    font-weight: 500;
}

/* Animation de pulsation pour l'indicateur de chargement */
.loading-indicator.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
    }
    100% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.1);
    }
}
