/* ============================================================================
   VOICE.CSS — the "Voice" console (Phase 1 of the RVC pipeline).
   Sits inside the Sing-Along path, right after a take is captured. Lets the
   user train their OWN voice model (Option A — zero legal risk) and convert
   every take into that voice. Pro feature.
   Matches the brushed-metal console + neon-accent aesthetic of mixer.css.
   ========================================================================== */

.voice-console {
  margin-top: 14px;
  border: 1px solid #0a0c10;
  border-radius: 14px;
  padding: 16px;
  background:
    radial-gradient(700px 200px at 100% -30%, rgba(53,194,255,0.10), transparent 60%),
    radial-gradient(600px 180px at -10% 130%, rgba(255,107,53,0.08), transparent 60%),
    linear-gradient(180deg, #23262e 0%, #191c22 12%, #14161b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 30px rgba(0,0,0,0.45);
  position: relative;
}
.voice-console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0.9;
}

.vc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.vc-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.vc-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 14px;
  line-height: 1.5;
}

.vc-pro-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ff9a3d);
  color: #1a0d05;
}

/* ---- "Match the original AI vocal" callout ------------------------------- */
.vc-match {
  border: 1px solid rgba(53,194,255,0.35);
  border-radius: 12px;
  padding: 12px 14px 6px;
  margin: 0 0 14px;
  background:
    radial-gradient(500px 160px at 100% -40%, rgba(53,194,255,0.16), transparent 60%),
    linear-gradient(180deg, rgba(53,194,255,0.08), rgba(53,194,255,0.02));
}
.vc-match-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vc-match-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}
.vc-match-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(53,194,255,0.18);
  border: 1px solid rgba(53,194,255,0.45);
  color: #9fe0ff;
}

/* ---- "Guide-tune to the original" callout (pitch only) ------------------- */
.vc-tune {
  border: 1px solid rgba(75,224,138,0.35);
  border-radius: 12px;
  padding: 12px 14px 6px;
  margin: 0 0 14px;
  background:
    radial-gradient(500px 160px at 100% -40%, rgba(75,224,138,0.16), transparent 60%),
    linear-gradient(180deg, rgba(75,224,138,0.08), rgba(75,224,138,0.02));
}
.vc-tune .vc-match-tag {
  background: rgba(75,224,138,0.18);
  border-color: rgba(75,224,138,0.45);
  color: #a8f5c8;
}

/* ---- row layout ---------------------------------------------------------- */
.vc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vc-row > label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vc-select {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #12141a;
  border: 1px solid #0c0e12;
  border-radius: 9px;
  padding: 9px 11px;
  min-width: 220px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.vc-select:focus { outline: 1px solid var(--accent); }

.vc-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: linear-gradient(180deg, #2c313b, #20242c);
  border: 1px solid #0c0e12;
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.vc-btn:hover:not(:disabled) { background: linear-gradient(180deg, #343a46, #262b34); }
.vc-btn:active:not(:disabled) { transform: translateY(1px); }
.vc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.vc-btn.primary {
  background: linear-gradient(180deg, var(--accent), #1f9fd8);
  border-color: #0b6f99;
  color: #04121a;
  font-weight: 700;
}
.vc-btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #5cc9ff, #2aa9e0); }
.vc-btn.danger {
  background: linear-gradient(180deg, #3a2426, #2a1a1c);
  border-color: #5a2a2e;
  color: #ffb4b4;
}
.vc-btn.rec { background: linear-gradient(180deg, #3a1e1e, #2a1414); border-color: #7a2a2a; color: #ff8a8a; }
.vc-btn.rec.on { background: linear-gradient(180deg, #e0433f, #a92a27); border-color: #ff6b53; color: #fff; }

/* ---- train sub-panel ----------------------------------------------------- */
.vc-train {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;
  padding: 14px;
  background: rgba(10,12,16,0.45);
  margin-bottom: 12px;
}
.vc-train[hidden] { display: none; }
.vc-train-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.vc-input {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #12141a;
  border: 1px solid #0c0e12;
  border-radius: 9px;
  padding: 9px 11px;
  min-width: 180px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.vc-input:focus { outline: 1px solid var(--accent); }

.vc-sample-status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}
.vc-sample-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #555; display: inline-block;
}
.vc-sample-status.recording .dot { background: #ff4d4d; animation: vc-pulse 1s infinite; }
.vc-sample-status.ready .dot { background: #46d369; }
@keyframes vc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---- progress ------------------------------------------------------------ */
.vc-progress {
  height: 8px;
  border-radius: 999px;
  background: #0d0f13;
  border: 1px solid #0a0c10;
  overflow: hidden;
  margin: 10px 0 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
.vc-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}
.vc-progress[hidden] { display: none; }

.vc-status {
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
  line-height: 1.5;
}
.vc-status.ok { color: #7fe0a0; }
.vc-status.err { color: #ff9a9a; }

/* ---- capability chip ----------------------------------------------------- */
.vc-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.vc-cap .dot { width: 7px; height: 7px; border-radius: 50%; background: #888; }
.vc-cap.studio .dot { background: #46d369; }
.vc-cap.preview .dot { background: #ffb454; }

/* Monthly voice-training quota (2 new voices / calendar month) */
.vc-quota {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(53,194,255,0.28);
  background: rgba(53,194,255,0.06);
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e8ecf3);
}
.vc-quota .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2, #35c2ff);
  box-shadow: 0 0 8px rgba(53,194,255,0.7);
  flex: 0 0 auto;
}
.vc-quota .vc-quota-hint {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent-3, #35ff9e);
}
.vc-quota.full {
  border-color: rgba(255,107,53,0.4);
  background: rgba(255,107,53,0.08);
}
.vc-quota.full .dot { background: var(--accent, #ff6b35); box-shadow: 0 0 8px rgba(255,107,53,0.7); }
.vc-quota.full .vc-quota-hint { color: #ffb27a; }

.vc-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}
.vc-note a {
  color: var(--accent-2, #35c2ff);
  text-decoration: none;
  border-bottom: 1px solid rgba(53,194,255,0.4);
}
.vc-note a:hover { border-bottom-color: var(--accent-2, #35c2ff); }

/* ---- voice list chips ---------------------------------------------------- */
.vc-voices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.vc-voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
}
.vc-voice-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  background: rgba(53,194,255,0.10);
}
.vc-voice-chip .meta { font-size: 10.5px; color: var(--muted); }
.vc-voice-chip .del {
  color: #ff9a9a; font-weight: 800; cursor: pointer; padding: 0 2px;
}

.vc-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 14px 0;
}

/* ---- converted badge on the take ----------------------------------------- */
.vc-converted-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #7fe0a0;
  background: rgba(70,211,105,0.10);
  border: 1px solid rgba(70,211,105,0.35);
  border-radius: 999px;
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .vc-select { min-width: 160px; }
  .vc-row { gap: 8px; }
}

/* ---- multi-voice library (name / register / role per voice) ---- */
.vc-library { margin-top: 12px; }
.vc-lib-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.vc-lib-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px; background: rgba(255,255,255,0.03);
}
.vc-lib-row.vc-lib-training { opacity: 0.6; }
.vc-lib-row.vc-lib-failed { border-color: rgba(255,90,90,0.35); background: rgba(255,90,90,0.06); }
.vc-lib-row.vc-lib-failed .vc-lib-state { color: #ff9b9b; }
.vc-lib-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; padding: 2px 8px;
  border-radius: 999px; background: rgba(255,107,53,0.16);
  border: 1px solid rgba(255,107,53,0.4); color: #ffc4a3; white-space: nowrap;
}
.vc-lib-name { flex: 1 1 160px; min-width: 120px; }
.vc-lib-reg, .vc-lib-role { flex: 0 0 auto; }
.vc-lib-state { font-size: 11px; color: #8fd694; white-space: nowrap; }
.vc-lib-empty { font-size: 13px; color: #9aa4b2; padding: 8px 0; line-height: 1.5; }

/* ---- §247j: "Final vocal" output mode (blend under lead / replace) ------- */
.vc-out {
  border: 1px solid rgba(255,107,53,0.32);
  border-radius: 12px;
  padding: 12px 14px 10px;
  margin: 0 0 14px;
  background:
    radial-gradient(500px 160px at 100% -40%, rgba(255,107,53,0.14), transparent 60%),
    linear-gradient(180deg, rgba(255,107,53,0.07), rgba(255,107,53,0.02));
}
.vc-out .vc-match-tag {
  background: rgba(255,107,53,0.18);
  border-color: rgba(255,107,53,0.45);
  color: #ffc4a3;
}
.vc-out-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 10px;
}
.vc-out-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #2a2f3a);
  background: linear-gradient(180deg, #232833, #1b1f27);
  color: var(--text, #e8eaed);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  font: inherit;
}
.vc-out-mode b { font-size: 12.5px; font-weight: 800; letter-spacing: .01em; }
.vc-out-mode span { font-size: 11px; color: var(--text-dim, #9aa0ac); line-height: 1.35; }
.vc-out-mode:hover { border-color: rgba(53,194,255,0.45); }
.vc-out-mode.is-active {
  border-color: var(--accent-2, #35c2ff);
  background: linear-gradient(180deg, rgba(53,194,255,0.16), rgba(53,194,255,0.04));
  box-shadow: 0 0 0 1px rgba(53,194,255,0.35) inset, 0 6px 18px -10px rgba(53,194,255,0.6);
}
.vc-out-mode.is-active span { color: #bfe9ff; }
.vc-out-db { margin: 0 0 6px; }
.vc-out-db > span { font-size: 11.5px; color: var(--text-dim, #9aa0ac); min-width: 96px; }
.vc-out-db[hidden] { display: none; }
@media (max-width: 520px) {
  .vc-out-modes { grid-template-columns: 1fr; }
}
