/* ============================================
   CHART — Meilleur moment pour vendre
   Reprise OGAPUR
   Scoped under .sellchart — zero global pollution
   ============================================ */

.sellchart {
  /* Tokens — adjust to match your palette if needed */
  --sc-purple:        #50b71f;
  --sc-purple-light: rgba(80, 183, 31, 0.78);
  --sc-purple-soft:   #c4b5fd;
  --sc-mint:          #b8f5d8;
  --sc-mint-text:     #1e3a2f;
  --sc-text:          #1f2937;
  --sc-text-soft:     #6b7280;
  --sc-text-now:      #1f2937;
  --sc-bg:            #ffffff;

  /* Geometry */
  --sc-chart-h: 240px;       /* height of the curve area */
  --sc-pad-top: 28px;        /* room for "Maintenant" label above curve */
  --sc-pad-bottom: 64px;     /* room for price labels below curve */
  --sc-pad-x: 8px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  width: 100%;
  background: var(--sc-bg);
  color: var(--sc-text);
  box-sizing: border-box;
}
.sellchart *,
.sellchart *::before,
.sellchart *::after { box-sizing: border-box; }

/* ---------- Badge ---------- */
.sellchart__badge {
  display: inline-block;
  background: #3da5300f;
  border: 1px solid #3da53069;
  color: #1e533e;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  margin-bottom: 22px;
  letter-spacing: -0.005em;
}

/* ---------- Canvas ---------- */
.sellchart__canvas {
  position: relative;
  width: 100%;
  padding: var(--sc-pad-top) var(--sc-pad-x) var(--sc-pad-bottom);
}

.sellchart__nowlabel {
  position: absolute;
  top: 0;
  left: var(--sc-pad-x);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sc-text-now);
  z-index: 2;
}

/* ---------- SVG ---------- */
.sellchart__svg {
  display: block;
  width: 100%;
  height: var(--sc-chart-h);
  overflow: visible;
}

.sellchart__area {
  fill: url(#sellchartFill);
}

.sellchart__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sellchart__line--solid {
  stroke: var(--sc-purple);
  stroke-width: 3;
  filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.15));
}

.sellchart__line--dashed {
  stroke: var(--sc-purple-light);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  opacity: 0.85;
}

/* Vertical axis at "now" */
.sellchart__axis {
  stroke: var(--sc-purple);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.sellchart__dot {
  fill: var(--sc-purple);
  filter: drop-shadow(0 4px 10px rgba(124, 58, 237, 0.4));
}

/* Animations on draw */
.sellchart__area {
  opacity: 0;
  animation: scFadeIn 0.7s ease-out 0.5s forwards;
}
.sellchart__line--solid {
  stroke-dasharray: var(--sc-solid-len, 1000);
  stroke-dashoffset: var(--sc-solid-len, 1000);
  animation: scDraw 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.1s forwards;
}
.sellchart__line--dashed {
  opacity: 0;
  animation: scFadeIn 0.6s ease-out 0.85s forwards;
}
.sellchart__axis,
.sellchart__dot {
  opacity: 0;
  animation: scFadeIn 0.4s ease-out 0.05s forwards;
}

@keyframes scDraw    { to { stroke-dashoffset: 0; } }
@keyframes scFadeIn  { to { opacity: 0.85; } }
.sellchart__line--dashed { animation-fill-mode: forwards; }
.sellchart__area { animation-fill-mode: forwards; }

/* ---------- Labels ---------- */
.sellchart__labels {
  position: absolute;
  left: var(--sc-pad-x);
  right: var(--sc-pad-x);
  bottom: 8px;
  height: var(--sc-pad-bottom);
  pointer-events: none;
}

.sellchart__label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0;
  animation: scLabelIn 0.5s ease-out forwards;
}
.sellchart__label[data-key="now"] { animation-delay: 0.3s; }
.sellchart__label[data-key="m1"]  { animation-delay: 0.6s; }
.sellchart__label[data-key="m3"]  { animation-delay: 0.75s; }
.sellchart__label[data-key="m6"]  { animation-delay: 0.9s; }

@keyframes scLabelIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.sellchart__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-text);
  letter-spacing: -0.01em;
}

.sellchart__period {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--sc-text-soft);
}

/* "Now" label has a pill background */
.sellchart__label--now .sellchart__price {
  background: #f1fff0;
  color: var(--sc-purple);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .sellchart {
    --sc-chart-h: 200px;
    --sc-pad-bottom: 60px;
  }
  .sellchart__price { font-size: 14px; }
  .sellchart__period { font-size: 12.5px; }
  .sellchart__label--now .sellchart__price {
    font-size: 13px;
    padding: 4px 10px;
  }
  .sellchart__nowlabel { font-size: 12.5px; }
  .sellchart__badge { font-size: 13px; padding: 6px 12px; }
}

@media (max-width: 420px) {
  .sellchart {
    --sc-chart-h: 170px;
    --sc-pad-bottom: 56px;
  }
  .sellchart__price { font-size: 13px; }
  .sellchart__period { font-size: 11.5px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sellchart__line--solid,
  .sellchart__line--dashed,
  .sellchart__area,
  .sellchart__axis,
  .sellchart__dot,
  .sellchart__label {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
  .sellchart__line--dashed { opacity: 0.85 !important; }
}
