/* ========================================================================
   VS Footy Stats — League Detail Page
   ======================================================================== */

/* ── Hero ── */
.vfs-l-hero__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 18px;
}

.vfs-l-hero__flag {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.vfs-l-hero__badge {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.vfs-l-hero__name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 4px;
    line-height: 1.2;
}

.vfs-l-hero__country {
    font-size: 0.82rem;
    color: #999;
    font-weight: 500;
}

.vfs-l-hero__info {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.78rem;
    color: #999;
    font-weight: 500;
}

.vfs-l-hero__info strong {
    color: #1a1a2e;
    font-weight: 700;
}

/* ── Two-column layout ── */
.vfs-league-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.vfs-league-main {
    flex: 1;
    min-width: 0;
}

.vfs-league-sidebar {
    width: 440px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h, 0px) + 16px);
    max-height: calc(100vh - var(--header-h, 0px) - 32px);
    overflow-y: auto;
}

/* ── Stat grid ── */
.vfs-l-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.vfs-l-stat-wide {
    grid-column: 1 / -1;
}

/* ── Text color (stat values) ── */
.vfs-l-tc--excellent { color: #1a7f37; font-weight: 700; }
.vfs-l-tc--good      { color: #3d8b37; font-weight: 700; }
.vfs-l-tc--average   { color: #b08830; font-weight: 700; }
.vfs-l-tc--poor      { color: #cf222e; font-weight: 700; }

/* ── Goal distribution bars ── */
.vfs-l-goal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.vfs-l-dist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.vfs-l-dist-row:last-child {
    margin-bottom: 0;
}

.vfs-l-dist-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #666;
    min-width: 56px;
}

.vfs-l-dist-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 36px;
    text-align: right;
}

/* ── Mini tables grid (Over/Under/FHG/2HG, Corners/Cards) ── */
.vfs-l-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.vfs-l-mini-table {
    min-width: 0;
}

.vfs-l-mini-table__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
    margin-bottom: 8px;
}

/* ── Average boxes (Corners/Cards summary) ── */
.vfs-l-avg-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    background: #f0f2f5;
    border-radius: 8px;
    margin-bottom: 10px;
}

.vfs-l-avg-box__val {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a2e;
}

.vfs-l-avg-box__label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
}

.vfs-l-avg-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.vfs-l-avg-split > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    background: #f0f2f5;
    border-radius: 8px;
}

.vfs-l-avg-split .vfs-l-avg-box__val {
    font-size: 1rem;
}

/* ── Upcoming / Fixtures (reuses vfs-mi layout from stats page) ── */
.vfs-mi {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background 0.1s;
}
.vfs-mi:hover {
    background: rgba(0,0,0,0.015);
}
.vfs-mi:last-child {
    border-bottom: none;
}
.vfs-mi-time {
    font-size: 0.65rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
}
.vfs-mi-teams {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vfs-mi-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.vfs-mi-team--away {
    text-align: right;
}
.vfs-mi-team__text {
    flex: 1;
    min-width: 0;
}
.vfs-mi-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0,0,0,0.04);
    flex-shrink: 0;
}
.vfs-mi-badge--ph {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0,0,0,0.06);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #999;
}
.vfs-mi-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vfs-mi-name--away {
    text-align: right;
}
.vfs-mi-form {
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    background: #f0f2f5;
    padding: 3px 6px;
    border-radius: 5px;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}
.vfs-mi-centre {
    flex-shrink: 0;
    min-width: 52px;
    text-align: center;
}
.vfs-mi-score {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 1px;
}

/* ── Player leaders grid ── */
.vfs-l-leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.vfs-l-leader-col {
    min-width: 0;
}

.vfs-l-leader-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
    margin: 0 0 10px;
}

.vfs-l-leader-bar {
    display: block;
    position: relative;
    padding: 7px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}

.vfs-l-leader-bar:hover {
    opacity: 0.8;
}

.vfs-l-leader-bar__fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(35, 153, 84, 0.1);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.vfs-l-leader-bar__text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Scorers table ── */
.vfs-l-scorer-row {
    cursor: pointer;
    transition: background 0.1s;
}

.vfs-l-scorer-row:hover td {
    background: rgba(0,0,0,0.02);
}

.vfs-l-scorer-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vfs-l-scorer-club {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #666;
}

.vfs-l-flag {
    width: 18px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.vfs-l-mini-badge {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── League table ── */
.vfs-l-league-table th,
.vfs-l-league-table td {
    padding: 8px 6px;
    white-space: nowrap;
}

.vfs-l-table-row {
    cursor: pointer;
    transition: background 0.1s;
}

.vfs-l-table-row:hover td {
    background: rgba(0,0,0,0.02);
}

.vfs-l-table-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1a1a2e;
}

.vfs-l-col-gf { color: #239954 !important; font-weight: 700 !important; }
.vfs-l-col-ga { color: #c85f46 !important; font-weight: 700 !important; }
.vfs-l-col-pts { font-weight: 800 !important; color: #1a1a2e !important; }

.vfs-l-form-cell {
    display: flex;
    gap: 2px;
}

/* ── Error state ── */
.vfs-l-error {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
    font-size: 0.95rem;
}

/* ── Responsive ── */
@media (max-width: 1023px) {
    .vfs-l-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vfs-league-layout {
        flex-direction: column;
    }

    .vfs-league-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }

    .vfs-l-leaders-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .vfs-l-hero__name {
        font-size: 1.15rem;
    }

    .vfs-l-hero__flag,
    .vfs-l-hero__badge {
        width: 44px;
        height: 44px;
    }

    .vfs-l-goal-grid {
        grid-template-columns: 1fr;
    }

    .vfs-l-tables-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Upcoming matches: club links & form row ── */
.vfs-mi-club-link {
    color: inherit;
    text-decoration: none;
}
.vfs-mi-club-link:hover .vfs-mi-name {
    color: #4A7FFF;
    text-decoration: underline;
}
.vfs-mi-form-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px 0;
}
.vfs-l-form-badges {
    display: flex;
    gap: 3px;
    font-size: 0.65rem;
}
