/* Video Optimization Styles - Faster Loading */

/* Video loading state */
.hero-video {
    transition: opacity 0.5s ease;
}

.hero-video[data-loading="true"] {
    opacity: 0;
}

.hero-video[data-loading="false"] {
    opacity: 1;
}

/* Video poster optimization */
.hero-video[poster] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Loading placeholder for videos */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -2;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.hero-slide[data-video-loaded="true"]::before {
    opacity: 0;
}

/* Video optimization attributes */
.hero-video {
    will-change: opacity;
    transform: translateZ(0); /* Hardware acceleration */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Smooth video transitions */
.hero-video {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Prevent video flicker */
.hero-video {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Optimize video rendering */
.hero-video {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Video preload optimization */
.hero-video[preload="auto"] {
    /* High priority video */
}

.hero-video[preload="metadata"] {
    /* Low priority video - load metadata only */
}

/* Loading spinner for videos */
.hero-slide[data-video-loading="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hide loading spinner when video is ready */
.hero-slide[data-video-ready="true"]::after {
    display: none;
}

/* Video fade-in effect */
.hero-video {
    animation: videoFadeIn 0.5s ease-in;
}

@keyframes videoFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Optimize video for mobile */
@media (max-width: 768px) {
    .hero-video {
        /* Reduce quality on mobile for faster loading */
        image-rendering: auto;
    }
}

/* Prevent video from blocking render */
.hero-video {
    content-visibility: auto;
    contain-intrinsic-size: 100vw 100vh;
}

