/* ═══════════════════════════════════════════════════════════════════
   Animations — Liquid Glass Effects & Micro-interactions
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page Transitions ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* ── Glow & Pulse ── */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--accent-glow-strong);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ── Gradient & Shimmer ── */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes liquidFlow {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(10px, -15px) scale(1.05);
    }
    50% {
        transform: translate(-5px, -25px) scale(0.95);
    }
    75% {
        transform: translate(-15px, -10px) scale(1.02);
    }
}

/* ── Loading ── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Check Mark ── */
@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ═══════════════════ Animation Classes ═══════════════════ */

.animate-fadeUp {
    animation: fadeUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-slideUp {
    animation: slideUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

.animate-breathe {
    animation: breathe 4s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.animate-liquid {
    animation: liquidFlow 8s ease-in-out infinite;
}

/* ── Stagger children ── */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        var(--bg-surface) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ── Loading Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Page entry ── */
.page.active {
    animation: fadeUp 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
