/* KOLCHIKAYN HERO SECTION - ELEMENTOR STYLES */

.kolchikayn-hero {
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, #F5E6D3 0%, #E8D5C4 50%, #F0E68C 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Custom Moroccan color palette */
.kolchikayn-hero .text-brand-blue { color: var(--primary-color, #2538ff); }
.kolchikayn-hero .bg-brand-blue { background-color: var(--primary-color, #2538ff); }
.kolchikayn-hero .border-brand-blue { border-color: var(--primary-color, #2538ff); }

/* Slide system */
.kolchikayn-hero .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.kolchikayn-hero .slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Multi-background support */
.kolchikayn-hero .slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: opacity 0.8s ease, transform 0.8s ease;
    background-attachment: fixed;
}

/* Multi-background video support */
.kolchikayn-hero .hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: opacity 0.8s ease;
}

/* Hide videos by default, show only when slide is active */
.kolchikayn-hero .hero-bg-video {
    display: none;
}

/* Multi-background mode specific styles */
.kolchikayn-hero[data-multi-background="true"] {
    /* Override default background when multi-background is enabled */
    background: transparent !important;
    animation: none !important;
}

.kolchikayn-hero[data-multi-background="true"] .slide.active .slide-background {
    opacity: 1;
    transform: scale(1);
}

.kolchikayn-hero[data-multi-background="true"] .slide:not(.active) .slide-background {
    opacity: 0;
    transform: scale(1.05);
}

/* Enhanced background transition effects */
.kolchikayn-hero .slide-background.gradient-bg {
    background-size: 400% 400% !important;
    animation: gradientShift 15s ease infinite;
}

.kolchikayn-hero .slide-background.image-bg {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.kolchikayn-hero .slide-background.solid-bg {
    animation: none !important;
}

/* Smooth transitions for background changes */
.kolchikayn-hero[data-multi-background="true"] .slide {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure proper layering */
.kolchikayn-hero .slide-background {
    pointer-events: none;
}

/* Video background specific styles */
.kolchikayn-hero .hero-bg-video.active {
    display: block !important;
    opacity: 1;
}

.kolchikayn-hero .hero-bg-video:not(.active) {
    display: none !important;
    opacity: 0;
}

/* Background rotation support */
.kolchikayn-hero .slide-background {
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Smooth transitions for background rotation */
.kolchikayn-hero .slide-background.transitioning {
    transition: none !important; /* Let GSAP handle transitions */
}

/* Ensure backgrounds don't interfere with content */
.kolchikayn-hero .slide-background {
    user-select: none;
    pointer-events: none;
}

/* Performance optimizations for background rotation */
.kolchikayn-hero[data-multi-background="true"] .slide-background {
    transform: translateZ(0); /* Force hardware acceleration */
    -webkit-transform: translateZ(0);
}

/* Background loading states */
.kolchikayn-hero .slide-background.loading {
    background-color: rgba(245, 230, 211, 0.3);
    background-image: none !important;
}

.kolchikayn-hero .slide-background.loaded {
    background-color: transparent;
}

/* Parallax layers */
.kolchikayn-hero .parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Person image - Fixed vertical positioning with drop-shadow filter */
.kolchikayn-hero .person-image {
    border-radius: 1rem;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    object-position: center bottom;
    height: 50vh;
    width: auto;
    object-fit: cover;
    max-width: 600px; /* Increased default max-width, will be overridden by Elementor */
}

/* Default drop-shadow (will be overridden by Elementor controls) */
.kolchikayn-hero .person-image {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.3));
}

/* No shadow when disabled */
.kolchikayn-hero .person-image.no-shadow {
    filter: none;
}

.kolchikayn-hero .person-image:hover {
    transform: translateX(-50%) scale(1.02) !important;
}

/* Person image container - improved for better sizing */
.kolchikayn-hero [data-depth="0.4"] {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    overflow: visible !important; /* Allow image to extend beyond container if needed */
}

/* Decorative items */
.kolchikayn-hero .decorative-item {
    will-change: transform, filter;
    cursor: pointer;
    transform-origin: center center;
    backface-visibility: hidden;
    perspective: 1000px;
    transition: filter 0.3s ease;
    position: absolute;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    user-select: none;
    pointer-events: auto;
}

.kolchikayn-hero .decorative-item:hover {
    z-index: 10;
    transform: scale(1.1) rotate(10deg);
    filter: drop-shadow(0 8px 16px rgba(37, 56, 255, 0.3));
}

/* Slide text styling */
.kolchikayn-hero .slide-text {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 0.85;
    font-weight: 900;
    color: var(--primary-color, #2538ff);
    margin: 0;
    text-align: center;
}

/* Navigation buttons */
.kolchikayn-hero .nav-btn {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color, #2538ff);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #2538ff);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.kolchikayn-hero .nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.kolchikayn-hero .nav-btn:hover::before {
    left: 100%;
}

.kolchikayn-hero .nav-btn:hover {
    background: var(--primary-color, #2538ff);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(37, 56, 255, 0.3);
}

.kolchikayn-hero .nav-btn:active {
    transform: scale(0.95);
}

/* Header styles removed - no header needed */

/* Navigation container */
.kolchikayn-hero .nav-container {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    display: flex;
    gap: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .kolchikayn-hero {
        height: 100vh;
        min-height: 500px;
    }

    .kolchikayn-hero .person-image {
        height: 40vh;
        max-width: 300px;
    }

    .kolchikayn-hero .slide-text {
        font-size: 3rem !important;
    }

    .kolchikayn-hero .decorative-item {
        width: 60px !important;
        opacity: 0.8 !important;
    }

    .kolchikayn-hero .nav-container {
        bottom: 1rem;
        right: 1rem;
    }

    .kolchikayn-hero .nav-btn {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    /* Multi-background mobile optimizations */
    .kolchikayn-hero .slide-background {
        background-attachment: scroll !important;
    }

    .kolchikayn-hero .hero-bg-video {
        /* On mobile, videos might be paused, ensure fallback works */
        background-size: cover;
        background-position: center;
    }

    /* Reduce background rotation effects on mobile for performance */
    .kolchikayn-hero .slide-background {
        will-change: auto !important;
        transform: none !important;
    }

    /* Simpler transitions on mobile */
    .kolchikayn-hero[data-multi-background="true"] .slide-background {
        transition: opacity 0.5s ease !important;
    }
}

@media (max-width: 480px) {
    .kolchikayn-hero .person-image {
        height: 35vh;
        max-width: 250px;
    }

    .kolchikayn-hero .slide-text {
        font-size: 2.5rem !important;
    }
}

/* Smooth transitions for all elements */
.kolchikayn-hero * {
    box-sizing: border-box;
}

/* Background text styling - Minimal defaults, let Elementor control typography */
.kolchikayn-hero .parallax-layer[data-depth="0.1"] h1,
.kolchikayn-hero .background-text {
    /* Only essential styles that must remain fixed */
    opacity: 0.1 !important;
    margin: 0 !important;
    text-align: center !important;
    pointer-events: none !important;
    user-select: none !important;
    position: relative;
    z-index: 1;
}

/* Fallback styles only if Elementor doesn't apply any */
.kolchikayn-hero .parallax-layer[data-depth="0.1"] h1:not([style*="font"]),
.kolchikayn-hero .background-text:not([style*="font"]) {
    font-size: 18vw;
    font-weight: 900;
    color: #2538ff;
    line-height: 0.8;
}

/* Ensure Elementor styles take precedence - very specific selectors */
.elementor-element .kolchikayn-hero .parallax-layer[data-depth="0.1"] h1,
.elementor-element .kolchikayn-hero .background-text,
.elementor-widget-kolchikayn_hero .kolchikayn-hero .parallax-layer[data-depth="0.1"] h1,
.elementor-widget-kolchikayn_hero .kolchikayn-hero .background-text {
    /* Let Elementor control all typography */
}

/* Ensure proper z-index layering */
.kolchikayn-hero .parallax-layer[data-depth="0.1"] {
    z-index: 1;
}

.kolchikayn-hero .parallax-layer[data-depth="0.4"] {
    z-index: 2;
}

.kolchikayn-hero .parallax-layer[data-depth="0.8"] {
    z-index: 3;
}

.kolchikayn-hero .decorative-item {
    z-index: 4;
}

.kolchikayn-hero .nav-container {
    z-index: 50;
}
