/* ===== VARIABLES ===== */
:root {
  --primary: #1463ff;
  --primary-hover: #0d4fd4;
  --border: #e6e6ee;
  --ink: #111;
  --muted: #555;
  --bg: #fff;
  --bgcard: #f8f8fa;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --primary: #4d8aff;
  --primary-hover: #6ba0ff;
  --border: #2a2a2a;
  --ink: #e0e0e0;
  --muted: #a0a0a0;
  --bg: #1a1a1a;
  --bgcard: #242424;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== BODY ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  padding: 20px;
}

/* ===== CONTENEUR ===== */
#lbsdlv-app {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}

/* ===== TOOLBAR (AU-DESSUS) ===== */
.lbsdlv-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.toolbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bgcard);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toolbar-btn:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ===== QUOTA BADGE ===== */
.quota-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bgcard);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toolbar-btn svg {
  width: 22px;
  height: 22px;
}

/* ===== CARD PRINCIPALE ===== */
.lbsdlv-card {
  background: var(--bgcard);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: all 0.3s ease;
}

/* ===== EN-TÊTE ===== */
.lbsdlv-v2-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bgcard);
}

.lbsdlv-v2-header > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lbsdlv-v2-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: calc(100% - 60px);
}

/* Bouton voix (à côté du titre) */
.btn-voice-control {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-voice-control.active {
  display: flex;
}

.btn-voice-control:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn-voice-control.playing {
  background: var(--primary);
  color: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== SECTIONS ===== */
.lbsdlv-section {
  padding: 18px 20px;
  display: none;
  background: var(--bgcard);
}

.lbsdlv-section.active {
  display: block;
}

.lbsdlv-row {
  margin-bottom: 14px;
}

.lbsdlv-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

/* ===== ACCORDÉONS ÉMOTIONS ===== */
.emotion-family {
  margin-bottom: 12px;
}

.family-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.family-header:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.family-header.no-toggle:hover {
  background: var(--primary);
  color: #fff;
}

.family-emoji {
  font-size: 22px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.family-label {
  flex: 1;
}

.family-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  stroke: var(--ink);
}

.family-header.open .family-chevron {
  transform: rotate(180deg);
}

.family-content {
  display: none;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -8px;
}

.family-content.open {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: slideDown 0.3s ease;
}

.emotion-chip {
  padding: 8px 14px;
  background: var(--bgcard);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: var(--ink);
  user-select: none;
}

.emotion-chip:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.emotion-chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* ===== CHIPS ===== */
.lbsdlv-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.lbsdlv-chip {
  background: var(--bg);
  border: 2px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.lbsdlv-chip:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.lbsdlv-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}

.lbsdlv-chip-action {
  background: var(--bg);
  border: 2px dashed var(--border);
  color: var(--muted);
  font-style: italic;
}

.lbsdlv-chip-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bgcard);
  border-style: solid;
  font-style: normal;
}
/* ===== ACTIONS ===== */
.lbsdlv-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  justify-content: flex-end;
}

.lbsdlv-btn {
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 140px;
}

.lbsdlv-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.lbsdlv-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.lbsdlv-btn.secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border);
}

.lbsdlv-btn.secondary:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bgcard);
}

.lbsdlv-badge-limit {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* ===== CHAMPS ===== */
textarea.lbsdlv-text,
input.lbsdlv-text {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--bg);
  color: var(--ink);
  transition: all 0.2s ease;
}

textarea.lbsdlv-text {
  min-height: 120px;
  resize: vertical;
}

textarea.lbsdlv-text:focus,
input.lbsdlv-text:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.1);
}

/* ===== RÉSULTAT / ERREURS ===== */
.lbsdlv-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
}

.lbsdlv-error {
  color: #b00020;
  font-weight: 600;
}

.lbsdlv-note {
  color: var(--muted);
  font-size: 12px;
}

/* ===== INDICATEUR D'ÉTAPE ===== */
.step-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bgcard);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  box-shadow: var(--shadow);
  z-index: 999;
  transition: all 0.3s ease;
}

.step-indicator:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
  .step-indicator {
    width: 40px;
    height: 40px;
    font-size: 16px;
    bottom: 15px;
    right: 15px;
  }
}

/* ===== MODALE RÉGLAGES ===== */
.lbsdlv-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}

.lbsdlv-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bgcard);
  margin: 20px;
  padding: 0;
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bgcard);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--border);
  color: var(--ink);
}

.modal-body {
  padding: 20px;
  color: var(--ink);
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
  color: var(--ink);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  border-color: var(--primary);
  background: var(--bg);
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.radio-option label {
  cursor: pointer;
  flex: 1;
  margin: 0;
  color: var(--ink);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.checkbox-option:hover {
  border-color: var(--primary);
  background: var(--bg);
}

.checkbox-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-option label {
  cursor: pointer;
  flex: 1;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.sub-options {
  margin-left: 32px;
  margin-top: 12px;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sub-options.enabled {
  opacity: 1;
  pointer-events: auto;
}

.voice-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  margin-bottom: 12px;
}

.voice-select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-test-voice {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bgcard);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-test-voice:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ===== SPINNER ===== */
.lbsdlv-spinner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lbsdlv-spinner.active {
  display: flex;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== OPTIONS RAPPEL ===== */
.reminder-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.reminder-option {
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  color: var(--ink);
  text-align: center;
}

.reminder-option:hover {
  border-color: var(--primary);
  background: var(--bgcard);
  transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .lbsdlv-toolbar {
    margin-bottom: 8px;
  }

  .toolbar-btn {
    width: 40px;
    height: 40px;
  }

  .lbsdlv-v2-header h1 {
    font-size: 18px;
  }

  .family-header {
    padding: 12px;
    font-size: 0.9rem;
  }

  .family-emoji {
    font-size: 20px;
  }

  .emotion-chip,
  .lbsdlv-chip {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .lbsdlv-btn {
    flex: 1 0 100%;
  }

  .modal-content {
    margin: 10px;
  }
}

/* ===== MASQUER MENU WORDPRESS ===== */
.navbar,
#header,
.site-header,
.menu-toggle,
button[aria-controls="site-navigation"] {
  display: none !important;
}

/* ===== MASQUER RECAPTCHA ===== */
.grecaptcha-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}