*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f; --surface: #111118; --border: #1e1e2e;
  --accent: #8b5cf6; --accent-glow: rgba(139,92,246,0.3);
  --text: #e2e2f0; --text-muted: #6b6b8a;
  --red: #ef4444; --green: #22c55e;
  --font: 'Segoe UI', system-ui, sans-serif;
}
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
.sala-body { display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.sala-container { width: 100%; max-width: 900px; }
.sala-header { text-align: center; margin-bottom: 2rem; }
.sala-header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.sala-subtitle { color: var(--text-muted); margin-top: 0.5rem; }
.badge-vivo { display: inline-block; background: var(--red); color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; padding: 0.25rem 0.75rem; border-radius: 999px; margin-top: 0.5rem; animation: pulse-vivo 1.5s ease-in-out infinite; }
@keyframes pulse-vivo { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.player-wrapper { margin: 1.5rem 0; }
.player-frame-container { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 0 60px var(--accent-glow); }
.player-frame-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
/* video_fill: escalar iframe para rellenar el lienzo 16:9 sin barras negras */
.player-frame-container.video-fill iframe {
  transform: scale(1.12);
  transform-origin: center center;
}

.video-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 48px; z-index: 20; pointer-events: all; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.video-overlay.muted { background: rgba(0,0,0,0.45); cursor: pointer; }
.video-overlay.active { background: transparent; cursor: default; }
.unmute-hint { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; background: rgba(10,10,15,0.85); border: 1px solid rgba(139,92,246,0.4); border-radius: 16px; padding: 1.5rem 2.5rem; backdrop-filter: blur(8px); }
.video-overlay.active .unmute-hint { display: none; }
.unmute-icon { font-size: 2.5rem; line-height: 1; }
.unmute-text { color: #e2e2f0; font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; text-align: center; }
@media (max-width: 600px) { .video-overlay { bottom: 60px; } }
.fs-blocker { display: none; }
@media (min-width: 601px) { .fs-blocker { display: block; position: absolute; bottom: 0; right: 0; width: 48px; height: 48px; z-index: 25; pointer-events: all; cursor: default; } }
.vivo-disclaimer { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 1rem; }
.countdown-wrapper { display: flex; justify-content: center; margin: 2rem 0; }
.countdown { display: flex; align-items: center; gap: 0.5rem; font-size: 4rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.countdown-unit { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem 1rem; min-width: 3.5ch; text-align: center; }
.countdown-sep { color: var(--accent); }
.espera-mensaje { text-align: center; color: var(--text-muted); }
.finalizado-body { align-items: center; }
.finalizado-content { text-align: center; margin-top: 2rem; }
.finalizado-icon { font-size: 4rem; color: var(--green); margin-bottom: 1rem; }
.admin-body { align-items: flex-start; justify-content: flex-start; }
.admin-login-container { margin: 4rem auto; width: 100%; max-width: 380px; }
.admin-login-container h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.admin-container { width: 100%; max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 1.5rem; }

/* ── Table v2: sticky header + sticky actions + contained scroll ───────────── */
.table-wrapper { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 200px); border: 1px solid var(--border); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table thead th { position: sticky; top: 0; z-index: 5; background: var(--bg); box-shadow: 0 1px 0 var(--border); color: var(--text-muted); font-weight: 600; }
.admin-table tr:hover td { background: var(--surface); }
/* Sticky actions column — always visible on right */
.admin-table .col-acciones { position: sticky; right: 0; z-index: 3; background: var(--bg); box-shadow: -2px 0 8px rgba(0,0,0,0.5); }
.admin-table tr:hover .col-acciones { background: var(--surface); }
.admin-table thead .col-acciones { z-index: 6; }
/* Column sizing */
.admin-table .col-check { width: 36px; padding: 0.55rem 0.25rem 0.55rem 0.75rem; text-align: center; }
.admin-table .col-id { width: 44px; }
/* Checkboxes */
.row-check, .check-all { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
/* Copy ID button */
.btn-copy-id { display: inline-flex; align-items: center; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.8rem; padding: 0.15rem 0.35rem; border-radius: 4px; transition: color 0.15s, background 0.15s; vertical-align: middle; line-height: 1; }
.btn-copy-id:hover { color: var(--text); background: var(--border); }
.btn-copy-id.copied { color: var(--green); }
/* Bulk delete bar */
.bulk-bar { display: none; align-items: center; gap: 1rem; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 0.75rem; font-size: 0.88rem; }
.bulk-bar.visible { display: flex; }
.bulk-bar-text { flex: 1; color: var(--text-muted); }
/* Multiple horarios */
.horario-list { display: flex; flex-direction: column; gap: 0.5rem; }
.horario-row { display: flex; align-items: center; gap: 0.5rem; }
.horario-row input { flex: 1; }
.btn-remove-horario { background: none; border: 1px solid var(--border); color: var(--red); border-radius: 6px; cursor: pointer; font-size: 1.1rem; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; font-family: var(--font); transition: background 0.15s; }
.btn-remove-horario:hover { background: rgba(239,68,68,0.12); }
.btn-add-horario { background: none; border: 1px dashed var(--border); color: var(--text-muted); border-radius: 8px; cursor: pointer; font-size: 0.85rem; padding: 0.45rem 1rem; font-family: var(--font); margin-top: 0.4rem; display: inline-block; transition: border-color 0.15s, color 0.15s; }
.btn-add-horario:hover { border-color: var(--accent); color: var(--text); }
/* Hide less critical columns on narrow screens */
@media (max-width: 700px) { .admin-table .col-lib, .admin-table .col-id { display: none; } }

code { font-size: 0.8em; background: var(--border); padding: 0.1em 0.4em; border-radius: 4px; }
.admin-form { max-width: 560px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: var(--font); font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group small { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-muted); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1.1rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; border: none; font-family: var(--font); transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; }
.badge-success { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-muted { background: var(--border); color: var(--text-muted); }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.empty-state { color: var(--text-muted); padding: 2rem 0; }

.asistencia-num { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; opacity: 0.92; white-space: nowrap; }

/* ── CTA Botón Flotante ──────────────────────────────────────────────────── */
.cta-flotante {
  position: fixed;
  bottom: 76px;
  right: 16px;
  z-index: 60;
  display: none; /* mostrado via JS */
  align-items: center;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.cta-btn:hover { opacity: 0.9; transform: scale(1.03); }
.cta-btn:active { transform: scale(0.97); }
.cta-tipo-whatsapp { background: #25D366; }
.cta-tipo-stripe   { background: #635bff; }
.cta-tipo-url      { background: var(--accent, #6366f1); }
.cta-texto { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
@keyframes cta-pulse-kf {
  0%   { box-shadow: 0 4px 24px rgba(0,0,0,0.45); }
  40%  { box-shadow: 0 4px 32px rgba(255,255,255,0.35); transform: scale(1.07); }
  100% { box-shadow: 0 4px 24px rgba(0,0,0,0.45); transform: scale(1); }
}
.cta-pulse { animation: cta-pulse-kf 0.55s ease-out 3; }
@media (max-width: 480px) {
  .cta-flotante { bottom: 68px; right: 10px; }
  .cta-btn { padding: 11px 16px; font-size: 0.88rem; }
  .cta-texto { max-width: 130px; }
}

/* ── CTA Admin: sección details + destinos ──────────────────────────────── */
.cta-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.cta-details summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  user-select: none;
}
.cta-details summary::-webkit-details-marker { display: none; }
.cta-details summary::after { content: '▸'; margin-left: auto; transition: transform 0.2s; }
.cta-details[open] summary::after { transform: rotate(90deg); }
.cta-fields { padding: 1rem; border-top: 1px solid var(--border); }
.form-group-inline label { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.93rem; color: var(--text); cursor: pointer; }
.form-group-inline input[type=checkbox] { width: auto; height: auto; accent-color: var(--accent); }
.form-group-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group-label-row { margin-bottom: 0.5rem; }
.form-group-label-row label { display: block; font-size: 0.9rem; color: var(--text-muted); }
.destino-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.destino-row input[type=text] { flex: 1; min-width: 0; }
.btn-remove-destino { background: none; border: 1px solid var(--border); color: var(--red); border-radius: 6px; cursor: pointer; font-size: 1.1rem; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font); transition: background 0.15s; }
.btn-remove-destino:hover { background: rgba(239,68,68,0.12); }
.btn-add-destino { background: none; border: 1px dashed var(--border); color: var(--text-muted); border-radius: 8px; cursor: pointer; font-size: 0.85rem; padding: 0.45rem 1rem; font-family: var(--font); margin-top: 0.2rem; display: inline-block; transition: border-color 0.15s, color 0.15s; }
.btn-add-destino:hover { border-color: var(--accent); color: var(--text); }
