/* Video Play Button Overlay Styles */

.video-container {
    position: relative;
    cursor: default; /* Reset cursor to default */
}

/* Play button overlay */
.video-play-button {
    position: absolute;
    top: 2%;
    right: 2%;
    transform: translate(0, 0);
    width: 80px;
    height: 80px;
    background-color: rgba(204, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

/* Stop button state */
.video-play-button.stop-state {
    background-color: rgba(51, 51, 51, 0.8);
}

.video-play-button.stop-state::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    margin-left: 0;
    border: none;
}

.video-play-button:hover {
    background-color: rgba(204, 0, 0, 1); /* Solid color on hover */
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}

/* Play triangle icon */
.video-play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 5px; /* Slight adjustment to center the triangle */
}

/* Hide play button when video is active - disabled for mobile */
.video-play-button.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 996px) {
    .video-play-button.hidden {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* Visual feedback for paused state */
.video-container.video-paused::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 996px) {
    .video-play-button {
        width: 60px;
        height: 60px;
        top: auto;
        right: 80%;
        bottom: 15%;
        left: auto;
        z-index: 9999; /* Ensure button is above all other elements including the video */
        position: fixed; /* Fix position on screen when video is active */
        display: flex !important; /* Ensure it's always displayed */
        opacity: 1 !important; /* Ensure it's visible */
        pointer-events: auto !important; /* Ensure it's clickable */
    }
    
    .video-play-button::after {
        border-width: 12px 0 12px 20px;
    }
    
    .video-play-button.stop-state {
        background-color: rgba(51, 51, 51, 0.9); /* More visible background */
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); /* Light glow for visibility */
    }
    
    .video-play-button.stop-state::after {
        width: 18px;
        height: 18px;
    }
    
    /* Mobile letterboxing for videos when active */
    .video-wrapper.video-active {
        background-image: url('videos/index/FondoVideoMovil.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Add dark overlay to the background image */
    .video-wrapper.video-active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #00234cdc; /* Dark overlay with 70% opacity */
        z-index: 1; /* Above the background image but below the video */
    }
    
    .video-wrapper.video-active video {
        object-fit: contain !important;
        width: 100% !important;
        height: 100% !important;
        position: relative;
        z-index: 2; /* Ensure video is above the dark overlay */
        margin: 0;
        min-width: unset;
        min-height: unset;
    }
    
    /* Ensure iframe has the same styling as video for consistency */
    .video-wrapper.video-active iframe {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16/9;
        min-height: unset;
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        object-fit: contain;
        z-index: 2; /* Ensure iframe is above the dark overlay */
    }
    
    /* Ensure brand text is visible on mobile */
    .video-brand-text-container {
        position: fixed;
        bottom: 82vh;
        left: 1px;
        z-index: 10;
    }
}

/* Remove the video-play-text as it's replaced by the button */
.video-play-text {
    display: none;
}