/* Video Hero Section Widget Styles */

/* Remove Elementor Container Gaps */
.elementor-widget-video-hero {
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-video-hero .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove gaps from Elementor inner containers */
.elementor-widget-video-hero .e-con-inner,
.elementor-widget-video-hero .e-container {
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    padding-block-start: 0 !important;
    padding-block-end: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    --padding-block-start: 0px !important;
    --padding-block-end: 0px !important;
    --padding-inline-start: 0px !important;
    --padding-inline-end: 0px !important;
}

/* Target parent containers that might have the padding variables */
.e-con:has(.elementor-widget-video-hero),
.e-con-inner:has(.elementor-widget-video-hero) {
    padding-block-start: 0 !important;
    padding-block-end: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    --padding-block-start: 0px !important;
    --padding-block-end: 0px !important;
    --padding-inline-start: 0px !important;
    --padding-inline-end: 0px !important;
}

/* Ensure section containers don't add spacing */
.elementor-section .elementor-widget-video-hero,
.e-con .elementor-widget-video-hero {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove any row/column gaps that might affect the widget */
.elementor-widget-video-hero .elementor-row,
.elementor-widget-video-hero .elementor-column,
.elementor-widget-video-hero .elementor-column-wrap,
.elementor-widget-video-hero .elementor-widget-wrap {
    margin: 0 !important;
    padding: 0 !important;
}

/* Handle flex containers */
.elementor-widget-video-hero .e-flex,
.elementor-widget-video-hero .e-con {
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}

/* Ensure parent sections don't interfere */
.elementor-section:has(.elementor-widget-video-hero),
.e-con:has(.elementor-widget-video-hero) {
    margin: 0 !important;
    padding: 0 !important;
}

/* Main Container */
.video-hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* Enable hardware acceleration for smoother parallax */
    transform: translateZ(0);
    will-change: transform;
}

/* Video Background */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

/* YouTube/Vimeo Video Containers */
.youtube-video,
.vimeo-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-video iframe,
.vimeo-video 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: none;
}

/* Video Placeholder */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.video-placeholder p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
}

/* Video Overlay */
.video-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Content Layer */
.video-hero-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 3;
    padding: 2rem;
    box-sizing: border-box;
    /* Parallax optimization */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Hero Text (Bottom Left) */
.hero-text-container {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    max-width: 40%;
    z-index: 4;
}

.hero-heading {
    color: #ffffff;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0 0 1rem 0;
    padding: 0;
}

.hero-text {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0;
}

/* Hero Button */
.hero-button {
    display: inline-block;
    padding: 12px 24px;
    margin-top: 1.5rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    border: none; /* Default no border, can be overridden by Elementor controls */
    transition: all 0.3s ease;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.hero-button:hover {
    background-color: #005a87;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.4);
}

.hero-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Scroll Indicator (Bottom Center) */
.scroll-indicator-container {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.scroll-indicator:hover {
    color: #ad8330;
    transform: scale(1.1);
}

.scroll-indicator i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.scroll-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Video Controls (Bottom Right) */
.video-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 4;
}

.video-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-control:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #ad8330;
    transform: scale(1.1);
}

.video-control:focus {
    outline: 2px solid #ad8330;
    outline-offset: 2px;
}

/* Fullscreen Mode */
.video-hero-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
}

.video-hero-container.fullscreen .video-hero-content {
    display: none;
}

.video-hero-container.fullscreen .video-controls {
    display: none;
}

/* Fullscreen Controls */
.fullscreen-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 2rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 50px;
    backdrop-filter: blur(20px);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-hero-container.fullscreen .fullscreen-controls {
    display: flex;
}

.video-hero-container.fullscreen:hover .fullscreen-controls,
.fullscreen-controls:hover {
    opacity: 1;
}

.fs-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.fs-control:hover {
    color: #ad8330;
    background: rgba(255, 255, 255, 0.1);
}

/* Progress Bar */
.progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin: 0 1rem;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #ad8330;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-container:hover .progress-fill::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-heading {
        font-size: 3rem;
    }
    
    .hero-text {
        font-size: 1.1rem;
    }
    
    .hero-text-container {
        max-width: 60%;
    }
    
    .video-controls {
        flex-direction: column;
        gap: 0.8rem;
    }
}

@media (max-width: 768px) {
    .hero-text-container {
        max-width: 90%;
        bottom: 1.5rem;
        left: 1.5rem;
    }
    
    .hero-heading {
        font-size: 2rem;
    }
    
    .hero-text {
        font-size: 0.9rem;
    }
    
    .hero-button {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin-top: 1rem;
    }
    
    .video-hero-content {
        padding: 1.5rem;
    }
    
    /* Reduce parallax effect on mobile for better performance */
    .video-hero-container {
        transform: none;
    }
    
    .video-hero-content {
        transform: none !important;
        will-change: auto;
    }
}

@media (max-width: 480px) {
    .hero-text-container {
        max-width: 95%;
        bottom: 1rem;
        left: 1rem;
    }
    
    .hero-heading {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-text {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .hero-button {
        padding: 8px 16px;
        font-size: 0.85rem;
        margin-top: 0.8rem;
    }
    
    .video-hero-content {
        padding: 1rem;
    }
}

/* High performance devices - enhanced parallax */
@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
    .video-hero-content {
        transition: transform 0.1s ease-out;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .video-hero-content {
        transform: none !important;
        will-change: auto;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .hero-button {
        transition: none;
    }
    
    .hero-button:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .video-hero-overlay {
        background-color: rgba(0, 0, 0, 0.4);
    }
    
    .video-control {
        background: rgba(0, 0, 0, 0.5);
    }
    
    .video-control:hover {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Animation for entering fullscreen */
.video-hero-container.entering-fullscreen {
    animation: enterFullscreen 0.3s ease-in-out;
}

.video-hero-container.exiting-fullscreen {
    animation: exitFullscreen 0.3s ease-in-out;
}

@keyframes enterFullscreen {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

@keyframes exitFullscreen {
    from {
        transform: scale(1.02);
    }
    to {
        transform: scale(1);
    }
}

/* Loading state */
.video-hero-container.loading .video-background::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility improvements */
.video-control:focus-visible,
.fs-control:focus-visible {
    outline: 2px solid #ad8330;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .scroll-indicator {
        animation: none;
    }
      .video-control,
    .fs-control {
        transition: none;
    }
    
    .video-hero-container.entering-fullscreen,
    .video-hero-container.exiting-fullscreen {
        animation: none;
    }
}
