/* Estilos globales y personalizaciones avanzadas */
/* Paleta KidsRun Oficial: Blanco base, Azul #1d4ed8, Amarillo #facc15, Rojo #ef4444 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-blue: #1d4ed8;
  --color-blue-light: #3b82f6;
  --color-blue-subtle: #eff6ff;
  --color-yellow: #facc15;
  --color-yellow-dark: #eab308;
  --color-red: #ef4444;
  --color-red-dark: #dc2626;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 1.875rem;
  --radius-full: 9999px;
}

html, body {
  font-family: var(--font-main);
  max-width: 100%;
  overflow-x: hidden;
}

html:not(.dark) body {
  background-color: #ffffff;
  color: #0f172a;
}

html.dark body {
  background-color: #0b0f19;
  color: #f3f4f6;
}

/* Scrollbar moderno */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #93c5fd;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #1e3a8a;
}

/* Ocultar barra de scroll para carruseles y tracks horizontales */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Gradientes de texto animados con la paleta deportiva */
.text-gradient {
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineGradient 5s linear infinite;
}

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

/* Efectos Glassmorphism adaptables y limpios para modo claro */
html:not(.dark) .glass-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px -10px rgba(30, 58, 138, 0.08);
}

html.dark .glass-panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-panel-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -10px rgba(29, 78, 216, 0.15);
}

.glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 247, 255, 0.95) 100%);
  border: 1px solid rgba(219, 234, 254, 0.8);
}

html.dark .glass-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Iluminación de fondo ambiental: Azul, Rojo y Amarillo sutiles sobre blanco */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.ambient-blue {
  background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
  opacity: 0.14;
}

.ambient-yellow {
  background: radial-gradient(circle, var(--color-yellow) 0%, transparent 70%);
  opacity: 0.18;
}

.ambient-red {
  background: radial-gradient(circle, var(--color-red) 0%, transparent 70%);
  opacity: 0.12;
}

html.dark .ambient-blue {
  opacity: 0.3;
}
html.dark .ambient-yellow {
  opacity: 0.25;
}
html.dark .ambient-red {
  opacity: 0.25;
}

/* Efecto de flotación sutil */
.floating-element {
  animation: floating 6s ease-in-out infinite;
}

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

/* Animación de pulso para badges */
.pulse-badge {
  box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.6);
  animation: pulse-ring 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  to {
    box-shadow: 0 0 0 10px rgba(29, 78, 216, 0);
  }
}

/* Toasts de Notificación */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-2xl);
  color: #fff;
  font-size: 0.925rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
  background: var(--color-blue);
  border: 1px solid var(--color-blue-light);
}

.toast.error {
  background: var(--color-red-dark);
  border: 1px solid var(--color-red);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==============================================================================
   ESTILOS PREMIUM Y ALTO CONTRASTE PARA EL PANEL DE ADMINISTRACIÓN (CMS)
   ============================================================================== */
.admin-input,
#cms-form input[type="text"],
#cms-form input[type="email"],
#cms-form input[type="tel"],
#cms-form input[type="number"],
#cms-form input[type="password"],
#cms-form input[type="datetime-local"],
#cms-form textarea,
#cms-form select {
  background-color: #0f172a !important; /* Slate 900 sólido de fondo */
  color: #ffffff !important;           /* Letra blanca nítida */
  border: 1.5px solid #334155 !important; /* Borde visible Slate 700 */
  border-radius: 0.875rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  padding: 0.625rem 0.875rem !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
}

.admin-input:focus,
#cms-form input:focus,
#cms-form textarea:focus,
#cms-form select:focus {
  outline: none !important;
  border-color: #3b82f6 !important; /* Azul eléctrico 500 */
  background-color: #1e293b !important; /* Slate 800 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
  color: #ffffff !important;
}

#cms-form input::placeholder,
#cms-form textarea::placeholder {
  color: #64748b !important; /* Slate 500 */
}

#cms-form label {
  color: #cbd5e1 !important; /* Slate 300 - etiquetas bien legibles */
  font-weight: 600 !important;
}

/* Tarjetas y paneles del CMS con fondo sólido y bordes nítidos */
.glass-panel {
  background-color: #0b1120 !important; /* Slate 950 sólido */
  border: 1px solid #1e293b !important; /* Slate 800 */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

/* Modal lightbox de alta resolución para ver comprobantes */
.proof-modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ==============================================================================
   SECCIÓN DE AUSPICIADORES & CARRUSEL INTERACTIVO / INFINITO
   ============================================================================== */
@keyframes sponsorMarquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.sponsors-track {
  display: flex;
  width: max-content;
  animation: sponsorMarquee 35s linear infinite;
}

.sponsors-track:hover {
  animation-play-state: paused;
}

.sponsor-card {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(85%) opacity(0.75);
}

.sponsor-card:hover {
  filter: grayscale(0%) opacity(1);
  transform: translateY(-6px) scale(1.04);
}

html.dark .sponsor-card {
  filter: grayscale(80%) brightness(1.2) opacity(0.8);
}

html.dark .sponsor-card:hover {
  filter: grayscale(0%) brightness(1) opacity(1);
}

/* ─── Sponsors Admin Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ─── Page Builder: secciones reordenables ─── */
.sections-wrapper {
  display: flex;
  flex-direction: column;
}
.sections-wrapper > section {
  width: 100%;
}

/* ─── Toggle switch (sections visibility) ─── */
.section-visibility-toggle:checked + .toggle-track { background-color: #2563eb; }
.section-visibility-toggle:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ─── Drag-and-drop sortable items ─── */
.section-sortable-item.drag-over  { border-color: #60a5fa !important; background: rgba(37,99,235,0.12) !important; }
.section-sortable-item.dragging   { opacity: 0.35; }

/* ─── Scanner QR & Barcode (Html5Qrcode) ─── */
#reader-qr-view {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}
#reader-qr-view video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 1rem !important;
}
#reader-qr-view img {
  display: none !important;
}

/* ─── Construction Mode Toggle Switch ─── */
.construction-toggle-track {
  width: 52px;
  height: 28px;
  background-color: #334155;
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.25s ease;
  cursor: pointer;
}
.construction-toggle-track.active {
  background-color: #f59e0b;
}
.construction-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.construction-toggle-track.active .construction-toggle-thumb {
  transform: translateX(24px);
}


