/* Video Background Styles */
.video-background {
    position: relative;
    overflow: hidden;
    min-height: 1080px;
    width: 100%;
    background: #000; /* Fallback background */
}

.video-background .video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 1;
}

.video-background .video-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
    pointer-events: auto;
    border: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.video-background .video-container iframe.loaded {
    opacity: 1;
}

.video-background .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 30%, rgba(0, 1, 12, 0.8) 100%) !important;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-background .video-overlay.playing {
    opacity: 0;
    pointer-events: none;
}

.play-button-container {
    text-align: center;
    color: white;
}

.video-play-btn {
    background: rgba(202, 60, 8, 0.9);
    border: 3px solid #ca3c08;
    color: #fff;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto 15px auto;
}

.video-play-btn:hover {
    background: #ca3c08;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(202, 60, 8, 0.5);
}

.play-text {
    color: white;
    font-size: 16px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.video-background .container {
    position: relative;
    z-index: 3;
}

/* Ensure content is visible over video */
.video-background .inner h1,
.video-background .service-wrapper {
    position: relative;
    z-index: 4;
}

/* Responsive adjustments */
@media (max-aspect-ratio: 16/9) {
    .video-background .video-container iframe {
        height: 100vh;
        width: 177.77vh;
    }
}

@media screen and (max-width: 1024px) {
    .video-background {
        min-height: 800px;
    }
}

@media screen and (max-width: 768px) {
    .video-background {
        min-height: 600px;
    }
    
    .video-background .video-container iframe {
        width: 120%;
        height: 120%;
        min-width: auto;
        min-height: auto;
        transform: translate(-50%, -50%);
    }
}

@media screen and (max-width: 480px) {
    .video-background {
        min-height: 500px;
    }
    
    .video-background .video-container iframe {
        width: 150%;
        height: 150%;
    }
}

/* Loading state */
.video-background.loading .video-overlay {
    background: rgba(0, 1, 12, 0.8);
}

/* Prefers reduced motion - fallback to static background */
@media (prefers-reduced-motion: reduce) {
    .video-background .video-container {
        display: none;
    }
    
    .video-background {
        background-image: url(../images/bg/bg-image-1.jpg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}
