/**
 * classroom-animations.css — ClassroomOS Shared Animation Classes
 *
 * Global CSS animations and transitions for UI elements.
 * Include in any lesson that uses classroom-animations.js.
 *
 *   <link rel="stylesheet" href="../assets/css/classroom-animations.css" />
 */

/* ============================================================================
   Pulse Animations (for station nodes, highlights, etc.)
   ============================================================================ */

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

@keyframes pulseGlow {
  0% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(52, 152, 219, 0.8));
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.6)) drop-shadow(0 0 16px rgba(74, 200, 255, 0.4));
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(52, 152, 219, 0.8));
    transform: scale(1);
  }
}

@keyframes pulseColor {
  0%, 100% {
    color: #3498db;
  }
  50% {
    color: #2ecc71;
  }
}

/* ============================================================================
   Fade Animations
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================================
   Slide Animations
   ============================================================================ */

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

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

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

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

/* ============================================================================
   Bounce Animations
   ============================================================================ */

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================================================
   Rotation Animations
   ============================================================================ */

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

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

/* ============================================================================
   Utility Classes for Animations
   ============================================================================ */

.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease-in-out forwards;
}

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

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

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

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

.animate-slide-in-up {
  animation: slideInUp 0.4s ease-out forwards;
}

.animate-slide-in-down {
  animation: slideInDown 0.4s ease-out forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* ============================================================================
   State-based Animations
   ============================================================================ */

/* Smooth transitions for interactive elements */
.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-fast {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-slow {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specific property transitions */
.transition-color {
  transition: color 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

.transition-box-shadow {
  transition: box-shadow 0.3s ease;
}

/* ============================================================================
   Hover/Focus Animations
   ============================================================================ */

.interactive-element {
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.interactive-element:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Loading Animations
   ============================================================================ */

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

.shimmer-loading {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ============================================================================
   Visibility Animations
   ============================================================================ */

.invisible {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================================
   Animation Delay Utilities
   ============================================================================ */

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================================================
   Animation Duration Utilities
   ============================================================================ */

.duration-300 { animation-duration: 300ms; }
.duration-500 { animation-duration: 500ms; }
.duration-700 { animation-duration: 700ms; }
.duration-1000 { animation-duration: 1000ms; }
