/* Loading Animation Styles - Aurora Theme */

/* Base loader styles */
.aurora-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse at center,
    rgba(10, 14, 26, 0.98) 0%,
    rgba(10, 14, 26, 0.95) 50%,
    rgba(10, 14, 26, 0.98) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.aurora-loader.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.aurora-loader.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

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

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

.aurora-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
}

/* Aurora Globe Spinner */
.aurora-globe-spinner {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.globe-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 20px rgba(94, 234, 212, 0.3);
}

.ring-1 {
  width: 160px;
  height: 160px;
  border-top-color: #5eead4;
  border-right-color: #38bdf8;
  animation: globe-spin 3s linear infinite;
}

.ring-2 {
  width: 120px;
  height: 120px;
  border-bottom-color: #818cf8;
  border-left-color: #c084fc;
  animation: globe-spin 2s linear infinite reverse;
}

.ring-3 {
  width: 80px;
  height: 80px;
  border-top-color: #22d3ee;
  border-right-color: #5eead4;
  animation: globe-spin 1.5s linear infinite;
}

.globe-core {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    #5eead4,
    #38bdf8,
    #1e3a8a
  );
  box-shadow: 
    0 0 20px rgba(94, 234, 212, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: globe-pulse 2s ease-in-out infinite;
}

@keyframes globe-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes globe-pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 0 20px rgba(94, 234, 212, 0.6),
      inset 0 0 20px rgba(0, 0, 0, 0.5);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 
      0 0 40px rgba(94, 234, 212, 0.8),
      inset 0 0 20px rgba(0, 0, 0, 0.5);
  }
}

/* Aurora Particles */
.aurora-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #5eead4, transparent);
  opacity: 0;
  animation: particle-float 4s ease-in-out infinite;
}

/* Stagger particle animations */
.particle-0 { left: 10%; top: 20%; animation-delay: 0s; }
.particle-1 { left: 20%; top: 80%; animation-delay: 0.2s; }
.particle-2 { left: 80%; top: 10%; animation-delay: 0.4s; }
.particle-3 { left: 90%; top: 60%; animation-delay: 0.6s; }
.particle-4 { left: 15%; top: 50%; animation-delay: 0.8s; }
.particle-5 { left: 70%; top: 75%; animation-delay: 1s; }
.particle-6 { left: 30%; top: 15%; animation-delay: 1.2s; }
.particle-7 { left: 85%; top: 40%; animation-delay: 1.4s; }
.particle-8 { left: 45%; top: 85%; animation-delay: 1.6s; }
.particle-9 { left: 60%; top: 25%; animation-delay: 1.8s; }
.particle-10 { left: 25%; top: 65%; animation-delay: 2s; }
.particle-11 { left: 75%; top: 90%; animation-delay: 2.2s; }
.particle-12 { left: 50%; top: 5%; animation-delay: 2.4s; }
.particle-13 { left: 5%; top: 45%; animation-delay: 2.6s; }
.particle-14 { left: 95%; top: 85%; animation-delay: 2.8s; }
.particle-15 { left: 40%; top: 35%; animation-delay: 3s; }
.particle-16 { left: 65%; top: 55%; animation-delay: 3.2s; }
.particle-17 { left: 35%; top: 95%; animation-delay: 3.4s; }
.particle-18 { left: 55%; top: 70%; animation-delay: 3.6s; }
.particle-19 { left: 78%; top: 30%; animation-delay: 3.8s; }

@keyframes particle-float {
  0%, 100% { 
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  50% { 
    opacity: 1;
    transform: translateY(-100px) scale(1);
  }
}

/* Aurora Wave Spinner (for population) */
.aurora-wave-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100px;
}

.wave-bar {
  width: 12px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(
    180deg,
    #5eead4 0%,
    #38bdf8 50%,
    #818cf8 100%
  );
  box-shadow: 0 0 15px rgba(94, 234, 212, 0.5);
  animation: wave-bounce 1.2s ease-in-out infinite;
}

.bar-1 { animation-delay: 0s; }
.bar-2 { animation-delay: 0.1s; }
.bar-3 { animation-delay: 0.2s; }
.bar-4 { animation-delay: 0.3s; }
.bar-5 { animation-delay: 0.4s; }

@keyframes wave-bounce {
  0%, 100% { 
    height: 40px;
    opacity: 0.6;
  }
  50% { 
    height: 100px;
    opacity: 1;
  }
}

/* Loader Text */
.aurora-loader-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.loader-message {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    #5eead4 0%,
    #38bdf8 25%,
    #818cf8 50%,
    #c084fc 75%,
    #5eead4 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: aurora-shimmer 3s ease infinite;
  letter-spacing: 0.02em;
}

.loader-submessage {
  font-size: 1rem;
  color: #94a3b8;
  font-weight: 400;
  opacity: 0.8;
  animation: pulse-opacity 2s ease-in-out infinite;
}

@keyframes aurora-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

/* Population loader specific styles */
.population-content {
  max-width: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .aurora-globe-spinner {
    width: 140px;
    height: 140px;
  }

  .ring-1 {
    width: 120px;
    height: 120px;
  }

  .ring-2 {
    width: 90px;
    height: 90px;
  }

  .ring-3 {
    width: 60px;
    height: 60px;
  }

  .globe-core {
    width: 30px;
    height: 30px;
  }

  .loader-message {
    font-size: 1.25rem;
  }

  .loader-submessage {
    font-size: 0.875rem;
  }

  .wave-bar {
    width: 10px;
  }
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .aurora-loader *,
  .particle,
  .wave-bar,
  .globe-ring,
  .globe-core {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
