/* ═══════════════════════════════════════════════════════════════════════
   LOADING SCREEN — Pantalla de carga con fogón animado
   ═══════════════════════════════════════════════════════════════════════
   Estos estilos solo aplican al contenido que Blazor muestra dentro de
   <div id="app"> mientras descarga WebAssembly. Cuando la app carga,
   Blazor reemplaza todo el innerHTML y estos selectores quedan inertes.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Contenedor principal ────────────────────────────────────────── */
.loading-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 1rem;
  background-color: #F9F7F2;
  font-family: 'Inter', sans-serif;
}

/* ── Gradiente radial cálido de fondo ────────────────────────────── */
.loading-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center bottom, #F57C0018 0%, #FFC10708 30%, transparent 70%);
}

/* ═══════════════════════════════════════════════════════════════════
   ICONOS FLOTANTES
   ═══════════════════════════════════════════════════════════════════ */
.loading-float-icon {
  position: absolute;
  pointer-events: none;
  color: #2E7D32;
  animation: loadingFloat 4s ease-in-out infinite;
}

/* Cada icono tiene su propio delay — lo pongo con style inline */
@keyframes loadingFloat {
  0%, 100% { opacity: 0.12; transform: translateY(10px); }
  50%      { opacity: 0.30; transform: translateY(-10px); }
}

/* ═══════════════════════════════════════════════════════════════════
   FOGÓN — contenedor
   ═══════════════════════════════════════════════════════════════════ */
.loading-fogon {
  position: relative;
  width: 220px;
  height: 220px;
}

/* ── Resplandor detrás del fuego ─────────────────────────────────── */
.loading-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  left: 20px;
  top: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFC10740 0%, #F57C0020 40%, transparent 70%);
  filter: blur(20px);
  animation: loadingGlow 2s ease-in-out infinite;
}

@keyframes loadingGlow {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 0.9; }
}

/* ── Chispas ─────────────────────────────────────────────────────── */
.loading-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #FFC107;
  left: 50%;
  top: 45%;
  animation: loadingSpark 2s ease-out infinite;
}

@keyframes loadingSpark {
  0%   { transform: translate(0, 0);       opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(var(--sx), -120px); opacity: 0; }
}

/* ── SVG del fogón — lo posiciono encima de chispas y glow ────── */
.loading-fogon svg {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   BARRA DE PROGRESO DECORATIVA
   ═══════════════════════════════════════════════════════════════════ */
.loading-progress-track {
  margin-top: 2rem;
  width: 240px;
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  background-color: #F57C0020;
}

.loading-progress-bar {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #D32F2F, #F57C00, #FFC107);
  animation: loadingSlide 1.8s ease-in-out infinite;
}

@keyframes loadingSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════
   TEXTO "CARGANDO..."
   ═══════════════════════════════════════════════════════════════════ */
.loading-text {
  margin-top: 2rem;
  color: #F57C00;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: loadingPulse 2s ease-in-out infinite;
}

.loading-dots {
  animation: loadingDotsPulse 1.5s infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

@keyframes loadingDotsPulse {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   ESTROFA ROTATIVA
   ═══════════════════════════════════════════════════════════════════ */
.loading-mensaje-box {
  margin-top: 1rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-mensaje {
  text-align: center;
  font-style: italic;
  color: #37474F;
  font-size: 1.05rem;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(12px);
}

.loading-mensaje.visible {
  opacity: 0.75;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════
   TRES PUNTOS REBOTANDO
   ═══════════════════════════════════════════════════════════════════ */
.loading-bounce-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.loading-bounce-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: loadingBounce 1s ease-in-out infinite;
}

.loading-bounce-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-bounce-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
  0%, 100% { transform: translateY(0);    opacity: 0.4; }
  50%      { transform: translateY(-14px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   SUBTEXTO INFERIOR
   ═══════════════════════════════════════════════════════════════════ */
.loading-footer {
  margin-top: 2.5rem;
  text-align: center;
  color: #37474F;
  font-size: 0.75rem;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — en pantallas chicas achico un toque el fogón
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .loading-fogon {
    width: 170px;
    height: 170px;
  }
  .loading-fogon svg {
    width: 170px;
    height: 170px;
  }
  .loading-glow {
    width: 140px;
    height: 140px;
    left: 15px;
    top: 15px;
  }
  .loading-progress-track {
    width: 180px;
  }
}
