/**
 * Frontend Styles for YiQiSlider Pro
 * Core Headless Architecture (GSAP Powered)
 */

/* ==========================================================================
   1. CORE ARCHITECTURE (THE VAULT)
   ========================================================================== */
.yiqi-slider-wrapper {
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.yiqi-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000000;
}

.yiqi-slider-container * {
    box-sizing: border-box;
}

/* Slides are absolute layers stacked on top of each other */
.yiqi-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden; 
    z-index: 1;
}

/* ==========================================================================
   2. LAYER MANAGEMENT
   ========================================================================== */
.yiqi-layer-positioner {
    pointer-events: none; 
}

.gsap-layer {
    pointer-events: auto;
    visibility: hidden; 
    opacity: 0;
}

.gsap-layer h1, 
.gsap-layer p {
    margin: 0;
    padding: 0;
}

/* Call to Action Buttons */
.yiqi-btn-layer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

/* Text Layer Color Protection */
.yiqi-slider-container .yiqi-layer-text,
.yiqi-slider-container .gsap-layer .yiqi-layer-text {
    color: var(--yiqi-text-color, inherit) !important;
}

/* --- AUDIO TOGGLES --- */
.yiqi-global-audio-toggle {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.yiqi-global-audio-toggle:hover,
.yiqi-layer-audio-toggle:hover {
    transform: scale(1.1) !important;
}

.yiqi-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   3. NAVIGATION CONTROLS (ARROWS)
   ========================================================================== */

/* Base Arrow Styles */
.yiqi-control-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: #ffffff;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 200;
}

.yiqi-prev-btn { left: 20px; }
.yiqi-next-btn { right: 20px; }

/* Arrows on Hover Behavior */
.yiqi-slider-container .yiqi-arrows-on-hover {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.yiqi-slider-container:hover .yiqi-arrows-on-hover {
    opacity: 1;
}

/* --- ARROWS THEMES --- */

/* Minimal Thin */
.yiqi-slider-container.yiqi-arrows-minimal .yiqi-control-btn {
    width: 30px;
    height: 40px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

/* Circle Dark */
.yiqi-slider-container.yiqi-arrows-circle-dark .yiqi-control-btn {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.yiqi-slider-container.yiqi-arrows-circle-dark .yiqi-control-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Circle Light */
.yiqi-slider-container.yiqi-arrows-circle-light .yiqi-control-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000000;
    border-radius: 50%;
}
.yiqi-slider-container.yiqi-arrows-circle-light .yiqi-control-btn:hover {
    background-color: #ffffff;
}

/* Square */
.yiqi-slider-container.yiqi-arrows-square .yiqi-control-btn {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Chevron Bold */
.yiqi-slider-container.yiqi-arrows-chevron-bold .yiqi-control-btn {
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

/* Material Drop */
.yiqi-slider-container.yiqi-arrows-material-drop .yiqi-control-btn {
    background-color: #ffffff;
    color: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #e2e8f0;
}

/* Floating Pill */
.yiqi-slider-container.yiqi-arrows-floating .yiqi-control-btn {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    width: 32px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   4. PAGINATION (BULLETS / THUMBNAILS)
   ========================================================================== */

/* Base Bullet Layout */
.yiqi-pagination {
    z-index: 200 !important;
}

.yiqi-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.yiqi-bullet.is-active {
    background-color: #ffffff;
}

/* --- BULLETS THEMES --- */

/* Dynamic (Expanding Pill) */
.yiqi-slider-container.yiqi-bullets-dynamic .yiqi-bullet.is-active {
    width: 24px;
    border-radius: 8px;
    background-color: #3b82f6;
}

/* Squares */
.yiqi-slider-container.yiqi-bullets-squares .yiqi-bullet {
    border-radius: 2px;
}

/* Horizontal Bars */
.yiqi-slider-container.yiqi-bullets-bars .yiqi-bullet {
    width: 12px;
    height: 4px;
    border-radius: 2px;
}
.yiqi-slider-container.yiqi-bullets-bars .yiqi-bullet.is-active {
    width: 24px;
}

/* Outline Circles */
.yiqi-slider-container.yiqi-bullets-outline .yiqi-bullet {
    background-color: transparent;
    border: 2px solid #ffffff;
    box-sizing: border-box;
}
.yiqi-slider-container.yiqi-bullets-outline .yiqi-bullet.is-active {
    background-color: #ffffff;
}

/* Expanding Pill */
.yiqi-slider-container.yiqi-bullets-pill .yiqi-bullet {
    border-radius: 8px;
}
.yiqi-slider-container.yiqi-bullets-pill .yiqi-bullet.is-active {
    width: 24px;
}

/* Diamonds */
.yiqi-slider-container.yiqi-bullets-diamond .yiqi-bullet {
    border-radius: 1px;
    transform: rotate(45deg);
}

/* Vertical Dashes */
.yiqi-slider-container.yiqi-bullets-vertical-lines .yiqi-bullet {
    width: 4px;
    height: 12px;
    border-radius: 2px;
}
.yiqi-slider-container.yiqi-bullets-vertical-lines .yiqi-bullet.is-active {
    height: 20px;
}

/* ==========================================================================
   5. UTILITIES
   ========================================================================== */
@media (max-width: 768px) {
    .yiqi-hide-on-mobile {
        display: none !important;
    }
}

/* ==========================================================================
   6. DECOUPLED ARROWS LAYOUT (VERTICAL OVERRIDES)
   ========================================================================== */

/* Reposition buttons to the horizontal center when vertical layout is active */
.yiqi-slider-container[data-arrows="vertical"] .yiqi-control-btn {
    left: 50%;
    top: auto;
    transform: translateX(-50%);
}

/* Push the previous button to the top of the viewport */
.yiqi-slider-container[data-arrows="vertical"] .yiqi-prev-btn {
    top: 20px;
}

/* Push the next button to the bottom of the viewport */
.yiqi-slider-container[data-arrows="vertical"] .yiqi-next-btn {
    bottom: 20px;
}

/* Rotate the SVG icons 90 degrees clockwise so Left points UP and Right points DOWN */
.yiqi-slider-container[data-arrows="vertical"] .yiqi-control-btn svg {
    transform: rotate(90deg);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   7. 3D TRANSITIONS ENGINE PERSPECTIVE
   ========================================================================== */
/* Common 3D stage setup */
.yiqi-slider-container {
    transform-style: preserve-3d !important;
}

.yiqi-slide {
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform-style: preserve-3d !important;
}

/* Isolated Perspective for Flip (Softer, flatter 3D) */
.yiqi-slider-container[data-effect="flip"] {
    perspective: 1600px !important;
}

/* Isolated Perspective for Cube (Aggressive, deep 3D) */
.yiqi-slider-container[data-effect="cube"] {
    perspective: 1000px !important;
}

/* Isolated Perspective for Coverflow */
.yiqi-slider-container[data-effect="coverflow"] {
    perspective: 1200px !important;
}

/* Isolated Perspective for Cards (Deep layered 3D deck) */
.yiqi-slider-container[data-effect="cards"] {
    perspective: 1400px !important;
}

/* ==========================================================================
   8. PREMIUM CURTAIN TRANSITION (SLITSLIDER REVOLUTION)
   ========================================================================== */

/* Taglio Verticale: Si apre simmetricamente verso Destra e Sinistra (Asse X) */
.yiqi-slide.curtain-horizontal {
    will-change: clip-path;
    clip-path: polygon(
        calc(var(--curtain-cut) * 1%) 0%, 
        calc(100% - (var(--curtain-cut) * 1%)) 0%, 
        calc(100% - (var(--curtain-cut) * 1%)) 100%, 
        calc(var(--curtain-cut) * 1%) 100%
    );
}

/* Taglio Orizzontale: Si apre simmetricamente verso l'Alto e il Basso (Asse Y) */
.yiqi-slide.curtain-vertical {
    will-change: clip-path;
    clip-path: polygon(
        0% calc(var(--curtain-cut) * 1%), 
        100% calc(var(--curtain-cut) * 1%), 
        100% calc(100% - (var(--curtain-cut) * 1%)), 
        0% calc(100% - (var(--curtain-cut) * 1%))
    );
}

/* ==========================================================================
   9. PREMIUM SINGLE CURTAIN ENGINE (4-WAY SINGLE PANEL)
   ========================================================================== */
.yiqi-slider-container[data-effect="single-curtain"] .yiqi-slide,
.yiqi-slide.single-curtain-horizontal-ltr,
.yiqi-slide.single-curtain-horizontal-rtl,
.yiqi-slide.single-curtain-vertical-ttb,
.yiqi-slide.single-curtain-vertical-btt {
    will-change: clip-path;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Right to Left: Spinge la maschera da sinistra, rivelando la slide da destra */
.yiqi-slide.single-curtain-horizontal-ltr {
    clip-path: inset(0 0 0 calc(var(--single-curtain) * 1%));
}

/* Left to Right: Spinge la maschera da destra, rivelando la slide da sinistra */
.yiqi-slide.single-curtain-horizontal-rtl {
    clip-path: inset(0 calc(var(--single-curtain) * 1%) 0 0);
}

/* Top to Bottom: Spinge la maschera dal basso, rivelando la slide dall'alto */
.yiqi-slide.single-curtain-vertical-ttb {
    clip-path: inset(calc(var(--single-curtain) * 1%) 0 0 0);
}

/* Bottom to Top: Spinge la maschera dall'alto, rivelando la slide dal basso */
.yiqi-slide.single-curtain-vertical-btt {
    clip-path: inset(0 0 calc(var(--single-curtain) * 1%) 0);
}

/* ==========================================================================
   10. PREMIUM 3D SLICE WAVE ENGINE (TRANSIENT MESH STAGE)
   ========================================================================== */
.yiqi-slice-3d-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transform-style: preserve-3d;
    perspective: 1500px;
}

/* ==========================================================================
   11. PREMIUM SHUTTER WINDOW ENGINE (DOUBLE-SIDED PRISMS)
   ========================================================================== */
.yiqi-shutter-stage {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none;
    transform-style: preserve-3d;
    perspective: 1500px;
}
.yiqi-shutter-slice {
    position: absolute;
    transform-style: preserve-3d;
    will-change: transform;
}
.yiqi-shutter-face {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-repeat: no-repeat;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.yiqi-shutter-back {
    transform: rotateY(180deg); 
}
.yiqi-shutter-vertical-back {
    transform: rotateX(180deg);
}

/* ==========================================================================
   12. PREMIUM 3D TURBINE ENGINE (FLIP-CLOCK AXIS REVOLUTION)
   ========================================================================== */
.yiqi-turbine-stage {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none;
    transform-style: preserve-3d;
    perspective: 1500px;
}
.yiqi-turbine-slice {
    position: absolute;
    transform-style: preserve-3d;
    will-change: transform;
}
.yiqi-turbine-face {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-repeat: no-repeat;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    outline: 1px solid transparent; 
}
/* Gestione retro per rotazione orizzontale (Asse Y) */
.yiqi-turbine-back {
    transform: rotateY(180deg); 
}
/* Gestione retro per rotazione verticale (Asse X - La tua linea gialla) */
.yiqi-turbine-vertical-back {
    transform: rotateX(180deg);
}

/* ==========================================================================
   13. PREMIUM ALTERNATED BARS REVEAL ENGINE (TRANSIENT SPLIT GRID)
   ========================================================================= */
.yiqi-split-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}
.yiqi-split-bar {
    position: absolute;
    background-repeat: no-repeat;
    will-change: transform;
}