/* ============================================
   TaskFlow Animations — Premium Aurora Edition
   Micro-interactions, spring physics, aurora effects
   ============================================ */

/* ================================================
   KEYFRAMES
   ================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes springIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(12px); }
  55%  { opacity: 1; transform: scale(1.04) translateY(-3px); }
  75%  { transform: scale(0.97) translateY(1px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.9); }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.25); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50%       { transform: translateY(-12px); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(-6deg); }
  40%       { transform: rotate(6deg); }
  60%       { transform: rotate(-4deg); }
  80%       { transform: rotate(4deg); }
}
@keyframes checkDraw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(700px) rotate(720deg) scale(0.5); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}
@keyframes floatX {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(8px); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes auroraFlow {
  0%   { background-position: 0% 50%; opacity: 0.6; }
  33%  { background-position: 100% 0%; opacity: 0.8; }
  66%  { background-position: 50% 100%; opacity: 0.6; }
  100% { background-position: 0% 50%; opacity: 0.6; }
}
@keyframes ripple {
  to { transform: scale(3.5); opacity: 0; }
}
@keyframes slideFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-6px); }
  30%       { transform: translateX(6px); }
  45%       { transform: translateX(-5px); }
  60%       { transform: translateX(5px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(3px); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50%       { box-shadow: 0 0 24px var(--accent-glow), 0 0 48px var(--accent-glow); }
}
@keyframes glowPulse2 {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow-2); }
  50%       { box-shadow: 0 0 24px var(--accent-glow-2), 0 0 48px var(--accent-glow-2); }
}
@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-90deg) scale(0.5); }
  to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes morphBg {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30px, -20px) scale(1.05); }
  50%  { transform: translate(10px, 30px) scale(0.95); }
  75%  { transform: translate(-20px, 10px) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes taskComplete {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.15); }
  40%  { transform: scale(0.92); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ================================================
   ANIMATION UTILITY CLASSES
   ================================================ */
.animate-fade-in     { animation: fadeIn 0.3s ease-out; }
.animate-fade-out    { animation: fadeOut 0.25s ease-in forwards; }
.animate-slide-in    { animation: fadeSlideIn 0.4s ease-out; }
.animate-slide-up    { animation: fadeSlideUp 0.3s ease-out; }
.animate-slide-down  { animation: fadeSlideDown 0.3s ease-out; }
.animate-scale-in    { animation: scaleIn 0.3s ease-out; }
.animate-spring-in   { animation: springIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.animate-pulse       { animation: pulse 2s ease-in-out infinite; }
.animate-pulse-dot   { animation: pulseDot 1.5s ease-in-out infinite; }
.animate-bounce      { animation: bounce 1.2s infinite; }
.animate-float       { animation: float 4s ease-in-out infinite; }
.animate-float-x     { animation: floatX 6s ease-in-out infinite; }
.animate-glow        { animation: glowPulse 2.5s ease-in-out infinite; }
.animate-glow-2      { animation: glowPulse2 2.5s ease-in-out infinite; }
.animate-shake       { animation: shake 0.5s ease-out; }
.animate-wiggle      { animation: wiggle 0.6s ease-in-out; }
.animate-gradient    { animation: gradientShift 4s ease infinite; background-size: 200% 200%; }
.animate-aurora      { animation: auroraFlow 10s ease infinite; }


/* ================================================
   STAGGERED CHILDREN
   ================================================ */
.stagger-children > * {
  opacity: 0;
  animation: fadeSlideUp 0.45s ease-out forwards;
}
.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-children > *:nth-child(n+9){ animation-delay: 0.45s; }

.stagger2 > * { opacity: 0; animation: fadeSlideIn 0.5s ease-out forwards; }
.stagger2 > *:nth-child(1) { animation-delay: 0.1s; }
.stagger2 > *:nth-child(2) { animation-delay: 0.22s; }
.stagger2 > *:nth-child(3) { animation-delay: 0.34s; }
.stagger2 > *:nth-child(4) { animation-delay: 0.46s; }
.stagger2 > *:nth-child(n+5) { animation-delay: 0.58s; }


/* ================================================
   RIPPLE EFFECT
   ================================================ */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0);
  animation: ripple 0.65s linear;
  pointer-events: none;
}


/* ================================================
   PAGE TRANSITIONS
   ================================================ */
.page-enter { animation: fadeSlideIn 0.4s ease-out; }
.page-exit  { animation: slideFadeOut 0.3s ease-in forwards; }


/* ================================================
   HOVER MICRO-INTERACTIONS
   ================================================ */
.hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.hover-lift-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.hover-glow:hover { box-shadow: var(--shadow-glow); }
.hover-glow-2:hover { box-shadow: var(--shadow-glow-2); }
.hover-scale {
  transition: transform var(--transition-fast);
}
.hover-scale:hover { transform: scale(1.04); }
.hover-bright {
  transition: filter var(--transition-fast);
}
.hover-bright:hover { filter: brightness(1.15); }


/* ================================================
   AURORA ORB DECORATIONS (background elements)
   ================================================ */
.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.18;
  animation: orbFloat 15s ease-in-out infinite;
}
.aurora-orb-1 {
  background: var(--accent);
  width: 600px; height: 600px;
  animation-duration: 18s;
  animation-delay: 0s;
}
.aurora-orb-2 {
  background: var(--accent-2);
  width: 500px; height: 500px;
  animation-duration: 14s;
  animation-delay: -5s;
  opacity: 0.14;
}
.aurora-orb-3 {
  background: var(--accent-3);
  width: 400px; height: 400px;
  animation-duration: 12s;
  animation-delay: -9s;
  opacity: 0.10;
}


/* ================================================
   CONFETTI PARTICLES
   ================================================ */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-max);
  width: 8px;
  animation: confettiFall linear forwards;
}


/* ================================================
   REDUCED MOTION
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .aurora-orb { display: none; }
}
