/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --wl-hero-height: 600px;
    --wl-primary: #2271b1;
    --wl-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    --wl-content-width: 1200px;
}

/* =========================================
   2. HERO SECTION LAYOUT
   ========================================= */
.wl-hero {
    position: relative;
    width: 100%;
    height: var(--wl-hero-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden; 
    text-align: center;
    font-family: var(--wl-font-family) !important;
}

.wl-hero__background-layer {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0; pointer-events: none; overflow: hidden;
}

.wl-hero__overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

/* --- ЄДИНИЙ КОНТЕЙНЕР (Анімація + Скло + Ховер) --- */
.wl-hero__content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
    /* Це дозволяє ховеру перекривати анімацію після її завершення */
    transform-style: flat; 
}

/* =========================================
   3. GLASSMORPHISM
   ========================================= */
.wl-glass-box {
    padding: 40px !important;
    border-radius: 16px !important;
    margin: 0 auto;
    display: inline-block; /* Щоб блок був по центру */
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* =========================================
   4. TYPOGRAPHY & BUTTONS
   ========================================= */
.wl-hero__title {
    font-family: var(--wl-font-family) !important;
    font-weight: 800;
    margin: 0 0 20px 0;
    line-height: 1.1;
    letter-spacing: -1px;
}
.wl-hero__subtitle {
    font-family: var(--wl-font-family) !important;
    margin: 0 0 30px 0;
    opacity: 0.9;
    line-height: 1.5;
}
.wl-btn {
    display: inline-block;
    padding: 16px 40px;
    background-color: var(--wl-primary);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-family: var(--wl-font-family) !important;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}
.wl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    filter: brightness(1.1);
    color: #ffffff !important;
    z-index: 100;
}

/* =========================================
   5. HOVER EFFECTS (INTERACTIVITY)
   ========================================= */
[class*="wl-hover-"] {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, filter 0.4s ease;
}

/* ФІКС: Коли ми наводимо мишку, ми ПРИМУСОВО вмикаємо видимість і позицію. 
   Це перебиває будь-які глюки анімації. */
.wl-hero__content:hover,
.wl-btn:hover,
[class*="wl-hover-"]:hover {
    opacity: 1 !important; 
    z-index: 100 !important;
    /* Забороняємо анімації ховати блок */
    animation-play-state: paused !important; 
}

/* Lift Up */
.wl-hover-lift:hover { transform: translateY(-8px) !important; box-shadow: 0 15px 30px rgba(0,0,0,0.2) !important; }
/* Scale Up */
.wl-hover-scale:hover { transform: scale(1.05) !important; }
/* Glow */
.wl-hover-glow:hover { box-shadow: 0 0 20px var(--wl-primary), 0 0 40px rgba(255, 255, 255, 0.4) !important; }
/* Pulse */
@keyframes wlPulseAnim { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.wl-hover-pulse:hover { animation: wlPulseAnim 1s infinite !important; }
/* Wobble */
@keyframes wlWobbleHover { 16.65% { transform: skew(-12deg); } 33.3% { transform: skew(10deg); } 49.95% { transform: skew(-6deg); } 66.6% { transform: skew(4deg); } 83.25% { transform: skew(-2deg); } 100% { transform: skew(0); } }
.wl-hover-wobble:hover { animation: wlWobbleHover 0.8s ease-in-out !important; }
/* 3D Tilt */
.wl-hover-tilt:hover { transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(1.02) !important; }
/* Color Pop */
.wl-hover-color-pop { filter: grayscale(100%); }
.wl-hover-color-pop:hover { filter: grayscale(0%) !important; transform: scale(1.02) !important; }


/* =========================================
   6. ADVANCED BACKGROUNDS
   ========================================= */
@keyframes wlAuroraAnim { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.wl-bg-aurora { background: linear-gradient(-45deg, var(--wl-bg-1), var(--wl-bg-2), var(--wl-bg-3), var(--wl-bg-1)); background-size: 400% 400%; animation: wlAuroraAnim 15s ease infinite; }

.wl-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6; animation: wlOrbFloat 20s infinite alternate; }
.wl-orb-1 { width: 500px; height: 500px; background: var(--wl-bg-1); top: -10%; left: -10%; animation-duration: 25s; }
.wl-orb-2 { width: 400px; height: 400px; background: var(--wl-bg-2); bottom: -10%; right: -10%; animation-duration: 20s; animation-delay: -5s; }
.wl-orb-3 { width: 300px; height: 300px; background: var(--wl-bg-3); top: 20%; right: 20%; animation-duration: 18s; animation-delay: -10s; }
@keyframes wlOrbFloat { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(100px, 50px) scale(1.2); } }

.wl-shape { position: absolute; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.03); backdrop-filter: blur(2px); animation: wlShapeFloat 15s infinite linear; }
.wl-shape-1 { width: 100px; height: 100px; top: 10%; left: 10%; animation-duration: 20s; }
.wl-shape-2 { width: 150px; height: 150px; top: 60%; right: 15%; animation-duration: 25s; animation-direction: reverse; border-radius: 50%; }
.wl-shape-3 { width: 80px; height: 80px; bottom: 20%; left: 20%; animation-duration: 18s; transform: rotate(45deg); }
@keyframes wlShapeFloat { 0% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-40px) rotate(180deg); } 100% { transform: translateY(0) rotate(360deg); } }

.wl-bg-mesh { background-color: var(--wl-bg-2); background-image: radial-gradient(at 0% 0%, var(--wl-bg-1) 0px, transparent 50%), radial-gradient(at 100% 0%, var(--wl-bg-3) 0px, transparent 50%), radial-gradient(at 100% 100%, var(--wl-bg-2) 0px, transparent 50%), radial-gradient(at 0% 100%, var(--wl-bg-1) 0px, transparent 50%); background-size: 150% 150%; animation: wlAuroraAnim 10s ease-in-out infinite alternate; }
.wl-bg-grid { background-color: var(--wl-bg-2); background-image: linear-gradient(var(--wl-bg-3) 1px, transparent 1px), linear-gradient(90deg, var(--wl-bg-3) 1px, transparent 1px); background-size: 50px 50px; animation: wlGridMove 4s linear infinite; box-shadow: inset 0 0 100px rgba(0,0,0,0.8); }
@keyframes wlGridMove { 0% { background-position: 0 0; } 100% { background-position: 50px 50px; } }
.wl-bg-dark-base { background-color: #050505; }


/* =========================================
   7. ENTRANCE ANIMATIONS (FINAL FIX)
   ========================================= */
/* Використовуємо forwards, щоб зупинитися на останньому кадрі. 
   Останній кадр має transform: none, що дозволяє склу працювати. */
[class*="wl-anim-"] {
    animation-duration: 1s;
    animation-fill-mode: forwards; 
    will-change: transform, opacity;
}

@keyframes wlFadeUp { 0% { opacity: 0; transform: translateY(50px); } 100% { opacity: 1; transform: none; } }
.wl-anim-fade-up { animation-name: wlFadeUp; }

@keyframes wlSlideLeft { 0% { opacity: 0; transform: translateX(-200px); } 100% { opacity: 1; transform: none; } }
.wl-anim-slide-left { animation-name: wlSlideLeft; }

@keyframes wlSlideRight { 0% { opacity: 0; transform: translateX(200px); } 100% { opacity: 1; transform: none; } }
.wl-anim-slide-right { animation-name: wlSlideRight; }

@keyframes wlElasticUp { 0% { opacity: 0; transform: translateY(100px); } 60% { opacity: 1; transform: translateY(-15px); } 100% { opacity: 1; transform: none; } }
.wl-anim-elastic-up { animation-name: wlElasticUp; animation-duration: 1.2s; }

@keyframes wlFlipIn { 0% { opacity: 0; transform: perspective(1000px) rotateX(-90deg); } 100% { opacity: 1; transform: none; } }
.wl-anim-flip-in { animation-name: wlFlipIn; }

@keyframes wlSkewSlide { 0% { opacity: 0; transform: translateY(100px) skewY(10deg); } 100% { opacity: 1; transform: none; } }
.wl-anim-skew-slide { animation-name: wlSkewSlide; }

@keyframes wlRotateIn { 0% { opacity: 0; transform: rotate(-180deg) scale(0.5); } 100% { opacity: 1; transform: none; } }
.wl-anim-rotate-in { animation-name: wlRotateIn; }

@keyframes wlZoomIn { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: none; } }
.wl-anim-zoom-in { animation-name: wlZoomIn; }

@keyframes wlBlurIn { 0% { opacity: 0; filter: blur(40px); transform: scale(0.9); } 100% { opacity: 1; filter: blur(0); transform: none; } }
.wl-anim-blur-in { animation-name: wlBlurIn; animation-duration: 1.5s; }

@keyframes wlPopIn { 0% { opacity: 0; transform: scale(0); } 80% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: none; } }
.wl-anim-pop-in { animation-name: wlPopIn; }

@keyframes wlSwing { 0% { opacity: 0; } 20% { opacity: 1; transform: rotate3d(0, 0, 1, 15deg); } 40% { transform: rotate3d(0, 0, 1, -10deg); } 60% { transform: rotate3d(0, 0, 1, 5deg); } 80% { transform: rotate3d(0, 0, 1, -5deg); } 100% { opacity: 1; transform: none; } }
.wl-anim-swing { animation-name: wlSwing; transform-origin: top center; }

@keyframes wlWobble { 0% { opacity: 0; } 15% { opacity: 1; transform: translateX(-25%) rotate(-5deg); } 100% { opacity: 1; transform: none; } }
.wl-anim-wobble { animation-name: wlWobble; }

@keyframes wlHeartbeat { 0% { opacity: 0; transform: scale(1); } 100% { opacity: 1; transform: none; } }
.wl-anim-heartbeat { animation-name: wlHeartbeat; }

@keyframes wlGlitch { 0% { opacity: 0; } 100% { opacity: 1; transform: none; } }
.wl-anim-glitch { animation-name: wlGlitch; animation-duration: 0.3s; }

@keyframes wlRollIn { 0% { opacity: 0; transform: translateX(-100%) rotate(-120deg); } 100% { opacity: 1; transform: none; } }
.wl-anim-roll-in { animation-name: wlRollIn; }


/* =========================================
   8. EDITOR FIXES
   ========================================= */
.wl-editor-hero-preview {
    position: relative; padding: 50px; text-align: center; border-radius: 0; background-size: cover; background-position: center; min-height: 600px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: none; font-family: var(--wl-font-family) !important;
}
.wl-editor-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.wl-editor-content { position: relative; z-index: 10; max-width: 800px; margin: 0 auto; width: 100%; }
.wl-editor-content.is-glass { padding: 40px; border-radius: 16px; }
.fake-btn {
    display: inline-block; padding: 16px 40px; background-color: var(--wl-primary); color: #ffffff !important; text-decoration: none !important; font-weight: 600; font-family: var(--wl-font-family) !important; border-radius: 50px; transition: all 0.3s ease; border: none; line-height: 1; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.wp-block[data-type="weblut/hero"] { max-width: 100% !important; width: 100% !important; }