/* Standings pages (Individual/Majors/PGA Playoffs/Commissioner's Cup/Grid/Hall of Fame) -- ported from
   legacy's standings_modern.css. All of these share the same .standings/#standingsTable/.tableHeaderBackground
   markup (standings/_standings_table.html.erb, or Grid/Hall of Fame's own similarly-shaped tables), so
   they're styled together under one wrapper class rather than duplicated per page.

   Row shading kept as a lighter version of legacy's own colors (tan .standingsRow, alternating .whiteRow),
   rather than switching to the blue used elsewhere, matching legacy's own choice to keep these distinct. */
.standingsPage #pageTitle {
  margin-bottom: 12px;
}

.standingsPage .standingsControls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.standingsPage .standingsControlGroup label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.standingsPage .standingsControlGroup select {
  border: 1px solid var(--ptfg-input-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.standingsPage .standingsNote {
  font-size: 13px;
  margin-bottom: 10px;
}

.standingsPage .standingsUnavailableNote {
  max-width: 700px;
  font-size: 13px;
  color: var(--ptfg-text-muted);
}

.standingsPage .calloutWarning {
  max-width: 800px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}

.standingsPage .standingsHallOfFameInfo {
  max-width: 750px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}

/* Main standings table */
.standings {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--ptfg-border);
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.standings table {
  float: none;
  width: auto;
  margin: 0;
  border-collapse: collapse;
}

#standingsTable thead tr#header {
  background-color: var(--ptfg-navy);
}

#standingsTable thead tr#header td {
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  vertical-align: bottom;
  font-size: 11px;
  letter-spacing: 0.2px;
  padding: 4px 6px;
  border: 1px solid var(--ptfg-navy-dark);
  white-space: nowrap;
}

/* Click-to-sort (sortable-table Stimulus controller) -- only headers with a click action (not Scorecard/
   Trophy Case, sorting either is meaningless) get the pointer cursor and hover feedback. */
#standingsTable thead tr#header td[data-action] {
  cursor: pointer;
}

#standingsTable thead tr#header td[data-action]:hover {
  background-color: var(--ptfg-navy-dark);
}

/* Sort direction indicator -- data-sort-direction is set on whichever header was last clicked. White reads
   clearly against the navy header (matches the same choice made for Weekly Results). */
#standingsTable thead tr#header td[data-sort-direction]::after {
  margin-left: 4px;
  color: #fff;
}

#standingsTable thead tr#header td[data-sort-direction="asc"]::after {
  content: "\25B2"; /* up triangle */
}

#standingsTable thead tr#header td[data-sort-direction="desc"]::after {
  content: "\25BC"; /* down triangle */
}

/* Hall of Fame's Seasons Played/Teams Played/Member Since/HOF Points headers -- these are longer phrases
   than the short numbers/years in the column below them, so letting them wrap onto two lines (instead of
   forcing white-space: nowrap like every other header) keeps those columns narrow instead of stretching to
   fit one long line of header text. */
#standingsTable thead tr#header td.narrowHeader {
  white-space: normal;
  max-width: 70px;
}

#standingsTable tbody td {
  border: 1px solid var(--ptfg-border);
  padding: 2px 6px;
  font-size: 13px;
  white-space: nowrap;
}

#standingsTable tbody tr.standingsRow td {
  background-color: #f2ecd4;
}

/* ITM Standings (Cuts Made/Weekly Top Ten/Anytime Streak/Start of Season Streak/No Winner Picked) use a
   grey zebra stripe instead of the tan .standingsRow -- matches legacy's own distinct .itmStandingsRow
   color, kept as its own visual identity for this contest family rather than reusing the tan. */
#standingsTable tbody tr.itmStandingsRow td {
  background-color: #c7c7c7;
}

#standingsTable tbody tr.whiteRow td {
  background-color: #fff;
}

#standingsTable tbody tr:hover td {
  background-color: var(--ptfg-bg-hover);
}

#standingsTable tbody tr.highlightRow td {
  background-color: var(--ptfg-highlight);
}

#standingsTable td.number {
  text-align: right;
}

#standingsTable td.centerText {
  text-align: center;
}

#standingsTable .unpaid {
  color: var(--ptfg-red);
}

#standingsTable .userFlagImage {
  display: block;
  max-height: 16px;
  margin: 0 auto;
}

.standingsDeltaUp {
  color: var(--ptfg-green);
}

.standingsDeltaDown {
  color: var(--ptfg-red);
}

.standingsDeltaNone {
  color: var(--ptfg-text-muted);
}

.hofPointsNegative {
  color: var(--ptfg-red);
  font-weight: 700;
}

#standingsTable tfoot td {
  background: var(--ptfg-bg-tint);
  border: none;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ptfg-text-muted);
  white-space: normal;
  line-height: 1.4;
}

.standingsFooterHeading {
  font-weight: 700;
  margin-bottom: 2px;
}

/* .standingsNote is also used above the table (the "Standings are through week X" line, 13px there via
   .standingsPage .standingsNote) -- reused here for the footer's numbered list too, so it needs its own
   higher-specificity override to actually shrink to match .standingsFooterHeading's 11px instead of
   inheriting that unrelated 13px. */
#standingsTable tfoot .standingsNote {
  font-size: 11px;
}

/* Trophy legend (shared/_trophy_legend) -- override its default block spacing (browsers give <p> a 1em
   top/bottom margin by default, which reads as a big gap between what are really just short lines of a
   legend) to sit compactly wherever it's rendered: inside the table footer on Individual/Majors/PGA
   Playoffs/Commissioner's Cup, or standalone below the table on Hall of Fame. */
.trophyLegend {
  font-size: 11px;
}

.trophyLegend p {
  margin: 4px 0 0;
}

/* Hall of Fame renders the legend as a sibling of <table> inside .standings (not nested in a table footer
   like the other Standings pages -- HOF's table has no tfoot), so give it the same muted "footer note"
   panel treatment the tfoot itself already provides there. Being inside .standings -- rather than a
   separate block below it -- keeps it inside that div's shared border-radius/box-shadow/width, so it reads
   as part of the same table card instead of a disconnected floating box underneath it. */
.standings > .trophyLegend {
  background: var(--ptfg-bg-tint);
  padding: 8px;
  color: var(--ptfg-text-muted);
  line-height: 1.4;
  border-top: 1px solid var(--ptfg-border);
}
