/* --- Advanced Animations --- */

/* Base Classes */
.slide-up {
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.slide-down {
    opacity: 0;
    animation: slideDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.slide-left {
    opacity: 0;
    animation: slideLeft 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.slide-right {
    opacity: 0;
    animation: slideRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.zoom-in {
    opacity: 0;
    animation: zoomIn 0.8s ease forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Keyframes */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(197, 160, 89, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0);
    }
}

/* Lightning Effect */
.lightning-strike {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

.card:hover .lightning-strike {
    animation: lightning 0.6s ease-out;
}

@keyframes lightning {
    0% {
        opacity: 0;
        background: rgba(255, 255, 255, 0.8);
    }

    10% {
        opacity: 1;
    }

    20% {
        opacity: 0;
    }

    30% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
    }
}

/* Glow Elements */
.glow-hover {
    transition: 0.3s;
}

.glow-hover:hover {
    box-shadow: 0 0 20px var(--secondary-color);
}

/* --- Scroll Animations (Desktop Default) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- INNOVATIVE MOBILE ANIMATIONS (Max-Width: 768px) --- */
@media (max-width: 768px) {
    .animate-on-scroll {
        opacity: 0;
        /* Start slightly rotated and scaled down */
        transform: perspective(1000px) rotateX(20deg) translateY(50px) scale(0.9);
        transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        /* Smooth ease */
    }

    .animate-on-scroll.visible {
        opacity: 1;
        /* Land perfectly flat and full size */
        transform: perspective(1000px) rotateX(0deg) translateY(0) scale(1);
    }
}

/* Staggered Delays for Grid Items */
.animate-on-scroll:nth-child(2) {
    transition-delay: 0.1s;
}

.animate-on-scroll:nth-child(3) {
    transition-delay: 0.2s;
}

.animate-on-scroll:nth-child(4) {
    transition-delay: 0.3s;
}