/* ==========================================================================
   pages/aeo-report.css — Phase 4E in-app AEO progress report
   --------------------------------------------------------------------------
   BEM: .aeo-report-h1 / .aeo-report-sub
        .aeo-report-card / .aeo-report-card--{hero,muted,failed}
        .aeo-report-card__label / __row
        .aeo-report-hero / __from / __arrow / __to / __grade
        .aeo-report-delta / --up --down --flat
        .aeo-report-grid / .aeo-report-stat / __value / __label
        .aeo-report-action / __rank / __label / __pts
   ========================================================================== */

.aeo-report-h1 {
  font-family: var(--fh);
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
}

.aeo-report-sub {
  font-size: 13px;
  color: var(--text-m);
  margin-top: 2px;
}

.aeo-report-sub strong {
  color: var(--text);
  font-family: var(--fm);
  font-weight: 600;
}

.aeo-report-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.aeo-report-card--hero {
  border-left: 3px solid #7c3aed;
}

.aeo-report-card--muted {
  color: var(--text-d);
}

.aeo-report-card--failed {
  border-left: 3px solid var(--red);
}

.aeo-report-card__label {
  font-family: var(--fm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-d);
  margin-bottom: 10px;
}

.aeo-report-card__row {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* === Hero row — before → after =========================================*/

.aeo-report-hero {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
}

.aeo-report-hero__from {
  font-family: var(--fh);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-d);
  text-decoration: line-through;
}

.aeo-report-hero__arrow {
  font-size: 22px;
  color: var(--text-d);
}

.aeo-report-hero__to {
  font-family: var(--fh);
  font-size: 48px;
  font-weight: 800;
  color: #7c3aed;
  letter-spacing: -1px;
  line-height: 1;
}

.aeo-report-hero__grade {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
}

.aeo-report-delta {
  margin-left: auto;
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 700;
}

.aeo-report-delta--up   { color: var(--green); }
.aeo-report-delta--down { color: var(--red); }
.aeo-report-delta--flat { color: var(--text-d); }

/* === Stat grid ========================================================= */

.aeo-report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .aeo-report-grid { grid-template-columns: repeat(2, 1fr); }
}

.aeo-report-stat {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px 18px;
}

.aeo-report-stat__value {
  font-family: var(--fh);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.aeo-report-stat__label {
  font-family: var(--fm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-d);
  margin-top: 8px;
}

/* === Top actions list ================================================== */

.aeo-report-action {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}

.aeo-report-action:last-child { border-bottom: 0; }

.aeo-report-action__rank {
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 700;
  color: #7c3aed;
  text-align: center;
}

.aeo-report-action__label {
  color: var(--text);
}

.aeo-report-action__pts {
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

/* === Animated SVG line chart empty state (AEO Report: no client) ===
   Replaces the 📊 emoji. Lines draw in via stroke-dashoffset, dots
   pop in, the whole block fades up. Pure CSS — no JS, no inline CSS. */
@keyframes lineDrawIn {
  from { stroke-dashoffset: 600; opacity: 0.3; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes dotPopIn {
  0%   { r: 0; opacity: 0; }
  70%  { r: 3.5; opacity: 1; }
  100% { r: 2.5; opacity: 1; }
}

@keyframes chartFadeUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 3rem;
  animation: chartFadeUp 0.5s ease-out both;
}

.chart-svg-wrap {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.animated-line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 0.5;
  opacity: 0.6;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}

.chart-line-1 {
  stroke: #7C3AED;
  animation: lineDrawIn 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.chart-line-2 {
  stroke: #06B6D4;
  animation: lineDrawIn 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

.chart-dot {
  fill: #FFFFFF;
  stroke-width: 2;
}

.chart-dot-1 {
  stroke: #7C3AED;
  animation: dotPopIn 0.4s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.15s + 0.8s);
  r: 0;
}

.chart-dot-2 {
  stroke: #06B6D4;
  animation: dotPopIn 0.4s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.15s + 1.1s);
  r: 0;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.chart-legend-item {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.7;
}

.chart-legend-1 { color: #7C3AED; }
.chart-legend-2 { color: #06B6D4; }

.chart-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
