/*
==============================================================================
ADVANCED BUTTON STYLES
==============================================================================
*/

/* Core Wrapper */
.aeo-button-wrapper {
    display: block;
    width: 100%;
}

.aeo-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-style: solid;
    border-width: 0;
    box-sizing: border-box;
    transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
    outline: none;
    position: relative;
    z-index: 1;
    background-color: #61ce70;
    color: #ffffff;
    border-radius: 0;
}

.aeo-button-link:hover,
.aeo-button-link:focus,
.aeo-button-link:active {
    background-color: #0382CF;
    color: #ffffff;
}

.aeo-button-link svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
}

/* Sizing Defaults */
.aeo-size-xs {
    padding: 8px 16px;
    font-size: 12px;
    line-height: 1;
}
.aeo-size-sm {
    padding: 10px 20px;
    font-size: 14px;
    line-height: 1;
}
.aeo-size-md {
    padding: 12px 24px;
    font-size: 14px;
    line-height: 1;
}
.aeo-size-lg {
    padding: 15px 30px;
    font-size: 18px;
    line-height: 1;
}
.aeo-size-xl {
    padding: 20px 40px;
    font-size: 20px;
    line-height: 1;
}

/* Justified alignments */
.aeo-align-justify .aeo-button-link {
    display: flex;
    width: 100%;
}

/* Icon Alignment spacing */
.aeo-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.aeo-button-icon,
.aeo-button-icon svg,
.aeo-button-icon img {
    transition: transform var(--aeo-transition-duration, 0.3s) ease, color var(--aeo-transition-duration, 0.3s) ease, margin var(--aeo-transition-duration, 0.3s) ease;
}

.aeo-button-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.aeo-button-text-content {
    display: inline-block;
}

/* Default standard overflow for most animations */
.aeo-btn-default,
.aeo-btn-buzz,
.aeo-btn-jelly,
.aeo-btn-shutter,
.aeo-btn-split_reveal,
.aeo-btn-border_draw,
.aeo-btn-liquid_fill {
    overflow: hidden;
}

/* Overflow visible for neon and particles */
.aeo-btn-neon_pulse,
.aeo-btn-particle_burst {
    overflow: visible;
}

/* ==============================================================================
1. BUZZ (SHAKE) ANIMATION
============================================================================== */
.aeo-btn-buzz:hover {
    animation-duration: var(--aeo-buzz-speed, 0.3s);
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.aeo-buzz-dir-horizontal:hover {
    animation-name: aeoBuzzHorizontal;
}

.aeo-buzz-dir-vertical:hover {
    animation-name: aeoBuzzVertical;
}

.aeo-buzz-dir-tilt:hover {
    animation-name: aeoBuzzTilt;
}

@keyframes aeoBuzzHorizontal {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes aeoBuzzVertical {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-4px); }
    40% { transform: translateY(4px); }
    60% { transform: translateY(-4px); }
    80% { transform: translateY(4px); }
}

@keyframes aeoBuzzTilt {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-3deg); }
    40% { transform: rotate(3deg); }
    60% { transform: rotate(-3deg); }
    80% { transform: rotate(3deg); }
}

/* ==============================================================================
2. JELLY ANIMATION
============================================================================== */
.aeo-btn-jelly:hover {
    animation: aeoJelly var(--aeo-jelly-speed, 0.6s) ease-in-out;
}

@keyframes aeoJelly {
    0% { transform: scale3d(1, 1, 1); }
    30% { transform: scale3d(var(--aeo-jelly-intensity, 1.25), calc(2 - var(--aeo-jelly-intensity, 1.25)), 1); }
    40% { transform: scale3d(calc(2 - var(--aeo-jelly-intensity, 1.25)), var(--aeo-jelly-intensity, 1.25), 1); }
    50% { transform: scale3d(calc(1 + (var(--aeo-jelly-intensity, 1.25) - 1)*0.6), calc(1 - (var(--aeo-jelly-intensity, 1.25) - 1)*0.6), 1); }
    65% { transform: scale3d(calc(1 - (var(--aeo-jelly-intensity, 1.25) - 1)*0.2), calc(1 + (var(--aeo-jelly-intensity, 1.25) - 1)*0.2), 1); }
    75% { transform: scale3d(calc(1 + (var(--aeo-jelly-intensity, 1.25) - 1)*0.2), calc(1 - (var(--aeo-jelly-intensity, 1.25) - 1)*0.2), 1); }
    100% { transform: scale3d(1, 1, 1); }
}

/* ==============================================================================
3. SHUTTER ANIMATION
============================================================================== */
/* Shutter Transparency Override Removed */

.aeo-btn-shutter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--aeo-shutter-color, #ff007f);
    z-index: 1;
    transition: transform var(--aeo-shutter-duration, 0.4s) cubic-bezier(0.19, 1, 0.22, 1);
}

.aeo-btn-shutter .aeo-button-text {
    position: relative;
    z-index: 2;
}

/* Directional transitions for shutter */
.aeo-btn-shutter.aeo-shutter-dir-left-to-right .aeo-btn-shutter-bg,
.aeo-btn-shutter:not([class*="aeo-shutter-dir-"]) .aeo-btn-shutter-bg {
    transform: scaleX(0);
    transform-origin: left center;
}

.aeo-btn-shutter.aeo-shutter-dir-right-to-left .aeo-btn-shutter-bg {
    transform: scaleX(0);
    transform-origin: right center;
}

.aeo-btn-shutter.aeo-shutter-dir-top-to-bottom .aeo-btn-shutter-bg {
    transform: scaleY(0);
    transform-origin: center top;
}

.aeo-btn-shutter.aeo-shutter-dir-bottom-to-top .aeo-btn-shutter-bg {
    transform: scaleY(0);
    transform-origin: center bottom;
}

/* Hover Expansion */
.aeo-btn-shutter.aeo-shutter-dir-left-to-right:hover .aeo-btn-shutter-bg,
.aeo-btn-shutter:not([class*="aeo-shutter-dir-"]):hover .aeo-btn-shutter-bg {
    transform: scaleX(1);
}

.aeo-btn-shutter.aeo-shutter-dir-right-to-left:hover .aeo-btn-shutter-bg {
    transform: scaleX(1);
}

.aeo-btn-shutter.aeo-shutter-dir-top-to-bottom:hover .aeo-btn-shutter-bg {
    transform: scaleY(1);
}

.aeo-btn-shutter.aeo-shutter-dir-bottom-to-top:hover .aeo-btn-shutter-bg {
    transform: scaleY(1);
}

/* ==============================================================================
4. SPLIT REVEAL ANIMATION
============================================================================== */
.aeo-btn-split_reveal {
    position: relative;
    background-color: var(--aeo-reveal-bg-color, #333333) !important;
    color: var(--aeo-reveal-text-color, #ffffff) !important;
}

/* Underlayer text styling */
.aeo-btn-reveal-underlayer {
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--aeo-reveal-duration, 0.4s) ease;
}

.aeo-btn-split_reveal:hover .aeo-btn-reveal-underlayer {
    opacity: 1;
}

/* Split Cover Halves */
.aeo-btn-split-top,
.aeo-btn-split-bottom {
    position: absolute;
    overflow: hidden;
    z-index: 3;
    transition: transform var(--aeo-reveal-duration, 0.4s) cubic-bezier(0.77, 0, 0.175, 1);
    /* Set backgrounds to the button's intended styling (user variables are loaded by Elementor automatically) */
    background: inherit;
    color: inherit;
}

.aeo-btn-split-inner {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Horizontal Splits (left/right sliding) */
.aeo-split-dir-horizontal .aeo-btn-split-top {
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
}
.aeo-split-dir-horizontal .aeo-btn-split-bottom {
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
}
.aeo-split-dir-horizontal .aeo-btn-split-top .aeo-btn-split-inner {
    top: 0;
    left: 0;
    width: 200%; /* Double width so text centers correctly across splits */
}
.aeo-split-dir-horizontal .aeo-btn-split-bottom .aeo-btn-split-inner {
    top: 0;
    right: 0;
    width: 200%;
}

.aeo-split-dir-horizontal:hover .aeo-btn-split-top {
    transform: translateX(-100%);
}
.aeo-split-dir-horizontal:hover .aeo-btn-split-bottom {
    transform: translateX(100%);
}

/* Vertical Splits (top/bottom sliding) */
.aeo-split-dir-vertical .aeo-btn-split-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
}
.aeo-split-dir-vertical .aeo-btn-split-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
}
.aeo-split-dir-vertical .aeo-btn-split-top .aeo-btn-split-inner {
    top: 0;
    left: 0;
    height: 200%; /* Double height so text centers correctly across vertical split */
}
.aeo-split-dir-vertical .aeo-btn-split-bottom .aeo-btn-split-inner {
    bottom: 0;
    left: 0;
    height: 200%;
}

.aeo-split-dir-vertical:hover .aeo-btn-split-top {
    transform: translateY(-100%);
}
.aeo-split-dir-vertical:hover .aeo-btn-split-bottom {
    transform: translateY(100%);
}

/* ==============================================================================
5. BORDER DRAW ANIMATION
============================================================================== */
/* Border Draw Transparency Override Removed */

.aeo-border-line {
    position: absolute;
    background-color: var(--aeo-draw-color, #6c5ce7);
    transition: transform var(--aeo-draw-speed, 0.4s) ease;
}

.aeo-border-line-top,
.aeo-border-line-bottom {
    height: var(--aeo-draw-thickness, 2px);
    width: 100%;
    transform: scaleX(0);
}

.aeo-border-line-left,
.aeo-border-line-right {
    width: var(--aeo-draw-thickness, 2px);
    height: 100%;
    transform: scaleY(0);
}

.aeo-border-line-top {
    top: 0;
    left: 0;
    transform-origin: left center;
}

.aeo-border-line-right {
    top: 0;
    right: 0;
    transform-origin: center top;
    transition-delay: calc(var(--aeo-draw-speed, 0.4s) * 0.25);
}

.aeo-border-line-bottom {
    bottom: 0;
    right: 0;
    transform-origin: right center;
    transition-delay: calc(var(--aeo-draw-speed, 0.4s) * 0.5);
}

.aeo-border-line-left {
    bottom: 0;
    left: 0;
    transform-origin: center bottom;
    transition-delay: calc(var(--aeo-draw-speed, 0.4s) * 0.75);
}

/* Transform on Hover */
.aeo-btn-border_draw:hover .aeo-border-line-top {
    transform: scaleX(1);
}

.aeo-btn-border_draw:hover .aeo-border-line-right {
    transform: scaleY(1);
}

.aeo-btn-border_draw:hover .aeo-border-line-bottom {
    transform: scaleX(1);
}

.aeo-btn-border_draw:hover .aeo-border-line-left {
    transform: scaleY(1);
}

/* ==============================================================================
6. NEON PULSE ANIMATION
============================================================================== */
.aeo-btn-neon_pulse:hover {
    animation: aeoNeonPulse var(--aeo-neon-speed, 1.5s) infinite alternate;
}

@keyframes aeoNeonPulse {
    0% {
        box-shadow: 0 0 5px var(--aeo-neon-color, #00ffd5),
                    0 0 10px var(--aeo-neon-color, #00ffd5);
    }
    100% {
        box-shadow: 0 0 var(--aeo-neon-spread, 20px) var(--aeo-neon-color, #00ffd5),
                    0 0 calc(var(--aeo-neon-spread, 20px) * 1.5) var(--aeo-neon-color, #00ffd5);
    }
}

/* ==============================================================================
7. LIQUID FILL ANIMATION
============================================================================== */
.aeo-button-link.aeo-btn-liquid_fill {
    position: relative;
}

.aeo-btn-liquid_fill .aeo-button-text {
    position: relative;
    z-index: 2;
}

.aeo-liquid-bg {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--aeo-liquid-color, #2980b9);
    z-index: 1;
    transition: top var(--aeo-liquid-speed, 2s) cubic-bezier(0.19, 1, 0.22, 1);
}

/* Wavy Shapes inside Liquid BG */
.aeo-liquid-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background-color: var(--aeo-liquid-color, #2980b9);
    top: -150%;
    left: -50%;
    border-radius: 40%;
    animation: aeoLiquidRotate 5s infinite linear;
}

.aeo-liquid-wave-1 {
    opacity: 0.5;
    animation-duration: calc(var(--aeo-liquid-speed, 2s) * 3);
}

.aeo-liquid-wave-2 {
    opacity: 0.9;
    animation-duration: calc(var(--aeo-liquid-speed, 2s) * 4);
    border-radius: 38%;
}

.aeo-btn-liquid_fill:hover .aeo-liquid-bg {
    top: 0;
}

@keyframes aeoLiquidRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==============================================================================
8. 3D FLIP ANIMATION
============================================================================== */
.aeo-button-3d-wrapper {
    perspective: 1000px;
    display: inline-block;
}

/* 3D alignment adjustments */
.aeo-align-justify .aeo-button-3d-wrapper {
    display: block;
    width: 100%;
}

.aeo-btn-flip_3d {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 0 !important; /* Managed on front/back face containers instead */
    background: transparent !important;
    border-color: transparent !important;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.aeo-btn-3d-front,
.aeo-btn-3d-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-sizing: border-box;
    /* Mirror button base values for smooth layout styling */
    padding: 12px 24px;
    transition: transform var(--aeo-flip-duration, 0.6s) cubic-bezier(0.2, 0.85, 0.4, 1.275), z-index var(--aeo-flip-duration, 0.6s);
    -webkit-transition: -webkit-transform var(--aeo-flip-duration, 0.6s) cubic-bezier(0.2, 0.85, 0.4, 1.275), z-index var(--aeo-flip-duration, 0.6s);
}

/* Match sizes when padding is applied internally to Front/Back cards */
.aeo-size-xs .aeo-btn-3d-front, .aeo-size-xs .aeo-btn-3d-back { padding: 8px 16px; }
.aeo-size-sm .aeo-btn-3d-front, .aeo-size-sm .aeo-btn-3d-back { padding: 10px 20px; }
.aeo-size-md .aeo-btn-3d-front, .aeo-size-md .aeo-btn-3d-back { padding: 12px 24px; }
.aeo-size-lg .aeo-btn-3d-front, .aeo-size-lg .aeo-btn-3d-back { padding: 15px 30px; }
.aeo-size-xl .aeo-btn-3d-front, .aeo-size-xl .aeo-btn-3d-back { padding: 20px 40px; }

.aeo-btn-3d-front {
    background-color: #61ce70;
    color: inherit;
    border: inherit;
    border-radius: inherit;
    position: relative;
    z-index: 10;
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
}

.aeo-btn-3d-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background-color: #e74c3c;
    color: #ffffff;
    z-index: -1;
    padding: 0 !important;
}

/* Horizontal flip (rotateY) */
.aeo-flip-dir-horizontal .aeo-btn-3d-back {
    transform: rotateY(-180deg);
    -webkit-transform: rotateY(-180deg);
}

.aeo-flip-dir-horizontal:hover .aeo-btn-3d-front {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    z-index: -1;
}

.aeo-flip-dir-horizontal:hover .aeo-btn-3d-back {
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    z-index: 10;
}

/* Vertical flip (rotateX) */
.aeo-flip-dir-vertical .aeo-btn-3d-back {
    transform: rotateX(-180deg);
    -webkit-transform: rotateX(-180deg);
}

.aeo-flip-dir-vertical:hover .aeo-btn-3d-front {
    transform: rotateX(180deg);
    -webkit-transform: rotateX(180deg);
    z-index: -1;
}

.aeo-flip-dir-vertical:hover .aeo-btn-3d-back {
    transform: rotateX(0deg);
    -webkit-transform: rotateX(0deg);
    z-index: 10;
}

/* ==============================================================================
9. GLITCH ANIMATION
============================================================================== */
.aeo-btn-glitch {
    position: relative;
}

.aeo-btn-glitch-layer {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    color: inherit;
    border-radius: inherit;
}

.aeo-btn-glitch:hover .aeo-btn-glitch-layer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.aeo-btn-glitch-layer-1::before,
.aeo-btn-glitch-layer-2::before {
    content: attr(data-text);
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
}

.aeo-btn-glitch-layer-1::before {
    left: 2px;
    text-shadow: -2px 0 var(--aeo-glitch-color-1, #00ffff);
    animation: aeoGlitch1 var(--aeo-glitch-speed, 0.3s) infinite linear alternate-reverse;
}

.aeo-btn-glitch-layer-2::before {
    left: -2px;
    text-shadow: -2px 0 var(--aeo-glitch-color-2, #ff00ff);
    animation: aeoGlitch2 var(--aeo-glitch-speed, 0.3s) infinite linear alternate-reverse;
}

@keyframes aeoGlitch1 {
    0% { clip-path: inset(40% 0 61% 0); }
    20% { clip-path: inset(92% 0 1% 0); }
    40% { clip-path: inset(25% 0 58% 0); }
    60% { clip-path: inset(76% 0 5% 0); }
    80% { clip-path: inset(15% 0 80% 0); }
    100% { clip-path: inset(80% 0 10% 0); }
}

@keyframes aeoGlitch2 {
    0% { clip-path: inset(20% 0 71% 0); }
    20% { clip-path: inset(62% 0 31% 0); }
    40% { clip-path: inset(85% 0 5% 0); }
    60% { clip-path: inset(16% 0 65% 0); }
    80% { clip-path: inset(75% 0 15% 0); }
    100% { clip-path: inset(5% 0 85% 0); }
}

/* ==============================================================================
10. PARTICLE BURST ANIMATION
============================================================================== */
.aeo-btn-particle-burst {
    position: relative;
}

/* Floating Confetti Particle Styling */
.aeo-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--aeo-particle-color, #ff007f);
    pointer-events: none;
    z-index: 9999;
    opacity: 1;
    transform: translate(-50%, -50%);
}
