/**
 * File:          public/css/voice_notes.css
 * Version:       0.1.0
 * Last Modified: 2026-07-22
 * Changes:       New — styles for the Voice Notes feature (mic capture + library +
 *                karaoke) that feeds cleaned transcripts into the Prompt Builder.
 *                Everything is namespaced .vn- / #vn-modal so it never collides
 *                with app.js styles. Colors come from the app's CSS variables
 *                (dark-mode aware) with hex fallbacks.
 */

/* ── Composer mic button — VISIBLE, lives in #input-row next to the "+" (#mobilePlusBtn).
   NOT in #tool-rail (that is display:none at every width). Matches the "+" control. ── */
#voiceNoteBtn {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; min-width: 38px;
  flex-shrink: 0; padding: 0;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  color: var(--accent-hover, #c4b5fd);
  cursor: pointer;
  order: -1; /* leading edge of the composer, right after the "+" */
  transition: background 0.15s, box-shadow 0.2s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
/* Mic is Prompt-Builder-only for now — voice_notes.js toggles this class on
   council:mode-changed. !important so hiding always wins the cascade. */
#voiceNoteBtn.vn-hidden { display: none !important; }
#voiceNoteBtn:hover { background: rgba(139, 92, 246, 0.24); }
#voiceNoteBtn:active { background: rgba(139, 92, 246, 0.30); }
#voiceNoteBtn svg { width: 19px; height: 19px; }
#voiceNoteBtn.vn-recording {
  color: #fff;
  background: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
  animation: vnPulseBtn 1.4s ease-in-out infinite;
}
@keyframes vnPulseBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ── Modal shell ── */
#vn-modal {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.vn-box {
  display: flex; flex-direction: column;
  width: 100%; max-width: 560px; max-height: 85vh;
  background: var(--bg-secondary, #111114);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* ── Header + tabs ── */
.vn-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}
.vn-head-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary, #fafafa);
}
.vn-tabs { display: flex; gap: 4px; margin-left: 6px; }
.vn-tab {
  padding: 5px 12px; border: none; border-radius: 999px;
  background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: inherit;
  color: var(--text-secondary, #a1a1aa);
}
.vn-tab:hover { background: rgba(255, 255, 255, 0.06); }
.vn-tab.active {
  background: var(--accent-dim, rgba(99, 102, 241, 0.12));
  color: var(--accent-hover, #818cf8);
}
.vn-close {
  margin-left: auto;
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer;
  color: var(--text-secondary, #a1a1aa);
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.vn-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary, #fff); }

/* ── Body (scrolls) ── */
.vn-body {
  padding: 20px 18px; overflow-y: auto; flex: 1 1 auto;
  color: var(--text-primary, #fafafa);
}

/* ── Record view ── */
.vn-record { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.vn-mic-circle {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim, rgba(99, 102, 241, 0.1));
  border: 2px solid var(--accent, #6366f1);
  color: var(--accent-hover, #818cf8);
}
.vn-mic-circle.vn-live {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger, #ef4444);
  color: var(--danger, #ef4444);
  animation: vnPulseRing 1.5s ease-in-out infinite;
}
@keyframes vnPulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50%      { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}
.vn-timer {
  font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px; color: var(--text-primary, #fafafa);
}
.vn-hint { font-size: 13px; color: var(--text-secondary, #a1a1aa); max-width: 360px; line-height: 1.5; }
.vn-hint-dim { font-size: 12px; color: var(--text-dim, #52525b); }

/* ── Buttons ── */
.vn-btn {
  padding: 10px 18px; border-radius: 999px; border: none;
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
}
.vn-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.vn-btn-primary { background: var(--accent, #6366f1); color: #fff; }
.vn-btn-primary:hover:not(:disabled) { background: var(--accent-hover, #818cf8); }
.vn-btn-danger { background: var(--danger, #ef4444); color: #fff; }
.vn-btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.vn-btn-ghost {
  background: var(--bg-tertiary, #18181b); color: var(--text-secondary, #a1a1aa);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.12));
}
.vn-btn-ghost:hover:not(:disabled) { color: var(--text-primary, #fff); background: var(--bg-elevated, #232329); }
.vn-btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── Processing steps ── */
.vn-steps { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; margin: 4px auto; }
.vn-step { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-dim, #52525b); }
.vn-step-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-strong, rgba(255, 255, 255, 0.15));
  font-size: 11px;
}
.vn-step.active { color: var(--text-primary, #fafafa); font-weight: 600; }
.vn-step.active .vn-step-dot { border-color: var(--accent, #6366f1); color: var(--accent-hover, #818cf8); }
.vn-step.done { color: var(--text-secondary, #a1a1aa); }
.vn-step.done .vn-step-dot { border-color: var(--success, #22c55e); background: var(--success, #22c55e); color: #fff; }
.vn-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--accent-hover, #818cf8);
  animation: vnSpin 0.7s linear infinite;
}
@keyframes vnSpin { to { transform: rotate(360deg); } }

/* ── Transcript blocks ── */
.vn-transcript {
  width: 100%; box-sizing: border-box;
  background: var(--bg-tertiary, #18181b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 12px; padding: 14px 16px;
  font-size: 14px; line-height: 1.6; color: var(--text-primary, #fafafa);
  white-space: pre-wrap; word-break: break-word;
  max-height: 34vh; overflow-y: auto;
}
.vn-section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim, #52525b); margin: 14px 0 7px;
}
.vn-section-label:first-child { margin-top: 0; }
.vn-verbatim-note {
  font-size: 12px; color: var(--text-secondary, #a1a1aa);
  background: var(--accent-dim, rgba(99, 102, 241, 0.08));
  border: 1px solid var(--border-active, rgba(99, 102, 241, 0.3));
  border-radius: 10px; padding: 9px 12px; margin: 0 0 4px; line-height: 1.5;
}
.vn-raw-toggle {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 600; color: var(--accent-hover, #818cf8);
  padding: 4px 0; text-decoration: underline;
}

/* ── Error / permission states ── */
.vn-error {
  width: 100%; box-sizing: border-box;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px; padding: 14px 16px;
  font-size: 13px; line-height: 1.5; color: var(--text-primary, #fafafa);
}
.vn-error strong { color: var(--danger, #ef4444); }

/* ── Library list ── */
.vn-lib-empty { text-align: center; color: var(--text-dim, #52525b); font-size: 13px; padding: 30px 10px; line-height: 1.6; }
.vn-lib-list { display: flex; flex-direction: column; gap: 8px; }
.vn-lib-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px; cursor: pointer;
  background: var(--bg-tertiary, #18181b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.vn-lib-row:hover { border-color: var(--border-active, rgba(99, 102, 241, 0.4)); background: var(--bg-elevated, #202027); }
.vn-lib-main { flex: 1 1 auto; min-width: 0; }
.vn-lib-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #fafafa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vn-lib-meta { font-size: 11px; color: var(--text-dim, #52525b); margin-top: 2px; }
.vn-lib-preview { font-size: 12px; color: var(--text-secondary, #a1a1aa); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vn-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px;
}
.vn-badge-ready { color: var(--success, #22c55e); background: rgba(34, 197, 94, 0.12); }
.vn-badge-processing { color: var(--accent-hover, #818cf8); background: var(--accent-dim, rgba(99, 102, 241, 0.12)); }
.vn-badge-error { color: var(--danger, #ef4444); background: rgba(239, 68, 68, 0.12); }

/* ── Detail view ── */
.vn-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.vn-back {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--accent-hover, #818cf8);
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 0;
}
.vn-detail-actions { margin-left: auto; display: flex; gap: 6px; }
.vn-icon-btn {
  width: 32px; height: 32px; border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 8px; background: var(--bg-tertiary, #18181b); cursor: pointer;
  color: var(--text-secondary, #a1a1aa);
  display: flex; align-items: center; justify-content: center;
}
.vn-icon-btn:hover { color: var(--text-primary, #fff); border-color: var(--border-strong, rgba(255, 255, 255, 0.12)); }
.vn-icon-btn.vn-danger:hover { color: var(--danger, #ef4444); border-color: rgba(239, 68, 68, 0.4); }

/* ── Karaoke player ── */
.vn-karaoke {
  background: var(--bg-tertiary, #18181b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.vn-kara-text {
  font-size: 16px; line-height: 1.75; color: var(--text-secondary, #a1a1aa);
  max-height: 30vh; overflow-y: auto; margin-bottom: 12px;
}
.vn-word { transition: color 0.1s, background 0.1s; border-radius: 3px; padding: 0 1px; }
.vn-word.vn-word-active { color: #fff; background: var(--accent, #6366f1); }
.vn-word.vn-word-past { color: var(--text-primary, #fafafa); }
.vn-kara-controls { display: flex; align-items: center; gap: 12px; }
.vn-play-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--accent, #6366f1); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.vn-play-btn:hover { background: var(--accent-hover, #818cf8); }
.vn-progress { flex: 1 1 auto; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; cursor: pointer; }
.vn-progress-fill { height: 100%; width: 0%; background: var(--accent, #6366f1); border-radius: 3px; }
.vn-kara-time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-dim, #52525b); flex-shrink: 0; min-width: 74px; text-align: right; }

/* ── Rename inline ── */
.vn-rename-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px;
  background: var(--bg-tertiary, #18181b);
  border: 1px solid var(--border-active, rgba(99, 102, 241, 0.4));
  border-radius: 10px; color: var(--text-primary, #fafafa);
  font-size: 14px; font-family: inherit; outline: none;
}

/* ── Footer actions ── */
.vn-foot {
  display: flex; gap: 10px; padding: 14px 16px; flex-shrink: 0;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  flex-wrap: wrap;
}
.vn-foot .vn-btn { flex: 1 1 auto; }

/* ── Small confirm strip (no browser popups) ── */
.vn-confirm {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px; padding: 10px 12px; margin-top: 10px;
  font-size: 12px; color: var(--text-primary, #fafafa);
}
.vn-confirm .vn-confirm-actions { margin-left: auto; display: flex; gap: 6px; }
.vn-confirm button {
  padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none;
}

@media (max-width: 560px) {
  .vn-box { max-height: 92vh; border-radius: 14px; }
  .vn-foot { flex-direction: column; }
}

/* === END OF FILE (FILENAME: public/css/voice_notes.css) === */
