//
// COACH — dark
// ============
//

.coach-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.coach-summary-mascot { flex: 0 0 auto; }

.coach-mascot {
  width: 96px;
  height: auto;
  display: block;
}

.coach-summary-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.coach-score-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: $radius--md;
  border: 1px solid $color--border;
  background: $color--surface-card;
  text-decoration: none;
  transition: box-shadow $motion--med, transform $motion--med;

  &.ok { background: $color--ok-bg; border-color: $color--ok-border; color: $color--ok; }
  &.warning { background: $color--warning-bg; border-color: $color--warning-border; color: $color--warning; }
  &.error { background: $color--error-bg; border-color: $color--error-border; color: $color--error; }
  &.info { background: $color--info-bg; border-color: $color--info-border; color: $color--info; }

  &[href]:hover {
    box-shadow: $shadow--md;
    transform: translateY(-1px);
  }
}

.coach-score-label {
  font-size: 0.85rem;
  font-weight: $font--weight--medium;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.coach-score-value {
  font-size: 2rem;
  font-weight: $font--weight--semibold;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}

@media (max-width: 720px) {
  .coach-summary {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .coach-summary-mascot { margin: 0 auto; }
  .coach-mascot { width: 72px; }
}

.coach-section {
  margin-bottom: 28px;
}

.coach-section-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.coach-section-title {
  margin: 0;
}

.coach-section-severity {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.coach-severity {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: $radius--pill;
  font-size: 0.72rem;
  font-weight: $font--weight--semibold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;

  &--error {
    color: $color--error;
    background: $color--error-bg;
    border-color: $color--error-border;
  }
  &--warn {
    color: $color--warning;
    background: $color--warning-bg;
    border-color: $color--warning-border;
  }
  &--info {
    color: $color--info;
    background: $color--info-bg;
    border-color: $color--info-border;
  }
}

.coach-advice-score {
  color: $color--text-muted;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.coach-section-clear {
  color: $color--ok;
  font-weight: $font--weight--medium;
  margin: 0;
  padding: 14px 16px;
  background: $color--ok-bg;
  border: 1px solid $color--ok-border;
  border-radius: $radius--md;
}

.coach-advices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coach-advice {
  background: $color--surface-card;
  border: 1px solid $color--border;
  border-radius: $radius--md;
  overflow: hidden;
  transition: box-shadow $motion--med;
  &[open] { box-shadow: $shadow--sm; }
}

.coach-advice-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: background-color $motion--fast;

  &::-webkit-details-marker { display: none; }
  &::marker { display: none; }

  &::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid $color--text-muted;
    border-bottom: 2px solid $color--text-muted;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform $motion--fast;
    flex: 0 0 auto;
  }

  &:hover {
    background: rgba(255, 255, 255, 0.04);
  }
}

.coach-advice[open] > .coach-advice-summary::after {
  transform: rotate(225deg);
}

.coach-advice-title {
  font-weight: $font--weight--semibold;
  color: $color--text;
  flex: 1 1 auto;
  min-width: 0;
}

.coach-advice-rule {
  font-size: 0.78rem;
  color: $color--text-muted;
  font-family: $font--mono;
  background: transparent;
  border: 0;
  padding: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.coach-advice-body {
  padding: 0 16px 16px 16px;
  border-top: 1px solid $color--border;
  margin-top: 0;
}

.coach-advice-text {
  margin: 14px 0 8px 0;
  color: $color--text;
}

.coach-advice-desc {
  margin: 0 0 12px 0;
  color: $color--text-secondary;
  font-style: italic;
  font-size: 0.95rem;
}

.coach-offenders-title {
  font-size: 0.85rem;
  font-weight: $font--weight--semibold;
  color: $color--text-secondary;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 0 8px 0;
}

.coach-offenders-table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.coach-offenders-list {
  margin: 0 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
  li {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
  }
}

.tech-list {
  list-style: none;
  margin: 0;
  padding: 8px 14px 14px 14px;
  border-top: 1px solid $color--border;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.listing-card > .tech-list {
  border-top: 0;
  padding: 0;
}

.tech-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid $color--border;
  border-radius: $radius--md;
  background: $color--surface-card;
}

.tech-card-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.tech-name {
  font-weight: $font--weight--semibold;
  color: $color--text;
  text-decoration: none;
  border-bottom: 1px dotted $color--border;
}

.tech-name:hover {
  border-bottom-color: $color--text-muted;
}

.tech-version {
  font-family: $font--mono;
  font-size: 0.8rem;
  color: $color--text-muted;
}

.tech-confidence {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  font-size: 0.78rem;
}

.tech-confidence-label {
  color: $color--text-muted;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tech-confidence-value {
  color: $color--text;
  font-variant-numeric: tabular-nums;
  font-weight: $font--weight--medium;
}

.tech-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tech-category {
  font-size: 0.75rem;
  padding: 1px 8px;
  border: 1px solid $color--border;
  border-radius: $radius--pill;
  background: $color--surface;
  color: $color--text-secondary;
}

.tp-tool-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid $color--border;
  padding: 10px 14px 14px 14px;
}

.tp-tool-cat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-tool-cat-name {
  font-size: 0.78rem;
  font-weight: $font--weight--semibold;
  color: $color--text-muted;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tp-tool-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;

  li {
    font-size: 0.85rem;
    padding: 2px 9px;
    border: 1px solid $color--border;
    border-radius: $radius--pill;
    background: $color--surface;
    color: $color--text;
  }
}

.hints-list {
  border-top: 1px solid $color--border;
  padding: 10px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.listing-card > .hints-list {
  border-top: 0;
  padding: 0;
}

.hints-group-name {
  display: inline-block;
  margin-bottom: 4px;
  font-family: $font--mono;
  font-size: 0.8rem;
  color: $color--text-muted;
  text-transform: lowercase;
}

.hints-group-urls {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hints-group-url {
  font-size: 0.85rem;
  color: $color--text-secondary;
  word-break: break-all;
  overflow-wrap: anywhere;
}
