/* ============================================
   voice-recorder.css — стили таба «Запись»
   Переиспользуем .hero-tabs__tab (landing.css).
   ============================================ */

/* Контейнер таба mic */
.voice-recorder {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1rem;
  align-items: center;
}

/* --- Большая красная кнопка записи --- */
.voice-recorder__record-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: #e53935;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.35);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.voice-recorder__record-btn:hover {
  background: #d32f2f;
  transform: scale(1.03);
}

.voice-recorder__record-btn:focus-visible {
  outline: 3px solid #c6f311;
  outline-offset: 3px;
}

/* Состояние recording — «пульс» */
.voice-recorder__record-btn[data-state="recording"] {
  background: #111;
  box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.55);
  animation: vr-pulse 1.4s ease-out infinite;
}

.voice-recorder__record-btn[data-state="recording"] .voice-recorder__icon-mic {
  display: none;
}

.voice-recorder__record-btn[data-state="recording"] .voice-recorder__icon-stop {
  display: inline-block;
  width: 28px;
  height: 28px;
  background: #e53935;
  border-radius: 4px;
}

.voice-recorder__icon-stop {
  display: none;
}

.voice-recorder__record-btn[data-state="stopped"] {
  background: #555;
}

@keyframes vr-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.6);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(229, 57, 53, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
  }
}

/* --- Таймер --- */
.voice-recorder__timer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text, #111);
  font-variant-numeric: tabular-nums;
  min-width: 6ch;
  text-align: center;
}

/* --- Waveform canvas --- */
.voice-recorder__canvas-wrap {
  width: 100%;
  max-width: 520px;
  background: #0a0a0a;
  border-radius: 12px;
  padding: 12px;
}

.voice-recorder__canvas {
  display: block;
  width: 100%;
  height: 80px;
}

/* --- Подсказка под кнопкой --- */
.voice-recorder__hint {
  font-size: 0.9rem;
  color: var(--color-text-muted, #666);
  margin: 0;
  text-align: center;
}

/* --- Preview плеер --- */
.voice-recorder__preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 520px;
}

.voice-recorder__preview audio {
  width: 100%;
  outline: none;
}

/* --- Действия (отправить, перезаписать) --- */
.voice-recorder__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.voice-recorder__send-btn {
  /* Используем стандартный .btn-primary */
}

.voice-recorder__reset-btn {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--color-text, #111);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.voice-recorder__reset-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* --- Селектор языка (виден только после stop) --- */
.voice-recorder__language {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Сообщения (warning / error / info / fallback) --- */
.voice-recorder__message {
  width: 100%;
  max-width: 520px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.voice-recorder__message--warning {
  background: #fff7d6;
  color: #8a6d00;
  border: 1px solid #f2d675;
}

.voice-recorder__message--error {
  background: #fde8e8;
  color: #a61b1b;
  border: 1px solid #f5b5b5;
}

.voice-recorder__message--info {
  background: #e8f3fd;
  color: #0b5c99;
  border: 1px solid #b5d7f5;
}

.voice-recorder__message-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

/* --- Inline-подпись под кнопкой «Отправить» (параллельная транскрипция) --- */
.voice-recorder__inline-reason {
  font-size: 0.85rem;
  color: var(--color-text-muted, #666);
  margin-top: 0.25rem;
}

/* --- Плашка восстановления (заготовка — Task 7 наполнит) --- */
.voice-recorder__restore-banner {
  width: 100%;
  max-width: 520px;
  padding: 1rem;
  background: #f4f4f4;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- Dark theme overrides --- */
[data-theme="dark"] .voice-recorder__timer {
  color: #eee;
}

[data-theme="dark"] .voice-recorder__canvas-wrap {
  background: #1a1a1a;
}

[data-theme="dark"] .voice-recorder__message--warning {
  background: #3a2d00;
  color: #fff0a8;
  border-color: #6b5600;
}

[data-theme="dark"] .voice-recorder__message--error {
  background: #4a1616;
  color: #fbd0d0;
  border-color: #7a2323;
}

[data-theme="dark"] .voice-recorder__message--info {
  background: #0f2c44;
  color: #cfe4fa;
  border-color: #214c70;
}

[data-theme="dark"] .voice-recorder__restore-banner {
  background: #1e1e1e;
}

/* --- Mobile tweaks --- */
@media (max-width: 480px) {
  .voice-recorder__record-btn {
    width: 80px;
    height: 80px;
  }
  .voice-recorder__timer {
    font-size: 2rem;
  }
}
