/* Copyright (c) 2026 Brownie, LLC. All rights reserved. */

/*
 * An archer's progress (views/archer-progress.ts), its coaching details
 * (views/coaching-details.ts) and the charts every
 * analytics screen shares (app/team/charts.ts). Colors come from the
 * variables in styles.css, so dark mode follows by itself.
 */

/* ---------- Charts ---------- */

.chart-figure {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

/* Chart.js fills this box's width at its fixed height, at any screen size. */
.chart-box {
  position: relative;
  height: 260px;
  min-width: 0;
}

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

.chart-status:empty {
  display: none;
}

.chart-numbers > summary {
  width: fit-content;
  min-height: 32px;
  padding-block: 4px;
  list-style: none;
}

.chart-numbers > summary::-webkit-details-marker {
  display: none;
}

.chart-numbers[open] > summary {
  margin-bottom: 8px;
}

/* ---------- The archer's progress ---------- */

.progress-slot {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.progress-slot:empty,
.progress-controls[hidden] {
  display: none;
}

.progress-trend {
  font-weight: 600;
}

.progress-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0;
}

.progress-tile {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--control-radius);
  background: var(--color-surface);
}

/* Not in capitals, which would turn "10s" into "10S". */
.progress-tile dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.progress-tile dd {
  margin: 0;
}

.progress-tile-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.progress-tile-detail {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.progress-milestones {
  display: grid;
  gap: 8px;
}

.milestone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Milestone and 50 badges read as words, so they aren't in capitals. */
.badge.is-milestone,
.badge.is-personal-best,
.badge.is-fifty {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge.is-milestone {
  padding: 6px 10px;
}

.badge.is-fifty,
.badge.is-personal-best {
  background: var(--color-ten-soft);
  color: var(--color-text);
  border: 1px solid var(--color-ten);
}

/* ---------- Coaching details (views/coaching-details.ts) ---------- */

.progress-coaching {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.progress-coaching > h3,
.progress-coaching > p {
  margin: 0;
}

/* A line above, so the details read as their own part of the section. */
.progress-coaching > h3 {
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 1.3rem;
}

.coaching-part {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* In the headings' narrow font, like the h3 above, so they read as a step below it. */
.coaching-part > h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}

.coaching-part > p {
  margin: 0;
}

.coaching-hint {
  font-weight: 600;
}

/* Bar charts need less height than the score chart. */
.coaching-part .chart-box {
  height: 220px;
}
