/*
 * Version 3 -- Athlete 360 workspace.
 *
 * Continues the existing shell token system and reuses the Force Measurement
 * metric-card anatomy for the snapshot strip. Only Athlete 360's own layout
 * lives here; no component is redeclared under a second name.
 *
 * Status is never communicated by colour alone -- every system card states its
 * condition in a sentence, and the tone modifier only tints a border beside it.
 */

.v3-a360 {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-5);
}

/* ---- identity header ---------------------------------------------------- */

.v3-a360-header {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  padding-bottom: var(--v3-space-4);
  border-bottom: 1px solid var(--v3-border);
}

.v3-a360-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v3-text-muted);
}

.v3-a360-name {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--v3-maroon);
}

.v3-a360-identity {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v3-space-4);
  margin: 0;
}

.v3-a360-identity > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v3-a360-identity dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v3-text-muted);
}

.v3-a360-identity dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--v3-text);
}

.v3-a360-back {
  align-self: flex-start;
}

/* ---- sections ----------------------------------------------------------- */

.v3-a360-section {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-3);
}

.v3-a360-section-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-a360-empty {
  margin: 0;
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px dashed var(--v3-border-strong);
  background: var(--v3-surface-muted);
  color: var(--v3-text-muted);
}

/* ---- coverage ----------------------------------------------------------- */

.v3-a360-coverage,
.v3-a360-facts {
  display: grid;
  gap: var(--v3-space-2);
  margin: 0;
}

.v3-a360-coverage {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  background: var(--v3-surface);
}

.v3-a360-coverage > div,
.v3-a360-facts > div {
  display: flex;
  justify-content: space-between;
  gap: var(--v3-space-3);
  font-size: 0.82rem;
}

.v3-a360-coverage dt,
.v3-a360-facts dt {
  margin: 0;
  color: var(--v3-text-muted);
}

.v3-a360-coverage dd,
.v3-a360-facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--v3-text);
  text-align: right;
}

/* ---- snapshot ----------------------------------------------------------- */

.v3-a360-snapshot {
  margin: 0;
}

/* ---- system cards ------------------------------------------------------- */

.v3-a360-systems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--v3-space-3);
}

.v3-a360-system {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  border-top: 3px solid var(--v3-border-strong);
  background: var(--v3-surface);
}

.v3-a360-system--ready {
  border-top-color: var(--v3-maroon);
}

.v3-a360-system--empty {
  background: var(--v3-surface-muted);
}

.v3-a360-system-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-a360-system-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--v3-text-muted);
}

.v3-a360-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-1);
  margin: 0;
  padding: var(--v3-space-2) 0 0;
  list-style: none;
  border-top: 1px solid var(--v3-border);
}

.v3-a360-metrics li {
  display: flex;
  justify-content: space-between;
  gap: var(--v3-space-3);
  font-size: 0.85rem;
}

.v3-a360-metric-label {
  color: var(--v3-text-muted);
}

.v3-a360-metric-value {
  font-weight: 700;
  color: var(--v3-maroon);
}

.v3-a360-system-link {
  align-self: flex-start;
  margin-top: auto;
}

/* ---- trends ------------------------------------------------------------- */

.v3-a360-trends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--v3-space-3);
}

.v3-a360-trend {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  background: var(--v3-surface);
  min-width: 0;
}

.v3-a360-trend-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-a360-trend-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--v3-text-muted);
}

/* The established horizontal-scroll behaviour, so a long history never makes
   the page itself scroll sideways. */
.v3-a360-trend-scroll {
  overflow-x: auto;
  max-height: 240px;
  overflow-y: auto;
}

.v3-a360-trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.v3-a360-trend-table th,
.v3-a360-trend-table td {
  padding: var(--v3-space-1) var(--v3-space-2);
  text-align: left;
  border-bottom: 1px solid var(--v3-border);
}

.v3-a360-trend-table thead th {
  position: sticky;
  top: 0;
  background: var(--v3-surface);
  color: var(--v3-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v3-a360-trend-table tbody th {
  font-weight: 500;
  color: var(--v3-text-muted);
}

.v3-a360-trend-table tbody td {
  font-weight: 600;
  color: var(--v3-text);
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 720px) {
  .v3-a360-systems,
  .v3-a360-trends {
    grid-template-columns: 1fr;
  }

  .v3-a360-coverage > div,
  .v3-a360-facts > div {
    flex-direction: column;
    gap: var(--v3-space-1);
  }

  .v3-a360-coverage dd,
  .v3-a360-facts dd {
    text-align: left;
  }
}

/* ---- coach-facing intelligence ------------------------------------------ */

/*
 * Rendered at the same visual weight as the sections above it. The intelligence
 * assists the coach; it is not the point of the page, and it must not out-shout
 * the athlete's own performance data.
 *
 * Every status here is stated in words beside any colour, so nothing depends on
 * a dot or a tint being seen.
 */

.v3-a360-group {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  margin-bottom: var(--v3-space-4);
}

.v3-a360-group-heading {
  display: flex;
  align-items: center;
  gap: var(--v3-space-2);
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--v3-text);
}

.v3-a360-group-count {
  padding: 1px var(--v3-space-2);
  border-radius: var(--v3-radius-sm);
  border: 1px solid var(--v3-border-strong);
  background: var(--v3-surface-muted);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--v3-text-muted);
}

.v3-a360-group-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--v3-text-muted);
}

.v3-a360-findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--v3-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.v3-a360-finding {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-2);
  padding: var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px solid var(--v3-border);
  background: var(--v3-surface);
  min-width: 0;
}

.v3-a360-finding-system {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v3-text-muted);
}

.v3-a360-finding-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--v3-text);
  overflow-wrap: anywhere;
}

.v3-a360-finding-outcome,
.v3-a360-finding-window,
.v3-a360-finding-reason,
.v3-a360-finding-value {
  margin: 0;
  font-size: 0.82rem;
  color: var(--v3-text-muted);
}

.v3-a360-finding-value strong {
  color: var(--v3-maroon);
}

.v3-a360-finding-note {
  font-size: 0.75rem;
}

.v3-a360-finding-confidence {
  display: flex;
  align-items: center;
  gap: var(--v3-space-2);
  margin: 0;
  font-size: 0.8rem;
  color: var(--v3-text-muted);
}

/* Decorative only: the level is always spelled out in the same sentence. */
.v3-a360-confidence-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v3-border-strong);
}

.v3-a360-confidence-dot--high {
  background: var(--v3-maroon);
}

.v3-a360-confidence-dot--moderate {
  background: var(--v3-maroon-light);
}

.v3-a360-confidence-dot--low {
  background: var(--v3-border-strong);
}

.v3-a360-finding-confidence--none {
  font-style: italic;
}

.v3-a360-basis {
  border-top: 1px solid var(--v3-border);
  padding-top: var(--v3-space-2);
}

.v3-a360-basis > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--v3-maroon);
}

.v3-a360-basis > summary:focus-visible {
  outline: 2px solid var(--v3-focus-ring);
  outline-offset: 2px;
}

.v3-a360-basis-list {
  display: grid;
  gap: var(--v3-space-1);
  margin: var(--v3-space-2) 0 0;
}

.v3-a360-basis-list > div {
  display: flex;
  justify-content: space-between;
  gap: var(--v3-space-3);
  font-size: 0.8rem;
}

.v3-a360-basis-list dt {
  margin: 0;
  color: var(--v3-text-muted);
}

.v3-a360-basis-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--v3-text);
  text-align: right;
  overflow-wrap: anywhere;
}

.v3-a360-finding-link {
  align-self: flex-start;
  margin-top: auto;
}

.v3-a360-unavailable {
  display: flex;
  flex-direction: column;
  gap: var(--v3-space-1);
  margin: 0;
  padding: var(--v3-space-3) var(--v3-space-4);
  border-radius: var(--v3-radius-md);
  border: 1px dashed var(--v3-border-strong);
  background: var(--v3-surface-muted);
  list-style: none;
  font-size: 0.8rem;
  color: var(--v3-text-muted);
}

@media (max-width: 720px) {
  .v3-a360-findings {
    grid-template-columns: 1fr;
  }

  .v3-a360-basis-list > div {
    flex-direction: column;
    gap: 2px;
  }

  .v3-a360-basis-list dd {
    text-align: left;
  }
}
