/* =========================================================
   assets/css/animations.css — Custom Animations for Reveals,
   Staggered Grids, Transitions, and Loading Spinner
   ========================================================= */

/* Section Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Grid Item Fade-In */
.grid-item {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: staggerFadeIn 0.6s ease-out forwards;
}

.grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-item:nth-child(2) { animation-delay: 0.2s; }
.grid-item:nth-child(3) { animation-delay: 0.3s; }
.grid-item:nth-child(4) { animation-delay: 0.4s; }
.grid-item:nth-child(5) { animation-delay: 0.5s; }
.grid-item:nth-child(6) { animation-delay: 0.6s; }
.grid-item:nth-child(n+7) { animation-delay: 0.7s; }

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hover Transitions for Cards/Buttons */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Fade-In for Elements */
.fade-in {
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Counter Animation (for stats) */
.animate-counter {
  animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner Animation */
.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--teal-light);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark Mode Spinner Adjustment */
body[data-theme="blue"] .loading-spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--teal-light);
}

/* Dark Mode Transition */
body {
  transition: background-color 0.4s ease, color 0.4s ease;
}