/* loader.css - fade + spread + particles hide animation (no tilt) */
/* keep your existing vars and base styles; added new rules for particle hide */
:root {
  --lx-bg: rgba(2, 6, 23, 0.96);
  --lx-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  --lx-accent: #06b6d4;
  --lx-accent-2: #2dd4bf;
  --lx-muted: #9fb7d6;
  --lx-radius: 12px;
  --lx-shadow: 0 30px 80px rgba(2, 6, 23, 0.7);
  --lx-z: 99999;
  --hide-duration: 600ms;
  --particle-duration: 700ms;
  --progress-duration: 1000ms;
  /* progress bar will animate in 1s */
}

/* base loader styles */
.xl-loader-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lx-bg);
  z-index: var(--lx-z);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.xl-loader {
  width: min(680px, 94%);
  max-width: 680px;
  background: var(--lx-panel-bg);
  border-radius: var(--lx-radius);
  padding: 26px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-direction: column;
  box-shadow: var(--lx-shadow);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: opacity .42s ease, transform .42s cubic-bezier(.2, .9, .26, 1);
  will-change: opacity, transform;
  position: relative;
  overflow: visible;
}

.xl-loader.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.xl-loader-logo {
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #021126;
  font-size: 20px;
}

.xl-loader-title {
  color: var(--lx-accent-2);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.xl-loader-sub {
  color: var(--lx-muted);
  font-size: 13px;
  max-width: 520px;
  text-align: center;
}

.xl-boot-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.xl-boot-line {
  width: 82%;
  max-width: 480px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.12), rgba(45, 212, 191, 0.06));
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.xl-boot-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.95), rgba(45, 212, 191, 0.9));
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.08);
  transition: width var(--progress-duration) cubic-bezier(.2, .9, .26, 1);
}

.xl-boot-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 13px;
  color: var(--lx-muted);
  opacity: 0.96;
}

/* ------------------------------
   fade-spread hide (NO TILT / NO ROTATE)
   ------------------------------ */

/* marker class: triggers fade-spread */
.xl-loader--fade-spread {
  animation: fadeSpread var(--hide-duration) cubic-bezier(.2, .9, .26, 1) forwards;
  will-change: opacity, transform, filter;
}

/* particle container inside loader */
.xl-particle-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* each particle basic */
.xl-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, rgba(6, 182, 212, 0.95) 40%, rgba(45, 212, 191, 0.9) 60%);
  opacity: 0.95;
  transform-origin: center center;
  will-change: transform, opacity, filter;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.06);
  animation-name: particleFly;
  animation-duration: var(--particle-duration);
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(.08, .9, .3, 1);
}

/* particle small variant */
.xl-particle.xs {
  width: 6px;
  height: 6px
}

.xl-particle.sm {
  width: 7px;
  height: 7px
}

.xl-particle.lg {
  width: 10px;
  height: 10px
}

@keyframes fadeSpread {
  0% {
    opacity: 1;
    filter: blur(0px);
  }

  30% {
    opacity: 0.86;
    filter: blur(1px);
  }

  80% {
    opacity: 0.48;
    filter: blur(4px) saturate(0.95);
  }

  100% {
    opacity: 0;
    filter: blur(8px) saturate(0.9);
  }
}

/* particle flight uses CSS transform values set inline (translate + scale) */
/* fallback keyframes (in case inline transform not applied) */
@keyframes particleFly {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.98;
    filter: blur(0);
  }

  80% {
    opacity: 0.75;
    filter: blur(0.6px);
  }

  100% {
    transform: translate3d(calc(var(--tx, 0px)), calc(var(--ty, 0px)), 0) scale(var(--s, 0.8));
    opacity: 0;
    filter: blur(2px);
  }
}

/* reduced motion: simplify to fade */
@media (prefers-reduced-motion: reduce) {
  .xl-loader--fade-spread {
    animation: fadeSimple 320ms ease-out forwards !important;
  }

  .xl-particle {
    display: none !important;
    animation: none !important;
  }
}

@keyframes fadeSimple {
  0% {
    opacity: 1;
    transform: none;
  }

  100% {
    opacity: 0;
    transform: none;
    visibility: hidden;
  }
}