/**
 * VAST Pre-Roll Video Ad Overlay - Responsive Sizing Stylesheet
 * Ensures 100% pixel-perfect fit over responsive 16:9 iframe containers (.hscp-video-container).
 */

/* Force parent container to establish relative positioning if not already */
.vast-has-overlay {
    position: relative !important;
}

/* Master Overlay Wrapper - Exact 1:1 match to the iframe */
.vast-overlay-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background: #000000 !important;
    border-radius: inherit !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease-out, visibility 0.35s ease-out !important;
}

/* Dismissed / Fade-out state */
.vast-overlay-wrapper.vast-dismissed {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Video Mount Inner Container */
.vast-player-inner {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

/* Fluid Player Internal Wrapper Overrides - Forces 100% fill without collapse */
.vast-overlay-wrapper .fluid_video_wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: inherit !important;
    overflow: hidden !important;
}

/* Force video element to fill canvas with clean aspect-ratio preservation */
.vast-overlay-wrapper video,
.vast-overlay-wrapper .fluid_video_wrapper video,
.vast-overlay-wrapper .fluid_video_wrapper .fluid_video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000000 !important;
}

/* Fluid Player Controls & VAST Ad Controls Responsive Adjustments */
.vast-overlay-wrapper .fluid_ad_countdown,
.vast-overlay-wrapper .fluid_controls_container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    z-index: 10000 !important;
}

/* Click-To-Play Poster Overlay */
.vast-poster-cover {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10001 !important;
    background-color: #0b0c10 !important;
    transition: opacity 0.25s ease-out !important;
}

.vast-poster-cover.vast-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.vast-poster-cover::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.4) !important;
    pointer-events: none !important;
}

/* Stylish Play Button Matching Theme Accent */
.vast-play-btn {
    position: relative !important;
    z-index: 2 !important;
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    background: #74143B !important; /* Theme Burgundy */
    border: 3px solid #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(116, 20, 59, 0.7) !important;
    animation: vast-pulse 2s infinite !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, background-color 0.2s ease !important;
}

.vast-play-btn:hover {
    transform: scale(1.1) !important;
    background: #961d4e !important;
}

.vast-play-icon {
    width: 0 !important;
    height: 0 !important;
    border-top: 14px solid transparent !important;
    border-bottom: 14px solid transparent !important;
    border-left: 22px solid #ffffff !important;
    margin-left: 4px !important;
}

@keyframes vast-pulse {
    0% {
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(116, 20, 59, 0.7);
    }
    70% {
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7), 0 0 0 16px rgba(116, 20, 59, 0);
    }
    100% {
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(116, 20, 59, 0);
    }
}

/* Mobile Responsive Optimization (<= 640px) */
@media (max-width: 640px) {
    .vast-play-btn {
        width: 58px !important;
        height: 58px !important;
    }
    .vast-play-icon {
        border-top: 11px solid transparent !important;
        border-bottom: 11px solid transparent !important;
        border-left: 17px solid #ffffff !important;
        margin-left: 3px !important;
    }
}
