/* ============================================================================
 * vehicle-descriptifs-tab.css
 * Onglet "Descriptifs IA" — Style Apple premium, harmonisé DeepStack OS
 * Conventions : classes vd2-desc-* | vars CSS DeepStack uniquement
 * ============================================================================ */

/* ---------- KEYFRAMES ---------- */
@keyframes vd2DescSpin  { from { transform: rotate(0); }   to { transform: rotate(360deg); } }
@keyframes vd2DescPulse { 0%,100% { opacity: 1; }          50% { opacity: 0.4; } }
@keyframes vd2DescFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vd2DescBarFill { from { width: 0; } to { width: var(--bar-pct, 0%); } }

/* ========================================================================
   ÉTAT VIDE — Pas encore enrichi
   ======================================================================== */
.vd2-desc-empty {
  text-align: center;
  padding: 64px 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 680px;
  margin: 24px auto;
  animation: vd2DescFadeIn 300ms ease;
}
.vd2-desc-empty-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 12%, transparent);
}
.vd2-desc-empty-icon i { width: 32px; height: 32px; color: var(--primary); }
.vd2-desc-empty h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text, #0f172a);
  margin: 0 0 10px;
}
.vd2-desc-empty p {
  font-size: 14px; line-height: 1.6;
  color: var(--text-muted, #64748b);
  max-width: 480px; margin: 0 auto 28px;
}
.vd2-desc-empty-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.vd2-desc-empty-stats > div { text-align: center; }
.vd2-desc-empty-stats strong {
  display: block; font-size: 22px; font-weight: 800;
  color: var(--primary); letter-spacing: -0.02em;
}
.vd2-desc-empty-stats span {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.vd2-desc-generate-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: white; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 25%, transparent);
}
.vd2-desc-generate-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}
.vd2-desc-generate-btn i { width: 16px; height: 16px; }

/* ========================================================================
   HEADER STATUT — Carte fine horizontale
   ======================================================================== */
.vd2-desc-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 0 20px;
  height: auto; min-height: 60px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ebebef);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  animation: vd2DescFadeIn 300ms ease;
}
.vd2-desc-header-left {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.vd2-desc-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: var(--primary-hover, var(--primary));
  white-space: nowrap;
}
.vd2-desc-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  animation: vd2DescPulse 2.5s ease-in-out infinite;
}
.vd2-desc-meta-line {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.vd2-desc-meta-line span {
  display: inline-flex; align-items: center; gap: 4px;
}
.vd2-desc-meta-line i { width: 11px; height: 11px; }
.vd2-desc-manual {
  color: #d97706 !important;
  font-weight: 600;
}
.vd2-desc-header-right {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0;
}

/* Boutons header */
.vd2-desc-btn-secondary,
.vd2-desc-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  white-space: nowrap;
}
.vd2-desc-btn-secondary {
  background: transparent;
  border: 1px solid var(--border, #ebebef);
  color: var(--text, #0f172a);
}
.vd2-desc-btn-secondary:hover {
  background: var(--surface-2, #f8fafc);
  border-color: var(--border, #ebebef);
  transform: translateY(-1px);
}
.vd2-desc-btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 20%, transparent);
}
.vd2-desc-btn-primary:hover {
  background: #0f766e;
  transform: scale(1.02);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}
.vd2-desc-btn-secondary i,
.vd2-desc-btn-primary i { width: 13px; height: 13px; }

/* ========================================================================
   ZONE PREVIEW PASSERELLE
   ======================================================================== */
.vd2-desc-preview-zone {
  margin-bottom: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ebebef);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  animation: vd2DescFadeIn 300ms ease;
}
.vd2-desc-preview-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border, #ebebef);
  background: var(--surface-2, #f8fafc);
  padding: 0 16px;
}
.vd2-desc-preview-tab {
  padding: 11px 14px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #64748b);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: -1px;
}
.vd2-desc-preview-tab i { width: 12px; height: 12px; }
.vd2-desc-preview-tab:hover { color: var(--text, #0f172a); }
.vd2-desc-preview-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.vd2-desc-preview-body {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text, #0f172a);
}
.vd2-desc-preview-meta {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.vd2-desc-preview-section {
  padding: 12px 14px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  border-radius: 8px;
  margin-bottom: 8px;
}
.vd2-desc-preview-label {
  display: block;
  font-size: 10px; font-weight: 700;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.vd2-desc-preview-lbc {
  background: rgba(217, 119, 6, 0.04);
  border-color: rgba(217, 119, 6, 0.2);
}

/* ========================================================================
   BLOCS ÉDITABLES — layout principal
   ======================================================================== */
.vd2-desc-blocks {
  display: flex; flex-direction: column; gap: 12px;
}

.vd2-desc-block {
  padding: 20px 24px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ebebef);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  animation: vd2DescFadeIn 300ms ease;
}
.vd2-desc-block:hover {
  border-color: var(--border, #ebebef);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
}

/* --- Block head --- */
.vd2-desc-block-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  font-size: 14px; font-weight: 600;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}
.vd2-desc-block-head > i {
  width: 16px; height: 16px;
  color: var(--primary, #3b82f6);
  flex-shrink: 0;
}
.vd2-desc-info {
  margin-left: auto;
  font-size: 11px; font-weight: 400;
  color: var(--text-muted, #64748b);
}

/* --- Tags / chips dans le head --- */
.vd2-desc-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  padding: 2px 8px; border-radius: 999px;
}
.vd2-desc-tag-aapart {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--primary, #3b82f6);
}
.vd2-desc-tag-lbc {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
  color: var(--warning, #d97706);
}

/* ========================================================================
   BLOC HERO — Tagline publicitaire
   ======================================================================== */
.vd2-desc-hero-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}
.vd2-desc-hero-textarea {
  /* Hérite de .vd2-desc-textarea */
  font-size: 16px; font-weight: 500;
  font-style: italic;
  line-height: 1.5;
}

/* ========================================================================
   BLOC OPTIONS AJOUTÉES — Chips premium teal
   ======================================================================== */
.vd2-desc-options-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.vd2-desc-option-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  color: var(--primary-hover, var(--primary));
  transition: background 150ms ease;
  cursor: default;
}
.vd2-desc-option-pill:hover {
  background: color-mix(in srgb, var(--primary) 13%, transparent);
}
.vd2-desc-option-pill i { width: 11px; height: 11px; color: var(--primary); flex-shrink: 0; }
.vd2-desc-options-empty {
  font-size: 13px; font-style: italic;
  color: var(--text-muted, #64748b);
  padding: 8px 0;
}

/* ========================================================================
   TEXTAREAS & INPUTS — Apple-style invisible au repos
   ======================================================================== */
.vd2-desc-textarea,
.vd2-desc-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text, #0f172a);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.vd2-desc-textarea:hover,
.vd2-desc-input:hover {
  border-color: var(--border, #ebebef);
  background: var(--surface-2, #f8fafc);
}
.vd2-desc-textarea:focus,
.vd2-desc-input:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  background: var(--surface, #fff);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.vd2-desc-textarea::placeholder,
.vd2-desc-input::placeholder {
  color: var(--text-muted, #64748b);
  opacity: 0.6;
}

.vd2-desc-label {
  display: block;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.vd2-desc-field-pair {
  display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px;
  flex-wrap: wrap;
}
.vd2-desc-icon-input { font-size: 12px; font-family: monospace; }

/* Compteur caractères */
.vd2-desc-charcount {
  display: block; text-align: right;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  margin-top: 4px;
}

/* Badge modifié manuellement */
.vd2-desc-badge-manual {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  color: var(--primary-hover, var(--primary));
  margin-left: auto;
}
.vd2-desc-badge-manual i { width: 11px; height: 11px; }

/* ========================================================================
   BLOC AVIS / SCORE — Premium card
   ======================================================================== */
.vd2-desc-score-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .vd2-desc-score-card { grid-template-columns: 1fr; }
}

.vd2-desc-score-main {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  border-radius: 12px;
}
.vd2-desc-score-number {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
}
.vd2-desc-score-input {
  width: 100%; max-width: 120px;
  padding: 0;
  background: transparent; border: none;
  text-align: center;
  font-size: 56px; font-weight: 800;
  color: var(--primary);
  font-family: inherit;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.vd2-desc-score-input:focus { outline: none; }
.vd2-desc-score-denom {
  font-size: 18px; font-weight: 400;
  color: var(--text-muted, #64748b);
  align-self: flex-end; padding-bottom: 10px;
}
.vd2-desc-label-chip {
  display: inline-flex; align-items: center;
  margin: 10px auto 0;
  padding: 4px 14px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--primary-hover, var(--primary));
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.vd2-desc-label-input {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

/* --- Sous-scores avec barre de progression --- */
.vd2-desc-subscores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.vd2-desc-subscore {
  padding: 10px 12px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  border-radius: 8px;
}
.vd2-desc-subscore-label {
  display: block;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.vd2-desc-subscore-value {
  display: flex; align-items: baseline; gap: 2px;
  margin-bottom: 6px;
}
.vd2-desc-subscore-input {
  width: 52px; padding: 2px 0;
  background: transparent; border: none;
  font-size: 22px; font-weight: 700;
  color: var(--text, #0f172a);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.vd2-desc-subscore-input:focus { outline: none; }
.vd2-desc-subscore-denom {
  font-size: 11px; color: var(--text-muted, #64748b);
}
.vd2-desc-subscore-bar-track {
  height: 4px; border-radius: 2px;
  background: var(--border, #ebebef);
  overflow: hidden;
}
.vd2-desc-subscore-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--primary, #3b82f6);
  width: var(--bar-pct, 0%);
  animation: vd2DescBarFill 600ms ease forwards;
  transition: width 300ms ease;
}

/* ========================================================================
   LISTE ITEMS (points forts, pour_qui, pourquoi_choisir, FAQ, etc.)
   ======================================================================== */
.vd2-desc-listitem {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #ebebef);
  transition: background 150ms ease;
}
.vd2-desc-listitem:last-child { border-bottom: none; }
.vd2-desc-listitem:hover { background: var(--surface-2, #f8fafc); border-radius: 6px; }
.vd2-desc-listitem-title { font-weight: 600; font-size: 14px; }
.vd2-desc-listitem-desc { font-size: 13px; line-height: 1.6; color: var(--text-muted, #64748b); }

/* Points vigilance — accent warning */
.vd2-desc-vigilance-item {
  border-left: 3px solid var(--warning, #d97706);
  padding-left: 12px;
  margin-bottom: 2px;
}
.vd2-desc-vigilance-item .vd2-desc-listitem-title { color: var(--warning, #d97706); }

/* ========================================================================
   COÛTS D'USAGE
   ======================================================================== */
.vd2-desc-couts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.vd2-desc-cout {
  padding: 12px 14px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  border-radius: 8px;
}
.vd2-desc-cout-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.vd2-desc-cout-label i { width: 12px; height: 12px; color: var(--primary, #3b82f6); }

/* ========================================================================
   SEO PILLS
   ======================================================================== */
.vd2-desc-seo-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #ebebef);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text, #0f172a);
}

/* ========================================================================
   FAQ — Accordions natifs
   ======================================================================== */
.vd2-desc-faq-item {
  border-bottom: 1px solid var(--border, #ebebef);
}
.vd2-desc-faq-item:last-child { border-bottom: none; }

/* ========================================================================
   CHARGEMENT
   ======================================================================== */
.vd2-desc-loading {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted, #64748b);
  animation: vd2DescFadeIn 300ms ease;
}
.vd2-desc-loading i {
  width: 32px; height: 32px;
  color: var(--primary);
  animation: vd2DescSpin 1s linear infinite;
}
.vd2-desc-loading-text {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text, #0f172a);
  font-weight: 500;
}
.vd2-desc-loading-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

/* ========================================================================
   ERREUR
   ======================================================================== */
.vd2-desc-error {
  padding: 20px 24px;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 12px;
  color: var(--danger, #dc2626);
  font-size: 13px;
  line-height: 1.6;
}

/* ========================================================================
   DARK MODE
   ======================================================================== */

/* ========================================================================
   MOBILE
   ======================================================================== */
@media (max-width: 768px) {
  .vd2-desc-header { flex-direction: column; align-items: flex-start; padding: 14px 16px; height: auto; }
  .vd2-desc-header-right { width: 100%; justify-content: flex-end; padding: 0; }
  .vd2-desc-block { padding: 16px; }
  .vd2-desc-subscores-grid { grid-template-columns: repeat(2, 1fr); }
  .vd2-desc-couts-grid { grid-template-columns: repeat(2, 1fr); }
  .vd2-desc-preview-tabs { flex-wrap: wrap; }
  .vd2-desc-empty-stats { gap: 20px; }
}
@media (max-width: 480px) {
  .vd2-desc-subscores-grid { grid-template-columns: 1fr; }
  .vd2-desc-couts-grid { grid-template-columns: 1fr; }
}
