/* ============================================================
   ANIMATIONS CSS — Transitions, scroll reveals, hover effects
   ============================================================ */

/* Fade in on load */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide in from left */
.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up */
.scale-up {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scale-up.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover effects */
.card-hover {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Button press effect */
.btn-press:active {
  transform: scale(0.97);
}

/* Glow effect on focus */
.glow-focus:focus {
  box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.3);
}

/* Progress bar animation */
.progress-animate {
  animation: progressFill 1s ease-out forwards;
}

@keyframes progressFill {
  from { width: 0; }
}

/* Rotate icon */
.rotate-hover:hover {
  animation: rotateOnce 0.3s ease;
}

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

/* Subtle bounce */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Notification badge pop */
.badge-pop {
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Theme transition */
body.theme-transitioning * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Highlight flash for scroll target */
.highlight-flash {
  animation: highlightFlash 1.5s ease;
}

@keyframes highlightFlash {
  0% { background-color: rgba(243, 156, 18, 0.3); }
  100% { background-color: transparent; }
}

/* Typing indicator */
.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  margin: 0 2px;
  animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in, .slide-in-left, .slide-in-right, .scale-up {
    opacity: 1;
    transform: none;
  }
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}
