/*!
 * Legion Animated Background
 * Анимированный фон для Legion сайта
 */

/* Статичный фон без увеличения */
body {
  background-image: url('../images/background.jpg') !important;
  background-size: cover !important; /* Обычный размер */
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  /* Убираем анимацию фона */
}

/* Дополнительный слой с магическими эффектами */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(251, 191, 36, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 40% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: magicGlow 15s ease-in-out infinite;
}

/* Анимация магического свечения */
@keyframes magicGlow {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* Анимированные частицы поверх фона */
.legion-particles {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.legion-particle {
  position: absolute !important;
  width: 4px !important;
  height: 4px !important;
  background: rgba(139, 92, 246, 0.8) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5) !important;
  animation: legionParticleFloat 8s infinite ease-in-out !important;
}

/* Улучшенная анимация частиц */
@keyframes legionParticleFloat {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) scale(1);
    opacity: 0.4;
  }
  25% { 
    transform: translateY(-30px) translateX(10px) scale(1.2);
    opacity: 0.8;
  }
  50% { 
    transform: translateY(-60px) translateX(-5px) scale(0.8);
    opacity: 1;
  }
  75% { 
    transform: translateY(-30px) translateX(15px) scale(1.1);
    opacity: 0.6;
  }
}

/* Разные типы частиц */

/* Фиолетовые частицы Legion */
.legion-particle-purple {
  background: rgba(139, 92, 246, 0.8) !important;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.6) !important;
  width: 6px !important;
  height: 6px !important;
}

/* Золотые частицы */
.legion-particle-gold {
  background: rgba(251, 191, 36, 0.9) !important;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.7) !important;
  width: 4px !important;
  height: 4px !important;
}

/* Зеленые частицы (fel energy) */
.legion-particle-fel {
  background: rgba(16, 185, 129, 0.8) !important;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.6) !important;
  width: 5px !important;
  height: 5px !important;
}

/* Крупные светящиеся орбы */
.legion-orb {
  position: absolute !important;
  border-radius: 50% !important;
  opacity: 0.2 !important;
  /* Убираем blur эффект */
}

.legion-orb-1 {
  width: 80px !important;
  height: 80px !important;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent) !important;
  left: 15% !important;
  top: 20% !important;
  animation: orbFloat1 15s infinite ease-in-out !important;
}

.legion-orb-2 {
  width: 120px !important;
  height: 120px !important;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent) !important;
  right: 20% !important;
  top: 60% !important;
  animation: orbFloat2 20s infinite ease-in-out !important;
}

.legion-orb-3 {
  width: 100px !important;
  height: 100px !important;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3), transparent) !important;
  left: 70% !important;
  bottom: 30% !important;
  animation: orbFloat3 18s infinite ease-in-out !important;
}

/* Магические искры */
.legion-spark {
  position: absolute !important;
  width: 2px !important;
  height: 8px !important;
  background: linear-gradient(180deg, rgba(139, 92, 246, 1), transparent) !important;
  border-radius: 50% !important;
}

.legion-spark-1 {
  left: 25% !important;
  top: 15% !important;
  animation: sparkTwinkle 3s infinite ease-in-out !important;
}

.legion-spark-2 {
  right: 30% !important;
  top: 40% !important;
  animation: sparkTwinkle 4s infinite ease-in-out 1s !important;
}

.legion-spark-3 {
  left: 60% !important;
  bottom: 50% !important;
  animation: sparkTwinkle 3.5s infinite ease-in-out 2s !important;
}

.legion-spark-4 {
  right: 15% !important;
  bottom: 25% !important;
  animation: sparkTwinkle 4.5s infinite ease-in-out 0.5s !important;
}

.legion-spark-5 {
  left: 40% !important;
  top: 70% !important;
  animation: sparkTwinkle 3.8s infinite ease-in-out 1.5s !important;
}

/* Анимации для орбов */
@keyframes orbFloat1 {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) scale(1);
    opacity: 0.2;
  }
  50% { 
    transform: translateY(-30px) translateX(20px) scale(1.2);
    opacity: 0.4;
  }
}

@keyframes orbFloat2 {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) scale(1);
    opacity: 0.25;
  }
  50% { 
    transform: translateY(40px) translateX(-30px) scale(0.8);
    opacity: 0.5;
  }
}

@keyframes orbFloat3 {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) scale(1);
    opacity: 0.2;
  }
  50% { 
    transform: translateY(-25px) translateX(15px) scale(1.1);
    opacity: 0.45;
  }
}

/* Анимация искр */
@keyframes sparkTwinkle {
  0%, 100% { 
    opacity: 0;
    transform: scale(1) rotate(0deg);
  }
  50% { 
    opacity: 1;
    transform: scale(1.5) rotate(180deg);
  }
}

/* Позиционирование обычных частиц */
.legion-particle:nth-child(1) { left: 5%; top: 10%; animation-delay: 0s; animation-duration: 8s; }
.legion-particle:nth-child(2) { left: 15%; top: 25%; animation-delay: 1s; animation-duration: 10s; }
.legion-particle:nth-child(3) { left: 25%; top: 40%; animation-delay: 2s; animation-duration: 7s; }
.legion-particle:nth-child(4) { left: 35%; top: 15%; animation-delay: 3s; animation-duration: 9s; }
.legion-particle:nth-child(5) { left: 45%; top: 60%; animation-delay: 4s; animation-duration: 11s; }
.legion-particle:nth-child(6) { left: 55%; top: 30%; animation-delay: 5s; animation-duration: 8s; }
.legion-particle:nth-child(7) { left: 65%; top: 50%; animation-delay: 1.5s; animation-duration: 10s; }
.legion-particle:nth-child(8) { left: 75%; top: 20%; animation-delay: 2.5s; animation-duration: 9s; }
.legion-particle:nth-child(9) { left: 85%; top: 70%; animation-delay: 0.5s; animation-duration: 7s; }
.legion-particle:nth-child(10) { left: 10%; top: 80%; animation-delay: 3.5s; animation-duration: 8s; }
.legion-particle:nth-child(11) { left: 30%; top: 5%; animation-delay: 1.8s; animation-duration: 9s; }
.legion-particle:nth-child(12) { left: 50%; top: 85%; animation-delay: 4.2s; animation-duration: 7s; }
.legion-particle:nth-child(13) { left: 70%; top: 12%; animation-delay: 2.8s; animation-duration: 10s; }
.legion-particle:nth-child(14) { left: 90%; top: 45%; animation-delay: 0.8s; animation-duration: 8s; }
.legion-particle:nth-child(15) { left: 20%; top: 65%; animation-delay: 3.8s; animation-duration: 9s; }
.legion-particle:nth-child(16) { left: 80%; top: 35%; animation-delay: 1.2s; animation-duration: 11s; }
.legion-particle:nth-child(17) { left: 40%; top: 90%; animation-delay: 4.5s; animation-duration: 7s; }

/* Пульсирующее свечение для всего сайта */
.legion-ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: ambientPulse 20s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { 
    opacity: 0.2;
    transform: scale(1) rotate(0deg);
  }
  50% { 
    opacity: 0.4;
    transform: scale(1.1) rotate(2deg);
  }
}

/* Эффект мерцания для логотипа */
.legion-logo {
  animation: logoGlow 4s ease-in-out infinite !important;
}

@keyframes logoGlow {
  0%, 100% { 
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5) !important;
  }
  50% { 
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 30px rgba(139, 92, 246, 0.3) !important;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .legion-particles {
    display: none !important; /* Убираем частицы на мобильных для производительности */
  }
  
  .legion-ambient-glow {
    animation-duration: 30s !important; /* Медленнее на мобильных */
  }
  
  .legion-orb {
    display: none !important; /* Убираем орбы на мобильных */
  }
}

/* Эффект при загрузке страницы */
@keyframes pageLoad {
  0% { 
    opacity: 0;
    transform: scale(0.95);
  }
  100% { 
    opacity: 1;
    transform: scale(1);
  }
}

.uk-container {
  animation: pageLoad 1s ease-out !important;
}
