/* League Standings Table Scroll Fix */
.league-standings-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background: linear-gradient(135deg, rgba(13, 20, 33, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
    border-radius: 20px;
    padding: 20px;
}

.league-standings-table {
    min-width: 900px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    margin: 0;
    background: transparent;
}

.league-standings-table th,
.league-standings-table td {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
    border: none;
    white-space: nowrap;
}

/* Table Header */
.league-standings-table thead th {
    padding: 15px 20px;
    text-align: left;
    color: #45F882;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Column Widths */
.league-standings-table th:nth-child(1) { width: 60px; }  /* POS */
.league-standings-table th:nth-child(2) { width: 300px; } /* Team */
.league-standings-table th:nth-child(3) { width: 60px; }  /* P */
.league-standings-table th:nth-child(4) { width: 60px; }  /* W */
.league-standings-table th:nth-child(5) { width: 60px; }  /* D */
.league-standings-table th:nth-child(6) { width: 60px; }  /* L */
.league-standings-table th:nth-child(7) { width: 80px; }  /* GD */
.league-standings-table th:nth-child(8) { width: 80px; }  /* PTS */

/* Table Body */
.league-standings-table tbody td {
    padding: 12px 20px;
    color: #ffffff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Team Column */
.team-column {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    padding: 0;
}

.team-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.team-name {
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-size: 13px;
    display: block;
}

/* Numbers Columns */
.number-column {
    text-align: center;
    min-width: 40px;
}

/* Points Column */
.points-column {
    font-weight: 700;
    color: #45F882;
    text-align: center;
}

/* Goal Difference Column */
.gd-column {
    color: #45F882;
    text-align: center;
}

/* Position Column */
.position-column {
    font-weight: 700;
    text-align: center;
    min-width: 40px;
}

/* Scroll Indicators */
.scroll-indicator {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    background: rgba(69, 248, 130, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #45F882;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

.league-standings-wrapper:hover .scroll-indicator {
    opacity: 1;
}

/* Grid Layout */
.standings-header-row,
.standings-data-row {
    display: grid;
    grid-template-columns: 60px minmax(200px, 1fr) 60px 60px 60px 60px 80px 80px 80px 80px;
    gap: 10px;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    /* Hide less important columns on tablets */
    .standings-header-row > *:nth-child(n+7),
    .standings-data-row > *:nth-child(n+7) {
        display: none;
    }
    
    /* Show only important columns */
    .standings-header-row > *:nth-child(-n+6),
    .standings-data-row > *:nth-child(-n+6) {
        display: table-cell;
    }
    .league-standings-wrapper {
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }

    .standings-header-row,
    .standings-data-row {
        grid-template-columns: 40px minmax(150px, 1fr) 45px 45px 45px 45px;
    }

    .league-standings-table th,
    .league-standings-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .team-column {
        gap: 8px;
    }

    .team-name {
        font-size: 13px;
        max-width: 120px;
    }

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

    .number-column,
    .points-column,
    .gd-column {
        font-size: 13px;
    }

    .position-column {
        font-weight: 700;
        font-size: 13px;
    }

@media (max-width: 480px) {
    .standings-header-row,
    .standings-data-row {
        grid-template-columns: 35px minmax(120px, 1fr) 40px 40px;
    }
    /* Hide more columns on mobile */
    .standings-header-row > *:nth-child(n+5),
    .standings-data-row > *:nth-child(n+5) {
        display: none;
    }

    /* Show only essential columns */
    .standings-header-row > *:nth-child(-n+4),
    .standings-data-row > *:nth-child(-n+4) {
        display: table-cell;
    }

    /* Adjust min-width for better mobile view */
    .league-standings-table {
        min-width: 400px;
    }

    /* Adjust column widths for the visible columns */
    .league-standings-table th:nth-child(1) { width: 40px; }  /* POS */
    .league-standings-table th:nth-child(2) { width: 200px; } /* Team */
    .league-standings-table th:nth-child(3) { width: 40px; }  /* P */
    .league-standings-table th:nth-child(4) { width: 40px; }  /* W */
    .league-standings-wrapper {
        padding: 15px;
        margin: 0 -15px;
        border-radius: 0;
    }

    .league-standings-table {
        min-width: 800px; /* Keep more width on mobile */
    }
    
    /* Adjust column widths for mobile */
    .league-standings-table th:nth-child(1) { width: 50px; }  /* POS */
    .league-standings-table th:nth-child(2) { width: 250px; } /* Team */
    .league-standings-table th:nth-child(3) { width: 50px; }  /* P */
    .league-standings-table th:nth-child(4) { width: 50px; }  /* W */
    .league-standings-table th:nth-child(5) { width: 50px; }  /* D */
    .league-standings-table th:nth-child(6) { width: 50px; }  /* L */
    .league-standings-table th:nth-child(7) { width: 70px; }  /* GD */
    .league-standings-table th:nth-child(8) { width: 70px; }  /* PTS */

    .league-standings-table thead th,
    .league-standings-table tbody td {
        padding: 10px;
        font-size: 13px;
    }

    .team-column {
        min-width: 150px;
    }

    .team-logo {
        width: 25px;
        height: 25px;
    }

    /* Show scroll indicators on mobile */
    .scroll-indicator {
        opacity: 0.8;
    }
}

/* Zebra striping for rows */
.league-standings-table tbody tr:nth-child(odd) {
    background: rgba(69, 248, 130, 0.05);
}

/* Hover effect */
.league-standings-table tbody tr:hover {
    background: rgba(69, 248, 130, 0.1);
}
