/* AAA Slider Styles v1.5.0 - Final Animation Fix */

/* 1. CONTAINER & BASICS */
.aaa-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.aaa-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 2. SLIDE BASE STYLES */
.aaa-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Default: hidden and awaiting fade in */
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Base fade transition for normal 'Fade' effect */
    transition: opacity 1s ease-in-out, visibility 1s;
}

/* ACTIVE STATE (Generic) */
.aaa-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    transition: opacity 1s ease-in-out, visibility 0s;
}


/* 3. EFFECT: SLIDE (Cover Flow) */
/* Override base opacity so slides are solid for movement */
[data-effect="slide"] .aaa-slide {
    opacity: 1 !important;
    visibility: visible;
    transform: translateX(0);
    z-index: 1;
    /* Inactive sits behind */
}

/* Active slide moves in from Right */
[data-effect="slide"] .aaa-slide.active {
    z-index: 20;
    /* Active on top */
    animation: aaaSlideInRight 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes aaaSlideInRight {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(0);
    }
}


/* 4. EFFECT: MOSAIC & BARS */
/* Force visibility of slides so we can see the grid masking */
[data-effect="mosaic"] .aaa-slide,
[data-effect="bars"] .aaa-slide {
    opacity: 1 !important;
    visibility: visible;
    z-index: 1;
}

[data-effect="mosaic"] .aaa-slide.active,
[data-effect="bars"] .aaa-slide.active {
    z-index: 20;
}

/* GRIDS CONTAINER */
.aaa-mosaic-grid,
.aaa-bars-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

.aaa-mosaic-grid {
    display: flex;
    flex-wrap: wrap;
}

.aaa-bars-grid {
    display: flex;
}

/* TILES & BARS (Default State = Hidden/Transparent) 
   Crucial: Default must be hidden so OUTGOING slides don't turn black.
*/
.aaa-mosaic-tile {
    width: 10%;
    height: 20%;
    background: #000;
    opacity: 0;
    /* Default invisible */
}

.aaa-bar-item {
    flex: 1;
    height: 100%;
    background: #000;
    transform: scaleY(0);
    /* Default collapsed */
    transform-origin: top;
}

/* REVEAL ANIMATIONS (Only on Active) */
.aaa-slide.active .aaa-mosaic-tile {
    animation: aaaMosaicReveal 0.8s ease forwards;
}

.aaa-slide.active .aaa-bar-item {
    animation: aaaBarReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* Keyframes: Start Black (1) -> Fade to Clear (0) */
@keyframes aaaMosaicReveal {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes aaaBarReveal {
    0% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(0);
    }
}

/* Stagger Delays on Animation */
.aaa-slide.active .aaa-mosaic-tile:nth-child(2n) {
    animation-delay: 0.1s;
}

.aaa-slide.active .aaa-mosaic-tile:nth-child(3n) {
    animation-delay: 0.2s;
}

.aaa-slide.active .aaa-mosaic-tile:nth-child(4n) {
    animation-delay: 0.15s;
}

.aaa-slide.active .aaa-bar-item:nth-child(odd) {
    transform-origin: top;
}

.aaa-slide.active .aaa-bar-item:nth-child(even) {
    transform-origin: bottom;
}


/* 5. CONTENT STYLING */
.aaa-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.aaa-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    z-index: 15;
    padding: 20px;
    box-sizing: border-box;
}

.aaa-content-box {
    width: 100%;
    max-width: 600px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Alignments */
.aaa-align-left .aaa-container {
    justify-content: flex-start;
}

.aaa-align-left .aaa-content-box {
    text-align: left;
    align-items: flex-start;
}

.aaa-align-right .aaa-container {
    justify-content: flex-end;
}

.aaa-align-right .aaa-content-box {
    text-align: right;
    align-items: flex-end;
}

.aaa-align-center .aaa-container {
    justify-content: center;
}

.aaa-align-center .aaa-content-box {
    text-align: center;
    align-items: center;
}

/* Text/Content Entry Animations */
.aaa-anim-item {
    opacity: 0;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
}

.aaa-slide.active .aaa-effect-fadeIn {
    animation-name: aaaFadeIn;
}

.aaa-slide.active .aaa-effect-fadeInUp {
    animation-name: aaaFadeInUp;
}

.aaa-slide.active .aaa-effect-fadeInDown {
    animation-name: aaaFadeInDown;
}

.aaa-slide.active .aaa-effect-fadeInLeft {
    animation-name: aaaFadeInLeft;
}

.aaa-slide.active .aaa-effect-fadeInRight {
    animation-name: aaaFadeInRight;
}

.aaa-slide.active .aaa-effect-zoomIn {
    animation-name: aaaZoomIn;
}

.aaa-slide.active .aaa-effect-none {
    opacity: 1;
}

@keyframes aaaFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes aaaFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aaaFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aaaFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes aaaFadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes aaaZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Buttons & Dots */
.aaa-custom-btn {
    display: inline-block !important;
    padding: 15px 40px !important;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: normal;
    border: none;
}

.aaa-custom-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.aaa-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2000;
}

.aaa_dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aaa_dot.active {
    transform: scale(1.3);
}


/* 6. MOBILE FIX: KILL EFFECTS & SIMPLIFY */
@media (max-width: 900px) {
    .aaa-slider-container {
        height: auto !important;
        overflow: visible;
    }

    /* Hide fancy grids */
    .aaa-mosaic-grid,
    .aaa-bars-grid {
        display: none !important;
    }

    /* SIMPLE FADE/SHOW LOGIC FOR MOBILE */
    .aaa-slide {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        animation: none !important;
        left: auto !important;
        top: auto !important;
        /* Default hidden, simple display toggle */
        display: none !important;
        z-index: 1 !important;
        margin-bottom: 0;
        transition: none !important;
    }

    .aaa-slide.active {
        display: flex !important;
        z-index: 2 !important;
        margin-bottom: 30px;
        animation: none !important;
    }

    /* Override Data Effects specifically for Mobile */
    [data-effect] .aaa-slide.active {
        animation: none !important;
    }

    [data-effect] .aaa-slide {
        opacity: 1 !important;
        transform: none !important;
    }

    /* RESTORED MISSING RULE: Force content visible & static on mobile */
    .aaa-anim-item {
        opacity: 1 !important;
        animation: none !important;
        visibility: visible !important;
    }

    /* Content Layout */
    .aaa-content-box {
        max-width: 100%;
        padding: 0 10px;
    }

    .aaa-mob-align-center .aaa-container {
        justify-content: center;
    }

    .aaa-mob-align-center .aaa-content-box {
        text-align: center;
        align-items: center;
    }

    .aaa-mob-align-left .aaa-container {
        justify-content: flex-start;
    }

    .aaa-mob-align-left .aaa-content-box {
        text-align: left;
        align-items: flex-start;
    }

    .aaa-mob-align-right .aaa-container {
        justify-content: flex-end;
    }

    .aaa-mob-align-right .aaa-content-box {
        text-align: right;
        align-items: flex-end;
    }

    /* DOTS LOGIC FOR MOBILE (PERSISTENT & SINGLE) */
    /* 
       Instead of creating duplicate dots inside slides, we just
       re-style the GLOBAL dots to flow below the content on mobile.
       This ensures they are always visible for ALL slides.
    */

    /* If 'below content' mode is active (detected by PHP class) */
    .aaa-slider-container.aaa-has-mobile-inline-dots .aaa-dots-global {
        position: relative;
        left: auto;
        transform: none;
        margin-top: -30px;
        margin-bottom: 30px;

        justify-content: center;
        display: flex !important;
        /* Ensure it's not hidden by overflow if inside container */
        z-index: 200;
    }

    /* Normal Overlay Mode on Mobile */
    /* If NOT 'below' mode, they stay absolute (default) but adjusted */
    .aaa-slider-container:not(.aaa-has-mobile-inline-dots) .aaa-dots-global {
        bottom: 30px;
    }
}

/* DESKTOP: DEFAULT BEHAVIOR */
@media (min-width: 901px) {
    .aaa-dots-global {
        display: flex !important;
    }
}

`