/* ============================================================
   CarVerdict — Premium Results Engine Styles
   Used by all tools via results-engine.js (CVR namespace)
   ============================================================ */

/* ---- Card wrapper ---- */
.cvr-card {
  animation: cvrReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cvrReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Verdict banner (hero header) ---- */
.cvr-banner {
  position: relative;
  border: 0.5px solid color-mix(in srgb, var(--cvr-c) 35%, transparent);
  background: color-mix(in srgb, var(--cvr-c) 7%, #0d0d0d);
  border-radius: 18px;
  padding: 1.4rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  overflow: hidden;
}
.cvr-banner-glow { position: absolute; inset: 0; pointer-events: none; }
.cvr-banner-icon {
  width: 54px; height: 54px; margin: 0 auto 0.6rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cvr-c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cvr-c) 30%, transparent);
  animation: cvrPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
@keyframes cvrPop { from { transform: scale(0); } to { transform: scale(1); } }
.cvr-banner-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(26px, 7vw, 38px);
  letter-spacing: 1.5px; line-height: 1; position: relative;
}
.cvr-banner-sub {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-top: 0.6rem; position: relative;
}

/* ---- Radial gauge ---- */
.cvr-gauge { position: relative; margin: 0 auto 0.5rem; aspect-ratio: 1; }
.cvr-gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  width: 100%;
}
.cvr-gauge-num {
  font-family: 'Bebas Neue', sans-serif; font-size: 34px; line-height: 1; letter-spacing: 1px;
}
.cvr-gauge-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); margin-top: 3px; font-weight: 700;
}
@keyframes cvrGauge { to { stroke-dashoffset: var(--cvr-target); } }

/* ---- Bar chart ---- */
.cvr-barchart {
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 10px; padding: 0.5rem 0 0; margin: 0.5rem 0;
}
.cvr-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cvr-bar-val {
  font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: #fff;
  margin-bottom: 6px; letter-spacing: 0.5px; white-space: nowrap;
}
.cvr-bar-track { width: 100%; max-width: 64px; display: flex; align-items: flex-end; }
.cvr-bar-fill {
  width: 100%; height: 0; border-radius: 8px 8px 4px 4px;
  animation: cvrBarGrow 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cvrBarGrow { to { height: var(--cvr-h); } }
.cvr-bar-label {
  font-size: 11px; color: var(--text-secondary); margin-top: 8px;
  text-align: center; line-height: 1.3;
}

/* ---- Range meter ---- */
.cvr-range { margin: 1rem 0; }
.cvr-range-track {
  position: relative; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #1a1a1a, #222);
  border: 0.5px solid var(--border); overflow: visible;
}
.cvr-range-fair {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(34,197,94,0.25), rgba(34,197,94,0.4));
  border-radius: 6px;
}
.cvr-range-marker {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid #0a0a0a;
  animation: cvrSlideIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cvrSlideIn { from { left: 0 !important; opacity: 0; } }
.cvr-range-tip {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: 'Bebas Neue', sans-serif; font-size: 14px; white-space: nowrap;
}
.cvr-range-axis {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
}

/* ---- Stat grid ---- */
.cvr-stat-grid { display: grid; gap: 8px; margin: 1rem 0; }
.cvr-stat {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 0.95rem 0.75rem; text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.cvr-stat:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.cvr-stat-label {
  font-size: 9.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 7px;
}
.cvr-stat-value {
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(20px, 5vw, 27px); letter-spacing: 0.5px; line-height: 1;
}
.cvr-stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 5px; }

/* ---- Segmented meter ---- */
.cvr-segmeter { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0.9rem 0 0.2rem; }
.cvr-seg { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cvr-seg-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #2a2a2a; transition: all 0.3s;
}
.cvr-seg-on .cvr-seg-dot { transform: scale(1.25); }
.cvr-seg-label { font-size: 11px; color: var(--text-muted); }
.cvr-seg-line { flex: 1; height: 1.5px; background: #222; min-width: 24px; margin-bottom: 18px; }

/* ---- Info panel ---- */
.cvr-panel {
  margin-top: 0.75rem; border-radius: 14px; padding: 1rem;
  background: color-mix(in srgb, var(--cvr-c) 6%, #0d0d0d);
  border: 0.5px solid color-mix(in srgb, var(--cvr-c) 22%, transparent);
}
.cvr-panel-head {
  display: flex; align-items: center; font-size: 12px; font-weight: 700;
  margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.cvr-panel-body { font-size: 13px; color: #cfcfcf; line-height: 1.65; }
.cvr-panel-body em { color: #fff; font-style: italic; }

/* ---- Tips ---- */
.cvr-tips { display: flex; flex-direction: column; gap: 8px; margin: 0.6rem 0; }
.cvr-tip {
  display: flex; align-items: flex-start; font-size: 13px; color: #d8d8d8;
  line-height: 1.55; background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 0.7rem 0.85rem;
}

/* ---- Section label ---- */
.cvr-section-label {
  display: flex; align-items: center; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.5px;
  margin: 1.1rem 0 0.5rem;
}

/* ---- Price duo (quoted vs fair) ---- */
.cvr-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 1rem 0; }
.cvr-duo-cell {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 1rem; text-align: center;
}
.cvr-duo-label {
  font-size: 9.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 7px;
}
.cvr-duo-val { font-family: 'Bebas Neue', sans-serif; font-size: clamp(22px, 6vw, 30px); letter-spacing: 1px; line-height: 1; }

/* ---- ACTION ROW: exactly two buttons, side by side ---- */
.cvr-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 1.1rem;
}
.cvr-btn {
  display: flex; align-items: center; justify-content: center;
  height: 50px; border-radius: 14px; font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s; border: none;
  -webkit-tap-highlight-color: transparent;
}
.cvr-btn:active { transform: scale(0.97); }
.cvr-btn-save {
  background: var(--surface2); color: #fff; border: 0.5px solid var(--border-hover);
}
.cvr-btn-save:hover { background: var(--surface3); }
.cvr-btn-save.cvr-saved {
  background: var(--green-bg); color: var(--green); border-color: var(--green-border);
}
.cvr-btn-share {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0a0a0a;
}
.cvr-btn-share:hover { opacity: 0.92; }
.cvr-newcheck {
  display: block; width: 100%; margin-top: 12px; padding: 11px;
  background: transparent; border: none; color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.2s;
}
.cvr-newcheck:hover { color: #fff; }

/* ---- Trial / pro badge inline in results ---- */
.cvr-pro-ribbon {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim);
  border: 0.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 0.75rem;
}

/* ---- Mobile tuning ---- */
@media (max-width: 420px) {
  .cvr-bar-val { font-size: 14px; }
  .cvr-btn { height: 48px; font-size: 14px; }
  .cvr-banner { padding: 1.15rem 1rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cvr-card, .cvr-banner-icon, .cvr-gauge-arc, .cvr-bar-fill, .cvr-range-marker {
    animation: none !important;
  }
  .cvr-gauge-arc { stroke-dashoffset: var(--cvr-target) !important; }
  .cvr-bar-fill { height: var(--cvr-h) !important; }
}

/* ============================================================
   Extended chart types (radar, versus, donut, score, trend)
   ============================================================ */

/* ---- Radar / spider ---- */
.cvr-radar { display: flex; flex-direction: column; align-items: center; margin: 0.75rem 0; }
.cvr-radar-poly {
  opacity: 0;
  animation: cvrRadarIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cvrRadarIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.cvr-radar-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: #ccc; }
.cvr-radar-legend span { display: flex; align-items: center; gap: 6px; }
.cvr-radar-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---- Head-to-head versus bars ---- */
.cvr-vs { margin: 0.75rem 0; }
.cvr-vs-head { display: flex; justify-content: space-between; font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 0.5px; margin-bottom: 0.75rem; }
.cvr-vs-row { margin-bottom: 0.7rem; }
.cvr-vs-cat { text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 5px; font-weight: 700; }
.cvr-vs-bars { display: flex; align-items: center; gap: 8px; }
.cvr-vs-side { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.cvr-vs-a { justify-content: flex-end; }
.cvr-vs-num { font-family: 'Bebas Neue', sans-serif; font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.cvr-vs-track { flex: 1; height: 9px; background: #1a1a1a; border-radius: 5px; overflow: hidden; }
.cvr-vs-fill { height: 100%; width: 0; border-radius: 5px; animation: cvrVsGrow 0.85s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes cvrVsGrow { to { width: var(--cvr-w); } }

/* ---- Donut ---- */
.cvr-donut-wrap { display: flex; flex-direction: column; align-items: center; margin: 0.75rem 0; }
.cvr-donut { position: relative; }
.cvr-donut-seg {
  opacity: 0;
  animation: cvrDonutGrow 0.6s ease forwards;
}
@keyframes cvrDonutGrow { to { opacity: 1; } }
.cvr-donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; width: 100%; }
.cvr-donut-big { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: #fff; letter-spacing: 0.5px; }
.cvr-donut-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-top: 2px; }
.cvr-donut-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; margin-top: 14px; font-size: 12px; color: #ccc; }
.cvr-donut-legend span { display: flex; align-items: center; gap: 6px; }
.cvr-donut-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---- Score meter ---- */
.cvr-score { margin: 1rem 0; }
.cvr-score-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cvr-score-num { font-family: 'Bebas Neue', sans-serif; font-size: 40px; line-height: 1; letter-spacing: 1px; }
.cvr-score-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.cvr-score-track { height: 12px; background: #1a1a1a; border-radius: 7px; overflow: hidden; border: 0.5px solid var(--border); }
.cvr-score-fill { height: 100%; width: 0; border-radius: 7px; animation: cvrScoreGrow 1s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes cvrScoreGrow { to { width: var(--cvr-w); } }

/* ---- Trend line ---- */
.cvr-trend { margin: 0.75rem 0; }
.cvr-trend-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: cvrTrendDraw 1.4s ease forwards; }
@keyframes cvrTrendDraw { to { stroke-dashoffset: 0; } }
.cvr-trend-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .cvr-radar-poly, .cvr-vs-fill, .cvr-donut-seg, .cvr-score-fill, .cvr-trend-line { animation: none !important; opacity: 1 !important; }
  .cvr-vs-fill { width: var(--cvr-w) !important; }
  .cvr-score-fill { width: var(--cvr-w) !important; }
  .cvr-trend-line { stroke-dashoffset: 0 !important; }
  .cvr-radar-poly { transform: scale(1) !important; }
}

/* ---- Roast lines (numbered savage cards) ---- */
.cvr-roast-lines { display: flex; flex-direction: column; gap: 9px; margin: 0.6rem 0; }
.cvr-roast-line {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 0.8rem 0.9rem; font-size: 14px; color: #e8e8e8; line-height: 1.5;
}
.cvr-roast-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(249,115,22,0.14); color: #f97316;
  font-family: 'Bebas Neue', sans-serif; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* ---- Factor cards (value tool) ---- */
.cvr-factors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0.5rem 0; }
.cvr-factor { background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; padding: 0.75rem 0.85rem; }
.cvr-factor-top { display: flex; align-items: center; margin-bottom: 5px; }
.cvr-factor-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.cvr-factor-val { font-size: 12px; line-height: 1.4; }
@media (max-width: 380px) { .cvr-factors { grid-template-columns: 1fr; } }
