/* Ported verbatim from frontend/css/style.css -- Library (home) view and
   Transcript workspace view specific styles. */

/* Home hero -- the primary, unmissable way to start recording. */
.hero-record {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 20px 44px;
  margin-bottom: 8px;
}
.hero-record-btn {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent) 70%);
  box-shadow: var(--glow-accent);
  transition: transform .15s ease, box-shadow .15s ease;
  margin-bottom: 22px;
}
.hero-record-btn:hover { transform: scale(1.04); }
.hero-record-btn:active { transform: scale(0.98); }
.hero-record-icon { font-size: 40px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.hero-record-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
  animation: hero-ring-pulse 2.4s ease-out infinite;
}
@keyframes hero-ring-pulse {
  0% { transform: scale(0.94); opacity: .9; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
.hero-record-label { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.hero-record-sub { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 420px; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.quick-action-card .qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.quick-action-card .qa-title { font-weight: 600; font-size: 15px; }
.quick-action-card .qa-subtitle { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.quick-action-card.upload .qa-icon { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.quick-action-card.summary .qa-icon { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.library-header h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
#recordings-month-filter {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.recording-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.recording-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.recording-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.recording-card .card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.recording-card .card-title {
  font-weight: 600;
  font-size: 15px;
  word-break: break-word;
  outline: none;
  border-radius: 6px;
  padding: 1px 4px;
  margin: -1px -4px;
}
/* Editable-title affordance, shared with #job-title below (Recordings,
   Transcripts, and AI Transform all render this same card component) --
   a faint baseline underline hints it's a field even before hovering,
   an always-visible pencil icon (near-white for contrast against the
   dark panel, not the lower-contrast accent blue) confirms it, and
   cursor: text plus the existing tint+outline reinforce it while
   actually editing. The icon is never hover-gated -- it must be
   noticeable at rest, not discovered by accident. */
.recording-card .card-title,
#job-title {
  cursor: text;
  border-bottom: 1px dashed color-mix(in srgb, var(--border-strong) 55%, transparent);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.recording-card .card-title::after,
#job-title::after {
  content: "\270E";
  display: inline-block;
  margin-left: 7px;
  font-size: .95em;
  opacity: .85;
  color: var(--text);
  transition: opacity .12s ease, color .12s ease;
  vertical-align: middle;
}
.recording-card .card-title:hover,
#job-title:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-bottom-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.recording-card .card-title:hover::after,
#job-title:hover::after,
.recording-card .card-title:focus::after,
#job-title:focus::after {
  opacity: 1;
  color: var(--accent);
}
.recording-card .card-title:focus,
#job-title:focus {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-bottom-color: transparent;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.recording-card .card-meta { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.6; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recording-card .card-meta .dot-sep::before { content: "\00b7"; margin-right: 6px; color: var(--border-strong); }
.card-waveform {
  width: 100%;
  height: 36px;
  margin: 10px 0 8px;
  border-radius: 6px;
  display: block;
}
.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
}
.trash-empty-state { padding: 40px 16px; text-align: center; }

/* Use with AI -- informational page pointing at external LLMs, no
   different in kind from .ai-info-notice's tone, just more prominent
   since it's the page's whole point rather than a footnote. */
.use-with-ai-notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  max-width: 680px;
}
.use-with-ai-subheading { margin: 28px 0 14px; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.use-with-ai-tools .qa-icon { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
/* .quick-action-card is a <button> everywhere else; here it's an <a> to
   an external site, so the UA's a:link (higher specificity than a bare
   class) needs overriding to keep the same no-underline look. */
a.quick-action-card, a.quick-action-card:visited { color: var(--text); text-decoration: none; }
.use-with-ai-footnote { margin-top: 20px; max-width: 680px; line-height: 1.6; }

/* Transcript workspace */
.transcript-view-panel { max-width: 980px; }
.back-btn { margin-bottom: 16px; }

.job-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#job-title {
  outline: none;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  text-transform: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.speakers-list { display: flex; flex-direction: column; gap: 8px; }
.speaker-row { display: flex; align-items: center; gap: 10px; }
.speaker-row .speaker-original { color: var(--muted); font-size: 12px; width: 110px; flex-shrink: 0; }
.speaker-row input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.segment-speaker { color: var(--muted); font-weight: 600; font-size: 12px; flex-shrink: 0; width: 90px; padding-top: 2px; text-align: right; }

.waveform-canvas {
  width: 100%;
  height: 72px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
}

.player-wrap { width: 100%; }
#player { width: 100%; max-height: 360px; background: black; border-radius: 8px; }

.transcript-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.transcript-header h2 { margin: 0; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; }

.transcript-search { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.transcript-search .search-input { min-width: 180px; padding: 6px 12px; font-size: 13px; }
.transcript-search .muted.small { min-width: 44px; text-align: center; }

.transcript-view { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.segment-row {
  display: flex;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.segment-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.segment-row.active { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.segment-row.search-match { box-shadow: inset 3px 0 0 var(--warning); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.segment-row.search-match.active { background: color-mix(in srgb, var(--warning) 22%, transparent); }
.segment-time { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 12px; flex-shrink: 0; width: 64px; padding-top: 2px; }
.segment-text { flex: 1; outline: none; line-height: 1.5; }
.segment-text[contenteditable="true"]:focus { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 4px; }

/* AI Transform panel */
.ai-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-panel-header h2 { margin: 0; }
/* Generic readiness badge -- never names the model, just whether it's
   loaded and available right now. Only the status word itself (not the
   "LLM:" label or the badge background) turns green when ready. */
.ai-llm-status {
  font-size: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  padding: 5px 10px;
  border-radius: 999px;
}
#ai-llm-status-value.ready { color: var(--success); font-weight: 600; }

.ai-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* Selected state isn't color-only: bold weight + a checkmark also mark it. */
.ai-tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); font-weight: 700; }
.ai-tab-btn.active::before { content: "\2713\0020"; }
.ai-tab-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ai-info-notice {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
.ai-info-notice strong { font-weight: 700; }

.ai-output {
  margin-top: 12px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  max-width: 760px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ai-output:empty { display: none; }

/* AI-generated Markdown, rendered to real elements (see utils/markdown.js)
   -- these live inside a div.ai-output (white-space: pre-wrap above), so
   block-level margins/sizes here are what gives it heading hierarchy and
   keeps sections from running together, instead of one dense block. */
.ai-output:not(.muted) { white-space: normal; }
.ai-output h1, .ai-output h2, .ai-output h3, .ai-output h4, .ai-output h5, .ai-output h6 {
  margin: 20px 0 8px;
  line-height: 1.3;
}
.ai-output h1:first-child, .ai-output h2:first-child, .ai-output h3:first-child { margin-top: 0; }
.ai-output h1 { font-size: 17px; }
.ai-output h2 { font-size: 15.5px; }
.ai-output h3, .ai-output h4, .ai-output h5, .ai-output h6 { font-size: 14px; }
.ai-output p { margin: 0 0 12px; line-height: 1.6; }
.ai-output p:last-child { margin-bottom: 0; }
.ai-output ul, .ai-output ol { margin: 0 0 12px; padding-left: 24px; }
.ai-output li { margin-bottom: 6px; line-height: 1.6; }
.ai-output code {
  background: var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.92em;
}

/* AI Transform generation progress (see utils/ai-progress.js) -- shown
   inside the same output card while a tab is generating. */
.ai-progress { display: flex; flex-direction: column; gap: 8px; padding: 2px 0; }
.ai-progress-label { margin: 0; color: var(--muted); font-size: 13px; }
.ai-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.ai-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  /* transform, not width -- animating width triggers layout on every
     tick; scaleX is composited and doesn't. */
  transition: transform 0.3s ease;
}
/* No real per-token progress exists for generation/model-loading (see
   ai-progress.js) -- a fixed partial fill that pulses (reusing the same
   record-pulse keyframe/timing used elsewhere for "live" states) signals
   activity without claiming a false percentage. */
.ai-progress-fill.indeterminate { transform: scaleX(0.55); animation: record-pulse 1.6s ease-in-out infinite; }
.ai-progress-pct { align-self: flex-end; font-size: 12px; color: var(--muted); }

.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.ai-chat-empty { padding: 4px 0; }
.ai-chat-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.ai-chat-msg-text { white-space: pre-wrap; }
.ai-chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
}
.ai-chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ai-chat-msg.assistant.typing .ai-chat-msg-text { color: var(--muted); }
.ai-chat-msg-copy-btn {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.ai-chat-msg-copy-btn:hover { color: var(--text); text-decoration: underline; }
.ai-chat-form { display: flex; gap: 8px; }
.ai-chat-form input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
