/* ── Comment System ── usb.theslipstream.ai ───────────── */
/* Uses existing CSS custom properties from each document   */

/* ── Comment Area Container ───────────────────────────── */

.comments-area {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.comments-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.comments-divider::before,
.comments-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.comments-divider span {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ── Comment List ─────────────────────────────────────── */

.comments-list {
  margin-bottom: 1.25rem;
}

.comments-empty,
.comments-unavailable {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 0.25rem 0 0.5rem;
}

.comments-unavailable {
  color: var(--danger, #8B3538);
  font-style: normal;
}

.comment {
  padding: 0.75rem 0;
}

.comment + .comment {
  border-top: 1px solid var(--border-light);
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.comment-author {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.comment-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.comment-time::before {
  content: '·';
  margin-right: 0.5rem;
}

.comment-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ── Comment Form ─────────────────────────────────────── */

.comment-form {
  background: var(--surface-alt, #F5F3EF);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
}

.comment-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.comment-name {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.comment-name:focus {
  border-color: var(--accent);
}

.comment-text {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 0.65rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  overflow-y: hidden;
  box-sizing: border-box;
}

.comment-text:focus {
  border-color: var(--accent);
}

.comment-text::placeholder {
  color: var(--text-tertiary);
}

/* ── Controls Row ─────────────────────────────────────── */

.comment-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Voice & Submit Buttons ───────────────────────────── */

.btn-voice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
  line-height: 1;
}

.btn-voice:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.btn-voice:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-record.recording {
  border-color: #C0392B;
  color: #C0392B;
  background: #FDF2F2;
}

.btn-submit {
  padding: 0.5rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius, 8px);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s ease;
  min-height: 36px;
  line-height: 1;
}

.btn-submit:hover:not(:disabled) {
  filter: brightness(0.88);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Record Dot ───────────────────────────────────────── */

.record-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C0392B;
  flex-shrink: 0;
}

.record-dot.pulsing {
  animation: comment-pulse-dot 1.2s ease-in-out infinite;
}

@keyframes comment-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* ── Timer & Status ───────────────────────────────────── */

.recording-timer {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 42px;
}

.recording-status {
  font-size: 12.5px;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.recording-status.transcribing {
  color: var(--accent);
}

.recording-status.error {
  color: var(--danger, #8B3538);
}

/* ── Inline Error ─────────────────────────────────────── */

.comment-error {
  margin-top: 0.5rem;
  font-size: 13px;
  color: var(--danger, #8B3538);
}

/* ── Mobile ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .comments-area {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .comment-form {
    padding: 1rem;
  }

  .comment-name {
    max-width: 100%;
  }

  .comment-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-controls {
    justify-content: flex-start;
  }

  .btn-voice,
  .btn-submit {
    min-height: 44px;
    font-size: 14px;
  }

  .btn-submit {
    width: 100%;
    text-align: center;
  }
}
