/* ============================================================================
   ANIMATIONS - Dear Nobody Admin Redesign 2026
   Micro-interactions, loading states, transitions
   ============================================================================ */

/* ── Keyframes ── */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Page content entrance ── */
.content {
    animation: fadeInUp 0.4s cubic-bezier(0, 0, 0.2, 1) both;
}

/* ── Card entrance stagger ── */
.stats-grid .stat-card {
    animation: fadeInUp 0.4s cubic-bezier(0, 0, 0.2, 1) both;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ── Queue item entrance ── */
.queue-item {
    animation: fadeInUp 0.35s cubic-bezier(0, 0, 0.2, 1) both;
}

.queue-item:nth-child(1) { animation-delay: 0.05s; }
.queue-item:nth-child(2) { animation-delay: 0.08s; }
.queue-item:nth-child(3) { animation-delay: 0.11s; }
.queue-item:nth-child(4) { animation-delay: 0.14s; }
.queue-item:nth-child(5) { animation-delay: 0.17s; }

/* ── Hover effects ── */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* ── Loading states ── */

.skeleton {
    background: linear-gradient(90deg,
        var(--color-gray-100) 25%,
        var(--color-gray-200) 50%,
        var(--color-gray-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    width: 80%;
}

.skeleton-heading {
    height: 1.5em;
    width: 50%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--border-radius-lg);
}

/* ── Toast entrance ── */
.toast.show {
    animation: slideInRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Modal animations ── */
.modal-overlay.open .modal {
    animation: scaleIn 0.25s cubic-bezier(0, 0, 0.2, 1) both;
}

.modal-overlay.open {
    animation: fadeIn 0.2s ease-out both;
}

/* ── Stat number count-up feel ── */
.stat-value {
    animation: countUp 0.5s cubic-bezier(0, 0, 0.2, 1) both;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
