/* =============================================
   VOLEJBAL HUB — STANDINGS TABLE
   Ligová tabulka styling (admin + public shared)
   ============================================= */

/* ── Toolbar ──────────────────────────────── */
.standings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.standings-toolbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.standings-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.standings-team-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.standings-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.standings-meta i { font-size: 14px; }

.standings-scrape-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Block wrapper ────────────────────────── */
.standings-block {
    margin-bottom: 32px;
}
.standings-block__title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-primary, var(--gray-800));
}
.standings-block__title i {
    font-size: 18px;
    color: var(--red, #C41E3A);
}

/* ── Table ─────────────────────────────────── */
.standings-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border, #E2E2DE);
    background: var(--bg-card, #fff);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.standings-table thead {
    background: var(--bg-subtle, #FAFAF9);
    border-bottom: 2px solid var(--border, #E2E2DE);
}

.standings-table th {
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #9C9C98);
    text-align: center;
    user-select: none;
}

.standings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light, #F1F1EF);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.standings-table tbody tr {
    transition: background 0.15s ease;
}
.standings-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Column widths ────────────────────────── */
.standings-col-pos {
    width: 42px;
    text-align: center !important;
}
.standings-col-team {
    text-align: left !important;
    min-width: 180px;
}
.standings-col-num {
    width: 44px;
}
.standings-col-ratio {
    width: 70px;
    font-size: 12px;
    color: var(--text-muted, #6B6B67);
}
.standings-col-pts {
    width: 48px;
    font-size: 14px;
}

/* ── Position badge ───────────────────────── */
.standings-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    background: var(--bg-subtle, #F1F1EF);
    color: var(--text-primary, #2D2D2B);
}

/* Top 3 positions */
.standings-table tbody tr:nth-child(1) .standings-pos {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
}
.standings-table tbody tr:nth-child(2) .standings-pos {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #fff;
}
.standings-table tbody tr:nth-child(3) .standings-pos {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #fff;
}

/* ── Team name ────────────────────────────── */
.standings-team-name,
.standings-team-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.standings-team-name {
    font-weight: 500;
}
.standings-team-logo {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    object-fit: contain; background: var(--bg-subtle, #F1F1EF);
    border: 1px solid var(--border-light, #E5E5E3);
    vertical-align: middle;
}
.standings-team-logo--placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--text-muted, #9B9B97);
}
.standings-star {
    font-size: 12px;
    color: var(--red, #C41E3A);
    margin-left: 4px;
    vertical-align: baseline;
}

/* ── Zone coloring ────────────────────────── */
.standings-row--ours {
    background: rgba(196, 30, 58, 0.04) !important;
}
.standings-row--ours .standings-team-name {
    font-weight: 700;
    color: var(--red, #C41E3A);
}
.standings-row--ours .standings-pos {
    background: var(--red, #C41E3A) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.standings-row--playoff-last td {
    border-bottom: 2px dashed var(--border, #E2E2DE) !important;
}

.standings-row--relegation {
    opacity: 0.6;
}

/* ── Win/Loss cell tints ──────────────────── */
.standings-win {
    color: #059669;
    font-weight: 600;
}
.standings-win-soft {
    color: #10B981;
}
.standings-loss-soft {
    color: #F59E0B;
}
.standings-loss {
    color: #DC2626;
    font-weight: 600;
}

/* ── Legend ────────────────────────────────── */
.standings-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 10px 0 0;
    font-size: 11px;
    color: var(--text-muted, #9C9C98);
}
.standings-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.standings-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.standings-legend__dot--playoff { background: #059669; }
.standings-legend__dot--relegation { background: #DC2626; }
.standings-legend__dot--ours { background: var(--red, #C41E3A); }
.standings-legend__explain {
    color: var(--text-muted, #9C9C98);
    font-style: italic;
    margin-left: auto;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .standings-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .standings-scrape-form {
        flex-direction: column;
        width: 100%;
    }
    .standings-scrape-form input {
        width: 100% !important;
    }
    .standings-col-ratio {
        display: none;
    }
    .standings-table th:nth-child(8),
    .standings-table th:nth-child(9),
    .standings-table td:nth-child(8),
    .standings-table td:nth-child(9) {
        display: none;
    }
    .standings-legend__explain {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .standings-col-num {
        width: 32px;
        padding: 8px 4px !important;
        font-size: 12px;
    }
    .standings-col-team {
        min-width: 120px;
    }
    .standings-table th, .standings-table td {
        padding: 8px 6px;
    }
}

/* ── Hover (pointer devices only) ── */
@media (hover: hover) {
    .standings-table tbody tr:hover {
        background: var(--bg-hover, rgba(0,0,0,0.02));
    }
}