/* League Tables Styles */

/* Hide specific columns on mobile */
@media screen and (max-width: 768px) {
    .division-table .hide-mobile,
    .division-table th.hide-mobile,
    .division-table td.hide-mobile {
        display: none;
    }
}
.division-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    font-size: 12px;
    font-family: 'Bio Sans';
}

.division-table caption {
    background-color: var(--primary);
    color: white;
    padding: 12px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

.division-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    padding: 8px 5px;
    border-bottom: 2px solid #ddd;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
}

.division-table td:nth-child(even),
.division-table th:nth-child(even) {
    background-color: #f8f9fa;
}

.division-table td:nth-child(odd),
.division-table th:nth-child(odd) {
    background-color: #ffffff;
}

.division-table td {
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

/* Combined W/L column styles */
.division-table th.team-match-won,
.division-table td.team-match-won {
    /* min-width: 80px; */
    font-variant-numeric: tabular-nums;
}

.division-table th.team-name,
.division-table td.team-name {
    width: 25%;
}

.division-table th.team-match-won-wo,
.division-table td.team-match-won-wo {
    width: 100px;
}


.division-table th.team-match-won br + br {
    display: none;
}

.division-table th.team-match-won br + * {
    margin-top: 2px;
}

.division-table td.team-match-won {
    letter-spacing: 1px;
    position: relative;
}

.percentage-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 600;
}

.percentage-badge.success {
    background-color: #e6f4ea;
    color: #1e7e34;
}

.percentage-badge.danger {
    background-color: #fbe9e7;
    color: #dc3545;
}

.division-label {
    display: inline;
    /* margin-left: 6px; */
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
    vertical-align: baseline;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }
    
    .desktop-only {
        display: none;
    }

    .division-table th {
        padding: 4px 1px;
        font-size: 10px;
    }

    .division-table td {
        padding: 4px 1px;
        font-size: 10px;
    }

    .percentage-badge {
        font-size: 10px;
        padding: 0 2px;
        margin-left: 1px;
    }

    .mobile-break br {
        display: block;
    }
    
    /* Make team links more visible */
    .team-link {
        font-size: 1.05em;
    }

    .division-table th.team-match-won-wo,
    .division-table td.team-match-won-wo {
        width: 75px;
    }
}

.division-table tr:last-child td {
    border-bottom: none;
}

.division-table tr:hover {
    background-color: #f5f5f5;
}

/* Team name column is left-aligned */
.team-name {
    text-align: left !important;
    font-weight: 600;
    /* width: 40%;
    min-width: 180px;
    max-width: 100%; */
    white-space: normal;
}

/* Rank and points columns are bold */
.team-rank, .team-points {
    font-weight: bold;
}

.team-rank {
    background: #fff4df !important;
    color: #a65c00;
    /* border-radius: 4px; */
    font-weight: bold;
    padding: 6px 0;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .full-text {
        display: none;
    }
    
    .short-text {
        display: inline;
    }
    
    .division-table th, 
    .division-table td {
        padding: 4px 2px;
        font-size: 10px;
        white-space: nowrap;
    }
    
    /* Hide WO column on mobile */
    .team-walkover {
        display: none;
    }
    
    /* Make team name column take most of the space */
    .team-name {
        /* width: auto; */
        min-width: 40%;
        /* max-width: none; */
    }
    
    /* Make all other columns very compact */
    .team-rank, .team-played, .team-won, .team-lost,
    .team-match-diff, .team-game-won, .team-game-diff,
    .team-win-percent, .team-points {
        width: 28px;
        min-width: 0;
        max-width: 8%;
        padding: 4px 1px;
    }
    
    /* Specifically make the G W/L column more compact */
    .team-game-won {
        max-width: 7%;
        padding: 4px 1px;
        letter-spacing: -0.5px;
    }
}

/* Desktop view */
@media (min-width: 769px) {
    .full-text {
        display: inline;
    }
    
    .short-text {
        display: none;
    }
}

/* Highlight for positive and negative values */
.positive {
    color: #2ecc71;
}

.negative {
    color: #e74c3c;
}

/* Combined standings styles */
.combined-standings {
    margin-bottom: 60px;
}

.combined-standings caption {
    background-color: #f39c12;
    color: white;
}

.team-division {
    font-weight: 500;
    color: #2c3e50;
}

.view-toggle {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.section-subtitle {
    text-align: center;
    margin: 30px 0;
    color: #2c3e50;
    font-size: 1.8rem;
}

/* Sortable table styles */
th.sortable {
    position: relative;
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: rgba(0,0,0,0.05);
}

.sort-indicator {
    display: inline-block;
    margin-left: 3px;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

th[data-sort-direction="asc"] .sort-indicator,
th[data-sort-direction="desc"] .sort-indicator {
    opacity: 1 !important;
    color: #f39c12;
}
