/* Animation & Keyframes - Enhanced for Trending App Visuals */

/* Modern Floating Animation */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg);
    opacity: 0.1;
  }
  25% { 
    transform: translateY(-20px) rotate(90deg);
    opacity: 0.15;
  }
  50% { 
    transform: translateY(-40px) rotate(180deg);
    opacity: 0.1;
  }
  75% { 
    transform: translateY(-20px) rotate(270deg);
    opacity: 0.05;
  }
}

/* Shimmer Effect for Glass Cards */
@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* Gradient Slide Animation */
@keyframes gradient-slide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Pulse Glow for Lotus Button */
@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 
      0 12px 40px rgba(255, 107, 53, 0.3),
      0 4px 16px rgba(0, 0, 0, 0.1),
      inset 0 2px 0 rgba(255, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 
      0 16px 50px rgba(255, 107, 53, 0.5),
      0 6px 20px rgba(0, 0, 0, 0.15),
      inset 0 2px 0 rgba(255, 255, 255, 0.4);
  }
}

/* Keyframe Animations - Page load animations removed */

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

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

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

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

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes celebration {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-5deg);
  }
  50% {
    transform: scale(1.3) rotate(5deg);
  }
  75% {
    transform: scale(1.1) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

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

@keyframes barGrow {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes numberRoll {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes progressFill {
  from {
    stroke-dashoffset: 326.73;
  }
  to {
    stroke-dashoffset: var(--progress-offset, 326.73);
  }
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.8) translateY(50px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes badgeUnlock {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-200px) rotate(720deg);
    opacity: 0;
  }
}

/* Animation Classes - Page load animations removed */

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

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

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-celebration {
  animation: celebration 0.6s ease-in-out;
}

.animate-sparkle {
  animation: sparkle 1s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

/* Counter Animation */
.counter-animate {
  animation: countUp 0.4s ease-out;
}

.counter-number.updating {
  animation: numberRoll 0.3s ease-out;
}

/* Progress Ring Animation */
.progress-ring-progress {
  animation: progressFill var(--transition-slow) ease-out;
}

/* Chart Bar Animation */
.chart-bar {
  animation: barGrow var(--transition-slow) ease-out;
}

.chart-bar:nth-child(1) { animation-delay: 0ms; }
.chart-bar:nth-child(2) { animation-delay: 100ms; }
.chart-bar:nth-child(3) { animation-delay: 200ms; }
.chart-bar:nth-child(4) { animation-delay: 300ms; }
.chart-bar:nth-child(5) { animation-delay: 400ms; }
.chart-bar:nth-child(6) { animation-delay: 500ms; }
.chart-bar:nth-child(7) { animation-delay: 600ms; }

/* Navigation Animation */
.nav-item.active {
  animation: bounce 0.3s ease-out;
}

/* Button Hover Animations */
.hover-lift {
  transition: all var(--transition-fast);
}

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

.hover-grow {
  transition: all var(--transition-fast);
}

.hover-grow:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: all var(--transition-fast);
}

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

/* Page Transition Animations - Disabled */
.page-enter {
  /* animation removed */
}

.page-exit {
  /* animation removed */
}

/* Modal Animations */
.modal-enter {
  animation: modalSlideIn var(--transition-normal) ease-out;
}

/* Badge Unlock Animation */
.badge-unlock {
  animation: badgeUnlock 0.8s ease-out;
}

/* Confetti Animation */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent-primary);
  animation: confetti 2s ease-out forwards;
}

.confetti-particle:nth-child(odd) {
  background: var(--color-accent-secondary);
  animation-delay: 0.1s;
}

.confetti-particle:nth-child(3n) {
  background: var(--color-success);
  animation-delay: 0.2s;
}

/* Theme Transition */
.theme-transition * {
  transition: 
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal) !important;
}

/* Loading Animation States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* Micro-interaction Animations */
.button-press {
  animation: buttonPress 0.1s ease-out;
}

@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Streak Animation */
.streak-day.completing {
  animation: celebration 0.6s ease-out;
}

/* Goal Achievement Animation */
.goal-completed {
  animation: glow 1s ease-out, celebration 0.8s ease-out;
}

/* Voice Mode Pulse */
.voice-active .pulse-dot {
  animation: pulse 1s ease-in-out infinite;
}

.voice-active .listening-indicator {
  animation: glow 2s ease-in-out infinite;
}

/* Smooth Scrolling for Page Changes */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Stagger Animation for Lists - Disabled */
.stagger-animation > * {
  /* opacity and animation removed for immediate visibility */
}

/* Stagger animation delays removed for immediate visibility */

/* Focus Animations */
*:focus-visible {
  animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
  0% {
    box-shadow: 0 0 0 0 var(--color-accent-primary);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.3);
  }
}

/* Error State Animation */
.error-shake {
  animation: shake 0.5s ease-in-out;
}

/* Success State Animation */
.success-pulse {
  animation: pulse 0.8s ease-in-out;
}

/* Parallax Effect for Background Elements */
.parallax-bg {
  transform: translateZ(0);
  will-change: transform;
}

/* Performance Optimizations */
.will-animate {
  will-change: transform, opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animate-pulse,
  .animate-bounce,
  .animate-glow,
  .animate-sparkle,
  .animate-rotate {
    animation: none !important;
  }
}

/* High Contrast Mode Adjustments */
@media (prefers-contrast: high) {
  .animate-glow,
  .hover-glow {
    animation: none !important;
    box-shadow: none !important;
  }
  
  .animate-glow:hover,
  .hover-glow:hover {
    border: 3px solid currentColor !important;
  }
}

/* Dark Mode Specific Animations */
.theme-dark .glow-effect {
  filter: drop-shadow(0 0 10px var(--color-accent-primary));
}

/* Gentle Lotus Rotation */
@keyframes gentle-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Enhanced Lotus Button Animations */
@keyframes gentle-pulse {
  0%, 100% { 
    opacity: 0.7;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes tap-pulse {
  0% { 
    opacity: 0;
    transform: scale(0.8);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2);
  }
  100% { 
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes gentle-fade {
  0%, 100% { 
    opacity: 0.5;
  }
  50% { 
    opacity: 0.8;
  }
}

/* Progress Bar Shimmer */
@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Floating Mantra Animation */
@keyframes float-mantra {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(0px);
  }
  20% {
    opacity: 1;
    transform: scale(1.2) translateY(-10px);
  }
  40% {
    opacity: 1;
    transform: scale(1) translateY(-20px);
  }
  70% {
    opacity: 0.8;
    transform: scale(0.9) translateY(-40px);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateY(-60px);
  }
}

/* Goal Celebration Animations */
.goal-celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.goal-celebration-overlay.active {
  opacity: 1;
  transform: scale(1);
}

.goal-celebration-content {
  position: relative;
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
}

.celebration-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  animation: rays-rotate 8s linear infinite;
}

.celebration-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 150px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--color-accent-primary) 20%,
    var(--color-accent-secondary) 50%,
    var(--color-accent-tertiary) 80%,
    transparent
  );
  transform-origin: 50% 0%;
  opacity: 0.8;
  animation: ray-pulse 2s ease-in-out infinite alternate;
}

.celebration-lotus {
  position: relative;
  z-index: 2;
  margin: 2rem 0;
}

.celebration-lotus-image {
  width: 200px;
  height: 200px;
  animation: lotus-bloom 3s ease-out;
  filter: drop-shadow(0 0 30px var(--color-accent-primary));
}

.celebration-text {
  color: var(--color-text-primary);
  z-index: 2;
  position: relative;
}

.celebration-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(
    45deg,
    var(--color-accent-primary),
    var(--color-accent-secondary),
    var(--color-accent-tertiary)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-glow 2s ease-in-out infinite alternate;
}

.celebration-text p {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: text-fade-in 1s ease-out 1s forwards;
}

.celebration-mantra {
  font-style: italic;
  color: var(--color-accent-secondary);
  font-size: 1rem !important;
  animation: mantra-pulse 3s ease-in-out infinite;
}

/* Celebration Keyframes */
@keyframes rays-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes ray-pulse {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

@keyframes lotus-bloom {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes text-glow {
  0% { text-shadow: 0 0 20px var(--color-accent-primary); }
  100% { text-shadow: 0 0 40px var(--color-accent-secondary); }
}

@keyframes text-fade-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mantra-pulse {
  0%, 100% { 
    transform: scale(1);
    color: var(--color-accent-secondary);
  }
  50% { 
    transform: scale(1.05);
    color: var(--color-accent-primary);
  }
}

/* Enhanced Confetti Animations - Optimized */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent-primary);
  animation: confetti-fall linear forwards;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-10vh) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 1;
    transform: translateY(50vh) rotate(180deg) scale(1.2);
  }
  100% {
    transform: translateY(110vh) rotate(360deg) scale(0.8);
    opacity: 0;
  }
}

/* Print Mode - Disable Animations */
@media print {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Bottom Controls Slide In Animation - REMOVED */

/* Voice Mode Animations */
.voice-detected {
  animation: voicePulse 0.3s ease-out;
}

.voice-detecting {
  animation: voiceDetecting 0.5s ease-in-out;
}

@keyframes voicePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); background-color: var(--color-success); }
  100% { transform: scale(1); }
}

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