body {
  margin: 0;
}

html {
  overflow-x: hidden;
  overflow-y: scroll;
}

#loading-bg {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, 
    var(--initial-loader-bg, #000000) 0%, 
    var(--initial-loader-bg-secondary, #0A0A0A) 50%,
    var(--initial-loader-bg, #000000) 100%);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  block-size: 100vh;
  inline-size: 100%;
  z-index: 9999;
  overflow: hidden;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.loading-logo {
  animation: logo-pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

.loading-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
  color: var(--initial-loader-color, #818CF8);
  text-transform: uppercase;
  animation: text-fade 2s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(129, 140, 248, 0.5);
}

.loading {
  position: relative;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 60px;
  inline-size: 60px;
}

.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 100%;
  border-inline-start: 3px solid var(--initial-loader-color, #818CF8);
  inline-size: 100%;
}

.loading .effect-1 {
  animation: rotate 1.2s linear infinite;
  border-inline-start-color: var(--initial-loader-color, #818CF8);
}

.loading .effect-2 {
  animation: rotate-opacity 1.2s linear infinite 0.2s;
  border-inline-start-color: rgba(129, 140, 248, 0.6);
}

.loading .effect-3 {
  animation: rotate-opacity 1.2s linear infinite 0.4s;
  border-inline-start-color: rgba(129, 140, 248, 0.3);
}

.loading .effects {
  transition: all 0.3s ease;
}

.loading-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.loading-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--initial-loader-color, #818CF8);
  animation: dot-bounce 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.5);
}

.loading-dots .dot-1 {
  animation-delay: 0s;
}

.loading-dots .dot-2 {
  animation-delay: 0.2s;
}

.loading-dots .dot-3 {
  animation-delay: 0.4s;
}

.loading-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.loading-particles .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--initial-loader-color, #818CF8);
  border-radius: 50%;
  opacity: 0.6;
  animation: particle-float 8s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.8);
}

.loading-particles .particle:nth-child(1) {
  left: 20%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.loading-particles .particle:nth-child(2) {
  left: 40%;
  animation-delay: 2s;
  animation-duration: 12s;
}

.loading-particles .particle:nth-child(3) {
  left: 60%;
  animation-delay: 4s;
  animation-duration: 9s;
}

.loading-particles .particle:nth-child(4) {
  left: 80%;
  animation-delay: 1s;
  animation-duration: 11s;
}

.loading-particles .particle:nth-child(5) {
  left: 50%;
  animation-delay: 3s;
  animation-duration: 13s;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes logo-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

@keyframes text-fade {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-5px);
  }
}

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

@keyframes rotate-opacity {
  0% {
    opacity: 0.3;
    transform: rotate(0deg);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.3;
    transform: rotate(360deg);
  }
}

@keyframes dot-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) translateX(50px) scale(1);
    opacity: 0;
  }
}
