@import url("../race-info/style.css");

table.racecard {
  /* needs to be more obvious */
  tr[data-racestage="9"] {
    background: #ffcc00;
  }
}

table.racecard.riders-specified .gender {
  display: none;
}

/* Inline details row styles moved from assets */
.gkstats .race-info-row td {
  background-color: transparent;
  padding: 0; /* inner table cells are styled on the embedded wrapper for specificity */
  vertical-align: middle;
}
.gkstats .race-info-row {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}
.gkstats .race-info-row.open {
  max-height: 2000px;
}
.gkstats tr.race {
  cursor: pointer;
}

/* Subtle hover for rows */
.gkstats tr.race:hover {
  background-color: #c8d8f0;
}

/* Visual toggle indicator (chevron) on the date cell */
.gkstats tr.race td.date {
  position: relative;
}
.gkstats tr.race td.date::before {
  content: "\25B6"; /* right-pointing triangle */
  display: inline-block;
  margin-right: 0.5rem;
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.9em;
  transition:
    transform 180ms ease,
    color 120ms ease;
  transform-origin: 50% 50%;
  transform: rotate(0deg);
}
.gkstats tr.race.open td.date::before {
  transform: rotate(90deg);
  color: rgba(0, 0, 0, 0.8);
}

/* Embedded output styling: apply background to the inner wrapper only */
.show-race-info.embedded {
  padding: 0 0 2em 0;
  background-color: #fff;
}

/* Style the inner table cells when race-info is embedded so flag CSS isn't overridden */
.show-race-info.embedded table.gkstats td {
  padding: 4px;
}

.show-race-info.embedded table.gkstats td.fc-background.flag-size-16 {
  background-size: 16px auto !important;
  background-position: 5px 50% !important;
  padding-left: 25px !important;
}

/* Filter controls moved from inline markup */
.gkstats-list-wrapper {
  margin-top: 0.25rem;
}
.gkstats-list-wrapper .gkstats-filters {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 6px;
  flex-wrap: nowrap; /* keep items on one line */
  width: 100%; /* allow right alignment across the full container */
}
.gkstats-list-wrapper .gkstats-filters select {
  padding: 0.25em 0.5em;
  font-size: small;
}
.gkstats-list-wrapper .gkstats-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  font-size: 0.95em;
  margin: 0; /* prevent labels from introducing vertical spacing */
}
.gkstats-list-wrapper .gkstats-filter-label input[type="checkbox"] {
  margin: 0;
}

/* Prevent labels stretching: keep each filter item compact */
.gkstats-list-wrapper .gkstats-filters > .gkstats-filter-label {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
}

/* If theme forces label to display:block, override it here */
.gkstats-list-wrapper .gkstats-filters label.gkstats-filter-label {
  display: inline-flex !important;
}
