/* ===================================================
   WebApple — Premium Page Loader
   Light theme, centered logo, animated rings
   =================================================== */

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: linear-gradient(135deg, #f0f6ff 0%, #ffffff 45%, #e6f0ff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
              transform 0.65s cubic-bezier(0.4,0,0.2,1);
  will-change: opacity, transform;
}

/* Background floating orbs */
#page-loader::before,
#page-loader::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
#page-loader::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(41,121,255,0.07) 0%, transparent 70%);
  top: -120px; right: -120px;
  animation: loaderOrbFloat 6s ease-in-out infinite;
}
#page-loader::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,200,255,0.06) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  animation: loaderOrbFloat 8s ease-in-out infinite reverse;
}

#page-loader.hide-loader {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

/* ── Logo Wrap ── */
.loader-logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderFadeUp 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

.loader-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 10px;
  box-shadow:
    0 4px 24px rgba(41,121,255,0.18),
    0 1px 4px rgba(0,0,0,0.06);
  animation: loaderLogoPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.loader-logo-text {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1565C0, #2979FF);
  color: white;
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(41,121,255,0.3);
  animation: loaderLogoPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

/* Spinning rings */
.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 2.5px solid transparent;
}

.loader-ring-1 {
  inset: -10px;
  border-top-color: #2979FF;
  border-right-color: rgba(41,121,255,0.35);
  animation: loaderSpin 1.1s linear infinite;
}

.loader-ring-2 {
  inset: -20px;
  border-bottom-color: #00c8ff;
  border-left-color: rgba(0,200,255,0.3);
  animation: loaderSpin 1.8s linear infinite reverse;
}

.loader-ring-3 {
  inset: -32px;
  border: 1.5px solid rgba(41,121,255,0.12);
  border-top-color: rgba(0,229,255,0.45);
  animation: loaderSpin 3s linear infinite;
}

/* ── Brand Name ── */
.loader-brand {
  text-align: center;
  animation: loaderFadeUp 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}

.loader-brand-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0D1B3E;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 6px;
}

.loader-brand-name span {
  background: linear-gradient(90deg, #1565C0, #00c8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-tagline {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64B5F6;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ── Progress Bar ── */
.loader-progress-wrap {
  animation: loaderFadeUp 0.5s ease 0.3s both;
}

.loader-progress {
  width: 220px;
  height: 3px;
  background: rgba(41,121,255,0.1);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1565C0, #2979FF, #00c8ff);
  border-radius: 99px;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(0,200,255,0.5);
}



/* ── Dots ── */
.loader-dots {
  display: flex;
  gap: 8px;
  animation: loaderFadeUp 0.5s ease 0.45s both;
}

.loader-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: loaderDotBounce 1.3s ease-in-out infinite;
}

.loader-dot:nth-child(1) { background: #1565C0; animation-delay: 0s; }
.loader-dot:nth-child(2) { background: #2979FF; animation-delay: 0.18s; }
.loader-dot:nth-child(3) { background: #00c8ff; animation-delay: 0.36s; }

/* ── Keyframes ── */
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes loaderLogoPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 24px rgba(41,121,255,0.18), 0 1px 4px rgba(0,0,0,0.06);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 8px 36px rgba(41,121,255,0.32), 0 2px 8px rgba(0,0,0,0.08);
  }
}

@keyframes loaderFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loaderDotBounce {
  0%, 70%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-9px) scale(1.1); }
}

@keyframes loaderOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, 15px) scale(1.05); }
}
