/* ==========================================================================
   FoundersPath AI — Animations & Micro-interactions
   ========================================================================== */

/* Scale In (for modals, popups) */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-scale-in { animation: scaleIn 280ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Slide Up */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-slide-up { animation: slideUp 300ms cubic-bezier(0, 0, 0.2, 1) forwards; }

/* Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fade-in { animation: fadeIn 250ms ease forwards; }

/* Spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* Slide In Right */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-right { animation: slideInRight 280ms cubic-bezier(0, 0, 0.2, 1) forwards; }

/* Slide In from bottom */
@keyframes slideInBottom {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(1, 156, 212, 0.25); }
    50%       { box-shadow: 0 0 20px rgba(1, 156, 212, 0.5), 0 0 40px rgba(1, 156, 212, 0.15); }
}
.animate-pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }

/* Shimmer (skeleton loading) */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--r-sm);
}

/* Score counter animation */
@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}
.animate-count { animation: countUp 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Gradient border rotation */
@keyframes rotateBorder {
    to { --border-angle: 1turn; }
}

/* Progress bar fill animation */
.progress-bar-fill {
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade out (for toasts, popups closing) */
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}
.animate-fade-out { animation: fadeOut 250ms ease forwards; }

/* Score ring fill */
@keyframes fillRing {
    from { stroke-dashoffset: 251; }
}
.ring-fill { animation: fillRing 1.5s ease-out forwards; }

/* Bounce in for new items */
@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-bounce-in { animation: bounceIn 450ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Slide drawer */
@keyframes slideDrawer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

/* Gradient background animation */
@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animated {
    background: linear-gradient(-45deg, #3b82f6, #6366f1, #8b5cf6, #ec4899);
    background-size: 400% 400%;
    animation: gradientFlow 8s ease infinite;
}

/* Staggered entry for list items */
.stagger-item { opacity: 0; animation: slideUp 300ms ease forwards; }
.stagger-item:nth-child(1) { animation-delay: 50ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 150ms; }
.stagger-item:nth-child(4) { animation-delay: 200ms; }
.stagger-item:nth-child(5) { animation-delay: 250ms; }
.stagger-item:nth-child(6) { animation-delay: 300ms; }

/* Hover lift effect */
.hover-lift {
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transition: opacity 300ms;
    pointer-events: none;
}
.btn:active::after { opacity: 1; }
