/**
 * XPEL Korea Hero Slider
 * Version 2.0
 * 
 * Full viewport hero with video backgrounds
 */

/* ==========================================================================
   Hero Slider Container
   ========================================================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    max-height: 1200px;
    overflow: hidden;
    background-color: var(--color-black);
}

/* ==========================================================================
   Slides
   ========================================================================== */
.hero-slider__slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* ==========================================================================
   Slide Background (Video or Image)
   ========================================================================== */
.hero-slide__background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* Video Background */
.hero-slide__video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* YouTube Embed */
.hero-slide__youtube {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.78vh; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-slide__youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Image Background */
.hero-slide__image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay */
.hero-slide__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

/* ==========================================================================
   Slide Content
   ========================================================================== */
.hero-slide__content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    padding-inline: var(--space-8);
    max-width: var(--container-2xl);
    margin-inline: auto;
}

.hero-slide__inner {
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero-slide.is-active .hero-slide__inner {
    opacity: 1;
    transform: translateY(0);
}

/* Title */
.hero-slide__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: var(--font-extrabold);
    line-height: 1.1;
    color: var(--color-white);
    margin-bottom: var(--space-6);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.hero-slide__title span {
    color: var(--color-gold);
}

/* Subtitle */
.hero-slide__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-8);
    max-width: 500px;
}

/* CTA Buttons */
.hero-slide__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.hero-slide__cta .btn {
    min-width: 140px;
}

/* ==========================================================================
   Navigation Dots
   ========================================================================== */
.hero-slider__dots {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: var(--space-3);
}

.hero-slider__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.hero-slider__dot:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.hero-slider__dot.is-active {
    background-color: var(--color-gold);
    transform: scale(1.2);
}

/* Progress indicator on dots */
.hero-slider__dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
}

.hero-slider__dot.is-active::after {
    border-color: var(--color-gold);
    animation: dotProgress 5s linear forwards;
}

@keyframes dotProgress {
    from {
        clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
    }
    to {
        clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%);
    }
}

/* ==========================================================================
   Navigation Arrows
   ========================================================================== */
.hero-slider__arrows {
    position: absolute;
    bottom: var(--space-8);
    right: var(--space-8);
    z-index: 10;
    display: flex;
    gap: var(--space-2);
}

.hero-slider__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hero-slider__arrow:hover {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-black);
}

.hero-slider__arrow .icon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Pause Button
   ========================================================================== */
.hero-slider__pause {
    position: absolute;
    bottom: var(--space-8);
    left: var(--space-8);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-white);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.hero-slider__pause:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.hero-slider__pause .icon {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Scroll Indicator
   ========================================================================== */
.hero-slider__scroll {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-slider__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.7), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.5;
        transform: scaleY(0.8);
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-slider {
        min-height: 500px;
    }
    
    .hero-slide__content {
        padding-inline: var(--space-6);
    }
    
    .hero-slider__arrows {
        display: none;
    }
    
    .hero-slider__pause {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 100svh; /* Use small viewport height on mobile */
        min-height: 450px;
    }
    
    .hero-slide__overlay {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }
    
    .hero-slide__content {
        align-items: flex-end;
        padding-bottom: var(--space-24);
    }
    
    .hero-slide__inner {
        text-align: center;
        max-width: 100%;
    }
    
    .hero-slide__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    .hero-slide__subtitle {
        font-size: var(--text-base);
        max-width: 100%;
    }
    
    .hero-slide__cta {
        justify-content: center;
    }
    
    .hero-slider__dots {
        bottom: var(--space-6);
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.hero-slider.is-loading {
    background-color: var(--color-gray-900);
}

.hero-slider.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: opacity 0.3s ease;
    }
    
    .hero-slide__inner {
        transition: none;
        transform: none;
    }
    
    .hero-slider__scroll-line {
        animation: none;
    }
    
    .hero-slider__dot.is-active::after {
        animation: none;
    }
}
