/* Modern Loader Styles */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loader Container */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Animated Logo/Text */
.loader-logo {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  display: flex;
  gap: 8px;
}

.loader-logo-text {
  color: var(--color-text-primary);
  animation: fadeInUp 0.8s ease-out;
}

.loader-logo-highlight {
  color: var(--color-primary);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Spinner Animation */
.loader-spinner {
  width: 60px;
  height: 60px;
  position: relative;
  margin: 20px 0;
}

.loader-spinner::before,
.loader-spinner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--color-primary);
  animation: spin 1.2s linear infinite;
}

.loader-spinner::before {
  width: 100%;
  height: 100%;
  border-top-color: var(--color-primary);
  border-right-color: var(--color-primary);
  opacity: 0.3;
}

.loader-spinner::after {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite reverse;
}

/* Progress Bar */
.loader-progress {
  width: 200px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
  border-radius: 10px;
  animation: progress 1.5s ease-out forwards;
  box-shadow: 0 0 10px var(--color-primary);
}

/* Dots Animation */
.loader-dots {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(1) {
  animation-delay: 0s;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .loader-logo {
    font-size: 36px;
    letter-spacing: 3px;
  }

  .loader-spinner {
    width: 50px;
    height: 50px;
  }

  .loader-progress {
    width: 150px;
  }
}
