/* ============================================================================
   ESTILOS PERSONALIZADOS E IDENTIDAD GRÁFICA EVENTIX
   Splash Screen Fullscreen Overlay 100% Fijado con Animación Bouncing Elastic
   Soporte Completo Modo Claro (#FFFFFF) & Modo Oscuro (#070C16 / #0A111E)
   ============================================================================ */

:root {
    --color-app-bg: #ffffff;
    --color-card-bg: #ffffff;
    --color-text-main: #0f172a;
    --color-gold-primary: #D4AF37;
    --color-gold-light: #E5C158;
    --color-gold-dark: #B8860B;
}

html.dark {
    --color-app-bg: #070C16;
    --color-card-bg: #0A111E;
    --color-text-main: #f8fafc;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-app-bg);
    color: var(--color-text-main);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Números tabulares en KPIs y contadores para evitar saltos visuales */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Focus accesible y elegante */
:focus-visible {
    outline: 2px solid var(--color-gold-primary);
    outline-offset: 2px;
}

/* Scrollbar sutil de nivel SaaS */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

/* Elevación interactiva suave para tarjetas */
.ux-card {
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.ux-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.12);
}
html.dark .ux-card:hover {
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.55);
}

/* ============================================================================
   SPLASH SCREEN FULLSCREEN OVERLAY (Z-INDEX 9999999 - COBERTURA 100% GARANTIZADA)
   ============================================================================ */
#app-splash-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: var(--color-app-bg) !important;
  z-index: 9999999 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  margin: 0 !important;
  overflow: hidden !important;
  user-select: none;
}

/* Salida con animación Bouncing Elastic de alto impacto */
#app-splash-screen.bounce-exit {
  animation: splashBounceExit 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
  pointer-events: none !important;
}

@keyframes splashBounceExit {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  20% {
    opacity: 1;
    transform: scale(0.84) translateY(16px);
  }
  45% {
    opacity: 0.95;
    transform: scale(1.24) translateY(-36px);
  }
  70% {
    opacity: 0.8;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 0;
    transform: scale(0.2) translateY(140px);
  }
}

/* Contenedor del Logo con Rebote de Entrada */
.splash-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  width: 100%;
  max-width: 480px;
  animation: splashElasticBounce 1.5s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
}

/* Caja Gráfica del Logo 100% Responsiva */
.splash-graphic-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: clamp(180px, 60vw, 250px);
  max-height: 44vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emblemFloatingBounce 2.4s infinite ease-in-out;
}

.splash-graphic-box img {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: block;
  width: 100%;
  height: auto;
  max-height: 44vh;
  object-fit: contain;
}

/* Barra de Carga Responsiva */
.splash-progress-bar {
  width: clamp(130px, 40vw, 170px);
  height: 4px;
  background: rgba(100, 116, 139, 0.18);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.splash-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #B8860B, #D4AF37, #FFF0C2, #D4AF37);
  background-size: 200% 100%;
  animation: splashFill 4s linear forwards, goldShimmer 2s infinite linear;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.85);
}

/* Keyframes de Entrada y Flotación */
@keyframes splashElasticBounce {
  0% {
    opacity: 0;
    transform: scale(0.15) translateY(45px);
  }
  55% {
    opacity: 1;
    transform: scale(1.18) translateY(-14px);
  }
  75% {
    transform: scale(0.94) translateY(6px);
  }
  90% {
    transform: scale(1.03) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes emblemFloatingBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.35));
  }
  50% {
    transform: translateY(-12px) scale(1.04);
    filter: drop-shadow(0 20px 35px rgba(212, 175, 55, 0.7));
  }
}

@keyframes splashFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes goldShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 380px) {
  .splash-graphic-box {
    width: 160px !important;
    max-height: 38vh !important;
  }
  .splash-progress-bar {
    width: 120px !important;
    margin-top: 1.2rem;
  }
}

@media (min-width: 1024px) {
  .splash-graphic-box {
    width: 210px !important;
    max-height: 42vh !important;
  }
}

/* ============================================================================
   UTILIDADES VISUALES Y REGLAS DE RESPONSIVIDAD GLOBAL
   ============================================================================ */

.text-gold-gradient {
    background: linear-gradient(135deg, #B8860B 0%, #D4AF37 50%, #E5C158 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-gold {
    border-color: rgba(212, 175, 55, 0.4) !important;
}

.border-gold-glow {
    border-color: rgba(212, 175, 55, 0.6) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

@keyframes scanline {
    0% { top: 0%; opacity: 0.8; }
    50% { top: 95%; opacity: 1; }
    100% { top: 0%; opacity: 0.8; }
}

.scanner-frame {
    position: relative;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.35);
    border-color: rgba(212, 175, 55, 0.85) !important;
}

.scanner-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #D4AF37, #E5C158, #D4AF37, transparent);
    box-shadow: 0 0 15px #D4AF37, 0 0 25px #E5C158;
    animation: scanline 2.2s ease-in-out infinite;
}

.swal2-container.swal2-backdrop-show {
    backdrop-filter: blur(12px) !important;
}

html.light .swal2-popup {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15) !important;
}

html.dark .swal2-popup {
    background-color: #0D172A !important;
    color: #f8fafc !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9) !important;
}

.swal2-title {
    font-weight: 800 !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html.light ::-webkit-scrollbar-track { background: #f8fafc; }
html.dark ::-webkit-scrollbar-track { background: #0A111E; }

html.light ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
html.dark ::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 4px; }

::-webkit-scrollbar-thumb:hover { background: #D4AF37; }
