/* =============================================================================
   ehr_style_13_misc_pages.css
   Auction, Watchlist, Hall of Fame, EOY Ratings, Player Stats
   Expanded rows use global stable_horse_list_expanded_info / stable_horse_list_show.
   Expand toggles use global stable_horse_list_expand_toggle.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — page containers
   ───────────────────────────────────────────────────────────────────────────── */

.auc_page_container,
.wl_page_container,
.hof_page_container,
.rtg_page_container,
.pst_page_container {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  box-sizing: border-box;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — table wrapper, table, thead, tbody
   ───────────────────────────────────────────────────────────────────────────── */

.auc_table_wrapper,
.wl_table_wrapper,
.hof_table_wrapper,
.rtg_table_wrapper,
.pst_table_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  box-sizing: border-box;
}

.auc_table,
.wl_table,
.hof_table,
.rtg_table,
.pst_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background-color: #fff;
}

.auc_table thead tr,
.wl_table thead tr,
.hof_table thead tr,
.rtg_table thead tr,
.pst_table thead tr {
  background-color: #E8E8D0;
}

.auc_table th,
.wl_table th,
.hof_table th,
.rtg_table th,
.pst_table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #c8c8a0;
  white-space: nowrap;
  overflow: hidden;
}

.auc_table td,
.wl_table td,
.hof_table td,
.rtg_table td,
.pst_table td {
  padding: 6px 6px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
}

/* ── Alternating rows ── */
/* auc/wl/hof/pst: rows come in pairs (main + expand), so stripe every 4 tr */
/* auc/wl/pst: rows come in pairs (main + expand), stripe every 4 tr */
.auc_table tbody tr:nth-child(4n+1),
.auc_table tbody tr:nth-child(4n+2),
.wl_table tbody tr:nth-child(4n+1),
.wl_table tbody tr:nth-child(4n+2),
.pst_table tbody tr:nth-child(4n+1),
.pst_table tbody tr:nth-child(4n+2) {
  background-color: #f8f8f2;
}

/* hof/rtg: no expand rows — standard odd/even */
.hof_table tbody tr:nth-child(odd),
.rtg_table tbody tr:nth-child(odd) {
  background-color: #f8f8f2;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — expand toggle column
   ───────────────────────────────────────────────────────────────────────────── */

.auc_td_expand,
.wl_td_expand,
.hof_td_expand,
.pst_td_expand {
  text-align: center;
  padding-left: 14px;
  white-space: nowrap;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — empty state
   ───────────────────────────────────────────────────────────────────────────── */

.auc_empty,
.wl_empty,
.hof_empty,
.rtg_empty,
.pst_empty {
  padding: 20px;
  color: #64748b;
  font-style: italic;
}


/* ─────────────────────────────────────────────────────────────────────────────
   AUCTION
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Controls ── */
.auc_controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px;
  align-items: center;
}

.auc_control_group {
  display: flex;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  overflow: hidden;
}

.auc_btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  background: #f0f0e0;
  border: none;
  border-left: 1px solid #c8c8a0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.auc_btn:first-child { border-left: none; }

.auc_btn:hover    { background: #e0e0c8; color: #1e293b; }
.auc_btn_active   { background: #fff; color: #1e293b; font-weight: 700; }

/* ── Columns ── */
.auc_td_horse     { font-weight: 600; }
.auc_td_bid       { text-align: right; white-space: nowrap; }
.auc_td_closes    { white-space: nowrap; }
.auc_td_bids      { text-align: center; }

.auc_horse_name   { color: #166534; font-weight: 600; }
.auc_bid_amount   { font-weight: 700; color: #1e293b; }
.auc_closes_time  { font-size: 11px; color: #4a5568; }

.auc_nobids {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.auc_hibidder_me {
  font-weight: 700;
  color: #fff;
  background: #15803d;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

.auc_hibidder_other { font-weight: 600; color: #1e293b; }

/* ── Pagination ── */
.auc_pagination {
  display: flex;
  gap: 20px;
  padding: 10px 4px;
  justify-content: center;
}

.auc_page_link {
  font-size: 13px;
  font-weight: 600;
  color: #3a7abf;
  text-decoration: none;
  cursor: pointer;
}

.auc_page_link:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 1400px) {
  .auc_th_tag,    .auc_td_tag,
  .auc_th_form,   .auc_td_form    { display: none; }
}
@media (max-width: 1200px) {
  .auc_th_sire,   .auc_td_sire,
  .auc_th_badge,  .auc_td_badge   { display: none; }
}
@media (max-width: 1000px) {
  .auc_th_owner,    .auc_td_owner,
  .auc_th_hibidder, .auc_td_hibidder { display: none; }
}
@media (max-width: 800px) {
  .auc_th_r, .auc_td_r,
  .auc_th_w, .auc_td_w            { display: none; }
}
@media (max-width: 600px) {
  .auc_th_as,   .auc_td_as,
  .auc_th_bids, .auc_td_bids      { display: none; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   WATCHLIST
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Controls ── */
.wl_controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.wl_btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  background: #f0f0e0;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.wl_btn:hover   { background: #e0e0c8; color: #1e293b; }
.wl_btn_active  { background: #fff; color: #1e293b; font-weight: 700; }

/* ── Columns ── */
.wl_td_horse  { font-weight: 600; }
.wl_td_tag    { white-space: nowrap; }

.wl_horse_name { color: #166534; font-weight: 600; }
.wl_price      { font-weight: 700; color: #1e293b; }

.wl_action_icon {
  cursor: pointer;
  color: #3a7abf;
  font-weight: 700;
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .wl_th_dist, .wl_td_dist,
  .wl_th_cond, .wl_td_cond  { display: none; }
}
@media (max-width: 1000px) {
  .wl_th_trk,  .wl_td_trk   { display: none; }
}
@media (max-width: 800px) {
  .wl_th_type, .wl_td_type,
  .wl_th_surf, .wl_td_surf   { display: none; }
}
@media (max-width: 600px) {
  .wl_th_sex,  .wl_td_sex,
  .wl_th_age,  .wl_td_age    { display: none; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   HALL OF FAME
   ───────────────────────────────────────────────────────────────────────────── */

.hof_title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 12px 0 8px 0;
}

.hof_td_horse  { font-weight: 600; }
.hof_horse_name { color: #166534; font-weight: 600; }

/* ── Responsive ── */
/* ── Status badges ── */
.hof_status_active {
  font-size: 11px;
  font-weight: 600;
  color: #166534;
}

.hof_status_retired {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.hof_row_retired {
  opacity: 0.7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hof_th_sire,    .hof_td_sire,
  .hof_th_badges,  .hof_td_badges  { display: none; }
}
@media (max-width: 600px) {
  .hof_th_status,  .hof_td_status,
  .hof_th_owner,   .hof_td_owner   { display: none; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   EOY RATINGS
   ───────────────────────────────────────────────────────────────────────────── */

.rtg_title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 12px 0 2px 0;
}

.rtg_subtitle {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

/* ── Filters ── */
.rtg_filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 8px;
  align-items: center;
}

.rtg_filter_select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  background: #f8f8f2;
  color: #374151;
  font-family: inherit;
}

.rtg_update_btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #4a5568;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.rtg_update_btn:hover { background: #374151; }

/* ── Columns ── */
.rtg_td_rank  { font-weight: 700; text-align: center; }
.rtg_td_horse { font-weight: 600; }
.rtg_td_pts   { text-align: right; }

.rtg_horse_name { color: #166534; font-weight: 600; }
.rtg_points     { font-weight: 700; color: #1e293b; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .rtg_th_g1itm, .rtg_td_g1itm,
  .rtg_th_g2itm, .rtg_td_g2itm,
  .rtg_th_g3itm, .rtg_td_g3itm  { display: none; }
}
@media (max-width: 800px) {
  .rtg_th_g1, .rtg_td_g1,
  .rtg_th_g2, .rtg_td_g2,
  .rtg_th_g3, .rtg_td_g3        { display: none; }
}
@media (max-width: 600px) {
  .rtg_th_age, .rtg_td_age,
  .rtg_th_sex, .rtg_td_sex       { display: none; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   PLAYER STATS
   ───────────────────────────────────────────────────────────────────────────── */

.pst_title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 12px 0 2px 0;
}

.pst_subtitle {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

/* ── Filters ── */
.pst_filters_container { margin-top: 8px; margin-bottom: 8px; }

.pst_filters_toggle {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #f0f0e0;
  color: #4a5568;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  cursor: pointer;
}

.pst_filters_toggle:hover { background: #e0e0c8; }

.pst_filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.pst_filter_select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  background: #f8f8f2;
  color: #374151;
  font-family: inherit;
}

.pst_update_btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #4a5568;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.pst_update_btn:hover { background: #374151; }

/* ── Columns ── */
.pst_td_rank   { font-weight: 700; text-align: center; }
.pst_td_master { font-weight: 600; }
.pst_td_earn   { text-align: right; white-space: nowrap; }
.pst_td_wpct, .pst_td_itmpct,
.pst_td_afi, .pst_td_aen, .pst_td_aod { text-align: right; }

.pst_master_name { color: #166534; font-weight: 600; }
.pst_money       { font-weight: 700; color: #1e293b; }

/* ── Responsive ── */
@media (max-width: 1200px) { .pst_th_aod,    .pst_td_aod    { display: none; } }
@media (max-width: 1000px) { .pst_th_aen,    .pst_td_aen    { display: none; } }
@media (max-width: 800px)  { .pst_th_afi,    .pst_td_afi    { display: none; } }
@media (max-width: 700px)  { .pst_th_itmpct, .pst_td_itmpct { display: none; } }
@media (max-width: 500px)  {
  .pst_th_earn, .pst_td_earn,
  .pst_th_p,    .pst_td_p,
  .pst_th_s,    .pst_td_s    { display: none; }
}
@media (max-width: 400px)  { .pst_th_r, .pst_td_r           { display: none; } }


/* ─────────────────────────────────────────────────────────────────────────────
   JOCKEY PAGE
   ───────────────────────────────────────────────────────────────────────────── */

.jky_page_container {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  box-sizing: border-box;
}

/* ── Controls ── */
.jky_controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px;
  align-items: center;
}

.jky_control_group {
  display: flex;
  border: 1px solid #c8c8a0;
  border-radius: 4px;
  overflow: hidden;
}

.jky_btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  background: #f0f0e0;
  border: none;
  border-left: 1px solid #c8c8a0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.jky_btn:first-child { border-left: none; }
.jky_btn:hover       { background: #e0e0c8; color: #1e293b; }
.jky_btn_active      { background: #fff; color: #1e293b; font-weight: 700; }

.jky_location_select {
  padding: 5px 8px;
  font-size: 12px;
  border: none;
  background: #f0f0e0;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
}

.jky_location_select:focus { outline: none; }

/* ── Table ── */
.jky_table_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  box-sizing: border-box;
}

.jky_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background-color: #fff;
  table-layout: auto;
}

.jky_td_name,
.jky_th_name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .jky_td_name,
  .jky_th_name { max-width: 100px; }
}

@media (max-width: 340px) {
  .jky_td_name,
  .jky_th_name { max-width: 70px; }
}

.jky_table thead tr { background-color: #E8E8D0; }

.jky_table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #c8c8a0;
  white-space: nowrap;
}

.jky_table td {
  padding: 6px 6px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
}

/* Alternating rows — pairs (main + expand) */
.jky_table tbody tr:nth-child(4n+1),
.jky_table tbody tr:nth-child(4n+2) {
  background-color: #f8f8f2;
}

/* ── Row flag colors ── */
.jky_row_red  { background-color: #ffeeee !important; }
.jky_row_blue { background-color: #eeeeff !important; }

/* ── Columns ── */
.jky_td_expand { text-align: center; padding-left: 14px; white-space: nowrap; }
.jky_td_rank   { text-align: center; font-weight: 700; }
.jky_td_name   { font-weight: 600; }
.jky_td_wpct, .jky_td_itmpct,
.jky_td_usdk, .jky_td_usdpr,
.jky_td_rmin   { text-align: right; white-space: nowrap; }

.jky_name { color: #166534; font-weight: 600; }

/* ── Expanded name heading ── */
.jky_exp_name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 8px 14px 4px 14px;
}

/* ── Empty ── */
.jky_empty {
  padding: 20px;
  color: #64748b;
  font-style: italic;
}

/* ── Responsive ── */

/* Controls wrap and shrink gracefully */
@media (max-width: 600px) {
  .jky_controls { gap: 4px; }
  .jky_btn      { padding: 5px 8px; font-size: 11px; }
  .jky_location_select { font-size: 11px; }
}

@media (max-width: 380px) {
  .jky_controls       { flex-direction: column; align-items: flex-start; }
  .jky_control_group  { width: 100%; }
  .jky_btn            { flex: 1; text-align: center; }
  .jky_location_select { width: 100%; }
}

/* Column hiding cascade — most → least important */

/* 900px: drop secondary stats columns */
@media (max-width: 900px) {
  .jky_th_itmpct,   .jky_td_itmpct,
  .jky_th_usdk,     .jky_td_usdk,
  .jky_th_usdpr,    .jky_td_usdpr,
  .jky_th_maxbase,  .jky_td_maxbase,
  .jky_th_tiebreak, .jky_td_tiebreak,
  .jky_th_canride,  .jky_td_canride  { display: none; }
}

/* 600px: drop Trk and Exp */
@media (max-width: 600px) {
  .jky_th_trk, .jky_td_trk,
  .jky_th_exp, .jky_td_exp          { display: none; }
}

/* 420px: drop SelOrder (flag mode) and RMin */
@media (max-width: 420px) {
  .jky_th_selorder, .jky_td_selorder,
  .jky_th_rmin,     .jky_td_rmin    { display: none; }
}

/* 340px: drop W% — only expand toggle, rank, name remain */
@media (max-width: 340px) {
  .jky_th_wpct, .jky_td_wpct        { display: none; }
}

/* Tighten cell padding at small sizes */
@media (max-width: 420px) {
  .jky_table th,
  .jky_table td   { padding: 5px 4px; font-size: 11px; }
  .jky_td_expand  { padding-left: 6px; }
}

@media (max-width: 340px) {
  .jky_table th,
  .jky_table td   { padding: 4px 3px; font-size: 11px; }
  .jky_td_expand  { padding-left: 4px; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   WATCHLIST — additional styles for real data
   ───────────────────────────────────────────────────────────────────────────── */

.wl_sire_name { color: #7c3aed; font-weight: 600; }

/* ── Type badges ── */
.wl_type_badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wl_type_badge_h  { background: #e5e7eb; color: #374151; }   /* plain horse    */
.wl_type_badge_c  { background: #dbeafe; color: #1e40af; }   /* claim          */
.wl_type_badge_a  { background: #dcfce7; color: #166534; }   /* auction        */
.wl_type_badge_ca { background: #fef9c3; color: #854d0e; }   /* claim+auction  */
.wl_type_badge_s  { background: #f3e8ff; color: #7c3aed; }   /* sire           */

/* ── Auction hi-bidder indicators ── */
.wl_nobids {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.wl_hibidder_me {
  font-weight: 700;
  color: #fff;
  background: #15803d;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── Column alignment ── */
.wl_td_cprice,
.wl_td_abid  { text-align: right; white-space: nowrap; }
.wl_td_crun,
.wl_td_aclose { white-space: nowrap; font-size: 11px; color: #4a5568; }

/* ── Responsive — watchlist updated ── */
@media (max-width: 1100px) {
  .wl_th_aclose, .wl_td_aclose,
  .wl_th_crun,   .wl_td_crun    { display: none; }
}
@media (max-width: 900px) {
  .wl_th_cdist,  .wl_td_cdist,
  .wl_th_csurf,  .wl_td_csurf,
  .wl_th_ahi,    .wl_td_ahi     { display: none; }
}
@media (max-width: 600px) {
  .wl_th_sex,    .wl_td_sex,
  .wl_th_tag,    .wl_td_tag     { display: none; }
}

/* ── HOF Badge responsive visibility ──
   5 badges on wide screens, down to 2 on narrow
   Empty badge spans are invisible anyway; this just hides the slot */
.hof_badge_1,
.hof_badge_2,
.hof_badge_3,
.hof_badge_4,
.hof_badge_5 { display: inline-block; }

@media (max-width: 1200px) {
    .hof_badge_5 { display: none; }
}
@media (max-width: 1000px) {
    .hof_badge_4 { display: none; }
}
@media (max-width: 800px) {
    .hof_badge_3 { display: none; }
}

/* ── Watchlist — sire horse rows ── */
.wl_sire_horses {
    padding: 6px 12px 8px 32px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wl_sire_horse_row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 13px;
    background: var(--ehr-white);
    border-bottom: 1px solid var(--ehr-border-light);
}

.wl_sire_horse_row:last-child {
    border-bottom: none;
}

.wl_sire_horse_name {
    font-weight: 600;
    color: #166534;
    min-width: 180px;
}

.wl_sire_horse_sex {
    color: var(--ehr-text-muted);
    font-size: 12px;
    min-width: 60px;
}

.wl_sire_horse_price {
    font-weight: 600;
    color: var(--ehr-text);
    min-width: 70px;
}

.wl_sire_horse_date {
    color: var(--ehr-text-muted);
    font-size: 12px;
}

.wl_sire_empty {
    padding: 8px 12px;
    color: var(--ehr-text-muted);
    font-style: italic;
    font-size: 13px;
}

/* ── Watchlist — sire-linked toggle ── */
.wl_sire_toggle_wrap {
    padding: 6px 0 4px;
}

.wl_sire_toggle {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--ehr-border);
    cursor: pointer;
    background: var(--ehr-white);
    color: var(--ehr-text-muted);
    transition: all var(--ehr-transition);
}

.wl_sire_toggle_on {
    border-color: #166534;
    color: #166534;
    background: #f0fdf4;
}

.wl_sire_toggle_off {
    border-color: var(--ehr-border);
    color: var(--ehr-text-muted);
}

.wl_sire_hidden {
    display: none !important;
}

/* ── Watchlist — sire-linked rows alternate between two light colors ── */
.wl_row_sire_linked.wl_sire_alt_0:not(.wl_sire_hidden) {
    background-color: #f0f9ff !important;  /* light sky blue */
}
.wl_row_sire_linked.wl_sire_alt_1:not(.wl_sire_hidden) {
    background-color: #f0fdf4 !important;  /* light mint green */
}