.standings-container {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.standings-header {
    text-align: center;
    margin-bottom: 3rem;
}

.standings-header h1 {
    font-size: 2.5rem;
    color: #101B3A;
    margin-bottom: 0.5rem;
}

.standings-header h1 .fa-trophy {
    color: #D4AF37;
    margin-right: 0.5rem;
}

.standings-header h1 .fa-calendar-alt {
    color: #3B82F6;
    margin-right: 0.5rem;
}

.standings-header p {
    color: #666;
    font-size: 1.1rem;
}

.division-standings {
    margin-bottom: 3rem;
}

.division-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #3B82F6;
}

.division-title h2 {
    font-size: 1.75rem;
    color: #101B3A;
    margin: 0;
}

.next-match-date {
    font-size: 1.2rem;
    font-weight: 400;
    color: #666;
    margin-left: 0.5rem;
}

.division-link {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.division-link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Schedule table specific column widths */
.standings-table.schedule-table {
    table-layout: fixed;
    width: 100%;
}

.standings-table.schedule-table th:nth-child(1),
.standings-table.schedule-table td:nth-child(1) {
    width: 25%;
    padding: 0.75rem 0.5rem;
    text-align: left;
}

.standings-table.schedule-table th:nth-child(2),
.standings-table.schedule-table td:nth-child(2) {
    width: 25%;
    padding: 0.75rem 0.5rem;
    text-align: left;
}

.standings-table.schedule-table th:nth-child(3),
.standings-table.schedule-table td:nth-child(3) {
    width: 80px;
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
    text-align: center;
}

.standings-table.schedule-table th:nth-child(4),
.standings-table.schedule-table td:nth-child(4) {
    width: 50%;
    padding: 0.75rem;
    text-align: left;
}

/* Division content wrapper for schedule table and team info sidebar */
.division-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    grid-template-rows: auto auto;
    gap: 2rem;
    align-items: start;
}

.schedule-table-wrapper {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.team-info-sidebar {
    grid-column: 2;
    grid-row: 1 / 3; /* Span both rows to align with full schedule */
    width: 350px;
}

.full-schedule-section {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
}

/* Post-season: When schedule table is hidden, team panel takes full width */
.division-content-wrapper.post-season {
    grid-template-columns: 1fr;
}

.division-content-wrapper.post-season .team-info-sidebar {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
}

.division-content-wrapper.post-season .full-schedule-section {
    grid-column: 1;
    grid-row: 2;
}

/* Post-season + wide screen: prevent word wrapping of phone numbers */
@media (min-width: 1001px) {
    .division-content-wrapper.post-season .team-info-table td:nth-child(2) {
        white-space: nowrap;
    }
}

.team-info-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
}

.team-info-table thead {
    background: linear-gradient(90deg, #101B3A 0%, #3B82F6 100%);
    color: white;
}

.team-info-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-info-table th:nth-child(1) {
    width: 40%;
}

.team-info-table th:nth-child(2) {
    width: 45%;
}

.team-info-table th:nth-child(3) {
    width: 15%;
    text-align: center;
}

.team-info-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.team-info-table td:nth-child(1) {
    padding-left: 6px;
    padding-right: 0.75rem;
}

.team-info-table td:nth-child(3) {
    text-align: center;
}

.team-info-table .team-name-with-seed {
    padding-left: 18px;
    text-indent: -13px;
}

.team-info-table .team-name-with-seed .team-seed {
    font-weight: bold;
    display: inline;
}

.team-info-table tbody tr:hover {
    background-color: #f8f9fa;
}

.team-info-table tbody tr:last-child td {
    border-bottom: none;
}

.team-info-table .roster-icon {
    color: #3B82F6;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.team-info-table .roster-icon:hover {
    color: #1e3a8a;
}

.standings-table thead {
    background: linear-gradient(90deg, #101B3A 0%, #3B82F6 100%);
    color: white;
}

.standings-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standings-table th:first-child {
    width: 60px;
    text-align: center;
}

.standings-table th:nth-child(2) {
    width: auto;
}

.standings-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.standings-table tbody tr {
    transition: background-color 0.2s ease;
}

.standings-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.rank {
    font-weight: 700;
    color: #101B3A;
    text-align: center;
    font-size: 1.1rem;
}

.team-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.stats {
    color: #666;
    font-size: 0.9rem;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
}

.quick-division-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.division-quick-link {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.division-quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3B82F6;
}

.division-quick-link h3 {
    margin: 0 0 0.5rem 0;
    color: #101B3A;
    font-size: 1.25rem;
}

.division-quick-link i {
    font-size: 2rem;
    color: #3B82F6;
    margin-bottom: 0.5rem;
}

/* Full Schedule Section */
.full-schedule-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 3px solid #e5e7eb;
}

.full-schedule-section h3 {
    font-size: 1.75rem;
    color: #101B3A;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #3B82F6;
}

.full-schedule-week {
    margin-bottom: 2.5rem;
}

.full-schedule-week:last-child {
    margin-bottom: 0;
}

.full-schedule-week-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: #101B3A;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.full-schedule-week-table {
    margin-bottom: 0;
}

/* Team info sidebar responsive: full width on screens < 1000px */
@media (max-width: 999px) {
    .division-content-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .team-info-sidebar {
        width: 100%;
        order: 2; /* Team Info appears after Next Matches */
    }
    
    .schedule-table-wrapper {
        order: 1; /* Next Matches appears first */
    }
    
    .full-schedule-section {
        order: 3; /* Full Schedule appears last */
    }
    
    .team-info-table {
        table-layout: auto;
    }
}

@media (max-width: 768px) {
    .standings-header h1 {
        font-size: 2rem;
    }
    
    .standings-table {
        font-size: 0.9rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .division-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
        .quick-division-links {
            grid-template-columns: 1fr;
        }
        
        .standings-table .team-name {
            font-size: 0.85rem;
        }
        
        /* Abbreviate column headers on mobile */
        .standings-table th[data-mobile] {
            font-size: 0;
            position: relative;
        }
        
        .standings-table th[data-mobile]::before {
            content: attr(data-mobile);
            font-size: 0.95rem;
        }
    }

.game-results-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 3px solid #e5e7eb;
}

.game-results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.game-results-header h2 {
    font-size: 2rem;
    color: #101B3A;
    margin-bottom: 0.5rem;
}

.game-results-by-date {
    margin-bottom: 3rem;
}

.date-header {
    background: linear-gradient(90deg, #101B3A 0%, #3B82F6 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.games-by-division {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.division-games {
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.division-games:last-child {
    border-bottom: none;
}

.division-games-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #101B3A;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.game-result {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    max-width: 770px; /* Limit width on desktop */
}

.game-result:last-child {
    border-bottom: none;
}

.game-teams {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.team-score {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0; /* Allows flex item to shrink below content size */
    max-width: 250px; /* Limit width on desktop */
}

.team-name {
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-name.winner {
    color: #3B82F6;
}

.set-scores {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.9rem;
    color: #666;
}

.set-score {
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.set-score .winner-score {
    color: #10b981;
    font-weight: 600;
}

.vs {
    color: #999;
    font-weight: 500;
}

.home-team-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    /* Tighten vertical spacing for game results on mobile */
    .game-result {
        padding: 0.4rem 0;
        max-width: none; /* Remove desktop width constraint on mobile */
    }
    
    .game-teams {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .team-score {
        max-width: none; /* Remove desktop width constraint on mobile */
    }
    
    .team-score:first-of-type {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Home team wrapper keeps "at" and home team on same line */
    .home-team-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding-left: 22px;
        margin-top: 0;
    }
    
    .home-team-wrapper .vs {
        margin: 0;
        flex-shrink: 0;
    }
    
    .home-team-wrapper .team-score {
        flex: 1;
    }
    
    .set-scores {
        margin-left: 0;
        margin-top: 0.25rem;
        width: 100%;
        padding-left: 22px;
    }
}

/* Roster Modal Styles */
.roster-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.roster-modal-backdrop.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.roster-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.roster-modal-header {
    background: linear-gradient(90deg, #101B3A 0%, #3B82F6 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roster-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.roster-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.roster-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.roster-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.roster-modal-content p {
    margin: 0 0 1rem 0;
}

.roster-modal-content p:last-child {
    margin-bottom: 0;
}

.roster-modal-content strong {
    color: #101B3A;
    font-weight: 600;
}
