/* AIBM Marketing Site - Animations */
/* Scroll animations, transitions, keyframes */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Scale Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Intersection Observer Classes */
/* IMPORTANT: Default to VISIBLE so content shows even without JS */
/* Animations are progressive enhancement, not required for content */
.animate-on-scroll {
  opacity: 1; /* Visible by default */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* When JS is loaded, it adds .js-enabled to body, then we can hide for animation */
body.js-enabled .animate-on-scroll:not(.visible) {
  opacity: 0;
}

.animate-on-scroll.visible {
  opacity: 1;
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
  opacity: 1; /* Visible by default */
}

body.js-enabled .animate-fade-in:not(.visible) {
  opacity: 0;
}

.animate-fade-in.visible {
  animation: fadeIn 0.8s ease forwards;
}

.animate-slide-left {
  opacity: 1; /* Visible by default */
  transform: translateX(0);
}

body.js-enabled .animate-slide-left:not(.visible) {
  opacity: 0;
  transform: translateX(-30px);
}

.animate-slide-left.visible {
  animation: fadeInLeft 0.6s ease forwards;
}

.animate-slide-right {
  opacity: 1; /* Visible by default */
  transform: translateX(0);
}

body.js-enabled .animate-slide-right:not(.visible) {
  opacity: 0;
  transform: translateX(30px);
}

.animate-slide-right.visible {
  animation: fadeInRight 0.6s ease forwards;
}

.animate-scale {
  opacity: 1; /* Visible by default */
  transform: scale(1);
}

body.js-enabled .animate-scale:not(.visible) {
  opacity: 0;
  transform: scale(0.9);
}

.animate-scale.visible {
  animation: scaleIn 0.6s ease forwards;
}

/* Stagger delay for multiple elements */
.animate-on-scroll:nth-child(1) {
  animation-delay: 0ms;
}

.animate-on-scroll:nth-child(2) {
  animation-delay: 100ms;
}

.animate-on-scroll:nth-child(3) {
  animation-delay: 200ms;
}

.animate-on-scroll:nth-child(4) {
  animation-delay: 300ms;
}

.animate-on-scroll:nth-child(5) {
  animation-delay: 400ms;
}

.animate-on-scroll:nth-child(6) {
  animation-delay: 500ms;
}

/* Loading Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* Progress Bar Fill Animation */
@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width);
  }
}

.progress-fill-animated {
  animation: progressFill 1s ease-out forwards;
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

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

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

/* Slide Down (for mobile menu) */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--gray-100) 0%,
    var(--gray-300) 50%,
    var(--gray-100) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Smooth transitions for interactive elements */
.transition-all {
  transition: all var(--transition-base);
}

.transition-colors {
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.transition-transform {
  transition: transform var(--transition-base);
}

.transition-opacity {
  transition: opacity var(--transition-base);
}

/* Hover effects */
.hover-lift:hover {
  transform: translateY(-2px);
}

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

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(25, 118, 210, 0.3);
}
