/* ============================================================
   WOW — chantier "WOW" : page track-record + signaux scanners
   Toutes les classes sont préfixées wr- (wow-record) pour éviter
   tout conflit avec wow.css et les autres chantiers.
   Réutilise les classes existantes (card, eyebrow, icon-chip,
   empty-state, btn, status-pill, reveal...) quand elles suffisent.
   ============================================================ */

/* ---------- Animations ---------- */
@keyframes wr-draw {
  from { stroke-dasharray: 0 var(--wr-c); }
}
@keyframes wr-grow {
  from { transform: scaleX(0); }
}
@keyframes wr-rise {
  from { transform: scaleY(0); }
}
@keyframes wr-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- Track record : badge "en direct" ---------- */
.wr-live {
  display: flex; align-items: center; gap: .55rem;
  color: var(--muted); font-size: .88rem; margin-top: .9rem;
}
.wr-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: wr-pulse 2.2s ease-in-out infinite; flex-shrink: 0;
}

/* ---------- Track record : tableau de bord (4 cartes stats) ---------- */
.wr-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: .9rem; margin: 1.75rem 0 .5rem;
}
@media (min-width: 900px) {
  .wr-stats { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}
.wr-stat {
  position: relative; overflow: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1rem;
  transition: transform .18s ease, border-color .18s ease;
}
.wr-stat:hover { transform: translateY(-2px); border-color: #2A3446; }
.wr-stat::before {
  content: ""; position: absolute; top: 0; left: 1rem; right: 1rem; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 208, 132, .55), transparent);
}
.wr-stat-label {
  display: block; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: .55rem;
}
.wr-stat-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.1rem); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.wr-stat-num.pos { color: var(--green); }
.wr-stat-num.neg { color: var(--red); }
.wr-stat-sub { color: var(--muted-dim); font-size: .8rem; margin-top: .4rem; }

/* Barre de progression (carte 1) */
.wr-bar {
  height: 6px; border-radius: 3px; background: var(--surface-3);
  margin-top: .85rem; overflow: hidden;
}
.wr-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #00965F, var(--green));
  transform-origin: left; animation: wr-grow 1s ease-out both;
}

/* Jauge circulaire (carte 2 — win rate) */
.wr-gauge { position: relative; width: 104px; height: 104px; margin: .35rem auto .15rem; }
.wr-gauge svg { width: 100%; height: 100%; display: block; }
.wr-gauge-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.wr-gauge-val {
  fill: none; stroke: var(--green); stroke-width: 9; stroke-linecap: round;
  transform: rotate(-90deg); transform-box: fill-box; transform-origin: center;
  stroke-dasharray: var(--wr-d) var(--wr-c);
  animation: wr-draw 1.3s cubic-bezier(.22, .8, .3, 1) both;
}
.wr-gauge-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.wr-gauge-num small { font-size: .78rem; color: var(--muted); margin-left: .15rem; font-weight: 600; }

/* Échelle profit factor (carte 3) */
.wr-scale {
  position: relative; height: 8px; border-radius: 4px;
  background: var(--surface-3); margin: .95rem .25rem 0;
}
.wr-scale-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px;
  background: linear-gradient(90deg, #00965F, var(--green));
  transform-origin: left; animation: wr-grow 1s ease-out both;
}
.wr-scale-fill.neg { background: linear-gradient(90deg, #B62A3F, var(--red)); }
.wr-scale-tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--muted-dim); border-radius: 1px;
}

/* Barre divergente (carte 4 — rendement moyen) */
.wr-diverge {
  position: relative; height: 8px; border-radius: 4px;
  background: var(--surface-3); margin: .95rem .25rem 0;
}
.wr-diverge-zero {
  position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px;
  transform: translateX(-50%); background: var(--muted-dim); border-radius: 1px;
}
.wr-diverge-fill {
  position: absolute; top: 0; bottom: 0; border-radius: 4px;
  animation: wr-grow .9s ease-out both;
}
.wr-diverge-fill.pos { background: linear-gradient(90deg, #00965F, var(--green)); transform-origin: left; }
.wr-diverge-fill.neg { background: linear-gradient(90deg, #B62A3F, var(--red)); transform-origin: right; }

/* ---------- Track record : distribution des rendements ---------- */
.wr-dist-card { margin: 1.5rem 0; }
.wr-h2 { font-size: 1.25rem; margin-bottom: .25rem; letter-spacing: -0.01em; }
.wr-dist { display: flex; gap: .6rem; margin-top: 1.4rem; }
.wr-dist-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
}
.wr-dist-n {
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  margin-bottom: .35rem; font-variant-numeric: tabular-nums;
}
.wr-dist-plot {
  height: 110px; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.wr-dist-bar {
  width: min(54px, 82%); border-radius: 6px 6px 3px 3px;
  transform-origin: bottom; animation: wr-rise .8s ease-out both;
}
.wr-dist-bar.pos { background: linear-gradient(180deg, var(--green), #00965F); }
.wr-dist-bar.neg { background: linear-gradient(180deg, var(--red), #B62A3F); }
.wr-dist-lab {
  margin-top: .5rem; font-size: .66rem; color: var(--muted);
  text-align: center; line-height: 1.35; font-variant-numeric: tabular-nums;
}

/* ---------- Track record : tableau des signaux ---------- */
.wr-table tbody tr:hover td { background: rgba(0, 208, 132, .055); }
.wr-table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--green); }
.wr-ticker {
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: .03em; font-size: .95rem;
}
.wr-pill { display: inline-flex; align-items: center; gap: .45rem; }
.wr-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.wr-ret { display: flex; align-items: center; gap: .65rem; }
.wr-ret-track {
  width: 76px; height: 6px; border-radius: 3px; flex-shrink: 0;
  background: var(--surface-3); overflow: hidden;
}
.wr-ret-fill { display: block; height: 100%; border-radius: 3px; }
.wr-ret-fill.pos { background: linear-gradient(90deg, #00965F, var(--green)); }
.wr-ret-fill.neg { background: linear-gradient(90deg, #B62A3F, var(--red)); }
.wr-ret-val { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Mobile : colonne ticker fixe pendant le scroll horizontal */
@media (max-width: 640px) {
  .wr-table th:nth-child(2),
  .wr-table td:nth-child(2) {
    position: sticky; left: 0; z-index: 3;
  }
  .wr-table th:nth-child(2) { background: var(--surface-2); z-index: 4; }
  .wr-table td:nth-child(2) { background: var(--surface); }
  .wr-table tbody tr:hover td:nth-child(2) { background: var(--surface); }
}

/* ---------- Track record : méthodologie premium ---------- */
.wr-meth-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.25rem;
}
@media (min-width: 720px) {
  .wr-meth-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .wr-meth-grid { grid-template-columns: repeat(3, 1fr); }
}
.wr-meth .icon-chip { margin-bottom: 0; }
.wr-meth h3 { font-size: 1rem; margin: .85rem 0 .4rem; }
.wr-meth p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.6; }

/* ---------- Scanners : cartes de signaux ---------- */
.wr-sig-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.25rem;
}
@media (min-width: 720px) {
  .wr-sig-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .wr-sig-grid { grid-template-columns: repeat(3, 1fr); }
}
.wr-sig-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.wr-sig-card:hover {
  transform: translateY(-3px); border-color: #2A3446; box-shadow: var(--shadow);
}
.wr-sig-card::before {
  content: ""; position: absolute; top: 0; left: 1.25rem; right: 1.25rem; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 208, 132, .55), transparent);
}
.wr-sig-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
}
.wr-ticker-big {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.45rem; letter-spacing: .02em;
}
.wr-sig-date { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* Mini-visuel de la zone de prix : stop / entrée / cible */
.wr-zone { position: relative; height: 78px; margin: 1.1rem 0 .2rem; }
.wr-zone-track {
  position: absolute; left: 0; right: 0; top: 46px; height: 8px;
  transform: translateY(-50%); border-radius: 4px; background: var(--surface-3);
}
.wr-zone-risk {
  position: absolute; top: 46px; transform: translateY(-50%); height: 8px;
  border-radius: 4px 0 0 4px; background: rgba(246, 70, 93, .30);
}
.wr-zone-reward {
  position: absolute; top: 46px; transform: translateY(-50%); height: 8px;
  border-radius: 0 4px 4px 0; background: rgba(0, 208, 132, .28);
}
.wr-zone-mark {
  position: absolute; top: 46px; width: 2px; height: 20px;
  transform: translate(-50%, -50%); border-radius: 1px;
}
.wr-zone-mark.stop { background: var(--red); box-shadow: 0 0 8px rgba(246, 70, 93, .6); }
.wr-zone-mark.target { background: var(--green); box-shadow: 0 0 8px rgba(0, 208, 132, .6); }
.wr-zone-mark.entry {
  background: var(--blue); box-shadow: 0 0 10px rgba(41, 98, 255, .8);
  width: 3px; height: 26px;
}
.wr-zone-lab {
  position: absolute; top: 0; font-size: .66rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted); line-height: 1.35;
}
.wr-zone-lab b {
  display: block; color: var(--text); font-size: .82rem; font-weight: 700;
  letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums;
}
.wr-zone-lab.wr-lab-c { transform: translateX(-50%); text-align: center; }
.wr-zone-lab.wr-lab-l { text-align: left; }
.wr-zone-lab.wr-lab-r { transform: translateX(-100%); text-align: right; }
.wr-zone-lab.wr-lab-end { text-align: right; }

/* Niveaux entrée / cible / stop */
.wr-levels {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .55rem; margin: 1rem 0;
}
.wr-levels > div {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: .6rem .7rem; margin: 0;
}
.wr-levels dt {
  font-size: .64rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem;
}
.wr-levels dd {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; font-variant-numeric: tabular-nums;
}
.wr-levels dd.pos { color: var(--green); }
.wr-levels dd.neg { color: var(--red); }
.wr-levels-1 { grid-template-columns: 1fr; }
.wr-sig-note { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; }
.wr-sig-card .btn { margin-top: auto; width: 100%; }

/* ---------- Accessibilité : animations désactivées si réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .wr-pulse { animation: none; }
  .wr-gauge-val { animation: none; }
  .wr-bar i, .wr-scale-fill, .wr-diverge-fill { animation: none; }
  .wr-dist-bar { animation: none; }
  .wr-stat, .wr-sig-card { transition: none; }
  .wr-stat:hover, .wr-sig-card:hover { transform: none; }
}
