/* index.css */
/* Sistema de Variables y Diseño Neumórfico Oscuro de Papos Guate 2.0 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colores Base */
  --color-bg: #090909;
  --color-bg-secondary: #101010;
  --color-surface: #161616;
  --color-surface-elevated: #1d1d1d;

  --color-red: #e4002b;
  --color-red-dark: #a90020;
  --color-red-light: #ff1744;

  --color-yellow: #ffb800;
  --color-yellow-light: #ffc928;

  --color-white: #ffffff;
  --color-text: #f5f5f5;
  --color-text-secondary: #a4a4a4;
  --color-text-muted: #666666;

  --color-success: #18c964;
  --color-error: #ff3b30;

  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Sombras Neumórficas - Elementos Elevados (Tarjetas, Botones) */
  --neumorph-shadow-out: 
    -4px -4px 12px rgba(255, 255, 255, 0.025),
    8px 8px 20px rgba(0, 0, 0, 0.45);
    
  /* Sombras Neumórficas - Elementos Hundidos (Inputs de formulario) */
  --neumorph-shadow-in: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.8),
    inset -4px -4px 8px rgba(255, 255, 255, 0.04);
}

/* Reglas Globales y Tipografía */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Outfit', sans-serif;
}

/* --- COMPONENTES NEUMÓRFICOS --- */

/* Tarjetas */
.card-neumorph {
  background-color: var(--color-surface);
  border-radius: 20px;
  box-shadow: var(--neumorph-shadow-out);
  border: 1px solid var(--border-subtle);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.card-neumorph:hover {
  transform: translateY(-6px);
  box-shadow: 12px 18px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(228, 0, 43, 0.06);
  border-color: rgba(228, 0, 43, 0.2);
}

/* Campos de Formulario */
.input-neumorph {
  background-color: var(--color-bg);
  border-radius: 12px;
  box-shadow: var(--neumorph-shadow-in);
  border: 1px solid transparent;
  color: var(--color-text);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  outline: none;
}

.input-neumorph:focus {
  border-color: var(--color-red);
  box-shadow: inset 0 0 0 1px var(--color-red), var(--neumorph-shadow-in);
}

.input-neumorph.input-success {
  border-color: var(--color-success);
  box-shadow: inset 0 0 0 1px var(--color-success), var(--neumorph-shadow-in);
}

.input-neumorph.input-error {
  border-color: var(--color-error);
  box-shadow: inset 0 0 0 1px var(--color-error), var(--neumorph-shadow-in);
}

/* Botones */
.btn-neumorph {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--neumorph-shadow-out);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
  cursor: pointer;
  outline: none;
}

.btn-neumorph:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.5);
  background-color: var(--color-surface-elevated);
}

.btn-neumorph:active {
  transform: translateY(0);
  box-shadow: var(--neumorph-shadow-in);
}

/* Botón Principal (Red Gradient) */
.btn-primary-neumorph {
  background: linear-gradient(135deg, var(--color-red), var(--color-red-light));
  color: var(--color-white);
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(228, 0, 43, 0.25);
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
  outline: none;
}

.btn-primary-neumorph:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(228, 0, 43, 0.4);
}

.btn-primary-neumorph:active {
  transform: translateY(0);
  box-shadow: var(--neumorph-shadow-in);
}

/* --- ANIMACIONES --- */

/* Animación de latido (Score Update) */
@keyframes scoreUpdate {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
    color: var(--color-white);
  }
  50% {
    transform: scale(1.2);
    text-shadow: 0 0 15px var(--color-yellow);
    color: var(--color-yellow);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
    color: var(--color-white);
  }
}

.animate-score-update {
  animation: scoreUpdate 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Flotación (Prize Floating) */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Animación Éxito (Success Pop) */
@keyframes successPop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-success-pop {
  animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Skeleton Loading */
@keyframes skeleton-loading {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #161616 25%, #222222 50%, #161616 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* --- DISEÑO RESPONSIVO & MEJORAS --- */

/* Scroll-snap para carrusel móvil */
.prizes-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.prizes-carousel::-webkit-scrollbar {
  display: none;
}

.prizes-carousel .prize-card-mobile {
  min-width: 85vw;
  scroll-snap-align: center;
}

/* Fondo especial para el Hero */
.hero-gradient {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(228, 0, 43, 0.2),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(255, 184, 0, 0.12),
      transparent 40%
    ),
    linear-gradient(
      135deg,
      #090909 0%,
      #140508 45%,
      #090909 100%
    );
}

/* Estilo para el Sticky Header con blur */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 9, 9, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Barra inferior móvil */
.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--color-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: color 150ms ease;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

.mobile-nav-btn.active {
  color: var(--color-yellow);
}

.mobile-nav-btn-center {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--color-red), var(--color-red-light));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(-14px);
  box-shadow: 0 8px 25px rgba(228, 0, 43, 0.4);
  color: var(--color-white);
  transition: transform 150ms ease, box-shadow 150ms ease;
  border: none;
  cursor: pointer;
  outline: none;
}

.mobile-nav-btn-center:hover {
  transform: translateY(-16px);
  box-shadow: 0 12px 30px rgba(228, 0, 43, 0.55);
}

.mobile-nav-btn-center:active {
  transform: translateY(-10px);
}

/* Soporte para preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- TARJETA DE EXPORTACIÓN A INSTAGRAM (STORIES 9:16) --- */

.imagen-generada-container {
  --bg-color: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --color-brand-red: #e6192b;
  --color-brand-yellow: #f5b041;
  --neumorph-out: -6px -6px 12px rgba(255, 255, 255, 0.03), 6px 6px 12px rgba(0, 0, 0, 0.6);
  --neumorph-in: inset 4px 4px 8px rgba(0, 0, 0, 0.6), inset -4px -4px 8px rgba(255, 255, 255, 0.03);

  width: 450px;
  height: 800px;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}

.borde-superior-acento {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--color-brand-yellow), var(--color-brand-red));
}

.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  width: 100%;
}

.logo-ticket {
  height: 90px;
  margin-bottom: 20px;
  object-fit: contain;
}

.badge-rojo {
  background-color: var(--color-brand-red);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  width: 90%;
  box-shadow: 0 4px 15px rgba(230, 25, 43, 0.3);
}

.card-principal {
  background-color: var(--bg-color);
  border-radius: 24px;
  padding: 30px 20px;
  width: 90%;
  text-align: center;
  box-shadow: var(--neumorph-out);
  margin-bottom: 35px;
}

.titulo-oportunidades {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 15px;
  line-height: 1.4;
}

.numero-grande {
  font-size: 80px;
  font-weight: 800;
  color: var(--color-brand-yellow);
  line-height: 1;
  margin: 15px 0 35px 0;
}

.text-glow {
  text-shadow: 0 0 20px rgba(245, 176, 65, 0.4);
}

.subtitulo-sorteo {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  margin-top: 0;
  line-height: 1.4;
}

.seccion-sucursales {
  width: 90%;
  margin-bottom: auto;
}

.titulo-progreso {
  font-size: 14px;
  color: var(--color-brand-yellow);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Contenedor del grid */
.grid-sucursales {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; /* Espacio cómodo entre tarjetas */
}

/* Las píldoras de las sucursales */
.sucursal-pill {
  background-color: #212121; /* Un gris apenas más claro que el fondo para destacar suavemente */
  border-radius: 16px; /* Esquinas más redondeadas */
  padding: 12px 16px; 
  min-height: 70px; /* Altura mayor para acomodar 2 líneas de texto */
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Alineación desde la izquierda */
  gap: 12px;
  box-sizing: border-box;
  
  /* Sombra externa neumórfica (outset) que NO genera los cuadros negros al exportar */
  box-shadow: 
    4px 4px 10px rgba(0, 0, 0, 0.6), 
    -3px -3px 8px rgba(255, 255, 255, 0.04);
    
  /* Un borde ultra sutil ayuda al renderizador a trazar bien la esquina */
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* El texto de la sucursal */
.sucursal-nombre {
  font-size: 13px; /* Tamaño un poco más grande y legible */
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  text-align: left;
  
  /* ESTO CORRIGE EL TEXTO CORTADO */
  white-space: normal; /* Permite que el texto baje a una segunda línea */
  word-wrap: break-word;
  
  flex-grow: 1; /* Ocupa el espacio disponible */
}

/* Iconos un poco más grandes */
.sucursal-icono {
  font-size: 22px; 
  flex-shrink: 0; /* Evita que el icono se aplaste si el texto es muy largo */
}

/* Indicador de estado (el puntito gris/amarillo) */
.sucursal-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto; /* Lo empuja hacia la derecha */
}

.sucursal-status.off {
  background-color: #444; /* Gris oscuro para el estado inactivo */
}

.sucursal-status.on {
  background-color: var(--color-brand-yellow);
  box-shadow: 0 0 8px var(--color-brand-yellow);
}

.footer-section {
  text-align: center;
  width: 100%;
  margin-top: 20px;
}

.texto-compra {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.texto-url {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-brand-red);
  letter-spacing: 1px;
}

.text-glow-red {
  text-shadow: 0 0 15px rgba(230, 25, 43, 0.4);
}

