/* ============================================================
 *  Peerly — UI d'enregistrement vocal
 *  v8.3.0 — boutons ronds (fix --md-shape-full → 50%)
 * ============================================================ */

/* ---- Bouton micro dans la barre d'input ---- */
.btn-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
}
.btn-voice:hover:not(:disabled) {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
}
.btn-voice:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-voice i { line-height: 1; }

/* ============================================================
 *  Barre d'enregistrement
 * ============================================================ */
.chat-input-bar.recording > *:not(.voice-recorder-bar) {
  display: none !important;
}
.chat-input-bar.recording {
  padding: var(--space-3) var(--space-4);
}

.voice-recorder-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  animation: recorderSlideIn var(--duration-base) var(--ease-out);
}

@keyframes recorderSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Bouton annuler — rond ---- */
.voice-recorder-cancel {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-error-soft);
  color: var(--md-error);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}
.voice-recorder-cancel:hover {
  background: var(--md-error);
  color: #fff;
}
.voice-recorder-cancel:active { transform: scale(0.94); }
.voice-recorder-cancel i {
  font-size: 20px;
  line-height: 1;
}

/* ---- Zone centrale ---- */
.voice-recorder-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.voice-recorder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF3B30;
  flex-shrink: 0;
  animation: recDotPulse 1s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

@keyframes recDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

.voice-recorder-timer {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  font-weight: var(--weight-medium);
  color: var(--md-on-surface);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  flex-shrink: 0;
}

/* ---- Waveform animée ---- */
.voice-recorder-wave {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.voice-recorder-bar-item {
  width: 3px;
  height: 8px;
  border-radius: 9999px;
  background: var(--md-primary);
  animation: recWave 0.9s ease-in-out infinite;
  flex-shrink: 0;
  opacity: 0.85;
}

@keyframes recWave {
  0%, 100% { height: 6px; opacity: 0.5; }
  50%      { height: 22px; opacity: 1; }
}

/* ---- Bouton envoyer — rond ---- */
.voice-recorder-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-md);
}
.voice-recorder-send:hover {
  background: color-mix(in srgb, var(--md-primary) 88%, white 12%);
  transform: scale(1.06);
}
.voice-recorder-send:active { transform: scale(0.94); }
.voice-recorder-send i {
  font-size: 20px;
  line-height: 1;
}

/* ---- Mobile ---- */
@media (max-width: 599px) {
  .voice-recorder-bar { gap: var(--space-2); }
  .voice-recorder-cancel,
  .voice-recorder-send {
    width: 38px;
    height: 38px;
  }
  .voice-recorder-cancel i,
  .voice-recorder-send i { font-size: 18px; }
  .voice-recorder-wave {
    gap: 2px;
    height: 24px;
  }
  .voice-recorder-bar-item { width: 2px; }
  .voice-recorder-timer {
    font-size: var(--text-xs);
    min-width: 38px;
  }
}