main.league-details {
    width: 100vw;
    background: var(--DefaultBackgroundColor);
    display: flex;
    justify-content: center;
}

/* Main content container */
main.league-details .main-content {
    display: flex;
    flex-direction: column;
    width: 70%;
    padding: 20px 0;
}

main.league-details .league-details-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* League Header Section */
main.league-details .league-header {
    width: 100%;
    background: var(--CardBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

/* League Info - Top Part */
main.league-details .league-info {
    display: flex;
    align-items: center;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

main.league-details .league-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    background: var(--LightBackgroundColor);
}

main.league-details .league-text {
    flex: 1;
}

main.league-details .league-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--TextDefaultColor);
}

main.league-details .country-name {
    font-size: 1rem;
    color: var(--DarkTextColor);
    margin: 4px 0 0 0;
}

/* Year Filter */
main.league-details .year-filter select {
    padding: 10px 40px 10px 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--TextDefaultColor);
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath fill='none' d='M15 0H0v15h15z'/%3E%3Cpath fill='%23717171' d='M.3 1.71L2.886 4.3a1 1 0 0 0 1.41 0l2.59-2.59A1 1 0 0 0 6.176 0H1a1 1 0 0 0-.7 1.71z' transform='rotate(180 5.54 4.796)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px 15px;;
}

main.league-details .year-filter select:hover {
    background-color: var(--DarkCardBackgroundColor);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath fill='none' d='M15 0H0v15h15z'/%3E%3Cpath fill='%23717171' d='M.3 1.71L2.886 4.3a1 1 0 0 0 1.41 0l2.59-2.59A1 1 0 0 0 6.176 0H1a1 1 0 0 0-.7 1.71z' transform='rotate(180 5.54 4.796)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px 15px;
}

main.league-details .year-filter select:focus {
    border-color: var(--DarkTextColor);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath fill='none' d='M15 0H0v15h15z'/%3E%3Cpath fill='%23717171' d='M.3 1.71L2.886 4.3a1 1 0 0 0 1.41 0l2.59-2.59A1 1 0 0 0 6.176 0H1a1 1 0 0 0-.7 1.71z' transform='rotate(180 5.54 4.796)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px 15px;
}

/* League Navigation */
main.league-details .league-navigation {
    display: flex;
    gap: 0;
}

main.league-details .league-navigation .nav-link {
    flex: 1;
    text-align: center;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--DarkTextColor);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

main.league-details .league-navigation .nav-link:hover {
    color: var(--TextDefaultColor);
    background: var(--FooterBackgroundColor);
}

main.league-details .league-navigation .nav-link.active {
    color: var(--TextDefaultColor);
    border-bottom-color: var(--TextDefaultColor);
    background: var(--FooterBackgroundColor);
}

/* Content Sections */
main.league-details .league-content {
    width: 100%;
    min-height: 400px;
}

main.league-details .content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

main.league-details .content-section.active {
    display: block;
}

main.league-details .content-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--TextDefaultColor);
}

main.league-details .content-section p {
    color: var(--DarkTextColor);
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= OVERVIEW SECTION ============= */
main.league-details .overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

main.league-details .overview-left,
main.league-details .overview-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Standings Table */
main.league-details .standings-container {
    padding: 20px;
}

main.league-details .standings-container h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--TextDefaultColor);
}

main.league-details .standings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

main.league-details .standings-table .small-column {
    width: 40px;
    text-align: center;
}

main.league-details .standings-table .column {
    width: auto;
}

main.league-details .standings-table .form-column {
    width: 120px;
    text-align: center;
}

main.league-details .standings-table thead tr.title th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--DarkTextColor);
    padding: 6px 8px;
    text-align: center;
}

main.league-details .standings-table thead tr.title th.team {
    text-align: left;
}

main.league-details .standings-table tbody tr.row,
main.league-details .standings-table tbody tr.top {
    background: var(--FooterBackgroundColor);
    cursor: pointer;
    transition: background 0.2s;
}

main.league-details .standings-table tbody tr.top {
    background: rgba(34, 197, 94, 0.15);
}

main.league-details .standings-table tbody tr.row:hover,
main.league-details .standings-table tbody tr.top:hover {
    background: var(--DarkCardBackgroundColor);
}

main.league-details .standings-table tbody tr td {
    padding: 10px 8px;
    font-size: 0.85rem;
}

main.league-details .standings-table tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
}

main.league-details .standings-table tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
}

main.league-details .standings-table .team {
    display: flex;
    align-items: center;
    gap: 8px;
}

main.league-details .standings-table .team img {
    width: 18px;
    height: 18px;
}

/* Form Boxes */
main.league-details .form-boxes {
    display: flex;
    gap: 4px;
    justify-content: center;
}

main.league-details .form-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--LightTextColor);
}

main.league-details .form-box.W {
    background: var(--WinColor);
}

main.league-details .form-box.D {
    background: var(--DrawColor);
}

main.league-details .form-box.L {
    background: var(--LossColor);
}

/* Top Players Section */
main.league-details .top-players-container {
    padding: 20px;
}

main.league-details .top-players-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

main.league-details .top-player-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--TextDefaultColor);
}

main.league-details .player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

main.league-details .player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--FooterBackgroundColor);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

main.league-details .player-item:hover {
    background: var(--DarkCardBackgroundColor);
    cursor: pointer;
}

main.league-details .player-rank {
    font-weight: 700;
    color: var(--DarkTextColor);
    width: 20px;
    text-align: center;
}

main.league-details .player-item img {
    width: 24px;
    height: 24px;
}

main.league-details .player-name {
    flex: 1;
    font-weight: 500;
}

main.league-details .player-stat {
    font-weight: 700;
    color: var(--TextDefaultColor);
}

/* ============= TABLE SECTION ============= */
main.league-details .table-container {
    padding: 20px;
}

main.league-details .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

main.league-details .table-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--TextDefaultColor);
}

main.league-details .table-filters {
    display: flex;
    gap: 8px;
}

main.league-details .filter-btn {
    padding: 8px 16px;
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--TextDefaultColor);
    cursor: pointer;
    transition: all 0.2s;
}

main.league-details .filter-btn:hover {
    background: var(--DarkCardBackgroundColor);
}

main.league-details .filter-btn.active {
    background: var(--DarkCardBackgroundColor);
    border-color: var(--TextDefaultColor);
}

main.league-details .full-standings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

main.league-details .full-standings-table .small-column {
    width: 40px;
    text-align: center;
}

main.league-details .full-standings-table .column {
    width: auto;
}

main.league-details .full-standings-table .form-column {
    width: 120px;
    text-align: center;
}

main.league-details .full-standings-table thead tr.title th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--DarkTextColor);
    padding: 6px 8px;
    text-align: center;
}

main.league-details .full-standings-table thead tr.title th.team {
    text-align: left;
}

main.league-details .full-standings-table tbody tr.row,
main.league-details .full-standings-table tbody tr.top {
    background: var(--FooterBackgroundColor);
    cursor: pointer;
    transition: background 0.2s;
}

main.league-details .full-standings-table tbody tr.top {
    background: rgba(34, 197, 94, 0.15);
}

main.league-details .full-standings-table tbody tr.row:hover,
main.league-details .full-standings-table tbody tr.top:hover {
    background: var(--DarkCardBackgroundColor);
}

main.league-details .full-standings-table tbody tr td {
    padding: 10px 8px;
    font-size: 0.85rem;
}

main.league-details .full-standings-table tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
}

main.league-details .full-standings-table tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
}

main.league-details .full-standings-table .team {
    display: flex;
    align-items: center;
    gap: 8px;
}

main.league-details .full-standings-table .team img {
    width: 18px;
    height: 18px;
}

/* Rounds Container */
main.league-details .rounds-container {
    padding: 20px;
}

main.league-details .round-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

main.league-details .round-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--TextDefaultColor);
}

main.league-details .round-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

main.league-details .round-nav-btn:hover {
    background: var(--DarkCardBackgroundColor);
}

main.league-details .round-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--TextDefaultColor);
}

/* Round Matches */
main.league-details .round-matches {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

main.league-details .match-date-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

main.league-details .match-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--DarkTextColor);
    padding-left: 4px;
}

main.league-details .match-score {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

main.league-details .match-score .score {
    display: flex;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

main.league-details .match-score .score:hover {
    background: var(--FooterBackgroundColor);
    cursor: pointer;
}

main.league-details .match-score .position {
    color: var(--DarkTextColor);
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    min-width: 40px;
    text-align: center;
}

main.league-details .match-score .match {
    display: flex;
    margin: auto;
    gap: 10px;
    align-items: center;
}

main.league-details .match-score .match img {
    width: 16px;
    height: 16px;
}

main.league-details .match-score .score-result {
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

/* ============= FIXTURES SECTION ============= */
main.league-details .fixtures-container {
    padding: 20px;
}

main.league-details .fixtures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

main.league-details .fixtures-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--TextDefaultColor);
}

main.league-details .fixtures-filters {
    display: flex;
    gap: 8px;
}

main.league-details .fixtures-filter-btn {
    padding: 8px 16px;
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--TextDefaultColor);
    cursor: pointer;
    transition: all 0.2s;
}

main.league-details .fixtures-filter-btn:hover {
    background: var(--DarkCardBackgroundColor);
}

main.league-details .fixtures-filter-btn.active {
    background: var(--DarkCardBackgroundColor);
    border-color: var(--TextDefaultColor);
}

main.league-details .fixtures-content {
    position: relative;
}

main.league-details .fixtures-view {
    display: none;
}

main.league-details .fixtures-view.active {
    display: block;
}

/* By Date View */
main.league-details #date-view .match-date-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

main.league-details #date-view .match-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--DarkTextColor);
    padding-left: 4px;
}

main.league-details #date-view .match-score {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

/* By Round View */
main.league-details .round-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--FooterBackgroundColor);
    border-radius: 8px;
}

main.league-details .round-title-fixtures {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--TextDefaultColor);
    margin: 0;
}

main.league-details .round-matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

main.league-details .round-matches-list .match-score {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* By Team View */
main.league-details .team-selector {
    margin-bottom: 24px;
}

main.league-details .team-dropdown {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    background: var(--FooterBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--TextDefaultColor);
    cursor: pointer;
    outline: none;
}

main.league-details .team-dropdown:focus {
    border-color: var(--TextDefaultColor);
}

main.league-details .team-matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

main.league-details .no-team-selected {
    text-align: center;
    padding: 40px 20px;
    color: var(--DarkTextColor);
    font-size: 0.9rem;
}

main.league-details .team-matches-list .match-score {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1200px) {
    main.league-details .main-content {
        width: 85%;
    }
}

@media (max-width: 1024px) {
    main.league-details .overview-grid {
        grid-template-columns: 1fr;
    }

    main.league-details .top-players-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main.league-details .main-content {
        width: 95%;
    }

    main.league-details .league-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    main.league-details .league-logo {
        width: 60px;
        height: 60px;
    }

    main.league-details .league-name {
        font-size: 1.5rem;
    }

    main.league-details .league-navigation {
        padding: 0 12px;
    }

    main.league-details .league-navigation .nav-link {
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    main.league-details .standings-table {
        font-size: 0.75rem;
    }

    main.league-details .standings-table .team img {
        width: 14px;
        height: 14px;
    }

    /* Hide W, D, L, Last 5 columns on small screens */
    main.league-details .standings-table thead tr.title th:nth-child(4),
    main.league-details .standings-table thead tr.title th:nth-child(5),
    main.league-details .standings-table thead tr.title th:nth-child(6),
    main.league-details .standings-table thead tr.title th:nth-child(9),
    main.league-details .standings-table tbody tr td:nth-child(4),
    main.league-details .standings-table tbody tr td:nth-child(5),
    main.league-details .standings-table tbody tr td:nth-child(6),
    main.league-details .standings-table tbody tr td:nth-child(9) {
        display: none;
    }

    main.league-details .full-standings-table {
        font-size: 0.75rem;
    }

    main.league-details .full-standings-table .team img {
        width: 14px;
        height: 14px;
    }

    /* Hide W, D, L, Last 5 columns on small screens */
    main.league-details .full-standings-table thead tr.title th:nth-child(4),
    main.league-details .full-standings-table thead tr.title th:nth-child(5),
    main.league-details .full-standings-table thead tr.title th:nth-child(6),
    main.league-details .full-standings-table thead tr.title th:nth-child(9),
    main.league-details .full-standings-table tbody tr td:nth-child(4),
    main.league-details .full-standings-table tbody tr td:nth-child(5),
    main.league-details .full-standings-table tbody tr td:nth-child(6),
    main.league-details .full-standings-table tbody tr td:nth-child(9) {
        display: none;
    }

    main.league-details .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    main.league-details .table-filters {
        width: 100%;
    }

    main.league-details .filter-btn {
        flex: 1;
        padding: 10px;
    }

    main.league-details .form-box {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    main.league-details .fixtures-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    main.league-details .fixtures-filters {
        width: 100%;
    }

    main.league-details .fixtures-filter-btn {
        flex: 1;
        padding: 10px;
    }

    main.league-details .team-dropdown {
        max-width: 100%;
    }
}
