/* Loading Screen Styles */
#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1f 50%, #0a0a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* Animated Logo Letters */
.loader-logo {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.loader-letter {
  font-size: 60px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite, letterFloat 2s ease-in-out infinite;
  opacity: 0;
  transform: translateY(30px);
}

.loader-letter:nth-child(1) {
  animation-delay: 0s, 0s;
}

.loader-letter:nth-child(2) {
  animation-delay: 0.1s, 0.2s;
}

.loader-letter:nth-child(3) {
  animation-delay: 0.2s, 0.4s;
}

.loader-letter:nth-child(4) {
  animation-delay: 0.3s, 0.6s;
}

.loader-letter:nth-child(5) {
  animation-delay: 0.4s, 0.8s;
}

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

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

/* Progress Bar Container */
.loader-bar-container {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.loader-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.loader-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  background-size: 200% 100%;
  border-radius: 10px;
  position: relative;
  animation: progressGlow 2s ease infinite;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes progressGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(4, 4, 4, 0.5);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(10, 10, 10, 0.6);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Percentage Display */
.loader-percentage {
  font-size: 24px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: #e5e7eb;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Loading Text */
.loader-text {
  font-size: 16px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 10px;
  opacity: 0;
  animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Background Particles */
.loader-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.loader-particles::before,
.loader-particles::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: particleFloat 8s ease-in-out infinite;
}

.loader-particles::before {
  background: radial-gradient(circle, #6366f1, transparent);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.loader-particles::after {
  background: radial-gradient(circle, #ec4899, transparent);
  bottom: -200px;
  right: -200px;
  animation-delay: 4s;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 50px) scale(0.9);
  }
}

/* Fade Out Animation */
#loader-wrapper.fade-out {
  animation: fadeOutLoader 0.8s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes fadeOutLoader {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .loader-letter {
    font-size: 48px;
    gap: 10px;
  }

  .loader-bar-container {
    width: 300px;
  }

  .loader-percentage {
    font-size: 20px;
  }

  .loader-text {
    font-size: 14px;
    letter-spacing: 2px;
  }
}

@media (max-width: 480px) {
  .loader-letter {
    font-size: 36px;
    gap: 8px;
  }

  .loader-bar-container {
    width: 250px;
  }

  .loader-percentage {
    font-size: 18px;
  }

  .loader-text {
    font-size: 12px;
  }

  .loader-particles::before,
  .loader-particles::after {
    width: 300px;
    height: 300px;
    filter: blur(80px);
  }
}
