/* ==========================================================================
   TradOpiax Trading Platform — Premium Logo Preloader & Reconnect Sync Overlay
   Architecture: Ultra-Modern Fintech, Glassmorphism, Cyber Glow & Smooth Motion
   ========================================================================== */

.db-loader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 45%, #0c1220 0%, #060913 65%, #03050a 100%);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.db-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.02);
}

/* Ambient Cyber Aurora Glows */
.db-loader-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.22;
  will-change: transform, opacity;
  animation: dbAuroraFloat 8s ease-in-out infinite alternate;
}

.db-loader-aurora-cyan {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #00e5ff 0%, rgba(0, 229, 255, 0) 70%);
  top: 15%;
  left: 20%;
  animation-duration: 7s;
}

.db-loader-aurora-emerald {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #00e676 0%, rgba(0, 230, 118, 0) 70%);
  bottom: 15%;
  right: 20%;
  animation-duration: 9s;
  animation-direction: alternate-reverse;
}

.db-loader-aurora-purple {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.14;
}

@keyframes dbAuroraFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -20px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Background Cyber Grid */
.db-loader-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
}

/* Center Stage Content Card */
.db-loader-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Orbital Rings & Logo Disc */
.db-loader-orbit-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

/* Outer Spinning Conical Arc */
.db-loader-orbit-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(from 0deg, transparent 0%, #00e5ff 40%, #00e676 80%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: dbOrbitSpin 1.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.25);
}

/* Inner Counter-Rotating Dashed Orbit */
.db-loader-orbit-inner {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 230, 118, 0.35);
  animation: dbOrbitSpinRev 4s linear infinite;
}

/* Core Pulsing Glow Behind Logo */
.db-loader-orbit-halo {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.3) 0%, rgba(0, 230, 118, 0.15) 50%, transparent 75%);
  animation: dbHaloPulse 2s ease-in-out infinite;
}

/* Center Glassmorphism Logo Shield */
.db-loader-logo-shield {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 26px;
  background: rgba(14, 20, 36, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6),
              inset 0 1px 1px rgba(255, 255, 255, 0.25),
              0 0 30px rgba(0, 229, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: dbShieldPulse 2s ease-in-out infinite;
}

/* Sheen Light Sweep */
.db-loader-logo-shield::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(0, 229, 255, 0.3) 52%,
    transparent 65%
  );
  transform: rotate(25deg);
  animation: dbSheenSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}

/* Animated Logo Image */
.db-loader-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(0, 229, 255, 0.45));
  animation: dbLogoPulse 2s ease-in-out infinite;
  transition: transform 0.3s ease;
}

/* Typography & Brand Meta */
.db-loader-brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #00e5ff 0%, #ffffff 45%, #00e676 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: dbTextShimmer 3s linear infinite;
  margin-bottom: 6px;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.35);
}

.db-loader-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 22px;
}

.db-loader-live-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  animation: dbBeaconBlink 1.4s ease-in-out infinite;
}

/* Modern Pill Progress Bar */
.db-loader-progress-track {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.db-loader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00e5ff, #00e676);
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.7);
  transition: width 0.3s ease;
  will-change: width;
}

.db-loader-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
  animation: dbProgressScan 1.2s linear infinite;
}

/* Dynamic Status Feedback */
.db-loader-status {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  min-height: 20px;
  letter-spacing: 0.2px;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.db-loader-detail {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  letter-spacing: 0.3px;
  text-align: center;
}

/* Keyframe Animations */
@keyframes dbOrbitSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes dbHaloPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 0.75; }
}

@keyframes dbShieldPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 35px rgba(0,0,0,0.6), 0 0 25px rgba(0, 229, 255, 0.2); }
  50% { transform: scale(1.03); box-shadow: 0 16px 45px rgba(0,0,0,0.7), 0 0 35px rgba(0, 230, 118, 0.35); }
}

@keyframes dbLogoPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(0, 230, 118, 0.7));
  }
}

@keyframes dbSheenSweep {
  0% { transform: translateY(-120%) rotate(25deg); opacity: 0; }
  25% { opacity: 1; }
  60% { transform: translateY(120%) rotate(25deg); opacity: 0; }
  100% { transform: translateY(120%) rotate(25deg); opacity: 0; }
}

@keyframes dbTextShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes dbBeaconBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

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

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .db-loader-orbit-wrapper {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
  }
  .db-loader-logo-shield {
    width: 78px;
    height: 78px;
    border-radius: 22px;
  }
  .db-loader-logo-img {
    width: 46px;
    height: 46px;
  }
  .db-loader-brand-title {
    font-size: 20px;
  }
  .db-loader-progress-track {
    width: 180px;
    height: 3.5px;
  }
  .db-loader-status {
    font-size: 12px;
  }
  .db-loader-detail {
    font-size: 10px;
  }
}
