/**
 * Video Viewport Autoplay - Frontend Styles
 *
 * @package VideoViewportAutoplay
 * @since 1.0.0
 */

/* Video transition effects */
.video-viewport-autoplay-enabled video {
    transition: opacity 0.3s ease-in-out;
}

.video-viewport-autoplay-enabled video.vva-paused {
    opacity: 0.8;
}

.video-viewport-autoplay-enabled video.vva-playing {
    opacity: 1;
}

/* Loading state */
.vva-loading {
    position: relative;
}

.vva-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: vva-spin 1s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vva-loading.vva-initializing::after {
    opacity: 1;
}

/* Keyframes */
@keyframes vva-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .video-viewport-autoplay-enabled video,
    .vva-loading::after {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .vva-loading::after {
        border-color: currentColor;
        border-top-color: transparent;
    }
}

/* Focus states for accessibility */
.video-viewport-autoplay-enabled video:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}