/* ==================== */
/* LAZY LOADING STYLES */
/* ==================== */

/* Lazy sections - hidden until loaded */
.lazy-section {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
}

.lazy-section.section-loaded {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Lazy images - blur until loaded */
img[data-src],
img[data-srcset] {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

img.loaded {
    filter: blur(0);
}

/* Background images */
[data-bg] {
    background-color: var(--bg-secondary, #f0f0f0);
    transition: background-image 0.3s ease;
}

[data-bg].bg-loaded {
    background-color: transparent;
}

/* Reduced animations for low-performance devices */
.reduced-animations *,
.reduced-animations *::before,
.reduced-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Priority content - load immediately */
.priority-loaded {
    opacity: 1 !important;
    transform: none !important;
}

/* Loading skeleton for images */
img[data-src]::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Defer heavy effects */
body:not(.effects-ready) .particles-container,
body:not(.effects-ready) #matrix-canvas,
body:not(.effects-ready) .custom-cursor,
body:not(.effects-ready) .custom-cursor-dot {
    display: none !important;
}

/* Loading state for iframes */
iframe[data-src] {
    background: var(--bg-secondary, #f0f0f0);
    min-height: 400px;
}

/* Smooth reveal for lazy content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-loaded {
    animation: fadeInUp 0.6s ease-out;
}

/* Performance optimizations */
.lazy-section * {
    will-change: auto;
}

.section-loaded * {
    will-change: transform, opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .lazy-section,
    .section-loaded {
        animation: none !important;
        transition: none !important;
    }
    
    img[data-src],
    img.loaded {
        filter: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lazy-section {
        transform: translateY(20px);
    }
    
    img[data-src] {
        filter: blur(5px);
    }
}

