/* ══════════════════════════════════════════════════════════════════════════
   CUE LIST / KỊCH BẢN CHƯƠNG TRÌNH + HEALTH BADGE + UPLOAD CONFIG + MIDI + REC
   ══════════════════════════════════════════════════════════════════════════ */

.cue-section {
  border: 1px solid rgba(168, 85, 247, 0.18);
}

.cue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cue-head-tools {
  display: flex;
  gap: 0.5rem;
}

.cue-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.cue-btn:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  transform: translateY(-1px);
}

.cue-btn-ghost { background: transparent; }

.cue-btn-back {
  border-color: rgba(96, 165, 250, 0.4);
  color: #60a5fa;
}

.cue-btn-back:hover { border-color: #60a5fa; }

.cue-btn-reset {
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--neon-rose);
}

.cue-btn-reset:hover { border-color: var(--neon-rose); color: var(--neon-rose); }

.cue-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cue-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cue-add-select {
  flex: 1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.cue-add-select:focus {
  outline: none;
  border-color: var(--neon-purple);
}

.cue-add-select optgroup { color: var(--neon-cyan); font-style: normal; }

.cue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 320px;
  overflow-y: auto;
}

.cue-item {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  transition: var(--transition);
  cursor: grab;
}

.cue-item.cue-current {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 1px var(--neon-cyan), 0 0 20px rgba(0, 242, 254, 0.18);
  background: rgba(0, 242, 254, 0.05);
}

.cue-item.cue-done {
  opacity: 0.55;
}

.cue-item.cue-dragover {
  border-style: dashed;
  border-color: var(--neon-purple);
}

.cue-item.cue-fail { border-color: rgba(244, 63, 94, 0.4); }

.cue-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-purple);
}

.cue-item.cue-current .cue-num {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: var(--text-dark);
}

.cue-item.cue-done .cue-num {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--neon-emerald);
}

.cue-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cue-info-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cue-info-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.cue-tag-event { color: var(--neon-cyan); }
.cue-tag-sup { color: #60a5fa; }
.cue-tag-playlist { color: var(--neon-emerald); }
.cue-tag-party { color: #fbbf24; }
.cue-tag-action { color: var(--neon-rose); }

.cue-action-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}

.cue-action-btn:hover {
  border-color: var(--neon-rose);
  color: var(--neon-rose);
}

.cue-action-group {
  display: flex;
  gap: 0.25rem;
}

.cue-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 1.2rem 0.5rem;
  border: 1px dashed var(--glass-border);
  border-radius: 10px;
  font-style: italic;
}

.cue-go-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.cue-go-btn {
  background: linear-gradient(135deg, var(--neon-emerald) 0%, var(--neon-cyan) 100%);
  color: var(--text-dark);
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
  text-align: left;
}

.cue-go-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

.cue-go-btn:active { transform: translateY(1px); }

.cue-go-btn:disabled {
  background: rgba(100, 116, 139, 0.4);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.cue-go-btn i { font-size: 1.4rem; }

.cue-go-lbl {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.cue-go-sub {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.cue-btn-back, .cue-btn-reset {
  font-size: 1rem;
  padding: 0 1.1rem;
  min-width: 56px;
  justify-content: center;
}

.duck-select.active {
  border-color: rgba(168, 85, 247, 0.55);
  color: var(--neon-purple);
}

/* Pre-Listen / Cue Out trigger buttons */
.cue-out-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  flex: 0 0 auto;
}

.cue-out-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.cue-out-btn.active {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.15);
  animation: cuePulse 1.5s ease-in-out infinite;
}

@keyframes cuePulse {
  0%, 100% { box-shadow: 0 0 12px rgba(96, 165, 250, 0.15); }
  50%      { box-shadow: 0 0 18px rgba(96, 165, 250, 0.35); }
}

.plist-item .cue-out-btn { margin-left: auto; }

/* ── Config upload button & source tag ── */
.cfg-upload-btn {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
  border: 1px dashed rgba(96, 165, 250, 0.5);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.cfg-upload-btn:hover {
  background: rgba(96, 165, 250, 0.2);
  border-style: solid;
}

.cfg-src-tag {
  font-size: 0.7rem;
  color: var(--neon-emerald);
  font-style: italic;
  margin-left: 0.4rem;
}

/* ── Health badge cảnh báo file lỗi ── */
.health-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--neon-rose);
  color: var(--text-dark);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
  z-index: 5;
  animation: healthPulse 1.6s ease-in-out infinite;
}

@keyframes healthPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(244, 63, 94, 0.6); }
  50%      { box-shadow: 0 0 22px rgba(244, 63, 94, 0.95); }
}

/* ── MIDI mapping rows ── */
.midi-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  margin-bottom: 0.3rem;
  font-size: 0.83rem;
}

.midi-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.midi-row-note {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--neon-purple);
  background: rgba(168, 85, 247, 0.1);
  padding: 2px 8px;
  border-radius: 5px;
  min-width: 90px;
  text-align: center;
}

.midi-row .midi-learn {
  background: rgba(0, 242, 254, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.4);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.midi-row .midi-learn:hover {
  background: rgba(0, 242, 254, 0.2);
}

/* ── REC button blink khi đang ghi ── */
.hdr-tool-btn.rec-active {
  background: var(--neon-rose);
  border-color: var(--neon-rose);
  color: #fff;
  animation: recBlink 1s ease-in-out infinite;
}

@keyframes recBlink {
  0%, 100% { box-shadow: 0 0 0 rgba(244, 63, 94, 0); }
  50%      { box-shadow: 0 0 18px rgba(244, 63, 94, 0.7); }
}
