/**
 * Lazy Loading Styles for DrnkSync
 */

/* Base state for lazy images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Loading state */
img.lazy-loading {
    opacity: 0.5;
    filter: blur(5px);
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lazy-shimmer 1.5s infinite;
}

/* Loaded state */
img.lazy-loaded {
    opacity: 1;
    filter: none;
    animation: lazy-fade-in 0.3s ease-in-out;
}

/* Error state */
img.lazy-error {
    opacity: 0.3;
    filter: grayscale(100%);
}

/* Loading animation */
@keyframes lazy-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Fade in animation */
@keyframes lazy-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Placeholder for profile pictures */
.lazy-profile-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(45deg, var(--neon-pink, #e91e63), var(--neon-purple, #9c27b0));
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Gallery specific lazy loading */
.photo-gallery img[data-src] {
    min-height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Responsive image container */
.lazy-img-container {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.lazy-img-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: lazy-skeleton 1.5s infinite;
    z-index: 1;
}

.lazy-img-container img.lazy-loaded + ::before {
    display: none;
}

@keyframes lazy-skeleton {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}