/**
 * ALS Video Wrapper Styles
 * Complete CSS replacement for Tailwind classes
 * Version: 1.0.0
 */

/* ============================================
   SECTION CONTAINER
   ============================================ */
    [data-name="VideoHeroModule"].section.als-section-container {
        position: relative;
        overflow: hidden; /* Clip the mobile video so it crops like allwyn.com */
        overflow-x: hidden; /* Prevent horizontal scrollbar */
        background-color: #27e2cc; /* Updated background color */
        padding-bottom: 6.625rem;
        padding-top: 10rem;
        height: auto; /* Natural height - ScrollTrigger pin will create scroll space */
        width: 100%;
        max-width: 100%; /* Ensure it doesn't exceed viewport width */
        box-sizing: border-box;
    }

/* Mobile min-heights to match wrapper sizing (absolute video isn't in flow) */
@media (max-width: 320px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        min-height: 661.969px;
    }
}

@media (min-width: 321px) and (max-width: 425px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        min-height: 581.312px;
    }
}

@media (min-width: 426px) and (max-width: 1023px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        min-height: 680px;
    }
}

/* Hide desktop widget on mobile/tablet */
@media (max-width: 1023px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        display: none;
    }
}

@media (min-width: 768px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        padding-bottom: 12.625rem;
        padding-top: 10rem;
    }
}

@media (min-width: 1280px) {
    [data-name="VideoHeroModule"].section.als-section-container {
        position: relative; /* ScrollTrigger pin will handle positioning */
        top: auto;
        padding-top: 0; /* xlg:py-0 - removes padding on large screens */
        padding-bottom: 0;
        z-index: 10; /* Ensure section stays above footer and other content */
        overflow: hidden;
        overflow-x: hidden; /* Prevent horizontal scrollbar */
    }
}

/* ============================================
   INNER CONTAINER
   ============================================ */
[data-name="VideoHeroModule"] .als-inner-container {
    position: relative;
    z-index: 10; /* Ensure inner container and its children (text) are above mobile video wrapper */
    /* Ensure inner container creates positioning context for absolute children */
    isolation: isolate; /* Create new stacking context to prevent layout shifts */
    width: 100%;
    max-width: 100%; /* Prevent overflow */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

@media (min-width: 1280px) {
    [data-name="VideoHeroModule"] .als-inner-container {
        display: flex;
        min-height: 100vh;
        height: 100vh !important; /* CRITICAL: Fix visual height to exactly 100vh */
        max-height: 100vh !important; /* CRITICAL: Constrain visual height to viewport */
        align-items: center;
        overflow: visible; /* Allow template content to be visible even if it extends beyond viewport */
        position: relative;
    }
}

/* ============================================
   BACKGROUND IMAGE
   ============================================
   Exact positioning from original Allwyn.com:
   - Base: left: 0, top: 0, height: 26rem (416px)
   - xlg (≥1280px): display: block
   - xlgDesktop (≥1194px): left: calc((100vw - 1224px) / 2 - 11.5rem), height: 31.5rem (504px)
   - Aspect ratio: 2032/1007
   ============================================ */
[data-name="VideoHeroModule"] .als-bg-image {
    position: absolute;
    left: 0; /* Base position */
    top: 0; /* Base position */
    opacity: 1;
    z-index: 1; /* Behind text (z-10) but above background */
    pointer-events: none;
    display: none; /* hidden by default - shown at xlg breakpoint */
    aspect-ratio: 2032 / 1007; /* Exact aspect ratio from original */
    height: 26rem; /* Base height: 416px */
    width: auto;
    transform: translateY(0); /* Initial position - will be animated by GSAP */
    will-change: transform, opacity; /* Optimize for animation */
    /* CRITICAL: Use transform3d to move to GPU layer and prevent layout shifts */
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

[data-name="VideoHeroModule"] .als-bg-image img {
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    color: transparent;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    object-fit: cover;
}

/* xlg breakpoint (≥1280px): Show the background image */
@media (min-width: 1280px) {
    [data-name="VideoHeroModule"] .als-bg-image {
        display: block;
        /* Still at left: 0, top: 0, height: 26rem */
    }
}

/* xlgDesktop breakpoint (≥1194px): Adjust position and size */
/* Note: This breakpoint is actually smaller than xlg, but it's applied after xlg */
/* The original uses xlgDesktop which appears to be ≥1194px */
@media (min-width: 1194px) {
    [data-name="VideoHeroModule"] .als-bg-image {
        /* Position relative to container center: 
           - Container is 1224px max-width, centered
           - (100vw - 1224px) / 2 = space outside container on each side
           - Subtract 11.5rem (184px) to position image to the left of container center */
        left: calc((100vw - 1224px) / 2 - 11.5rem);
        height: 31.5rem; /* Increased height: 504px */
        max-width: calc(100vw + 11.5rem); /* Prevent overflow - allow slight extension but clip if needed */
    }
}

/* ============================================
   DESKTOP VIDEO WRAPPER
   ============================================ */
[data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper {
    position: absolute;
    left: 100%; /* left-full - starts off-screen right */
    top: 50vh; /* top-[50vh] - vertically centered */
    height: 33.5vw; /* h-[33.5vw] */
    width: 64vw; /* w-[64vw] */
    max-width: 100vw; /* Prevent overflow beyond viewport */
    transform-origin: center; /* origin-center */
    transform: translate(-60%, -50%); /* -translate-x-[60%] -translate-y-1/2 - brings it partially on screen */
    overflow: hidden;
    border-radius: 20rem; /* rounded-[20rem] = 800px - pill shape */
    display: none; /* hidden by default */
    will-change: transform, width, height, border-radius, left, top;
    z-index: 1; /* keep beneath the text container while still above the bg image */
    /* Ensure it doesn't affect layout */
    isolation: isolate; /* Create new stacking context */
}

@media (min-width: 1024px) {
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper {
        display: block; /* lg:block */
    }
}

/* ============================================
   MOBILE VIDEO WRAPPER (reset for rebuild)
   ============================================ */
[data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%; /* Prevent overflow beyond container */
    height: 661.969px; /* default: up to 320px viewport */
    overflow: hidden;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    display: block;
    will-change: auto;
    z-index: 1; /* behind text (z-100) but above green background */
    isolation: isolate;
}

/* up to 375px */
@media (min-width: 321px) and (max-width: 375px) {
    [data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper {
        height: 581.312px;
    }
}

/* up to 425px */
@media (min-width: 376px) and (max-width: 425px) {
    [data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper {
        height: 581.312px;
    }
}

/* up to 768px */
@media (min-width: 426px) and (max-width: 768px) {
    [data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper {
        height: 680px;
    }
}

/* up to 1024px */
@media (min-width: 769px) and (max-width: 1023px) {
    [data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper {
        height: 680px;
    }
}

/* Hide mobile wrapper on desktop */
/* ============================================
   VIDEO CONTAINER
   ============================================ */
[data-name="VideoHeroModule"] .videowrapper .video.als-video-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.1); /* bg-video-overlay equivalent */
    min-height: 200px; /* Ensure minimum height for iframe to render */
    overflow: hidden; /* Prevent iframe overflow */
}

[data-name="VideoHeroModule"] .videowrapper .video.als-video-container > video,
[data-name="VideoHeroModule"] .videowrapper .video.als-video-container > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Ensure video is centered when cropped */
}

/* Mobile video wrapper reset: allow natural sizing */
[data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper .video.als-video-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

/* Fill the container with cover behavior */
[data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper .video.als-video-container > video,
[data-name="VideoHeroModule"] .videowrapper.als-mobile-video-wrapper .video.als-video-container > iframe {
    position: relative;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* YouTube iframe specific styling */
[data-name="VideoHeroModule"] .videowrapper .video.als-video-container > iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    position: relative;
}

/* Placeholder when video is disabled */
[data-name="VideoHeroModule"] .als-video-placeholder {
    width: 100%;
    height: 100%;
    background: #d6d6d6;
    color: #1d1d1d;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    padding: 1rem;
    box-sizing: border-box;
}

/* Hide YouTube title overlay using overlay cover */
[data-name="VideoHeroModule"] .videowrapper .video.als-video-container {
    position: relative;
}

[data-name="VideoHeroModule"] .videowrapper .video.als-video-container .als-youtube-overlay-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Increased to cover YouTube title bar */
    background: transparent;
    z-index: 100; /* Above iframe */
    pointer-events: none; /* Let clicks pass through */
}

/* For desktop - ensure overlay stays above scaled iframe */
@media (min-width: 1024px) {
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper .video.als-video-container .als-youtube-overlay-cover {
        height: 80px; /* Slightly larger for desktop */
        z-index: 100;
    }
}

/* Desktop iframe cover positioning - object-fit: cover behavior for iframes */
@media (min-width: 1024px) {
    /* Allow container to overflow so scaled iframe isn't clipped */
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper .video.als-video-container {
        overflow: visible !important; /* Override any hidden overflow */
    }
    
    /* When video wrapper is at fullscreen (no border radius), allow overflow */
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper.als-fullscreen,
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper[style*="border-radius: 0px"],
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper[style*="border-radius: 0"][style*="width: 100vw"] {
        overflow: visible !important;
    }
    
    [data-name="VideoHeroModule"] .videowrapper.als-desktop-video-wrapper .video.als-video-container > iframe {
        position: absolute;
        top: 50%;
        left: 50%;
        /* Start with 16:9 aspect dimensions - JS will scale to cover */
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        /* Center the iframe */
        transform: translate(-50%, -50%);
        transform-origin: center center;
        /* Ensure iframe can scale beyond container bounds */
        max-width: none;
        max-height: none;
        /* Prevent any browser default constraints */
        box-sizing: border-box;
        /* Ensure iframe is above any overlays */
        z-index: 1;
        /* Force the iframe content to cover - this affects how the browser renders the iframe's content area */
        object-fit: cover;
    }
}

/* ============================================
   WRAPPER CONTAINER (Text Content)
   ============================================ */
[data-name="VideoHeroModule"] .als-wrapper-container {
    position: relative;
    width: 100%;
    max-width: 1224px; /* container max-width */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    z-index: 100; /* Highest z-index to ensure text is always visible above video and background */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* ============================================
   TEMPLATE CONTENT CONTAINER
   ============================================ */
[data-name="VideoHeroModule"] .als-template-content {
    position: relative;
    z-index: 100; /* Highest z-index to ensure template content is always visible */
    width: 100%;
    overflow: visible; /* Ensure all template content is visible */
    min-height: auto; /* Allow template to determine its own height */
}

/* ============================================
   TITLE MOLECULE
   ============================================ */
[data-name="VideoHeroModule"] .als-title-molecule {
    position: relative;
    z-index: 100; /* High z-index to ensure text is always visible */
    padding-bottom: 0;
}

@media (max-width: 1279px) {
    [data-name="VideoHeroModule"] .als-title-molecule {
        padding-bottom: 4rem; /* max-xlg:pb-16 */
    }
}

@media (min-width: 1280px) {
    [data-name="VideoHeroModule"] .als-title-molecule {
        max-width: 50%; /* xlg:col-span-4 = ~50% of 8-column grid */
    }
}

@media (min-width: 1194px) {
    [data-name="VideoHeroModule"] .als-title-molecule {
        max-width: 58.33%; /* mdDesktop:col-span-7 = ~58.33% of 12-column grid */
    }
}

/* ============================================
   TITLE CONTENT
   ============================================ */
[data-name="VideoHeroModule"] .als-title-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* gap-6 */
}

@media (min-width: 768px) {
    [data-name="VideoHeroModule"] .als-title-content {
        gap: 1.5rem; /* md:gap-6 */
    }
}

/* ============================================
   TEXT WRAPPER
   ============================================ */
[data-name="VideoHeroModule"] .als-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* gap-4 */
}

@media (min-width: 768px) {
    [data-name="VideoHeroModule"] .als-text-wrapper {
        gap: 1rem; /* md:gap-4 */
    }
}

@media (min-width: 1024px) {
    [data-name="VideoHeroModule"] .als-text-wrapper {
        gap: 1.5rem; /* lg:gap-6 */
    }
}

/* ============================================
   HEADING
   ============================================ */
[data-name="VideoHeroModule"] .als-heading {
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 101; /* Ensure heading text is always visible */
}

/* On mobile/tablet, show white text */
@media (max-width: 1279px) {
    [data-name="VideoHeroModule"] .als-heading {
        color: #ffffff; /* text-white */
    }
}

@media (max-width: 1024px) {
    [data-name="VideoHeroModule"] .als-heading {
        font-size: 28px !important;
        line-height: 36px !important;
    }
}

@media (min-width: 768px) {
    [data-name="VideoHeroModule"] .als-heading {
        font-size: 3.5rem; /* md:text-headings-h1 */
        line-height: 1.1;
    }
}

/* On desktop, remove color to let gradient work */
@media (min-width: 1280px) {
    [data-name="VideoHeroModule"] .als-heading {
        color: transparent; /* Let gradient div handle color */
    }
}

/* Text lines created by SplitText - these get the gradient effect */
[data-name="VideoHeroModule"] .als-text-line {
    display: inline-block;
    width: 100%;
}

/* ============================================
   DESCRIPTION
   ============================================ */
[data-name="VideoHeroModule"] .als-description {
    /* Remove color - let the gradient div handle it */
    font-size: 16px; /* Mobile: 16px (Body/03) */
    line-height: 24px; /* Mobile: 24px (150%) */
    font-weight: 500; /* Mobile: 500 (Medium) */
    position: relative;
    z-index: 101; /* Ensure description text is always visible */
}

/* On mobile/tablet, show white text */
@media (max-width: 1279px) {
    [data-name="VideoHeroModule"] .als-description {
        color: #ffffff; /* text-white */
    }
}

@media (max-width: 1024px) {
    [data-name="VideoHeroModule"] .als-description {
        font-size: 16px !important;
        line-height: 24px !important;
    }
}

@media (min-width: 1024px) {
    [data-name="VideoHeroModule"] .als-description {
        font-size: 1.125rem; /* lg:text-body-large */
        line-height: 1.7;
        font-weight: 400; /* Desktop: 400 (Regular) */
    }
}

/* On desktop, remove color to let gradient work */
@media (min-width: 1280px) {
    [data-name="VideoHeroModule"] .als-description {
        color: transparent; /* Let gradient div handle color */
    }
}

/* ============================================
   TEXT COLOR REVEAL ANIMATION
   ============================================
   Magic technique: Uses background-clip: text with a gradient
   - Creates a gradient: white (50%) → teal (50%)
   - Background is 200% width (double the text width)
   - background-position-x animates from -100% to 0
   - This reveals white text from left to right as you scroll
   ============================================ */
[data-name="VideoHeroModule"] .TitleMolecule_content__GADaf > div,
[data-name="VideoHeroModule"] .als-heading > div,
[data-name="VideoHeroModule"] .als-description > div,
[data-name="VideoHeroModule"] .als-text-line > div,
[data-name="VideoHeroModule"] .als-template-content h1,
[data-name="VideoHeroModule"] .als-template-content h2,
[data-name="VideoHeroModule"] .als-template-content h3,
[data-name="VideoHeroModule"] .als-template-content h4,
[data-name="VideoHeroModule"] .als-template-content h5,
[data-name="VideoHeroModule"] .als-template-content h6,
[data-name="VideoHeroModule"] .als-template-content p,
[data-name="VideoHeroModule"] .als-template-content .elementor-heading-title,
[data-name="VideoHeroModule"] .als-template-content .elementor-widget-text-editor {
    position: relative;
    z-index: 101; /* Ensure all text elements are always visible */
}

[data-name="VideoHeroModule"] .TitleMolecule_content__GADaf > div,
[data-name="VideoHeroModule"] .als-heading > div,
[data-name="VideoHeroModule"] .als-description > div,
[data-name="VideoHeroModule"] .als-text-line > div {
    /* Initial state: show teal color (background-position-x: -100%) */
    background: linear-gradient(90deg, #ffffff 50%, #1D4757 0);
    background-size: 200% 100%;
    background-position-x: -100%; /* Start showing teal part */
    color: transparent !important; /* Hide actual text color */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block; /* Required for background-clip to work */
}

/* Only apply on desktop (≥1280px) to match original */
/* Styles are already defined above, no need to repeat */

/* ============================================
   UTILITY CLASSES (for JavaScript selectors)
   ============================================ */
/* .TitleMolecule_content__GADaf - Keep this class for JavaScript text animation targeting */
