/* Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: all 0.8s ease-in-out;
  overflow: hidden;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 500px;
  width: 100%;
  padding: 2rem;
}

/* Lottie Animation Container */
.lottie-container {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.lottie-container dotlottie-wc {
  filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.3));
  animation: lottie-float 3s ease-in-out infinite;
}

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

/* Loading Circle */
.loading-circle-container {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.loading-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #60a5fa 0deg,
    #2563eb 90deg,
    #1d4ed8 180deg,
    #1e40af 270deg,
    #60a5fa 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotate 2s linear infinite;
  position: relative;
}

.loading-circle::before {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a0a0a 0%, #111111 50%, #1a1a1a 100%);
  z-index: 1;
}

.loading-circle-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a0a0a 0%, #111111 50%, #1a1a1a 100%);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-percentage {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #60a5fa;
  text-align: center;
  line-height: 1;
  animation: number-glow 2s ease-in-out infinite alternate;
}

@keyframes number-glow {
  from {
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
  }
  to {
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.8);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* Loading Text */
.loading-text {
  color: #333;
  z-index: 2;
  position: relative;
}

.loading-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-glow 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
  from {
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.5));
  }
  to {
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.8));
  }
}

.loading-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
  opacity: 0.8;
  animation: fade-in-out 2s ease-in-out infinite;
}

@keyframes fade-in-out {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Loading Progress Bar */
.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 50%, #1d4ed8 100%);
  border-radius: 2px;
  width: 0%;
  animation: progress-load 3s ease-in-out infinite;
  position: relative;
}

.loading-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-load {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

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

/* Background Effects */
.preloader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(29, 78, 216, 0.1) 0%, transparent 50%);
  animation: background-shift 8s ease-in-out infinite;
  z-index: 1;
}

@keyframes background-shift {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .preloader-content {
    padding: 1rem;
  }
  
  .lottie-container dotlottie-wc {
    width: 250px !important;
    height: 250px !important;
  }
  
  .loading-circle {
    width: 60px;
    height: 60px;
  }
  
  .loading-circle::before {
    width: 50px;
    height: 50px;
  }
  
  .loading-circle-inner {
    width: 40px;
    height: 40px;
  }
  
  .loading-percentage {
    font-size: 12px;
  }
  
  .loading-progress {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .lottie-container dotlottie-wc {
    width: 200px !important;
    height: 200px !important;
  }
  
  .loading-title {
    font-size: 1.5rem;
  }
  
  .loading-subtitle {
    font-size: 0.875rem;
  }
  
  .loading-progress {
    width: 120px;
  }
}

/* Dark mode adjustments */
.dark .preloader {
  background: linear-gradient(135deg, #0a0a0a 0%, #111111 25%, #1a1a1a 50%, #262626 75%, #404040 100%);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .lottie-container dotlottie-wc,
  .loading-circle,
  .loading-percentage,
  .loading-title,
  .loading-subtitle,
  .loading-progress-bar,
  .loading-progress-bar::after,
  .preloader::before {
    animation: none;
  }
  
  .loading-progress-bar {
    animation: progress-load-simple 3s ease-in-out infinite;
  }
}

@keyframes progress-load-simple {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}
