/* Player browser styles. Every selector is scoped under .player_browser;
 * the component uses classes only (the two page-level ids exist only for
 * the bootstrap lookup, never for styling). */

.player_browser {
    margin: 5px;
}

/* ---- tab bars ---- */
.player_browser .pb_sport_tabs,
.player_browser .pb_type_tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 5px 0;
}

.player_browser .pb_tab {
    font: inherit;
    padding: 4px 10px;
    border: 1px solid #000;
    border-radius: 3px;
    background: #fff;
    color: #000;
    cursor: pointer;
}

.player_browser .pb_tab.pb_active {
    background: #000;
    color: #fff;
}

/* ---- scroll wrapper ----
 * The table scrolls on BOTH axes here. With only overflow-x the sticky
 * header would stick to the wrapper, not the page (plan decision 16);
 * the max-height keeps the footer and the outer page reachable. */
.player_browser .pb_scroll {
    overflow: auto;
    max-height: 70vh;
}

/* border-collapse: separate (with border-spacing 0) instead of collapse:
 * with collapse, a sticky th/td loses its borders while it is stuck
 * (borders are painted by the table, not the cell). Borders below are
 * put on the cells themselves so they stick with them. */
.player_browser .pb_table {
    border-collapse: separate;
    border-spacing: 0;
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
}

.player_browser .pb_table th,
.player_browser .pb_table td {
    padding: 6px 10px;           /* touch-friendly row height */
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
    white-space: nowrap;
    /* Opaque: sticky cells must not show scrolling content through. */
    background: #fff;
}

/* ---- sticky header + sticky name column ---- */
.player_browser .pb_table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
}

.player_browser .pb_name {
    position: sticky;
    left: 0;
    z-index: 1;
}

/* ---- row action buttons (plan_fa F9) ----
 * They live inside the sticky name cell, after the name span
 * (.pb_name_text). The cell is nowrap, so the sticky column simply
 * grows to fit; on a 390px viewport the button (~64px wide) stays
 * usable and the stat columns scroll behind the sticky column as
 * before. */
.player_browser .pb_action {
    font: inherit;
    min-height: 32px;              /* touch-sized even in a dense table */
    margin-left: 8px;
    padding: 2px 10px;
    border: 1px solid #000;
    border-radius: 3px;
    background: #fff;
    color: #000;
    cursor: pointer;
}

.player_browser .pb_action:disabled {
    color: #888;
    cursor: wait;
}

/* The corner cell sits above both stickies. */
.player_browser .pb_table thead .pb_name {
    z-index: 3;
}

/* ---- sort affordance (no hover-only affordances) ---- */
.player_browser .pb_sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* ---- stat cells ---- */
.player_browser .pb_stat {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- footer (outside the scroll wrapper, always reachable) ---- */
.player_browser .pb_footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.player_browser .pb_more {
    font: inherit;
    padding: 4px 10px;
}

.player_browser .pb_chunk_size {
    font: inherit;
    padding: 4px;
}
