/* styles/animations.css */
/* Keyframes, transitions, animation utilities */

/* ===== KEYFRAMES ===== */

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

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

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

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

@keyframes breatheExpand {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--color-accent);
  }
  50% {
    transform: scale(1.4);
    box-shadow: 0 0 60px 20px var(--color-accent);
  }
}

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

@keyframes dissolveOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    filter: blur(4px);
  }
}

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--color-accent-glow); }
  50% { box-shadow: 0 0 40px var(--color-accent-glow); }
}

@keyframes causticDrift {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(100px, 100px) rotate(10deg); }
}

@keyframes causticDriftReverse {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(-80px, 80px) rotate(-8deg); }
}

@keyframes spotFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  25% { transform: translate(30px, -20px) scale(1.1); opacity: 0.8; }
  50% { transform: translate(-20px, 30px) scale(0.9); opacity: 0.5; }
  75% { transform: translate(20px, 20px) scale(1.05); opacity: 0.7; }
}

/* ===== ANIMATION CLASSES ===== */

.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-breathe { animation: breatheExpand 8s ease-in-out infinite; }
.animate-dissolve { animation: dissolveOut 1.5s ease forwards; }
.animate-gradient { background-size: 400% 400%; animation: gradientShift 60s ease infinite; }
.animate-glow { animation: glowPulse 3s ease-in-out infinite; }

/* Stagger delays for lists */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

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

  .animate-breathe {
    animation: none;
    transform: scale(1.2);
  }

  .animate-gradient {
    animation: none;
    background-position: 0% 50%;
  }

  .truth-line {
    opacity: 1;
    animation: none;
  }
}

/* ===== TRANSITION UTILITIES ===== */

.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-slow); }
.transition-slow { transition: all 0.5s ease; }

/* ===== HOVER EFFECTS ===== */

.hover-lift {
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .hover-lift:hover { transform: none; }
}

.hover-glow {
  transition: box-shadow var(--transition-slow);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--color-accent-glow);
}

.hover-border-glow {
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.hover-border-glow:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-dim);
}

/* ===== PAGE TRANSITIONS ===== */

.page-enter { opacity: 0; }
.page-enter-active { opacity: 1; transition: opacity var(--transition-slow); }
.page-exit { opacity: 1; }
.page-exit-active { opacity: 0; transition: opacity var(--transition-slow); }

/* ===== TREATMENT-SPECIFIC ANIMATIONS ===== */

/* Meditation breathing circle */
.breathing-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle.breathing {
  animation: breatheExpand 8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .breathing-circle.breathing {
    animation: none;
    transform: scale(1.2);
  }
}

/* Tracker name dissolve */
.tracker-name {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  padding: var(--space-md);
}

.tracker-name.dissolving { animation: dissolveOut 1.5s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  .tracker-name.dissolving { animation: none; opacity: 0; }
}

/* Confession text dissolve */
.confession-text.dissolving { animation: dissolveOut 2s ease forwards; }

/* Anti-feed scroll reveal */
.scroll-reveal {
  opacity: 0;
  transition: opacity 1s ease;
}

.scroll-reveal.visible { opacity: 1; }

/* Stats counter animation */
.stat-value.counting { animation: countPulse 0.3s ease; }
