/* ========================================
   ANIMATIONS - Staggered Reveals & Micro-interactions
   ======================================== */

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes shake {

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

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

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

@keyframes badgePulse {

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Staggered reveal for dashboard cards */
.dashboard-grid .card {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dashboard-grid .card:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-grid .card:nth-child(2) {
    animation-delay: 0.2s;
}

.dashboard-grid .card:nth-child(3) {
    animation-delay: 0.3s;
}

.dashboard-grid .card:nth-child(4) {
    animation-delay: 0.4s;
}

.dashboard-grid .card:nth-child(5) {
    animation-delay: 0.5s;
}

/* Quick action buttons staggered reveal */
.quick-actions .quick-action-btn {
    opacity: 0;
    animation: fadeInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.quick-actions .quick-action-btn:nth-child(1) {
    animation-delay: 0.4s;
}

.quick-actions .quick-action-btn:nth-child(2) {
    animation-delay: 0.5s;
}

.quick-actions .quick-action-btn:nth-child(3) {
    animation-delay: 0.6s;
}

.quick-actions .quick-action-btn:nth-child(4) {
    animation-delay: 0.7s;
}

.quick-actions .quick-action-btn:nth-child(5) {
    animation-delay: 0.8s;
}

/* Stat items staggered reveal */
.stat-item {
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stat-item:nth-child(1) {
    animation-delay: 0.6s;
}

.stat-item:nth-child(2) {
    animation-delay: 0.7s;
}

.stat-item:nth-child(3) {
    animation-delay: 0.8s;
}

.stat-item:nth-child(4) {
    animation-delay: 0.9s;
}

.stat-item:nth-child(5) {
    animation-delay: 1.0s;
}

/* Micro-interactions */
.quick-action-btn:active {
    transform: scale(0.95);
    transition: transform 100ms ease;
}

.feedback-success {
    animation: successPulse 0.6s ease;
}

.feedback-error {
    animation: shake 0.5s ease;
}

.stat-value {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-value.updating {
    color: var(--primary);
    transform: scale(1.1);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
}

.status-pendiente {
    animation: badgePulse 2s ease-in-out infinite;
}

.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
