/* ============================================================
   东交智控 - Animations
   ============================================================ */

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

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

@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);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(26, 86, 219, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(26, 86, 219, 0.3);
  }
}

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

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

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === Animation Classes === */
.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

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

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* === Hero Animations === */
.hero-text-line {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-text-line:nth-child(1) { animation-delay: 0.1s; }
.hero-text-line:nth-child(2) { animation-delay: 0.3s; }
.hero-text-line:nth-child(3) { animation-delay: 0.5s; }
.hero-text-line:nth-child(4) { animation-delay: 0.7s; }

/* === Gradient Text Animation === */
.text-gradient-animate {
  background: linear-gradient(90deg, #1a56db, #0ea5e9, #1a56db);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* === Loading Spinner === */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(26, 86, 219, 0.2);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* === Card Hover Effects === */
.card-hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* === Image Zoom === */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform var(--transition-slow);
}

.img-zoom:hover img {
  transform: scale(1.08);
}

/* === Underline Animation === */
.nav-underline {
  position: relative;
}

.nav-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--c-gradient-primary);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-underline:hover::after,
.nav-underline.active::after {
  width: 100%;
}

/* === Scroll Progress Bar === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--c-gradient-primary);
  z-index: 2000;
  width: 0;
  transition: width 0.1s;
}

/* === Particles / Background Animation === */
@keyframes drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-40px, -40px); }
}

.bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--c-primary);
  border-radius: 50%;
  opacity: 0.15;
  animation: drift 8s linear infinite;
}

/* === Marquee === */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: marquee 30s linear infinite;
}

/* === Counter Animation === */
.counter {
  display: inline-block;
}
