/* =======================================
   PANTALLA DE CARGA - Bar Galileo
   Usa variables CSS del tema para
   adaptarse automáticamente a claro/oscuro
======================================= */

/* === Pantalla de carga (overlay fijo) === */
.dashboard-loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-accent);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.dashboard-loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* === Fade-out de salida === */
.dashboard-loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* === Fade-in de entrada (nueva página arranca cubierta y se descubre) === */
.dashboard-loading-screen.page-entering {
  opacity: 1;
  visibility: visible;
  animation: coverFadeOut 0.5s ease 0.1s forwards;
}

@keyframes coverFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* === Contenido centrado === */
.loading-content {
  text-align: center;
  animation: fadeInUp 0.6s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* === Logo === */
.loading-logo {
  margin-bottom: 28px;
  animation: logoFloat 2.4s ease-in-out infinite;
}

.loading-logo img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--color-secondary);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 0 40px rgba(166, 137, 50, 0.15);
  display: block;
}

/* === Textos === */
.loading-text h2 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 2.2em;
  font-weight: 700;
  color: var(--color-secondary);
  margin: 0 0 8px 0;
  letter-spacing: 3px;
  animation: textGlow 2.2s ease-in-out infinite alternate;
}

.loading-text p {
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  color: var(--color-gray);
  margin: 0 0 28px 0;
  font-weight: 300;
  opacity: 0.85;
  animation: textFade 2s ease-in-out infinite alternate;
}

/* === Spinner === */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(166, 137, 50, 0.18);
  border-left: 4px solid var(--color-secondary);
  border-right: 4px solid var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  position: relative;
}

.spinner::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid transparent;
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1.8s linear infinite reverse;
}

/* === Halo de fondo decorativo === */
.loading-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(166, 137, 50, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: halo 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* =======================================
   KEYFRAMES
======================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes textGlow {
  0%   { opacity: 0.75; }
  100% { opacity: 1;    }
}

@keyframes textFade {
  0%   { opacity: 0.55; }
  100% { opacity: 0.9;  }
}

@keyframes halo {
  0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.25; }
  50%       { transform: translate(-50%, -50%) scale(1.18); opacity: 0.1;  }
}

/* =======================================
   RESPONSIVE
======================================= */
@media (max-width: 768px) {
  .loading-logo img {
    width: 88px;
    height: 88px;
  }

  .loading-text h2 {
    font-size: 1.7em;
    letter-spacing: 2px;
  }

  .loading-text p {
    font-size: 0.92em;
  }

  .spinner {
    width: 38px;
    height: 38px;
  }
}