/* Championship Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #e31e24;
    --dark-red: #b71c1c;
    --dark-gray: #2d2d2d;
    --medium-gray: #4a4a4a;
    --light-gray: #6b6b6b;
    --bg-light: #fafafa;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --green: #2e7d32;
    --red: #c62828;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 45px;
    width: auto;
}

.brand-text h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.85rem;
    color: var(--light-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Championship Header */
.championship-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.championship-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.1), rgba(227, 30, 36, 0.05));
    border: 1px solid rgba(227, 30, 36, 0.2);
    border-radius: 50px;
    color: var(--primary-red);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.championship-badge i {
    width: 16px;
    height: 16px;
}

.championship-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-gray);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.championship-dates {
    font-size: 1.1rem;
    color: var(--light-gray);
}

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--light-gray);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-button i {
    width: 18px;
    height: 18px;
}

.tab-button:hover {
    color: var(--primary-red);
}

.tab-button.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
}

.group-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.group-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-red);
}

.group-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--dark-gray), var(--medium-gray));
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.group-badge {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Standings Table */
.standings-table {
    overflow-x: auto;
}

.standings-table table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table thead {
    background: var(--bg-light);
}

.standings-table th {
    padding: 15px 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standings-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.standings-table tbody tr:hover {
    background: var(--bg-light);
}

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

.standings-table td {
    padding: 15px 12px;
    font-size: 0.95rem;
}

.standings-table .pos {
    width: 50px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-red);
}

.standings-table .team {
    min-width: 200px;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

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

.team-name {
    font-weight: 600;
    color: var(--dark-gray);
}

.team-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.team-country {
    font-size: 0.8rem;
    color: var(--light-gray);
    font-weight: 500;
    text-transform: uppercase;
}

.standings-table .stat {
    text-align: center;
    width: 60px;
    color: var(--light-gray);
}

.standings-table .points {
    font-weight: 700;
    color: var(--dark-gray);
    font-size: 1.05rem;
}

.standings-table .positive {
    color: var(--green);
    font-weight: 600;
}

.standings-table .negative {
    color: var(--red);
    font-weight: 600;
}

/* Colunas mais largas (Sets e Pontos com saldo) */
.standings-table .stat-wide {
    text-align: center;
    min-width: 90px;
    white-space: nowrap;
}

.standings-table .ratio {
    font-weight: 600;
    color: var(--dark-gray);
}

.standings-table .balance {
    font-size: 0.8rem;
    margin-left: 3px;
}

.standings-table .win {
    color: var(--green);
    font-weight: 600;
}

.standings-table .loss {
    color: var(--red);
    font-weight: 600;
}

/* Legenda da classificação */
.standings-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.standings-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.standings-legend strong {
    color: var(--dark-gray);
}

/* Overall Container */
.overall-container {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.overall-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
}

.overall-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.overall-header p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Teams Grid */
.teams-container {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.teams-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--medium-gray), var(--dark-gray));
    color: var(--white);
}

.teams-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.teams-header p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px;
}

.team-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-red);
}

.team-badge {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.team-badge-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--medium-gray), var(--dark-gray));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-badge-placeholder i {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.team-card-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.team-card-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.team-code {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.team-city {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.team-city i {
    width: 14px;
    height: 14px;
}

.team-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--light-gray);
}

.team-stats span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.team-stats i {
    width: 14px;
    height: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-gray);
}

.empty-state i {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--medium-gray);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1rem;
}

.empty-state .hint {
    font-size: 0.9rem;
    margin-top: 10px;
    opacity: 0.7;
}

/* Playoffs (Mata-Mata) */
.playoff-card .playoff-header {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
}

.playoff-card:hover {
    border-color: var(--dark-red);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    text-align: center;
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .championship-title {
        font-size: 2rem;
    }

    .tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        padding: 12px 20px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .standings-table {
        font-size: 0.85rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .championship-title {
        font-size: 1.5rem;
    }

    .brand-text h2 {
        font-size: 1.1rem;
    }

    .logo {
        height: 35px;
    }

    .tab-button span {
        display: none;
    }

    .tab-button {
        padding: 12px 15px;
    }
}

/* ============================================ */
/* FIVB Button                                  */
/* ============================================ */

.btn-fivb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
    margin-top: 20px;
}

.btn-fivb:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

.volleyball-icon {
    width: 32px;
    height: 32px;
}

/* ============================================ */
/* PLAYOFFS BRACKET - Confrontos               */
/* ============================================ */

.playoffs-bracket {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.playoffs-bracket.fictional {
    opacity: 0.7;
}

.playoff-phase {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.playoff-phase:hover {
    box-shadow: var(--shadow-md);
}

.playoff-phase.final-phase {
    border-color: var(--primary-red);
    box-shadow: 0 0 20px rgba(227, 30, 36, 0.2);
}

.phase-title {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--dark-gray), var(--medium-gray));
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.final-phase .phase-title {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
}

.matchups-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.matchup-card {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 15px 25px;
    width: 100%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.matchup-card:hover {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-md);
}

.matchup-card.final-match {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.3);
}

.matchup-card.bronze-match {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(205, 127, 50, 0.05));
    border-color: rgba(205, 127, 50, 0.3);
}

.matchup-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.matchup-team.winner {
    background: rgba(46, 125, 50, 0.1);
}

.matchup-team.winner .matchup-name {
    color: var(--green);
    font-weight: 700;
}

.matchup-team.winner .matchup-score {
    background: var(--green);
}

.matchup-badge {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.matchup-badge-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--medium-gray), var(--light-gray));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.matchup-badge-placeholder i {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.matchup-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-gray);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matchup-score {
    background: var(--dark-gray);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 800;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.matchup-vs {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--light-gray);
    padding: 0 20px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Sets parciais do confronto */
.matchup-sets {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-left: auto;
    padding-left: 15px;
    border-left: 1px solid var(--border);
}

.matchup-sets .set-score {
    font-size: 0.7rem;
    color: var(--light-gray);
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* Matchup finalizado */
.matchup-card.finished {
    background: var(--white);
}

.matchup-card.finished .matchup-team.winner .matchup-score {
    background: var(--green);
}

/* Fase Bronze */
.playoff-phase.bronze-phase .phase-title {
    color: #cd7f32;
}

.matchup-card.bronze-match {
    border-color: #cd7f32;
}

/* ============================================ */
/* ATHLETES TAB                                 */
/* ============================================ */

.athletes-container {
    padding: 20px 0;
}

.athletes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.athlete-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.athlete-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-red);
}

.athlete-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--dark-gray), var(--medium-gray));
    color: var(--white);
}

.athlete-card-header i {
    width: 24px;
    height: 24px;
}

.athlete-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.athlete-list {
    padding: 10px 0;
}

.athlete-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.athlete-item:last-child {
    border-bottom: none;
}

.athlete-item:hover {
    background: var(--bg-light);
}

.athlete-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-right: 15px;
}

.athlete-item.top-1 .athlete-rank {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.athlete-item.top-2 .athlete-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.athlete-item.top-3 .athlete-rank {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.athlete-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.athlete-name {
    font-weight: 600;
    color: var(--dark-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-team {
    font-size: 0.8rem;
    color: var(--light-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-stat {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-red);
    min-width: 40px;
    text-align: right;
}

.athlete-list .no-data {
    padding: 30px 25px;
    text-align: center;
    color: var(--light-gray);
    font-size: 0.95rem;
}

/* Group Label in Overall */
.group-label {
    font-weight: 600;
    color: var(--primary-red) !important;
}

/* Responsive for new sections */
@media (max-width: 768px) {
    .matchups-container {
        padding: 10px;
        gap: 10px;
    }
    
    .matchup-card {
        flex-wrap: wrap;
        padding: 12px;
    }
    
    .matchup-team {
        min-width: 150px;
    }
    
    .matchup-sets {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
        padding-left: 0;
        padding-top: 10px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .athletes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .matchup-card {
        padding: 10px;
    }
    
    .matchup-team {
        gap: 8px;
        padding: 5px 10px;
    }
    
    .matchup-name {
        font-size: 0.8rem;
    }
    
    .matchup-badge,
    .matchup-badge-placeholder {
        width: 30px;
        height: 30px;
    }
    
    .matchup-score {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .matchup-vs {
        padding: 0 10px;
        font-size: 0.75rem;
    }
}
