/* Snapshot tool — dark-theme override for the existing analyze/results UI.
   Owns ONLY the DOM that /js/snapshot.js renders into (analyzing overlay,
   scorecard, phase selector, summary cards, CTA, error). Hero + upload zone
   itself live in revamp/site.css. */

/* ───────── INSTRUCTIONS COLLAPSIBLE (above the upload) ───────── */
.snapshot-instructions {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.snapshot-instructions summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
}
.snapshot-instructions summary::-webkit-details-marker { display: none; }
.snapshot-instructions summary::before {
  content: '›';
  display: inline-block;
  width: 14px;
  color: var(--accent);
  font-weight: 700;
  transition: transform .2s;
}
.snapshot-instructions[open] summary::before { transform: rotate(90deg); }
.snapshot-instructions-body {
  padding: 0 18px 18px;
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.snapshot-instructions-body p { margin: 0 0 8px; }
.snapshot-instructions-body strong { color: #fff; }
.snapshot-instructions-body ul { margin: 6px 0 10px 20px; }
.snapshot-instructions-body li { margin-bottom: 4px; }
.snapshot-instructions-note {
  font-style: italic;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ───────── ANALYZING OVERLAY ───────── */
.analyzing-overlay {
  display: none;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}
.analyzing-overlay.active { display: block; }
.analyzing-spinner {
  width: 48px; height: 48px;
  margin: 0 auto 22px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 4px;
}
.analyzing-sub {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 0 24px;
}
.analyzing-steps {
  text-align: left;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.analyzing-step {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color .25s;
}
.analyzing-step.active { color: #fff; }
.analyzing-step.done { color: var(--green); }
.analyzing-step-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ───────── RESULTS WRAPPER ───────── */
.snapshot-results { margin-top: 32px; }

/* Phase selector */
.phase-selector-wrap {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.phase-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 12px;
}
.phase-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.phase-selector.pulse { animation: phasePulse 1.2s ease-in-out 3; border-radius: 8px; }
@keyframes phasePulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 6px var(--accent-wash); }
}
.phase-btn {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--ink-muted);
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.phase-btn:hover {
  border-color: var(--accent-line);
  color: #fff;
  background: var(--accent-wash);
}
.phase-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(216,90,48,0.28);
}
.phase-hint {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 8px 0 0;
}

.phase-info-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.phase-info-details summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.phase-info-details summary::-webkit-details-marker { display: none; }
.phase-info-details summary::before {
  content: '›';
  display: inline-block;
  width: 12px;
  margin-right: 4px;
  transition: transform .2s;
}
.phase-info-details[open] summary::before { transform: rotate(90deg); }
.phase-info-body {
  padding-top: 12px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}
.phase-info-disclaimer { color: rgba(255,255,255,0.72); }
.phase-info-disclaimer strong { color: #fff; }
.phase-info-title {
  margin: 14px 0 8px;
  font-weight: 600;
  color: #fff;
}
.phase-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: rgba(255,255,255,0.72);
}
.phase-info-list li {
  padding: 8px 12px;
  border-left: 2px solid transparent;
  margin-bottom: 4px;
  font-size: 13.5px;
  line-height: 1.55;
}
.phase-info-list li strong { color: #fff; }
.phase-info-list li.active-phase {
  background: var(--accent-wash);
  border-left-color: var(--accent);
  border-radius: 0 6px 6px 0;
}
.phase-info-ask {
  margin: 14px 0 0;
  color: var(--accent);
  font-style: italic;
}

/* Brand-name input on results panel */
.snapshot-input-group {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.snapshot-input-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.snapshot-text-input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14.5px;
  color: #fff;
}
.snapshot-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.snapshot-text-input::placeholder { color: var(--ink-faint); }
.snapshot-input-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 6px 0 0;
}

/* "See a sample snapshot" banner — makes it unmistakable this is illustrative,
   not the user's data. The sample shows the REAL snapshot UI (no bait-and-switch
   to the bigger audit). */
.snapshot-sample-banner {
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.snapshot-sample-banner strong { color: var(--accent); }

/* Snapshot → full-audit bridge (so the snapshot never dead-ends). */
.snapshot-audit-bridge {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  text-align: center;
}
.snapshot-audit-bridge > span {
  font-size: 14px;
  color: var(--ink-muted);
}
.snapshot-audit-bridge .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.snapshot-audit-bridge-sample {
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.snapshot-audit-bridge-sample:hover { color: #fff; }

/* Factual wasted-spend callout — the dollar number anchored on the user's own
   data. Hero treatment, but the copy is a measurement, not a promise. */
.waste-callout {
  background:
    radial-gradient(ellipse 620px 200px at 30% 0%, rgba(239,68,68,0.12), transparent 70%),
    var(--bg-2);
  border: 1px solid rgba(239,68,68,0.28);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.waste-callout-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.waste-callout-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: #fff;
}
.waste-callout-unit {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(15px, 1.6vw, 18px);
  letter-spacing: 0;
  color: var(--ink-muted);
}
.waste-callout-sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: 12px;
  max-width: 680px;
}
.waste-callout-sub strong { color: #fff; }
.waste-callout-method {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.waste-callout-method summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent);
}
.waste-callout-method summary::-webkit-details-marker { display: none; }
.waste-callout-method summary::before {
  content: '›'; display: inline-block; width: 12px; margin-right: 4px;
  transition: transform .2s;
}
.waste-callout-method[open] summary::before { transform: rotate(90deg); }
.waste-callout-method p {
  margin: 10px 0 0;
  font-size: 13px; line-height: 1.6;
  color: var(--ink-dim);
}
.waste-callout-method strong { color: var(--ink-muted); }
.waste-callout-scale {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.55;
  color: var(--ink-dim);
}
.waste-callout-scale strong { color: var(--accent); }

/* Summary cards row (Healthy / Needs Attention / ACOS) */
.snapshot-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.summary-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.summary-card .s-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
}
.summary-card .s-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 8px;
}
.summary-card.healthy { border-color: rgba(34,197,94,0.3); }
.summary-card.healthy .s-number { color: var(--green); }
.summary-card.investigate { border-color: rgba(239,68,68,0.3); }
.summary-card.investigate .s-number { color: var(--red); }

/* Scorecard table */
.snapshot-table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.snapshot-table th {
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.snapshot-table td {
  padding: 14px 18px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.snapshot-table td:first-child {
  color: #fff;
}
.snapshot-table td strong {
  color: #fff;
  font-weight: 600;
}
.snapshot-table tr:last-child td { border-bottom: none; }
.snapshot-table tr:hover td { background: rgba(255,255,255,0.02); }
.benchmark-header { color: var(--accent); }

/* Status badges (re-skin for dark) */
.snapshot-table .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.snapshot-table .status-badge.healthy {
  background: var(--green-wash);
  color: var(--green);
}
.snapshot-table .status-badge.investigate {
  background: rgba(239,68,68,0.14);
  color: var(--red);
}

/* ASIN detail collapsible inside table */
.asin-detail {
  margin-top: 6px;
  font-size: 12.5px;
}
.asin-detail-toggle {
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.asin-detail-toggle::-webkit-details-marker { display: none; }
.asin-detail-toggle::before {
  content: '›';
  display: inline-block;
  width: 10px;
  margin-right: 2px;
  transition: transform .2s;
}
.asin-detail[open] .asin-detail-toggle::before { transform: rotate(90deg); }
.asin-detail-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.asin-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}
.asin-rank {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}
.asin-id { color: #fff; }
.asin-val { margin-left: auto; color: var(--ink-dim); }

.branded-edit-btn {
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--accent-line);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.branded-edit-btn:hover {
  background: var(--accent-wash);
  border-color: var(--accent);
}

/* Post-result CTA card */
.snapshot-cta {
  margin-top: 24px;
  padding: 36px 32px;
  text-align: center;
  background:
    radial-gradient(ellipse 600px 240px at center top, rgba(216,90,48,0.18), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.snapshot-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.snapshot-cta p {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 8px;
}
.snapshot-cta .cta-sub {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-muted);
  margin: 0 auto 22px;
  max-width: 560px;
  line-height: 1.55;
  letter-spacing: 0;
}
.snapshot-cta .btn-primary {
  display: inline-flex;
}

/* Error card */
.snapshot-error {
  display: none;
  margin-top: 20px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.snapshot-error p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* Mobile */
@media (max-width: 720px) {
  .snapshot-summary { grid-template-columns: 1fr; }
  .snapshot-cta { padding: 28px 20px; }
  .snapshot-cta p { font-size: 18px; }
  .phase-selector-wrap { padding: 18px; }
}
