/**
 * Vaucluse Handball Standings - Styles front-end
 * Inspiration : ffhandball.fr (bleu marine + rouge institutionnels)
 */

.vhb-standings-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1a1a1a;
    margin: 1.5em 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.vhb-standings-header {
    background: #003c64; /* bleu marine FFHB */
    color: #fff;
    padding: .75em 1em;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .75em;
}

.vhb-standings-competition {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: #fff;
}

.vhb-standings-poule {
    font-size: .85em;
    background: rgba(255,255,255,.15);
    padding: .15em .6em;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.vhb-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92em;
    margin: 0;
}

.vhb-standings-table thead th {
    background: #f5f6f8;
    color: #003c64;
    font-weight: 600;
    text-align: center;
    padding: .55em .35em;
    border-bottom: 2px solid #003c64;
    font-size: .85em;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.vhb-standings-table thead th.vhb-col-team {
    text-align: left;
    padding-left: 1em;
}

.vhb-standings-table tbody td {
    padding: .55em .35em;
    text-align: center;
    border-bottom: 1px solid #ececec;
}

.vhb-standings-table tbody td.vhb-col-team {
    text-align: left;
    padding-left: 1em;
    font-weight: 500;
}

.vhb-standings-table tbody tr:hover {
    background: #f9fafc;
}

.vhb-standings-table .vhb-col-rank {
    width: 2em;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.vhb-standings-table .vhb-col-pts {
    background: #f5f6f8;
    color: #003c64;
    font-size: 1.05em;
    width: 3em;
}

.vhb-standings-table .vhb-col-num {
    width: 2.6em;
    font-variant-numeric: tabular-nums;
    color: #4b5563;
}

.vhb-standings-table .vhb-diff {
    font-weight: 500;
}

/* Détail répartition points (tiers + final) */
.vhb-tt-detail {
    display: inline-block;
    margin-left: .35em;
    font-size: .8em;
    font-weight: 400;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

/* Scores par tiers dans le tableau des matchs */
.vhb-tt-scores {
    display: block;
    margin-top: 2px;
    font-size: .8em;
    color: #6b7280;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.vhb-standings-table tr.vhb-leader td {
    background: rgba(220,40,20,.04); /* léger rouge FFHB */
}

.vhb-standings-table tr.vhb-leader .vhb-col-rank {
    color: #dc2814;
    font-weight: 700;
}

.vhb-standings-footer {
    padding: .6em 1em;
    background: #fafafa;
    border-top: 1px solid #ececec;
    color: #6b7280;
    font-size: .8em;
}

.vhb-empty,
.vhb-error {
    padding: 1em;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.vhb-error {
    color: #dc2814;
    background: rgba(220,40,20,.05);
    border-radius: 4px;
}

/* Tableau des matchs (option matchs="1") */
.vhb-matches-details {
    border-top: 1px solid #ececec;
}

.vhb-matches-details summary {
    cursor: pointer;
    padding: .7em 1em;
    background: #fafafa;
    color: #003c64;
    font-weight: 500;
    user-select: none;
}

.vhb-matches-details summary:hover {
    background: #f0f2f6;
}

.vhb-matches-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88em;
}

.vhb-matches-table th {
    background: #f5f6f8;
    color: #003c64;
    padding: .5em .4em;
    text-align: left;
    font-size: .82em;
    text-transform: uppercase;
    border-bottom: 1px solid #ddd;
}

.vhb-matches-table td {
    padding: .45em .4em;
    border-bottom: 1px solid #f0f0f0;
}

.vhb-matches-table .vhb-score {
    text-align: center;
    font-weight: 600;
    color: #003c64;
    font-variant-numeric: tabular-nums;
}

/* Onglets pour [vhb_poules] */
.vhb-pools-wrapper {
    margin: 1.5em 0;
}

.vhb-pools-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #003c64;
    margin-bottom: 0;
}

.vhb-pool-tab {
    background: #fff;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: .5em 1em;
    cursor: pointer;
    font-size: .9em;
    color: #4b5563;
    border-radius: 4px 4px 0 0;
    font-family: inherit;
}

.vhb-pool-tab small {
    color: #6b7280;
    font-size: .85em;
}

.vhb-pool-tab:hover {
    background: #f5f6f8;
    color: #003c64;
}

.vhb-pool-tab.active {
    background: #003c64;
    color: #fff;
    border-color: #003c64;
}

.vhb-pool-tab.active small {
    color: rgba(255,255,255,.85);
}

.vhb-pool-panel {
    display: none;
}

.vhb-pool-panel.active {
    display: block;
}

/* Mobile */
@media (max-width: 600px) {
    .vhb-standings-table {
        font-size: .82em;
    }
    .vhb-standings-table .vhb-col-num {
        width: 2.2em;
        padding: .4em .2em;
    }
    .vhb-standings-table thead th {
        padding: .4em .2em;
        font-size: .75em;
    }
    /* Sur mobile, on cache les colonnes BM/BE pour ne garder que la Diff */
    .vhb-standings-table th:nth-child(8),
    .vhb-standings-table th:nth-child(9),
    .vhb-standings-table td:nth-child(8),
    .vhb-standings-table td:nth-child(9) {
        display: none;
    }
}
