/**
 * K2 Standings Frontend Styles
 * Styling per lo shortcode [k2_standings]
 */

/* ===== Container ===== */
.k2-standings-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.k2-standings-header {
    margin-bottom: 16px;
}

.k2-standings-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

/* ===== Table wrapper ===== */
.k2-standings-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Table base ===== */
.k2-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.4;
    table-layout: fixed;
}

/* ===== Header ===== */
.k2-standings-table thead {
    background: #1e293b;
    color: #fff;
}

.k2-standings-table thead th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    border-bottom: 2px solid #334155;
}

.k2-standings-table thead th.k2-col-position {
    width: 40px;
}

.k2-standings-table thead th.k2-col-team {
    text-align: left;
    padding-left: 14px;
    width: 190px;
}

/* ===== Rows ===== */
.k2-standings-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
}

.k2-standings-table tbody tr:last-child {
    border-bottom: none;
}

.k2-standings-table tbody tr:hover {
    filter: brightness(1.15);
}

.k2-standings-table td {
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ===== Bordo separatore tra zone ===== */
.k2-zone-border {
    border-bottom: 2.5px solid #4ade80 !important;
}

.k2-zone-playin.k2-zone-border {
    border-bottom: 2.5px solid #fb923c !important;
}

/* ===== Position column ===== */
.k2-col-position {
    font-weight: 700;
    text-align: center;
    width: 40px;
    font-size: 13px;
    color: #fff;
}

.k2-zone-playoff .k2-col-position {
    background: #16a34a;
}

.k2-zone-playin .k2-col-position {
    background: #ea580c;
}

.manual-pos {
    font-size: 9px;
    vertical-align: super;
    margin-right: 1px;
}

/* ===== Team column ===== */
.k2-col-team {
    text-align: left !important;
    overflow: hidden;
    white-space: nowrap;
    padding-left: 10px !important;
}

.k2-team-cell {
    display: flex;
    align-items: center;
}

.k2-team-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 10px;
}

.k2-team-link:hover .k2-team-name {
    color: #2563eb;
}

.k2-team-logo {
    width: 26px !important;
    height: 26px !important;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.k2-team-name {
    font-weight: 600;
    font-size: 13px;
    transition: color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* ===== W/L columns ===== */
.k2-col-wins {
    font-weight: 700;
    color: #fff;
}

.k2-col-losses {
    font-weight: 700;
    color: #fff;
}

/* ===== Stat columns ===== */
.k2-col-pct,
.k2-col-gb {
    font-weight: 600;
}

.k2-col-conf,
.k2-col-other,
.k2-col-home,
.k2-col-road,
.k2-col-l10 {
    font-size: 12px;
    opacity: 0.8;
}

.k2-col-pf,
.k2-col-ps,
.k2-col-ppg,
.k2-col-papg {
    font-size: 12px;
    opacity: 0.8;
}

/* ===== Streak badge ===== */
.k2-col-streak {
    text-align: center;
}

.k2-streak {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.k2-streak-w {
    background: #14532d;
    color: #4ade80;
}

.k2-streak-l {
    background: #450a0a;
    color: #f87171;
}

/* ===== Diff columns ===== */
.k2-col-diff,
.k2-col-diffpg {
    font-weight: 600;
}

.k2-col-diff.positive,
.k2-col-diffpg.positive {
    color: #4ade80;
}

.k2-col-diff.negative,
.k2-col-diffpg.negative {
    color: #f87171;
}

/* ===== Sortable headers ===== */
.k2-standings-table thead th {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.k2-standings-table thead th:hover {
    background: #334155;
}

.k2-sort-arrow {
    font-size: 9px;
    margin-left: 3px;
    opacity: 0.7;
}

/* ===== Footer ===== */
.k2-standings-footer {
    margin-top: 10px;
    text-align: right;
    opacity: 0.5;
    font-size: 11px;
}

.k2-standings-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.5;
    font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .k2-standings-table {
        font-size: 11px;
    }

    .k2-standings-table thead th {
        padding: 8px 5px;
        font-size: 9px;
    }

    .k2-standings-table td {
        padding: 6px 4px;
    }

    .k2-team-logo {
        width: 20px !important;
        height: 20px !important;
    }

    .k2-team-name {
        font-size: 11px;
    }

    .k2-team-link {
        gap: 6px;
    }

    .k2-col-team {
        min-width: auto;
    }

    .k2-col-conf,
    .k2-col-other,
    .k2-col-home,
    .k2-col-road,
    .k2-col-l10,
    .k2-col-pf,
    .k2-col-ps,
    .k2-col-ppg,
    .k2-col-papg {
        font-size: 10px;
    }

    .k2-streak {
        padding: 1px 5px;
        font-size: 10px;
    }

    .k2-col-position {
        width: 28px;
        font-size: 11px;
    }
}
