/* ========================================
   KS Catering - Animations
   ======================================== */

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }

    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease both;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease both;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease both;
}

.animate-slide-up {
    animation: slideUp 0.8s ease both;
}

.animate-slide-down {
    animation: slideDown 0.8s ease both;
}

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

.animate-bounce-in {
    animation: bounceIn 1s ease both;
}

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

.animate-flip-in {
    animation: flipIn 0.8s ease both;
}

.animate-shake {
    animation: shake 0.6s ease both;
}

.animate-wiggle {
    animation: wiggle 1s ease infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Delayed Animations */
.animate-fade-in-delay {
    animation: fadeIn 0.8s ease 0.3s both;
}

.animate-slide-up-delay {
    animation: slideUp 0.8s ease 0.5s both;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animations for children */
.stagger-children>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children>*:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-children>*:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger-children>*:nth-child(7) {
    transition-delay: 0.7s;
}

.stagger-children>*:nth-child(8) {
    transition-delay: 0.8s;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

/* Loading Animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* Gradient Animation */
.animated-gradient {
    background: linear-gradient(270deg,
            #ff6b6b,
            #ff8e53,
            #4ecdc4,
            #44a08d,
            #667eea,
            #764ba2);
    background-size: 1200% 1200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Text Typing Animation */
.typing {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary);
    }
}

/* Particle Effect */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.5;
    }
}

/* Morphing Shape */
.morphing-shape {
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Counter Animation Helper */
.counter-animate {
    transition: all 2s ease-out;
}