/**
 * Video Curtain Overlay for Support Pages
 *
 * Adds high-quality thumbnail overlay to video player that shows before iframe loads.
 * Improves perceived quality and page load performance (iframes lazy-load on click).
 */

/* Override existing .embed-container styles from sureflap.less */
.youtubeVids .embed-container {
    position: relative;
    width: 100%;
    height: 310px !important; /* Match iframe height, override padding-bottom hack */
    padding-bottom: 0 !important; /* Remove aspect ratio hack */
    overflow: visible !important; /* Allow play button to show */
}

/* High-quality thumbnail overlay */
.video-curtain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #000;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
    display: block !important; /* Override any display:none */
}

.video-curtain.hidden {
    display: none !important;
}

.video-curtain:hover {
    opacity: 0.95;
}

/* Remove duplicate - already added above */

/* YouTube play button overlay */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(33, 33, 33, 0.8);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.video-curtain:hover .play-button {
    background-color: rgba(255, 0, 0, 0.9);
}

/* Play button triangle */
.play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #fff;
}

/* Video iframe */
.video-iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

.video-iframe.hidden {
    display: none;
}

.video-iframe.playing {
    display: block;
    z-index: 15; /* Above curtain when playing */
}

/* Loading state for iframe */
.video-iframe[src=""] {
    background: #000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .play-button {
        width: 56px;
        height: 40px;
    }

    .play-button::before {
        border-width: 8px 0 8px 16px;
    }
}

/* Accessibility: Focus state */
.video-curtain:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Print: Hide video elements */
@media print {
    .video-curtain,
    .video-iframe {
        display: none;
    }
}
