/**
 * Buy Elaichi Online - Signature Luxury Preloader & Transition Styles
 * Forest Green & Royal Gold Theme (#0f291e, #c8a876)
 */

#app-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: radial-gradient(circle at center, #0f291e 0%, #061711 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out, visibility 0.22s ease;
  pointer-events: all;
  user-select: none;
}

#app-preloader.fade-out {
  opacity: 0;
  transform: scale(1.02);
  visibility: hidden;
  pointer-events: none;
}

.preloader-brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.22s ease-out, opacity 0.22s ease;
}

#app-preloader.fade-out .preloader-brand-box {
  transform: scale(0.96) translateY(-8px);
  opacity: 0;
}

/* Golden disc container */
.preloader-circle-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsing outer aura ring */
.preloader-circle-wrapper::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(200, 168, 118, 0.45);
  animation: preloaderSpinRing 12s linear infinite;
}

.preloader-circle-wrapper::after {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 168, 118, 0.28) 0%, transparent 70%);
  animation: preloaderPulseGlow 2.4s ease-in-out infinite;
  z-index: 1;
}

/* Solid gold circular disc (Exact match to brand logo) */
.preloader-gold-disc {
  position: relative;
  z-index: 2;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5d796 0%, #c8a876 50%, #ad8543 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(200, 168, 118, 0.5), 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: preloaderDiscPop 2.4s ease-in-out infinite;
}

/* Sprout leaf inside the circle */
.preloader-leaf-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 85%;
  animation: preloaderLeafBreathe 2.4s ease-in-out infinite;
}

.preloader-leaf-icon svg {
  width: 100%;
  height: 100%;
  fill: #0f291e;
  filter: drop-shadow(0 1.5px 2px rgba(0, 0, 0, 0.2));
}

/* Typography */
.preloader-title {
  margin-top: 1.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.preloader-tagline {
  margin-top: 0.35rem;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c8a876;
  opacity: 0.95;
}

/* Smooth golden progress bar track */
.preloader-progress-track {
  margin-top: 1.35rem;
  width: 130px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.preloader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #c8a876, #f3d489, #c8a876);
  border-radius: 9999px;
  animation: preloaderSlideTrack 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Animations */
@keyframes preloaderSpinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes preloaderPulseGlow {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.85;
  }
}

@keyframes preloaderDiscPop {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(200, 168, 118, 0.4), 0 8px 20px rgba(0, 0, 0, 0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 45px rgba(200, 168, 118, 0.7), 0 12px 30px rgba(0, 0, 0, 0.55);
  }
}

@keyframes preloaderLeafBreathe {
  0%, 100% {
    transform: scale(1) translateY(0) rotate(0deg);
  }
  50% {
    transform: scale(1.08) translateY(-2px) rotate(-2deg);
  }
}

@keyframes preloaderSlideTrack {
  0% {
    left: -45%;
  }
  100% {
    left: 100%;
  }
}
