/* ============================================================
   SEOGrow — Graphiques réutilisables (evolutionChart, components/charts.js)
   ============================================================
   Partagé par le suivi de test (Insights) et le Dashboard (trafic réseau).
   Déplacé depuis pipelines.css en 0.34.0. */

/* Graphique d'évolution : 4 séries (clics en barres, impressions/CTR/position en courbes). */
/* Palette par série. */
:root, .evo-chart {
  --evo-clicks: var(--accent, #3b82f6);
  --evo-impr:   #f59e0b;
  --evo-ctr:    #8b5cf6;
  --evo-pos:    var(--success, #16a34a);
}
.evo-chart { width: 100%; height: auto; display: block; margin-top: var(--space-2); }

/* Barres (clics). */
.evo-bar { fill: var(--evo-clicks); opacity: .35; transition: opacity .12s; }
.evo-bar--clicks { fill: var(--evo-clicks); }

/* Courbes par série. */
.evo-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evo-line--impr { stroke: var(--evo-impr); }
.evo-line--ctr  { stroke: var(--evo-ctr); }
.evo-line--pos  { stroke: var(--evo-pos); }
.evo-line--clicks { stroke: var(--evo-clicks); }
.evo-dot { fill: var(--evo-pos); }
.evo-dot--impr { fill: var(--evo-impr); }
.evo-dot--ctr  { fill: var(--evo-ctr); }
.evo-dot--pos  { fill: var(--evo-pos); }

.evo-grid { stroke: var(--border, #e5e7eb); stroke-width: 1; }
.evo-j0 { stroke: var(--text-tertiary, #9ca3af); stroke-width: 1; stroke-dasharray: 3 3; }
.evo-j0-label { fill: var(--text-tertiary, #9ca3af); font-size: 10px; font-weight: 600; }
.evo-axis { fill: var(--text-tertiary, #9ca3af); font-size: 10px; }

/* Marqueurs d'étape (date d'application) : ligne verticale + libellé. */
.evo-marker { stroke: var(--color-brand-primary, #6366f1); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.75; }
.evo-marker-label { fill: var(--color-brand-primary, #6366f1); font-size: 9px; font-weight: 600; }

/* Légende cliquable (toggle de séries). */
.evo-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2); font-size: 12px; color: var(--text-secondary, #6b7280); }
.evo-legend__item {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; border-radius: var(--radius-md, 6px);
  padding: 3px 8px; cursor: pointer; color: inherit; font: inherit;
  transition: background .12s, opacity .12s;
}
.evo-legend__item:hover { background: var(--surface-secondary, rgba(0,0,0,.04)); }
.evo-legend__item.is-off { opacity: .4; }
.evo-legend__item.is-off .evo-swatch { background: var(--text-tertiary, #9ca3af) !important; }
.evo-legend__hint { font-size: 11px; }
.evo-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.evo-swatch--clicks { background: var(--evo-clicks); opacity: .55; }
.evo-swatch--impr { background: var(--evo-impr); }
.evo-swatch--ctr  { background: var(--evo-ctr); }
.evo-swatch--pos  { background: var(--evo-pos); }

/* Survol interactif : bandes + ligne-guide + tooltip. */
.evo-wrap { position: relative; }
.evo-hit { fill: transparent; cursor: crosshair; }
.evo-hit:hover { fill: var(--accent, #3b82f6); fill-opacity: .06; }
.evo-cursor { stroke: var(--text-tertiary, #9ca3af); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.evo-bar { transition: opacity .12s; }
.evo-tip {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 150px; padding: 8px 10px;
  background: var(--surface-1, #fff); color: var(--text-primary, #111827);
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.12));
  font-size: 12px; line-height: 1.5;
}
.evo-tip[hidden] { display: none; }
.evo-tip__date { font-weight: 700; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border, #e5e7eb); }
.evo-tip__row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-secondary, #6b7280); }
.evo-tip__row b { color: var(--text-primary, #111827); font-variant-numeric: tabular-nums; }
