/**
 * YouTube Video Optimizer Styles
 */

/* Poster container */
.yvo-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

/* Play button overlay */
.yvo-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.yvo-poster:hover .yvo-play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Loading state */
.yvo-poster.yvo-loading {
    cursor: wait;
}

.yvo-poster.yvo-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: yvo-spin 0.8s linear infinite;
}

.yvo-poster.yvo-loading .yvo-play-button {
    opacity: 0;
}

@keyframes yvo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade out animation */
.yvo-poster.yvo-fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Ensure video is behind poster initially */
.elementor-background-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Dark overlay for better text readability */
.yvo-poster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.yvo-play-button {
    z-index: 2;
}

/* Loading indicator in corner */
.yvo-poster.yvo-loading::before {
    background: rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .yvo-play-button {
        width: 54px;
        height: 38px;
    }
    
    .yvo-poster.yvo-loading::after {
        width: 30px;
        height: 30px;
        margin: -15px 0 0 -15px;
        border-width: 2px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .yvo-poster,
    .yvo-play-button,
    .yvo-poster.yvo-loading::after {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .yvo-poster::before {
        background: rgba(0, 0, 0, 0.5);
    }
    
    .yvo-play-button {
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .yvo-poster,
    .elementor-background-video-container iframe {
        display: none;
    }
}
