/* ============================================
   LOADER PREMIUM - ACGEST
   Design: Minimalista, Suave, Profissional
   ============================================ */

.loading-area {
  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: loaderFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-area.fade-out {
  opacity: 0;
  pointer-events: none;
}

@keyframes loaderFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Container */
.loading-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Logo wrapper com ring animado */
.loader-logo-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ring exterior animado */
.loader-logo-wrapper::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #6c5ce7;
  border-right-color: rgba(108, 92, 231, 0.3);
  animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Ring interior animado (direcao oposta) */
.loader-logo-wrapper::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: rgba(108, 92, 231, 0.2);
  border-left-color: rgba(108, 92, 231, 0.15);
  animation: loaderSpinReverse 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

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

/* Logo image */
#cssload-cupcake {
  position: relative;
  z-index: 2;
}

#cssload-cupcake img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  animation: loaderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  filter: drop-shadow(0 4px 16px rgba(108, 92, 231, 0.12));
}

@keyframes loaderPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.92);
    opacity: 0.7;
  }
}

/* Texto de carregamento */
.loading-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #636e72;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
}

/* Dots animados */
.loading-text .dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
  width: 24px;
}

.loading-text .dots::after {
  content: '';
  display: none;
}

/* Progress bar minimalista */
.loader-progress {
  width: 120px;
  height: 3px;
  background: #f0edff;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.loader-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #6c5ce7, transparent);
  border-radius: 10px;
  animation: loaderProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loaderProgress {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 575.98px) {
  .loader-logo-wrapper {
    width: 80px;
    height: 80px;
  }

  #cssload-cupcake img {
    width: 48px;
    height: 48px;
  }

  .loading-text {
    font-size: 0.82rem;
  }

  .loader-progress {
    width: 100px;
  }
}

/* ============================================
   DARK MODE SUPPORT (opcional)
   ============================================ */
@media (prefers-color-scheme: dark) {
  .loading-area {
    background: rgba(30, 30, 40, 0.97);
  }

  .loading-text {
    color: #b2bec3;
  }

  .loader-progress {
    background: rgba(108, 92, 231, 0.15);
  }
}
