/* ================================================
   TSV STANDINGS TABLE — high-specificity SportsPress overrides
   ================================================ */

/* Wrap from PHP: <div class="tsv-standings-wrap"> */
.tsv-standings-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--tsv-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.tsv-standings-wrap,
.tsv-standings-wrap .sp-template,
.tsv-standings-wrap .sp-template-league-table {
    font-size: 13px !important;
    font-family: var(--tsv-font) !important;
}

.tsv-standings-wrap table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: transparent !important;
    border: none !important;
}

/* Section heading with red underline */
.tsv-section-heading {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tsv-dark);
    border-bottom: 3px solid var(--tsv-primary);
    padding-bottom: 10px;
    margin: 0 0 20px;
    display: inline-block;
}

/* Table header */
.tsv-standings-wrap thead tr th,
.tsv-standings-wrap .sp-template thead tr th,
#tsv-standings thead th {
    background: #f8f8f8 !important;
    color: var(--tsv-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 8px 10px !important;
    text-align: center !important;
    border: none !important;
    border-bottom: 2px solid var(--tsv-border) !important;
    white-space: nowrap !important;
}
.tsv-standings-wrap thead th:first-child,
.tsv-standings-wrap thead th:nth-child(2) {
    text-align: left !important;
}

/* Table body cells */
.tsv-standings-wrap tbody tr td,
.tsv-standings-wrap .sp-template tbody tr td,
#tsv-standings tbody td {
    padding: 10px 10px !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    text-align: center !important;
    vertical-align: middle !important;
    color: var(--tsv-dark) !important;
    background: transparent !important;
    font-size: 13px !important;
}
.tsv-standings-wrap tbody td:first-child,
.tsv-standings-wrap tbody td:nth-child(2) {
    text-align: left !important;
}

/* Row hover */
.tsv-standings-wrap tbody tr:hover td {
    background: #fafafa !important;
}

/* Alternating row tint */
.tsv-standings-wrap tbody tr:nth-child(even) td {
    background: #fafafa !important;
}

/* 1st place row — gold tint + red left border */
.tsv-standings-wrap tbody tr:first-child td {
    background: #fffdf0 !important;
}
.tsv-standings-wrap tbody tr:first-child td:first-child {
    border-left: 3px solid var(--tsv-primary) !important;
    padding-left: 7px !important;
    color: #c8a000 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}
.tsv-standings-wrap tbody tr:first-child td:first-child,
.tsv-standings-wrap tbody tr:nth-child(2) td:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.tsv-standings-wrap tbody tr:first-child td:first-child::before {
    content: '\1F947';
    line-height: 1;
}

/* 2nd place row — silver medal */
.tsv-standings-wrap tbody tr:nth-child(2) td:first-child::before {
    content: '\1F948';
    line-height: 1;
}

/* PTS column — red + bold */
.tsv-standings-wrap tbody td:last-child,
.tsv-standings-wrap thead th:last-child,
.tsv-standings-wrap td[data-label="PTS"],
.tsv-standings-wrap td.data-pts {
    color: var(--tsv-primary) !important;
    font-weight: 700 !important;
}

/* Team logo */
.tsv-standings-wrap td img,
.tsv-standings-wrap .sp-team-logo,
.tsv-standings-wrap .data-name img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

/* Rank number */
.tsv-standings-wrap td:first-child {
    color: var(--tsv-muted) !important;
    font-size: 12px !important;
    width: 30px !important;
}

/* GD coloring — applied via JS in schedule-filter.js */
.tsv-gd-pos { color: var(--tsv-positive) !important; font-weight: 600 !important; }
.tsv-gd-neg { color: var(--tsv-primary)  !important; font-weight: 600 !important; }

/* Legacy class names */
.tsv-gd-positive { color: var(--tsv-positive) !important; font-weight: 600 !important; }
.tsv-gd-negative { color: var(--tsv-primary)  !important; font-weight: 600 !important; }

/* SportsPress data-* column classes */
.tsv-standings-wrap td.data-pts,
.sp-template-league-table td.data-pts { color: var(--tsv-primary) !important; font-weight: 700 !important; }

/* Mobile — hide D L GF GA GD columns */
@media (max-width: 767px) {
    .tsv-standings-wrap thead th.col-d,
    .tsv-standings-wrap thead th.col-l,
    .tsv-standings-wrap thead th.col-gf,
    .tsv-standings-wrap thead th.col-ga,
    .tsv-standings-wrap thead th.col-gd,
    .tsv-standings-wrap tbody td.col-d,
    .tsv-standings-wrap tbody td.col-l,
    .tsv-standings-wrap tbody td.col-gf,
    .tsv-standings-wrap tbody td.col-ga,
    .tsv-standings-wrap tbody td.col-gd,
    .tsv-standings-wrap th.data-d,  .tsv-standings-wrap td.data-d,
    .tsv-standings-wrap th.data-l,  .tsv-standings-wrap td.data-l,
    .tsv-standings-wrap th.data-gf, .tsv-standings-wrap td.data-gf,
    .tsv-standings-wrap th.data-ga, .tsv-standings-wrap td.data-ga,
    .tsv-standings-wrap th.data-gd, .tsv-standings-wrap td.data-gd,
    .sp-template-league-table th.data-d,  .sp-template-league-table td.data-d,
    .sp-template-league-table th.data-l,  .sp-template-league-table td.data-l,
    .sp-template-league-table th.data-gf, .sp-template-league-table td.data-gf,
    .sp-template-league-table th.data-ga, .sp-template-league-table td.data-ga,
    .sp-template-league-table th.data-gd, .sp-template-league-table td.data-gd {
        display: none !important;
    }
}

/* Legend below table */
.tsv-standings-legend {
    font-size: 11px;
    color: var(--tsv-muted);
    padding: 10px 16px;
    background: #f8f8f8;
    border-top: 1px solid var(--tsv-border);
    border-radius: 0 0 6px 6px;
    margin: 0;
}
