/* ============================================
   ENHANCED ANIMATIONS & TRANSITIONS
   Smooth, professional micro-interactions
   ============================================ */

/* Loading State Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Skeleton Screen Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-light) 0%,
    #e0e0e0 50%,
    var(--color-bg-light) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* Fade In Up Animation (for content reveals) */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Stagger animation for lists */
.stagger-item {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Hover lift effect */
.lift-on-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Smooth scale effect */
.scale-on-hover {
  transition: transform var(--transition-fast);
}

.scale-on-hover:hover {
  transform: scale(1.02);
}

/* Glow effect for important elements */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(201, 42, 42, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(201, 42, 42, 0.8);
  }
}

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

/* Progress Bar Animation */
@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-gray), var(--color-primary-blue));
  animation: progressBar 1.5s ease-out forwards;
}

/* Typewriter effect (optional for headers) */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(40) forwards;
}

/* Slide in from side */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

/* Bounce effect for icons */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce-on-hover:hover {
  animation: bounce 0.6s ease-in-out;
}

/* Rotate effect */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate-on-hover:hover {
  animation: rotate 0.6s ease-in-out;
}

/* Focus visible enhancement */
*:focus-visible {
  outline: 3px solid var(--color-primary-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Smooth color transitions */
.smooth-color-transition {
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

/* 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;
  }
}
