/* ============================================
   LifeReceipt - Animations
   ============================================ */

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

@keyframes stampAppear {
    0% {
        opacity: 0;
        transform: rotate(-15deg) scale(2);
    }

    50% {
        opacity: 1;
        transform: rotate(-15deg) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: rotate(-15deg) scale(1);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

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

@keyframes pulse {

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

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-primary);
    }

    50% {
        box-shadow: 0 0 40px var(--accent-primary);
    }
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes print {
    0% {
        height: 0;
        opacity: 0;
    }

    100% {
        height: auto;
        opacity: 1;
    }
}

/* Receipt print animation */
.receipt.printing {
    animation: print 0.8s ease-out;
}

/* Staggered item animations */
.receipt-item:nth-child(1) {
    animation-delay: 0.1s;
}

.receipt-item:nth-child(2) {
    animation-delay: 0.15s;
}

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

.receipt-item:nth-child(4) {
    animation-delay: 0.25s;
}

.receipt-item:nth-child(5) {
    animation-delay: 0.3s;
}

.receipt-item:nth-child(6) {
    animation-delay: 0.35s;
}

.receipt-item:nth-child(7) {
    animation-delay: 0.4s;
}

.receipt-item:nth-child(8) {
    animation-delay: 0.45s;
}

/* Hover animations */
.receipt:hover .stamp {
    animation: pulse 1s infinite;
}

.generate-btn:active {
    animation: shake 0.3s ease;
}

/* Loading dots animation */
@keyframes dots {

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

    40% {
        content: '..';
    }

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

.loading-text::after {
    content: '';
    animation: dots 1.5s infinite;
}