/* Animation keyframes */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

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

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

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

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Animation classes */
.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

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

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

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

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

/* Staggered animations for lists */
.stagger-animation > * {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-animation > *:nth-child(9) { animation-delay: 0.9s; }
.stagger-animation > *:nth-child(10) { animation-delay: 1.0s; }

/* Loading animations */
.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Typing indicator */
.typing-indicator {
  display: inline-block;
}

.typing-indicator::after {
  content: '|';
  animation: blink 1s infinite;
  color: var(--accent);
  font-weight: bold;
}

/* Hover animations */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Focus animations */
.focus-glow:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent), 0.3);
  transition: box-shadow 0.2s ease;
}

/* Mood selection animations */
.mood-select-enter {
  animation: slideUp 0.3s ease-out;
}

.mood-icon-selected {
  animation: pulse 0.6s ease-out;
}

/* AI insight animations */
.ai-insight-enter {
  animation: fadeIn 0.8s ease-out, slideUp 0.8s ease-out;
}

.insight-text-animate {
  overflow: hidden;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  animation: typewriter 2s steps(40) 1s forwards, blink 1s step-end 3s;
}

/* Modal animations */
.modal-enter {
  animation: fadeIn 0.3s ease-out;
}

.modal-content-enter {
  animation: slideUp 0.4s ease-out;
}

/* Button press animation */
.button-press {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Smooth transitions */
.smooth-transition {
  transition: all 0.3s ease;
}

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