/* ==========================================================================
   🎃 PORTAL DE DESCARGAS HALLOWEEN 2026 - ESTILOS VISUALES
   ==========================================================================
   Todos los colores, fuentes y medidas son fácilmente personalizables aquí.
   ========================================================================== */

:root {
  /* 🎨 PALETA DE COLORES NEÓN HALLOWEEN (Modifica los valores aquí) */
  --color-primary: #ff6b00;         /* Naranja calabaza neón */
  --color-primary-glow: rgba(255, 107, 0, 0.45);
  --color-purple: #a855f7;          /* Púrpura eléctrico */
  --color-purple-glow: rgba(168, 85, 247, 0.4);
  --color-green: #10b981;           /* Verde bruja / ectoplasma */
  --color-cyan: #06b6d4;            /* Azul cian / láser */
  --color-bg-dark: #07050e;         /* Fondo ultra oscuro */
  --color-bg-surface: #100b20;      /* Superficie paneles */
  --color-card-bg: rgba(22, 16, 42, 0.82); /* Vidrio oscuro */
  --color-card-border: rgba(255, 107, 0, 0.22);
  --color-card-hover: rgba(255, 107, 0, 0.45);
  --color-text-main: #f8fafc;       /* Texto blanco */
  --color-text-muted: #94a3b8;      /* Texto secundario */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* RESET Y BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(255, 107, 0, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.12) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* CONTENEDOR PRINCIPAL */
.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* HEADER Y HERO */
.site-header {
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 107, 0, 0.12);
  border: 1px solid rgba(255, 107, 0, 0.35);
  color: #ff9d42;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(255, 107, 0, 0.2);
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 30%, #ff9d42 70%, #ff6b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 35px rgba(255, 107, 0, 0.35);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-qr-trigger {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-qr-trigger:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 0 18px var(--color-purple-glow);
}

/* BARRA FIJA DE BÚSQUEDA Y FILTROS */
.sticky-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 5, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  transition: var(--transition);
}

.search-box-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  margin-bottom: 0.75rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 0.8rem 2.8rem 0.8rem 2.8rem;
  color: var(--color-text-main);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* PESTAÑAS DE CATEGORÍA */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-main);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--color-primary), #ff8800);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

/* CARROUSEL RÁPIDO DE CHIPS DE AMIGOS */
.friends-quick-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.5rem 0 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 0, 0.3) transparent;
}
.friends-quick-chips::-webkit-scrollbar {
  height: 4px;
}
.friends-quick-chips::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 0, 0.3);
  border-radius: 4px;
}

.friend-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.friend-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--color-purple);
  color: #fff;
}

.friend-chip.active {
  background: var(--color-purple);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px var(--color-purple-glow);
}

/* CONTADOR DE RESULTADOS */
.results-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.5rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

/* GRID DE TARJETAS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 3rem;
}

/* TARJETA INDIVIDUAL */
.portal-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.portal-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-card-hover);
  box-shadow: 0 15px 35px rgba(255, 107, 0, 0.18), 0 0 20px rgba(168, 85, 247, 0.15);
}

/* BADGE SUPERIOR DE TIPO */
.card-type-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.badge-individual {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
}
.badge-pareja {
  background: rgba(236, 72, 153, 0.85);
  color: #fff;
}
.badge-grupo {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
}

/* SWITCH SUPERIOR DE MEDIA (FOTO vs VIDEO) */
.card-media-switch {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  padding: 2px;
  backdrop-filter: blur(8px);
}

.media-toggle-btn {
  background: transparent;
  border: none;
  color: #d1d5db;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.media-toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

/* CONTENEDOR DE MEDIA */
.card-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-img-preview,
.card-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-media-wrapper:hover .card-img-preview {
  transform: scale(1.04);
}

/* OVERLAY PARA VIDEO (BOTÓN PLAY) */
.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.play-circle-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 107, 0, 0.9);
  box-shadow: 0 0 25px var(--color-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  transition: var(--transition);
}

.card-media-wrapper:hover .play-circle-icon {
  transform: scale(1.15);
  background: var(--color-primary);
}

.video-playing .video-play-overlay {
  opacity: 0;
  pointer-events: none;
}

/* CUERPO DE LA TARJETA */
.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ETIQUETAS DE PERSONAS EN LA TARJETA */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.2rem;
}

.card-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

/* BOTONES DE ACCIÓN */
.card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-download-primary {
  background: linear-gradient(135deg, var(--color-primary), #ff8800);
  border: none;
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-download-primary:hover {
  background: linear-gradient(135deg, #ff8800, #ffa534);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

.secondary-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-main);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ESTADO SIN RESULTADOS */
.no-results-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.no-results-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.no-results-msg {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* MODAL DE PANTALLA COMPLETA / LIGHTBOX */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-media-wrapper {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--color-primary-glow);
}

.modal-media-wrapper img,
.modal-media-wrapper video {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  object-fit: contain;
}

.modal-footer {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.modal-close-btn {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* MODAL DE CÓDIGO QR */
.qr-modal-body {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  max-width: 440px;
  width: 90vw;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.qr-code-placeholder {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 1.2rem auto;
}

.qr-code-placeholder canvas,
.qr-code-placeholder img {
  display: block;
}

/* FOOTER INFORMATIVO */
.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3rem 1rem 2rem;
  background: rgba(7, 5, 14, 0.95);
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.help-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.help-card h4 {
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  font-size: 0.8rem;
}

/* TOAST NOTIFICACIONES */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}
.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE DESIGN */
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .card-media-wrapper {
    aspect-ratio: 4 / 3;
  }
}
