/* ══════════════════════════════════════════════════════════════
   VAPELINK · Preloader Styles
   ══════════════════════════════════════════════════════════════ */

/* ── PRELOADER ────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  background: #040808;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 1.2s var(--ease), visibility 1.2s var(--ease);
  overflow: hidden;
}

#preloader.hidden { opacity: 0; visibility: hidden; }

#preloader.hidden .preloader-content {
  transform: scale(1.1) translateY(-10px);
  filter: blur(16px);
  opacity: 0;
}

#preloader-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.preloader-bg-circles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}

.bg-circle.c1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,255,136,.15), transparent 70%);
  top: -300px; left: 50%;
  transform: translateX(-50%);
  animation: floatC1 8s ease-in-out infinite;
}

.bg-circle.c2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,200,150,.1), transparent 70%);
  bottom: -100px; right: -100px;
  animation: floatC2 10s ease-in-out infinite;
}

.bg-circle.c3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(0,255,136,.08), transparent 70%);
  bottom: 40%; left: -80px;
  animation: floatC3 7s ease-in-out infinite;
}

@keyframes floatC1 {
  0%,100% { transform: translateX(-50%) scale(1); opacity:.8; }
  50% { transform: translateX(-50%) scale(1.15) translateY(-20px); opacity:1; }
}
@keyframes floatC2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-50px,-40px) scale(1.1); }
}
@keyframes floatC3 {
  0%,100% { transform: scale(1); opacity:.5; }
  50% { transform: scale(1.3) translateY(-15px); opacity:.8; }
}

.smoke-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}

.smoke-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,255,136,.06);
  background: transparent;
}

.sr-1 { width: 350px; height: 350px; animation: ringExpand 5s ease-out infinite; }
.sr-2 { width: 350px; height: 350px; animation: ringExpand 5s ease-out infinite 1.7s; }
.sr-3 { width: 350px; height: 350px; animation: ringExpand 5s ease-out infinite 3.4s; }

@keyframes ringExpand {
  0%   { transform: scale(.2); opacity:.6; border-color: rgba(0,255,136,.15); border-width: 2px; }
  100% { transform: scale(3.5); opacity:0; border-color: rgba(0,255,136,0); border-width: .5px; }
}

.preloader-content {
  text-align: center;
  position: relative;
  z-index: 10;
  transition: transform 1.2s var(--ease), filter 1.2s ease, opacity 1.2s ease;
  max-width: 90vw;
  padding: 0 10px;
}

.vape-device-wrap { margin: 0 auto 16px; display: flex; justify-content: center; }

.vape-device {
  width: 80px; height: 200px;
  filter: drop-shadow(0 0 30px rgba(0,255,136,.15));
  animation: deviceFloat 4s ease-in-out infinite;
  transition: transform 1s ease, opacity 1s ease;
}

@keyframes deviceFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.preloader-logo {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 8px;
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 2px;
}

.logo-letter {
  display: inline-block;
  color: #fff;
  text-shadow: 0 0 25px rgba(255,255,255,.3);
  animation: letterReveal .7s calc(var(--i) * .1s) var(--spring) both;
}

.logo-accent {
  display: inline-block;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent), 0 0 60px rgba(0,255,136,.3);
  animation: letterReveal .7s calc(var(--i) * .1s) var(--spring) both;
}

@keyframes letterReveal {
  0% { opacity:0; transform: translateY(40px) scale(.5); filter: blur(8px); }
  60% { filter: blur(0); }
  100% { opacity:1; transform: translateY(0) scale(1); filter: blur(0); }
}

.preloader-subtitle {
  font-size: 10px;
  letter-spacing: 6px;
  color: rgba(0,255,136,.35);
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 600;
  animation: subtitleFade 1.5s ease .8s both;
}

@keyframes subtitleFade {
  0% { opacity:0; letter-spacing:12px; }
  100% { opacity:1; letter-spacing:6px; }
}

.preloader-percent {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,255,136,.6);
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.preloader-progress {
  width: 200px;
  height: 1.5px;
  background: rgba(255,255,255,.03);
  border-radius: 10px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, #00ffcc 50%, var(--accent) 80%, transparent 100%);
  border-radius: 10px;
  animation: preloaderProgress 2.8s var(--ease) forwards;
}

@keyframes preloaderProgress {
  0% { width:0%; } 15% { width:10%; } 30% { width:25%; }
  50% { width:50%; } 70% { width:72%; } 85% { width:88%; } 100% { width:100%; }
}

.preloader-text {
  color: rgba(0,180,100,.4);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 16px;
  animation: textPulse 3.5s ease-in-out infinite;
}

@keyframes textPulse {
  0%,100% { opacity:.4; letter-spacing:4px; }
  50% { opacity:.8; letter-spacing:7px; }
}

/* Preloader mobile */
@media (max-width: 600px) {
  .vape-device { width: 52px; height: 130px; }
  .preloader-logo { font-size: 28px; letter-spacing: 4px; }
  .preloader-subtitle { font-size: 8px; letter-spacing: 3px; }
  .preloader-progress { width: 160px; }
  .bg-circle.c1 { width: 400px; height: 400px; top: -200px; }
  .bg-circle.c2 { width: 250px; height: 250px; }
}

@media (max-width: 380px) {
  .preloader-bg-circles,
  .smoke-rings { display: none; }
  #preloader-canvas { display: none; }
  .vape-device { width: 40px; height: 100px; }
  .preloader-logo { font-size: 22px; }
}

/* Design tokens needed for preloader (repeated from main CSS) */
:root {
  --accent: #00ff88;
  --ease: cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}
