/* Animation Effects for Science LMS */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital@0;1&display=swap');

/* ==================== Floating Formulas Background ==================== */

.formula-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.formula {
  position: absolute;
  font-family: 'Merriweather', serif;
  font-size: 1.5rem;
  font-style: italic;
  color: rgba(140, 180, 255, 0.25);
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes float-formula {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 0.5;
  }
  95% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-100vh) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

.formula {
  animation: float-formula linear infinite;
}

/* Stagger animations */
.formula:nth-child(1) { animation-delay: -10s; animation-duration: 20s; left: 10%; }
.formula:nth-child(2) { animation-delay: -5s;  animation-duration: 25s; left: 20%; }
.formula:nth-child(3) { animation-delay: -15s; animation-duration: 22s; left: 30%; }
.formula:nth-child(4) { animation-delay: -2s;  animation-duration: 26s; left: 40%; }
.formula:nth-child(5) { animation-delay: -18s; animation-duration: 24s; left: 50%; }
.formula:nth-child(6) { animation-delay: -7s;  animation-duration: 23s; left: 60%; }
.formula:nth-child(7) { animation-delay: -12s; animation-duration: 25s; left: 70%; }
.formula:nth-child(8) { animation-delay: -20s; animation-duration: 21s; left: 80%; }
.formula:nth-child(9) { animation-delay: -3s;  animation-duration: 27s; left: 90%; }

/* ==================== Particle Background ==================== */

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

/* ==================== Chemistry Icons Animation ==================== */

.chemistry-section {
  position: relative;
}

.flask-icon {
  display: inline-block;
  position: relative;
}

.flask-icon svg {
  filter: drop-shadow(0 5px 15px rgba(255, 107, 107, 0.3));
}

.flask-smoke {
  position: absolute;
  width: 40px;
  height: 50px;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
}

/* ==================== Course Cards Enhancement ==================== */

.card.lesson-card {
  position: relative;
  transition: all 0.3s ease;
}

.card.lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card.lesson-card:hover::before {
  opacity: 1;
}

.card.lesson-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2) !important;
}

/* ==================== Badge Animations ==================== */

.badge {
  animation: badge-fade-in 0.5s ease;
}

@keyframes badge-fade-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==================== Progress Bar Animation ==================== */

.progress-bar {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  animation: progress-shimmer 2s infinite;
}

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

/* ==================== Responsive Adjustments ==================== */

@media (max-width: 768px) {
  .formula {
    font-size: 1rem;
  }
  
}

/* ==================== Accessibility ==================== */

@media (prefers-reduced-motion: reduce) {
  .formula {
    animation: none;
    opacity: 0.15;
  }
  
  .card.lesson-card:hover {
    transform: none;
  }
}
