/* ============================================================
   Assistant Communication Dysarthrie — Paramètres de voix
   Bouton roue dentée + modal ElevenLabs (clonage vocal)
   Réutilise les tokens --da-* définis dans style.css
   ============================================================ */

/* ─── Bouton d'ouverture ──────────────────────────────────── */

.da-settings-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.da-settings-btn:hover {
  background: #e5e7eb;
}

/* ─── Overlay + modal ─────────────────────────────────────── */

.da-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

/* Spécificité supérieure à `.da-modal-overlay` seule, nécessaire pour que
   l'attribut `hidden` l'emporte sur `display: flex` ci-dessus. */
.da-modal-overlay[hidden] {
  display: none;
}

.da-modal {
  background: var(--da-surface);
  border-radius: var(--da-radius);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.da-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--da-border);
  position: sticky;
  top: 0;
  background: var(--da-surface);
}

.da-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--da-text);
}

.da-modal-close {
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
}
.da-modal-close:hover { background: #e5e7eb; }

.da-modal-body {
  padding: 20px;
}

.da-modal-intro {
  font-size: 0.85rem;
  color: var(--da-muted);
  line-height: 1.5;
  margin: 0 0 18px;
}

/* ─── Champs ──────────────────────────────────────────────── */

.da-field {
  margin-bottom: 18px;
}

.da-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 2px solid var(--da-border);
  border-radius: 8px;
  font-family: inherit;
  color: var(--da-text);
  background: var(--da-bg);
  box-sizing: border-box;
}

.da-input:focus {
  outline: none;
  border-color: var(--da-primary);
  background: #ffffff;
}

.da-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.da-toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--da-primary);
  flex-shrink: 0;
}

/* ─── Sections (profil, voix clonée) ─────────────────────────── */

.da-voice-section {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--da-border);
}

.da-voice-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.da-section-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--da-text);
}

.da-current-voice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.da-voice-name {
  font-weight: 600;
  color: #14532d;
}

.da-voice-actions {
  display: flex;
  gap: 8px;
}

.da-record-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.da-record-timer {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--da-danger);
  font-weight: 600;
}

.da-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #e0f2fe;
  color: var(--da-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}
.da-file-btn:hover { background: #bae6fd; }

.da-preview-audio {
  width: 100%;
  margin: 10px 0;
}

.da-btn-primary.da-recording {
  background: var(--da-danger);
}

/* ─── Statut ──────────────────────────────────────────────── */

.da-vs-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 4px 0 0;
}

.da-vs-status.da-vs-error { color: var(--da-danger); }
.da-vs-status.da-vs-ok    { color: var(--da-success); }

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .da-modal {
    max-height: 100vh;
    border-radius: 0;
  }
}
