/* World Cup 2026 - Group Stage Styling */

.worldcup-content {
    padding: 20px 0;
}

/* === World Cup Navigation Bar === */
.worldcup-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #C0392B;
}

.nav-title-group {
    display: flex;
    align-items: center;
}

.nav-title {
    font-size: 24px;
    font-weight: bold;
    color: #1B2631;
    margin: 0;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-tab-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #F0F0F0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #D0D0D0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-tab-btn:hover {
    background-color: #E0E0E0;
    border-color: #999;
}

.nav-tab-btn.active {
    background-color: #C0392B;
    color: white;
    border-color: #C0392B;
}

.back-home-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: transparent;
    color: #C0392B;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #C0392B;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-home-btn:hover {
    background-color: #C0392B;
    color: white;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #1B2631;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 3px solid #C0392B;
    padding-bottom: 15px;
}

/* === Color Legend === */
.color-legend {
    background-color: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.color-legend h2 {
    font-size: 18px;
    font-weight: bold;
    color: #1B2631;
    margin-bottom: 10px;
}

.legend-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #999;
}

.legend-color.advancing {
    background-color: #BBF3BB;
}

.legend-color.conditional {
    background-color: #BBF3FF;
}

.legend-color.eliminated {
    background-color: #F0F0F0;
    border: 2px dashed #999;
}

/* === Section Titles === */
.section-title {
    font-size: 22px;
    font-weight: bold;
    color: #1B2631;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #C0392B;
}

/* === Groups Section === */
.groups-section {
    margin-bottom: 40px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }
}

.group-card {
    background-color: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.group-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.group-title {
    font-size: 16px;
    font-weight: bold;
    color: #C0392B;
    margin-bottom: 12px;
    text-align: center;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.group-table thead {
    background-color: #1B2631;
    color: white;
}

.group-table th {
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #999;
}

.group-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #E8E8E8;
}

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

.group-table tbody tr.advancing {
    background-color: #BBF3BB !important;
}

.group-table tbody tr.advancing:hover {
    background-color: #A0E5A0 !important;
}

.group-table tbody tr.conditional {
    background-color: #BBF3FF !important;
}

.group-table tbody tr.conditional:hover {
    background-color: #A0E5FF !important;
}

.group-table tbody tr.eliminated {
    background-color: #F0F0F0 !important;
}

.group-table tbody tr.eliminated:hover {
    background-color: #E0E0E0 !important;
}

.group-table .pos {
    font-weight: bold;
    width: 35px;
}

.group-table .team-name {
    text-align: left;
    font-weight: 500;
    min-width: 100px;
}

.group-table .points {
    font-weight: bold;
    color: #C0392B;
    width: 40px;
}

/* === Third Place Section === */
.third-place-section {
    margin-bottom: 40px;
}

.third-place-table-container {
    background-color: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
}

.third-place-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.third-place-table thead {
    background-color: #1B2631;
    color: white;
}

.third-place-table th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #999;
}

.third-place-table td {
    padding: 8px 8px;
    text-align: center;
    border: 1px solid #E8E8E8;
}

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

.third-place-table tbody tr.conditional {
    background-color: #BBF3FF !important;
}

.third-place-table tbody tr.conditional:hover {
    background-color: #A0E5FF !important;
}

.third-place-table tbody tr.eliminated {
    background-color: #F0F0F0 !important;
}

.third-place-table tbody tr.eliminated:hover {
    background-color: #E0E0E0 !important;
}

.third-place-table .pos,
.third-place-table .grp {
    font-weight: bold;
    width: 45px;
}

.third-place-table .team-name {
    text-align: left;
    font-weight: 500;
    min-width: 120px;
}

.third-place-table .points {
    font-weight: bold;
    color: #C0392B;
    width: 45px;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .page-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 18px;
        margin-top: 25px;
        margin-bottom: 15px;
    }
    
    .groups-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .group-card {
        padding: 12px;
    }
    
    .group-table {
        font-size: 12px;
    }
    
    .group-table th,
    .group-table td {
        padding: 6px 4px;
    }
    
    .group-table .team-name {
        min-width: 80px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 10px;
    }
    
    .third-place-table {
        font-size: 12px;
    }
    
    .third-place-table th,
    .third-place-table td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .group-table {
        font-size: 11px;
    }
    
    .group-table th,
    .group-table td {
        padding: 4px 2px;
    }
    
    .group-table .team-name {
        min-width: 60px;
        font-size: 10px;
    }
    
    .group-title {
        font-size: 14px;
    }
    
    .third-place-table {
        font-size: 11px;
    }
    
    .third-place-table th,
    .third-place-table td {
        padding: 4px 2px;
    }
    
    .third-place-table .team-name {
        min-width: 80px;
        font-size: 10px;
    }
}

/* === Knockout Bracket / Tree Layout === */
.knockout-bracket {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 8px;
    padding: 20px 0;
    margin-top: 20px;
    width: 100%;
    overflow-x: auto;
}

.bracket-round {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.round-header {
    background-color: #1B2631;
    color: white;
    padding: 8px;
    border-radius: 4px 4px 0 0;
    text-align: center;
}

.round-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.round-matches {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background-color: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-top: none;
    border-radius: 0 0 4px 4px;
    flex: 1;
    justify-content: space-around;
    min-height: 300px;
}

.bracket-match {
    background-color: white;
    border: 1px solid #D0D0D0;
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 0 0 auto;
    position: relative;
}

/* 冠军赛在上，季军赛在下 */
.bracket-match.match-championship {
    order: -1;
    margin-bottom: 0px;
}

.bracket-match.match-third-place {
    order: 0;
    margin-top: 0px;
}

/* Final round 的特殊处理，让两个 match 靠近 */
.bracket-round[data-round="Final"] .round-matches {
    justify-content: center;
    gap: 2px;
}

.bracket-round[data-round="Final"] .bracket-match {
    flex-basis: auto;
}

.bracket-match::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    width: 8px;
    height: 2px;
    background-color: #D0D0D0;
    transform: translateY(-50%);
}

.bracket-round:last-child .bracket-match::after {
    display: none;
}

.match-type-label {
    font-size: 11px;
    color: #C0392B;
    font-weight: 600;
    margin-bottom: 2px;
    text-align: center;
}

.match-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.team {
    padding: 3px;
    background-color: #F5F5F5;
    border-radius: 3px;
    text-align: center;
}

.team.home-team {
    border-left: 2px solid #1B2631;
}

.team.away-team {
    border-left: 2px solid #999;
}

.team-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    word-break: break-word;
    line-height: 1.2;
}

.match-vs {
    font-size: 10px;
    text-align: center;
    color: #999;
    font-weight: 600;
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: #666;
    border-top: 1px solid #E0E0E0;
    padding-top: 3px;
}

.match-date {
    font-weight: 500;
}

.match-location {
    font-size: 9px;
    color: #999;
    margin-top: 2px;
    padding-top: 3px;
    border-top: 1px solid #E0E0E0;
    text-align: center;
    word-break: break-word;
    line-height: 1.1;
}

.section-subtitle {
    font-size: 20px;
    font-weight: bold;
    color: #1B2631;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #C0392B;
}

.news-placeholder {
    background-color: #F8F9FA;
    border: 1px dashed #D0D0D0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.news-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* === Responsive: Tablet (1200px) === */
@media (max-width: 1200px) {
    .round-matches {
        gap: 4px;
        padding: 6px;
        min-height: 250px;
    }
    
    .bracket-match {
        padding: 5px;
    }
    
    .round-header h3 {
        font-size: 12px;
    }
    
    .team-name {
        font-size: 11px;
    }
    
    .match-info {
        font-size: 9px;
    }
    
    .match-location {
        font-size: 8px;
    }
}

/* === Responsive: Mobile - Navigation === */
@media (max-width: 768px) {
    .worldcup-nav {
        gap: 10px;
    }
    
    .nav-buttons {
        gap: 8px;
    }
    
    .nav-tab-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .back-home-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .round-matches {
        gap: 3px;
        padding: 4px;
        min-height: 200px;
    }
    
    .bracket-match {
        padding: 4px;
    }
    
    .round-header h3 {
        font-size: 11px;
        padding: 6px;
    }
    
    .team-name {
        font-size: 9px;
    }
    
    .match-info {
        font-size: 7px;
    }
    
    .match-location {
        font-size: 6px;
    }
}

@media (max-width: 480px) {
    .worldcup-nav {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .nav-title-group {
        width: 100%;
        order: -1;
    }
    
    .nav-title {
        font-size: 18px;
    }
    
    .nav-buttons {
        width: 100%;
        gap: 6px;
    }
    
    .nav-tab-btn {
        padding: 5px 10px;
        font-size: 12px;
        flex: 1;
        text-align: center;
    }
    
    .back-home-btn {
        margin-left: 0;
        padding: 5px 10px;
        font-size: 12px;
        flex: 1;
        text-align: center;
    }
    
    .round-matches {
        gap: 2px;
        padding: 3px;
        min-height: 150px;
    }
    
    .bracket-match {
        padding: 3px;
    }
    
    .round-header h3 {
        font-size: 11px;
        padding: 5px;
    }
    
    .team-name {
        font-size: 9px;
    }
    
    .match-info {
        font-size: 7px;
    }
    
    .match-location {
        font-size: 6px;
    }
    
    .bracket-match::after {
        display: none;
    }
}
