/* ============================================
   Page Loader Styles
   ============================================ */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

/* Logo Animation */
.loader-logo {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-logo img {
  width: 100px;
  height: auto;
  animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Spinner Ring Around Logo */
.loader-spinner {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 3px solid rgba(124, 58, 237, 0.1);
  border-top-color: var(--primary-color, #7c3aed);
  border-right-color: var(--secondary-color, #06b6d4);
  border-radius: 50%;
  animation: spinnerRotate 1.2s linear infinite;
}

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

/* Loading Text */
.loader-text {
  font-size: 0.95rem;
  color: var(--light-text, #6b7280);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: textFade 1.5s ease-in-out infinite;
}

@keyframes textFade {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   Alternative Loader Styles
   ============================================ */

/* Dots Loader (alternative to spinner) */
.loader-dots {
  display: flex;
  gap: 0.5rem;
}

.loader-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color, #7c3aed);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) { animation-delay: 0s; }
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Progress Bar Loader (alternative) */
.loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color, #7c3aed), var(--secondary-color, #06b6d4));
  border-radius: 2px;
  animation: progressLoad 2s ease-in-out infinite;
}

@keyframes progressLoad {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 60%;
    margin-left: 20%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}

/* ============================================
   Dark Theme Loader
   ============================================ */

.page-loader.dark {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
}

.page-loader.dark .loader-text {
  color: rgba(255, 255, 255, 0.6);
}

.page-loader.dark .loader-spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color, #7c3aed);
  border-right-color: var(--secondary-color, #06b6d4);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .loader-logo {
    width: 100px;
    height: 100px;
  }

  .loader-logo img {
    width: 60px;
    margin-bottom: 1rem;
  }

  .loader-spinner {
    width: 80px;
    height: 80px;
  }

  .loader-text {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }
}

/* ============================================
   Prefers Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .loader-logo img,
  .loader-spinner,
  .loader-text,
  .loader-dots span,
  .loader-progress-bar {
    animation: none;
  }

  .loader-spinner {
    border-top-color: var(--primary-color, #7c3aed);
    opacity: 0.5;
  }
}