/**
 * Sterling Wealth Page Loader CSS
 * Exact replication from React PageLoader component
 */

/* ===============================================
   PAGE LOADER CONTAINER
   =============================================== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #071019;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

.page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ===============================================
   ANIMATED BACKGROUND GRID
   =============================================== */
.loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 200, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 200, 255, 0.1) 1px, transparent 1px);
  background-size: min(50px, 12vw) min(50px, 12vw);
  opacity: 0.2;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* ===============================================
   LOGO
   =============================================== */
.loader-logo {
  position: relative;
  z-index: 1;
  margin-bottom: 3rem;
  animation: logoGlow 2s ease-in-out infinite, logoFadeIn 0.5s ease-out;
}

.loader-logo img {
  height: clamp(36px, 10vw, 60px);
}

@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(0, 200, 255, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(0, 200, 255, 0.8));
  }
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===============================================
   PROGRESS BAR
   =============================================== */
.loader-progress-container {
  position: relative;
  width: min(80vw, 300px);
  height: clamp(4px, 0.8vw, 6px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: clamp(0.75rem, 2.5vw, 1rem);
}

.loader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00C8FF, #00E08A);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
  transition: width 0.3s ease;
  width: 0%;
}

.loader-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s linear infinite;
}

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

/* ===============================================
   PROGRESS TEXT
   =============================================== */
.loader-progress-text {
  color: #00C8FF;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: bold;
  font-family: monospace;
  letter-spacing: 0.1em;
}

.loader-text {
  color: #E6EEF3;
  font-size: clamp(0.85rem, 3vw, 1rem);
  margin-top: 1rem;
  animation: textPulse 2s ease-in-out infinite;
}

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

/* ===============================================
   FLOATING PARTICLES
   =============================================== */
.loader-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.loader-particle {
  position: absolute;
  width: clamp(3px, 0.9vw, 4px);
  height: clamp(3px, 0.9vw, 4px);
  border-radius: 50%;
  animation: particleFloat 3s ease-in-out infinite;
}

.loader-particle.cyan {
  background: #00C8FF;
}

.loader-particle.green {
  background: #00E08A;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    transform: translateY(-30px);
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: translateY(-30px);
    opacity: 0;
    transform: scale(0);
  }
}
