/* SMX Results Pages /results/ */

/* Spinner */
.smx-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}
.smx-loader .lds-roller {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.smx-loader .lds-roller div {
  animation: smx-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  transform-origin: 40px 40px;
}
.smx-loader .lds-roller div:after {
  content: ' ';
  display: block;
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5425AF;
  margin: -4px 0 0 -4px;
}
.smx-loader .lds-roller div:nth-child(1)       { animation-delay: -0.036s; }
.smx-loader .lds-roller div:nth-child(1):after  { top: 63px; left: 63px; }
.smx-loader .lds-roller div:nth-child(2)       { animation-delay: -0.072s; }
.smx-loader .lds-roller div:nth-child(2):after  { top: 68px; left: 56px; }
.smx-loader .lds-roller div:nth-child(3)       { animation-delay: -0.108s; }
.smx-loader .lds-roller div:nth-child(3):after  { top: 71px; left: 48px; }
.smx-loader .lds-roller div:nth-child(4)       { animation-delay: -0.144s; }
.smx-loader .lds-roller div:nth-child(4):after  { top: 72px; left: 40px; }
.smx-loader .lds-roller div:nth-child(5)       { animation-delay: -0.18s; }
.smx-loader .lds-roller div:nth-child(5):after  { top: 71px; left: 32px; }
.smx-loader .lds-roller div:nth-child(6)       { animation-delay: -0.216s; }
.smx-loader .lds-roller div:nth-child(6):after  { top: 68px; left: 24px; }
.smx-loader .lds-roller div:nth-child(7)       { animation-delay: -0.252s; }
.smx-loader .lds-roller div:nth-child(7):after  { top: 63px; left: 17px; }
.smx-loader .lds-roller div:nth-child(8)       { animation-delay: -0.288s; }
.smx-loader .lds-roller div:nth-child(8):after  { top: 56px; left: 12px; }

@keyframes smx-roller {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Page wrapper */
.smx-results {
  background: #fff;
  color: #160D3E;
  padding: 40px 0;
}

.smx-results .smx-results-error,
.smx-results .smx-no-data {
  padding: 30px 0;
  color: rgba(22, 13, 62, 0.45);
  font-size: 15px;
}

/* Event page heading (matches original h2/h5 above the hr) */
.smx-event-heading { margin-bottom: 12px; }
.smx-event-heading h2 {
  font-size: 22px;
  font-weight: 700;
  color: #160D3E;
  margin: 0 0 4px;
}
.smx-event-heading h5 {
  font-size: 14px;
  font-weight: 400;
  color: rgba(22, 13, 62, 0.6);
  margin: 0;
}

/* Horizontal rule */
.smx-hr {
  border: 0;
  border-top: 2px solid #5425AF;
  margin: 0 0 20px;
}

/* ── Cards (match Bootstrap card / bg-smx card-header pattern) ── */
.smx-card { margin-bottom: 20px; border: 1px solid rgba(22, 13, 62, 0.12); }
.smx-card-header {
  background: #190D40;
  padding: 10px 16px;
}
.smx-card-header h2 {
  color: #CEFF00;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* ── Shared table ── */
.smx-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.smx-results-table thead tr { background: #190D40; color: #fff; }
.smx-results-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.smx-results-table tbody tr   { border-bottom: 1px solid rgba(22, 13, 62, 0.07); transition: background 0.12s; }
.smx-results-table tbody tr:hover { background: rgba(84, 37, 175, 0.04); }
.smx-results-table tbody tr:nth-child(even) { background: rgba(22, 13, 62, 0.02); }
.smx-results-table tbody tr:nth-child(even):hover { background: rgba(84, 37, 175, 0.05); }
.smx-results-table td         { padding: 8px 12px; vertical-align: middle; line-height: 1.3; }
.smx-results-table a          { color: #5425AF; font-weight: 500; text-decoration: none; }
.smx-results-table a:hover    { text-decoration: underline; }

/* Session group header rows (matches bg-dark text-white dividers) */
.smx-results-table .smx-session-header td {
  background: #1a1a2e !important;
  color: #fff;
  padding: 7px 12px;
}
.smx-results-table .smx-session-header h5 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

/* Indented sub-rows (match pl-5 in original) */
.smx-results-table td.smx-indent { padding-left: 28px; }

/* Clickable rows */
.smx-results-table .smx-clickable-row { cursor: pointer; }

/* Right-aligned cell */
.smx-results-table .smx-col-right { text-align: right; white-space: nowrap; }

/* Column widths / styles */
.smx-results-table .smx-col-pos      { width: 46px; font-weight: 700; font-size: 15px; text-align: center; }
.smx-results-table .smx-col-num      { width: 56px; }
.smx-results-table .smx-col-mfr      { width: 68px; }
.smx-results-table .smx-col-points   { font-weight: 700; font-size: 15px; }
.smx-results-table .smx-col-result   { font-family: monospace; font-size: 12px; }
.smx-results-table .smx-col-seed     { font-size: 12px; color: rgba(22, 13, 62, 0.65); }
.smx-results-table .smx-col-date     { white-space: nowrap; color: rgba(22, 13, 62, 0.6); }
.smx-results-table .smx-col-interval { font-size: 12px; font-family: monospace; }
.smx-results-table .smx-col-bestlap  { font-size: 12px; font-family: monospace; white-space: nowrap; }
.smx-results-table .smx-col-time     { font-size: 12px; font-family: monospace; }
.smx-results-table .smx-col-hometown { font-size: 12px; color: rgba(22, 13, 62, 0.65); }
.smx-results-table .smx-col-gap      { font-size: 12px; font-family: monospace; }

.smx-results-table .smx-row--dsq td,
.smx-results-table .smx-row--dns td,
.smx-results-table .smx-row--dnf td { color: rgba(22, 13, 62, 0.35); }

/* Individual Lap Times — one column per rider, horizontal scroll (legacy results-site layout) */
.smx-card-header--split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.smx-card-hint { font-size: 11px; color: rgba(255, 255, 255, 0.65); white-space: nowrap; }
.smx-rider-laps-scroll {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.smx-rider-laps-col {
  flex: 0 0 250px;
  width: 250px;
  border: 1px solid rgba(22, 13, 62, 0.35);
  background: #fff;
}
.smx-rider-laps-head {
  background: #190D40;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
}
.smx-rider-laps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.smx-rider-laps-table td { padding: 2px 6px; line-height: 1.4; }
.smx-rider-laps-num  { width: 28px; color: rgba(22, 13, 62, 0.6); }
.smx-rider-laps-time { font-family: monospace; }
.smx-rider-laps-pos  { text-align: right; font-size: 11px; color: rgba(22, 13, 62, 0.65); white-space: nowrap; }
.smx-rider-lap--fastest td { background: rgba(40, 167, 69, 0.25); font-weight: 700; }
.smx-rider-laps-stat td { padding: 2px 6px; }
.smx-rider-laps-stat--first td { border-top: 2px solid #190D40; }
.smx-rider-laps-stat + .smx-rider-laps-stat td { border-top: 1px solid rgba(22, 13, 62, 0.15); }
.smx-rider-laps-stat td > span:first-child { font-weight: 700; }
.smx-rider-laps-stat td { font-size: 11px; }
.smx-rider-laps-stat td span { display: inline-block; }
.smx-rider-laps-stat td > span:last-child { float: right; font-family: monospace; }

/* Colored bike number badge */
.smx-num-badge {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
}

/* Manufacturer image */
.smx-mfr-img {
  height: 24px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  vertical-align: middle;
}
.smx-mfr-text { font-size: 12px; color: rgba(22, 13, 62, 0.5); }

/* Rider headshot avatar */
.smx-col-rider { white-space: nowrap; }
.smx-rider-headshot {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  vertical-align: middle;
  margin-right: 8px;
  background: rgba(22, 13, 62, 0.08);
}
.smx-rider-headshot--empty { background: rgba(22, 13, 62, 0.08); }

/* Event detail two-column (matches Bootstrap col-8 / col-4) */
.smx-event-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Holeshot badge */
.smx-holeshot-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  background: #CEFF00;
  color: #160D3E;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Detailed Lap Times — horizontal scroll table */
.smx-lap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.smx-detailed-lap-table {
  white-space: nowrap;
  min-width: 600px;
}
.smx-detailed-lap-table .smx-lap-cell { font-family: monospace; font-size: 11px; padding: 6px 8px; }
.smx-detailed-lap-table .smx-lap--fastest { background: rgba(206, 255, 0, 0.25); font-weight: 700; }
.smx-lap--fastest-row td { background: rgba(206, 255, 0, 0.1) !important; }

/* Hard Charger gain/loss colors */
.smx-gain--pos { color: #27ae60; font-weight: 700; }
.smx-gain--neg { color: #c0392b; font-weight: 700; }

/* Team column */
.smx-results-table .smx-col-team { font-size: 12px; color: rgba(22, 13, 62, 0.65); }

/* Standings tabs */
.smx-standings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid rgba(22, 13, 62, 0.1);
}
.smx-standings-tab {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  text-decoration: none;
  color: rgba(22, 13, 62, 0.5);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.smx-standings-tab:hover { color: #5425AF; text-decoration: none; }
.smx-standings-tab.active { color: #5425AF; border-bottom-color: #5425AF; }

/* Series filter tabs — events listing pages (/results/, /results/{year}/) */
.smx-results-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(22, 13, 62, 0.1);
}
.smx-results-filter {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  color: rgba(22, 13, 62, 0.5);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.smx-results-filter:hover { color: #5425AF; }
.smx-results-filter.active { color: #5425AF; border-bottom-color: #5425AF; }

/* Pills — used on race/lineup detail pages only */
.smx-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  background: #5425AF !important;
  color: #CEFF00 !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}
.smx-pill:hover {
  background: #CEFF00 !important;
  color: #5425AF !important;
  text-decoration: none !important;
}

/* Round ranking page heading */
.smx-results-heading {
  font-size: 20px;
  font-weight: 700;
  color: #160D3E;
  margin: 0 0 16px;
}

/* Section title */
.smx-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #160D3E;
  border-bottom: 2px solid #5425AF;
  padding-bottom: 6px;
  margin: 0 0 14px;
}

/* Responsive */
@media screen and (max-width: 991px) {
  .smx-event-layout {
    grid-template-columns: 1fr;
  }
  .smx-results-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .smx-standings-tabs { gap: 0; }
  .smx-standings-tab  { padding: 6px 10px; font-size: 11px; }
}
