/* =========================================================
   SportStream Football Standings – Frontend Styles v2.1
   ========================================================= */

:root {
    --fs-primary: #2563eb;
    --fs-primary-hover: #1d4ed8;
    --fs-bg: #f1f5f9;
    --fs-card: #ffffff;
    --fs-text: #0f172a;
    --fs-text-muted: #64748b;
    --fs-border: #e2e8f0;
    --fs-radius: 14px;
    --fs-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --fs-shadow-hover: 0 8px 24px rgba(37, 99, 235, 0.12);
    --fs-positive: #16a34a;
    --fs-negative: #dc2626;
    --fs-top: #eff6ff;
    --fs-bottom: #fef2f2;
}

/* ---------- Leagues List ---------- */

.fs-leagues-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fs-header {
    margin-bottom: 28px;
}

.fs-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--fs-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.fs-leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.fs-league-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--fs-card);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--fs-text);
    font-weight: 500;
    font-size: 0.98rem;
    transition: all 0.22s ease;
    box-shadow: var(--fs-shadow);
}

.fs-league-card:hover {
    border-color: var(--fs-primary);
    box-shadow: var(--fs-shadow-hover);
    transform: translateY(-3px);
    color: var(--fs-primary);
}

.fs-league-name {
    flex: 1;
    line-height: 1.35;
}

.fs-league-arrow {
    font-size: 1.15rem;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.fs-league-card:hover .fs-league-arrow {
    opacity: 1;
}

/* ---------- Standings Page ---------- */

.fs-league-page {
    padding: 32px 16px 48px;
    background: var(--fs-bg);
    min-height: 65vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fs-container {
    max-width: 920px;
    margin: 0 auto;
}

.fs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--fs-primary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.fs-back:hover {
    opacity: 0.8;
}

.fs-back-icon {
    font-size: 1.1rem;
}

/* ---------- Standings Table ---------- */

.fs-standings-wrapper {
    background: var(--fs-card);
    border-radius: 18px;
    padding: 8px 0 12px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--fs-border);
    overflow: hidden;
}

.fs-standings-header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--fs-border);
}

.fs-league-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--fs-text);
    letter-spacing: -0.01em;
}

.fs-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fs-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.fs-standings-table thead th {
    background: #f8fafc;
    padding: 13px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--fs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--fs-border);
    white-space: nowrap;
}

.fs-standings-table thead th.fs-col-team {
    text-align: start;
    padding-inline-start: 16px;
}

.fs-standings-table tbody td {
    padding: 13px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.fs-standings-table tbody tr:last-child td {
    border-bottom: none;
}

.fs-standings-table tbody tr:hover {
    background: #f8fafc;
}

/* Rank */
.fs-rank {
    width: 48px;
}

.fs-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--fs-text-muted);
    background: #f1f5f9;
}

/* Top 4 highlight */
.fs-row-top .fs-rank-num {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Bottom / relegation zone */
.fs-row-bottom .fs-rank-num {
    background: #fee2e2;
    color: #b91c1c;
}

/* Team cell */
.fs-team {
    text-align: start !important;
    padding-inline-start: 16px !important;
}

.fs-team {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--fs-text);
}

.fs-team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.fs-team-name {
    line-height: 1.3;
}

/* Points */
.fs-points {
    font-size: 1.02rem;
    color: var(--fs-text);
}

.fs-col-pts {
    min-width: 56px;
}

/* Goal difference colors */
.fs-positive {
    color: var(--fs-positive);
    font-weight: 500;
}

.fs-negative {
    color: var(--fs-negative);
    font-weight: 500;
}

/* Error state */
.fs-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 18px 20px;
    border-radius: 12px;
    text-align: center;
    margin: 16px 20px;
    font-size: 0.95rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .fs-leagues-grid {
        grid-template-columns: 1fr;
    }

    .fs-main-title {
        font-size: 1.45rem;
    }

    .fs-league-title {
        font-size: 1.2rem;
    }

    .fs-standings-table {
        font-size: 0.85rem;
    }

    .fs-standings-table thead th,
    .fs-standings-table tbody td {
        padding: 11px 8px;
    }

    .fs-team-name {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fs-team-logo {
        width: 24px;
        height: 24px;
    }

    .fs-standings-header {
        padding: 18px 16px 14px;
    }
}

/* Very small screens – hide some columns if needed */
@media (max-width: 400px) {
    .fs-standings-table thead th:nth-child(6),
    .fs-standings-table tbody td:nth-child(6) {
        /* Lost column – optional hide */
    }
}
