/* 🚀 MODERN VIDEO PERFORMANCE OPTIMIZATIONS */

.avt-video-container {
    position: relative;
    width: 100vw;
    height: 60vh;
    background: #000;
    overflow: visible;
    margin: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    /* 🚀 PERFORMANCE: Hardware acceleration */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
}

.avt-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 🚀 PERFORMANCE: Optimized rendering */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    /* 🚀 PERFORMANCE: Smooth playback */
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 🚀 PERFORMANCE: Reduced memory usage */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 🚀 NO LOADING SPINNER - IMMEDIATE POSTER DISPLAY */
.avt-video-container {
    /* 🚀 ALWAYS SHOW POSTER FIRST */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.avt-video-container video {
    /* 🚀 ENSURE POSTER IS VISIBLE IMMEDIATELY */
    background: transparent;
}

.avt-video-container video[poster] {
    /* 🚀 POSTER SHOULD BE VISIBLE */
    object-fit: cover;
}

/* 🚀 HIDE LOADING SPINNER COMPLETELY */
.avt-video-container.loading::before {
    display: none;
}

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

/* 🚀 PLAY BUTTON FOR AUTOPLAY RESTRICTIONS */
.avt-video-container.play-required::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 115, 170, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.avt-video-container.play-required:hover::after {
    background: rgba(0, 115, 170, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 🚀 RESPONSIVE SYSTEM: PHP renders all values, CSS only handles transitions */
.avt-layer-container {
    transition: transform 0.3s ease;
}

.avt-layer-container .avt-text-element {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

/* 🚀 FORCE OVERRIDE: JavaScript responsive styles */
.avt-layer-container.avt-responsive-override {
    transform: var(--avt-transform) !important;
}

.avt-layer-container.avt-responsive-override .avt-text-element {
    color: var(--avt-color) !important;
    font-size: var(--avt-font-size) !important;
    font-weight: var(--avt-font-weight) !important;
    font-family: var(--avt-font-family) !important;
}

/* Background element inside container */
.avt-bg-element {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 0;
    z-index: 1;
    opacity: 1;
    overflow: visible !important;
    width: 500px;
    height: 300px;
    min-height: 200px;
    min-width: 300px;
    will-change: transform, opacity;
    pointer-events: none;
}

.avt-layer-container.avt-responsive-override .avt-bg-element {
    width: var(--avt-bg-width) !important;
    height: var(--avt-bg-height) !important;
    transform: var(--avt-bg-transform) !important;
}

/* 🚀 RESPONSIVE VIDEO OPTIMIZATIONS */
@media (max-width: 768px) {
    .avt-video-container {
        height: 50vh;
    }
    
    .avt-video-container video {
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    .avt-video-container {
        height: 40vh;
    }
}

/* 🚀 PERFORMANCE: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .avt-video-container video {
        animation: none;
    }
    
    .avt-video-container.loading::before {
        animation: none;
    }
    
    .avt-layer-container {
        transition: none;
    }
}

/* 🚀 ACCESSIBILITY: High contrast mode */
@media (prefers-contrast: high) {
    .avt-video-container::after {
        border: 2px solid white;
    }
}

/* 🚀 PERFORMANCE: Optimize for low-end devices */
@media (max-width: 320px) {
    .avt-video-container {
        height: 35vh;
    }
    
    .avt-video-container video {
        object-fit: cover;
        image-rendering: pixelated;
    }
}

/* Scroll Arrow Styles for Frontend */
.avt-scroll-arrow {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.avt-scroll-arrow:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.avt-scroll-arrow:active {
    transform: scale(0.95);
}

/* Bounce animation for scroll arrow */
@keyframes avt-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    40% {
        transform: translate(-50%, -50%) translateY(-30px);
    }
    60% {
        transform: translate(-50%, -50%) translateY(-15px);
    }
}

.avt-scroll-arrow.bounce {
    animation: avt-bounce 2s infinite !important;
}

/* Slider End Marker */
.avt-slider-end-marker {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
} 