/* ===== ELEMENTOR-STYLE ANIMATIONS (Left, Right, Top, Bottom) ===== */

/* BASE ANIMATION SETUP */
[data-animation] {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

/* ===== ENTRANCE ANIMATIONS (From edges) ===== */

/* SLIDE FROM LEFT */
.animate-left-in {
    animation-name: slideInLeft;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* SLIDE FROM RIGHT */
.animate-right-in {
    animation-name: slideInRight;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* SLIDE FROM TOP */
.animate-top-in {
    animation-name: slideInTop;
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SLIDE FROM BOTTOM */
.animate-bottom-in {
    animation-name: slideInBottom;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== EXIT ANIMATIONS (To edges) ===== */

/* SLIDE TO LEFT */
.animate-left-out {
    animation-name: slideOutLeft;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

/* SLIDE TO RIGHT */
.animate-right-out {
    animation-name: slideOutRight;
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* SLIDE TO TOP */
.animate-top-out {
    animation-name: slideOutTop;
}

@keyframes slideOutTop {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100px);
    }
}

/* SLIDE TO BOTTOM */
.animate-bottom-out {
    animation-name: slideOutBottom;
}

@keyframes slideOutBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100px);
    }
}

/* ===== HOVER ANIMATIONS ===== */

/* Hover Slide Left */
.hover-slide-left:hover {
    animation: slideInLeft 0.5s ease-out forwards;
}

/* Hover Slide Right */
.hover-slide-right:hover {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Hover Slide Top */
.hover-slide-top:hover {
    animation: slideInTop 0.5s ease-out forwards;
}

/* Hover Slide Bottom */
.hover-slide-bottom:hover {
    animation: slideInBottom 0.5s ease-out forwards;
}

/* ===== SCROLL ANIMATIONS (On page load / scroll) ===== */

/* Fade In with Slide */
.fade-slide-left {
    animation: slideInLeft 0.8s ease-out;
}

.fade-slide-right {
    animation: slideInRight 0.8s ease-out;
}

.fade-slide-top {
    animation: slideInTop 0.8s ease-out;
}

.fade-slide-bottom {
    animation: slideInBottom 0.8s ease-out;
}

/* ===== BOUNCE ANIMATIONS ===== */

.bounce-left {
    animation: bounceLeft 0.8s ease-out;
}

@keyframes bounceLeft {
    0% {
        opacity: 0;
        transform: translateX(-150px);
    }
    50% {
        opacity: 1;
        transform: translateX(10px);
    }
    100% {
        transform: translateX(0);
    }
}

.bounce-right {
    animation: bounceRight 0.8s ease-out;
}

@keyframes bounceRight {
    0% {
        opacity: 0;
        transform: translateX(150px);
    }
    50% {
        opacity: 1;
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0);
    }
}

.bounce-top {
    animation: bounceTop 0.8s ease-out;
}

@keyframes bounceTop {
    0% {
        opacity: 0;
        transform: translateY(-150px);
    }
    50% {
        opacity: 1;
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
    }
}

.bounce-bottom {
    animation: bounceBottom 0.8s ease-out;
}

@keyframes bounceBottom {
    0% {
        opacity: 0;
        transform: translateY(150px);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* ===== ROTATION ANIMATIONS ===== */

.rotate-in {
    animation: rotateIn 0.8s ease-out;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-30deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in-left {
    animation: rotateInLeft 0.8s ease-out;
}

@keyframes rotateInLeft {
    from {
        opacity: 0;
        transform: rotate(-45deg) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: rotate(0) translateX(0);
    }
}

.rotate-in-right {
    animation: rotateInRight 0.8s ease-out;
}

@keyframes rotateInRight {
    from {
        opacity: 0;
        transform: rotate(45deg) translateX(100px);
    }
    to {
        opacity: 1;
        transform: rotate(0) translateX(0);
    }
}

/* ===== SCALE ANIMATIONS ===== */

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in-left {
    animation: scaleInLeft 0.6s ease-out;
}

@keyframes scaleInLeft {
    from {
        opacity: 0;
        transform: scale(0.7) translateX(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* ===== ANIMATION SPEED VARIANTS ===== */

.animate-fast {
    animation-duration: 0.4s !important;
}

.animate-slow {
    animation-duration: 1.2s !important;
}

.animate-slower {
    animation-duration: 1.5s !important;
}

/* ===== EASING FUNCTIONS ===== */

.ease-in {
    animation-timing-function: ease-in !important;
}

.ease-out {
    animation-timing-function: ease-out !important;
}

.ease-in-out {
    animation-timing-function: ease-in-out !important;
}

.ease-linear {
    animation-timing-function: linear !important;
}

/* ===== DELAY VARIANTS ===== */

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* ===== REPEAT ANIMATIONS ===== */

.animate-infinite {
    animation-iteration-count: infinite !important;
}

.animate-twice {
    animation-iteration-count: 2 !important;
}

/* ===== STAGGERED ANIMATIONS (For lists) ===== */

.stagger-item {
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(n+6) {
    animation-delay: calc(0.1s * (var(--index, 1) - 5));
}

/* ===== INTERSECTION OBSERVER SUPPORT ===== */

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.animate-on-scroll.in-view {
    opacity: 1;
}

/* ===== RESPONSIVE ANIMATIONS ===== */

@media (max-width: 768px) {
    [data-animation] {
        animation-duration: 0.6s;
    }

    .animate-slow {
        animation-duration: 0.8s !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-animation],
    [class*="animate"],
    [class*="slide"],
    [class*="bounce"],
    [class*="rotate"],
    [class*="scale"] {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== UTILITY CLASSES ===== */

.no-animation {
    animation: none !important;
}

.pause-animation {
    animation-play-state: paused !important;
}

.reverse-animation {
    animation-direction: reverse !important;
}
