/* ByFlow — Recomendaciones de Karaoke
   Usa los tokens ya definidos en index.html (--p, --s, --g, --a, --card, --sub).
   Nada de paleta nueva: el panel tiene que sentirse parte de la app, no un widget pegado. */

/* ── Carril compacto del sidebar ───────────────────────────────── */

.reco-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(233, 30, 144, .14), transparent 60%),
    var(--card);
  border: 1px solid rgba(255, 255, 255, .07);
}

.reco-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.reco-rail-head h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;
  margin: 0;
  background: linear-gradient(90deg, var(--p), var(--a));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reco-rail-more {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color var(--dur-fast, 150ms) ease, background var(--dur-fast, 150ms) ease;
}

.reco-rail-more:hover,
.reco-rail-more:focus-visible { color: var(--p); background: rgba(233, 30, 144, .12); }

.reco-empty {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.5;
  padding: 6px 2px;
}

/* ── Tarjeta ───────────────────────────────────────────────────── */

.reco-card {
  position: relative;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px 9px 0;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-fast, 150ms) var(--ease-out, ease),
              border-color var(--dur-fast, 150ms) ease,
              background var(--dur-fast, 150ms) ease;
}

.reco-card:hover,
.reco-card:focus-visible {
  transform: translateX(2px);
  border-color: rgba(233, 30, 144, .35);
  background: rgba(255, 255, 255, .06);
}

.reco-card:active { transform: translateX(2px) scale(.99); }

/* Banda de color = color real de la escena de luces indexada */
.reco-stripe {
  align-self: stretch;
  border-radius: 10px 0 0 10px;
  background: var(--reco-accent, var(--sub));
}

.reco-body { min-width: 0; }

.reco-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reco-artist {
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reco-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.reco-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: .85;
}

.reco-badge.luces { color: var(--a); }
.reco-badge.lrc   { color: var(--s); }
.reco-badge.bar   { color: var(--g); }
.reco-badge.mia   { color: var(--p); }

/* Punto vivo en las que ya tienen luces */
.reco-badge.luces::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: recoPulse 1.8s ease-in-out infinite;
}

@keyframes recoPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.reco-score {
  font-size: 10px;
  font-weight: 800;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

/* ── Overlay completo ──────────────────────────────────────────── */

.reco-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(4, 4, 10, .82);
  backdrop-filter: blur(14px);
  overflow-y: auto;
}

.reco-overlay.open { display: block; }

.reco-sheet {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: clamp(16px, 3vw, 28px);
}

.reco-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.reco-sheet-head h2 {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}

.reco-sheet-head p { font-size: 12px; color: var(--sub); margin: 4px 0 0; }

.reco-close {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: inherit;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--dur-fast, 150ms) ease, transform var(--dur-fast, 150ms) ease;
}

.reco-close:hover { background: rgba(233, 30, 144, .2); transform: rotate(90deg); }

.reco-search { display: flex; gap: 8px; margin-bottom: 20px; }
.reco-search input { flex: 1; min-width: 0; }

.reco-section { margin-bottom: 24px; }

.reco-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sub);
  margin-bottom: 10px;
}

.reco-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .12), transparent);
}

.reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.reco-actions { display: flex; gap: 6px; margin-top: 8px; }

.reco-act {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--dur-fast, 150ms) ease, border-color var(--dur-fast, 150ms) ease;
}

.reco-act:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .28); }
.reco-act.primary { border-color: var(--a); color: var(--a); }
.reco-act.primary:hover { background: rgba(255, 204, 0, .14); }

.reco-why { font-size: 10px; color: var(--sub); margin-top: 6px; line-height: 1.4; }

@media (max-width: 600px) {
  .reco-grid { grid-template-columns: 1fr; }
  .reco-sheet { border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .reco-card, .reco-close, .reco-act, .reco-rail-more { transition: none; }
  .reco-badge.luces::before { animation: none; }
  .reco-card:hover, .reco-card:focus-visible { transform: none; }
}

/* ── Show Runner: seccion activa ───────────────────────────────── */
/* Feedback de que el show corre de verdad, incluso sin luces fisicas. */

.show-section-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #08080c;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-base, 300ms) ease, transform var(--dur-base, 300ms) ease, background var(--dur-slow, 500ms) ease;
  pointer-events: none;
}

.show-section-chip.visible { opacity: .92; transform: translateY(0); }

/* El teleprompter respira con el color de la seccion en curso */
#tp-display[style*="--show-section-color"] {
  box-shadow: inset 0 0 120px -60px var(--show-section-color, transparent);
  transition: box-shadow var(--dur-slow, 500ms) ease;
}

@media (prefers-reduced-motion: reduce) {
  .show-section-chip { transition: none; }
  #tp-display[style*="--show-section-color"] { transition: none; }
}

/* Destello al cargar una recomendacion: confirmacion visible en el lugar
   donde de verdad pasa algo, no solo un toast que se puede perder. */
.reco-just-loaded {
  animation: recoLoaded 1.1s var(--ease-out, ease);
}

@keyframes recoLoaded {
  0%   { box-shadow: inset 0 0 0 3px var(--p, #ff3366); }
  70%  { box-shadow: inset 0 0 0 3px var(--p, #ff3366); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .reco-just-loaded { animation: none; }
}
