/* ==========================================
   MESE AUTOMATION - ANIMATIONS & TRANSITIONS
   Modern Animations & Effects
   ========================================== */

/* ========== KEYFRAME ANIMATIONS ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(45, 13, 82, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(45, 13, 82, 0.6);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ANIMATION CLASSES ========== */

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.5s ease-out forwards;
}

.animate-zoom-out {
    animation: zoomOut 0.5s ease-out forwards;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-float {
    animation: floatUp 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ========== STAGGER ANIMATIONS ========== */
.animate-stagger>* {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.animate-stagger>*:nth-child(1) {
    animation-delay: 0.1s;
}

.animate-stagger>*:nth-child(2) {
    animation-delay: 0.2s;
}

.animate-stagger>*:nth-child(3) {
    animation-delay: 0.3s;
}

.animate-stagger>*:nth-child(4) {
    animation-delay: 0.4s;
}

.animate-stagger>*:nth-child(5) {
    animation-delay: 0.5s;
}

.animate-stagger>*:nth-child(n+6) {
    animation-delay: 0.6s;
}

/* ========== HOVER EFFECTS ========== */

.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-scale-sm {
    transition: transform var(--transition-base);
}

.hover-scale-sm:hover {
    transform: scale(1.02);
}

.hover-opacity {
    transition: opacity var(--transition-base);
}

.hover-opacity:hover {
    opacity: 0.8;
}

.hover-color-primary {
    transition: color var(--transition-base);
}

.hover-color-primary:hover {
    color: var(--color-primary);
}

.hover-color-secondary {
    transition: color var(--transition-base);
}

.hover-color-secondary:hover {
    color: var(--color-secondary);
}

.hover-glow {
    transition: all var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(45, 13, 82, 0.3);
}

/* ========== SCROLL ANIMATIONS ========== */

.scroll-fade {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.scroll-fade.in-view {
    opacity: 1;
}

.scroll-slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-slide-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.scroll-slide-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-out;
}

.scroll-slide-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease-out;
}

.scroll-scale.in-view {
    opacity: 1;
    transform: scale(1);
}

/* ========== LOADING STATES ========== */

.skeleton {
    background: linear-gradient(90deg,
            var(--color-gray-200) 25%,
            var(--color-gray-100) 50%,
            var(--color-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== TRANSITION DELAY ========== */

.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-500 {
    transition-delay: 500ms;
}

.delay-700 {
    transition-delay: 700ms;
}

.delay-1000 {
    transition-delay: 1000ms;
}

/* ========== ANIMATION TIMING ========== */

.ease-in {
    animation-timing-function: ease-in;
}

.ease-out {
    animation-timing-function: ease-out;
}

.ease-in-out {
    animation-timing-function: ease-in-out;
}

.ease-linear {
    animation-timing-function: linear;
}

/* ========== ANIMATION DIRECTION ========== */

.animate-reverse {
    animation-direction: reverse;
}

.animate-alternate {
    animation-direction: alternate;
}

/* ========== VISIBILITY ========== */

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/* ========== SCROLL REVEAL ANIMATIONS ========== */
/* Elements with data-reveal start hidden and animate in when 'revealed' class is added */

[data-reveal] {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for cards in grid layouts */
.row [data-reveal]:nth-child(1),
.row > div:nth-child(1) [data-reveal] { transition-delay: 0s; }
.row [data-reveal]:nth-child(2),
.row > div:nth-child(2) [data-reveal] { transition-delay: 0.1s; }
.row [data-reveal]:nth-child(3),
.row > div:nth-child(3) [data-reveal] { transition-delay: 0.2s; }
.row [data-reveal]:nth-child(4),
.row > div:nth-child(4) [data-reveal] { transition-delay: 0.3s; }
.row [data-reveal]:nth-child(5),
.row > div:nth-child(5) [data-reveal] { transition-delay: 0.4s; }
.row [data-reveal]:nth-child(6),
.row > div:nth-child(6) [data-reveal] { transition-delay: 0.5s; }

/* Service card entrance animation */
.service-card[data-reveal] {
    transform: translateY(30px) scale(0.97);
}

.service-card[data-reveal].revealed {
    transform: translateY(0) scale(1);
}

/* Product card - hover animation only, visibility managed by swiper */
.mesa-product-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* Floating card subtle entrance */
.mesa-floating-card[data-reveal] {
    transform: translateY(15px) scale(0.95);
}

.mesa-floating-card[data-reveal].revealed {
    transform: translateY(0) scale(1);
    animation: mesaFloat 5s ease-in-out infinite;
}

.mesa-floating-card[data-reveal].revealed.project-card {
    animation-delay: 1.5s;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .mesa-floating-card[data-reveal].revealed {
        animation: none;
    }
}