/* libertadores.css - Design unificado para Libertadores - APENAS FASE DE GRUPOS */

/* ===== VARIÁVEIS E RESET ===== */
:root {
    --libertadores-blue: #0046a8;
    --libertadores-dark: #1b1b1b;
    --libertadores-darker: #151515;
    --libertadores-light: #f8f9fa;
    --libertadores-success: #28a745;
    --libertadores-warning: #ffc107;
    --libertadores-danger: #dc3545;
    --libertadores-border: #333;
    --libertadores-text: #ffffff;
    --libertadores-text-secondary: #cccccc;
    
    /* ===== ESCALA DE FONTES FLUIDA ===== */
    --fs-xs: clamp(10px, 0.35vw + 9px, 12px);
    --fs-sm: clamp(11px, 0.45vw + 9px, 13.5px);
    --fs-md: clamp(12px, 0.60vw + 9px, 16px);
    --fs-lg: clamp(13px, 0.85vw + 9px, 18px);
    --fs-xl: clamp(14px, 1.10vw + 9px, 20px);
    
    /* ===== ESCALA BEM CONTIDA PARA NOMES DOS TIMES ===== */
    --fs-team: clamp(12px, 1.1vw + 8px, 15px);
    --fs-score: clamp(13px, 1.2vw + 9px, 18px);
    
    /* ===== VARIÁVEIS PARA CARDS PADRONIZADOS ===== */
    --card-width: clamp(340px, 45vw, 600px);
    --card-height: clamp(140px, 18vw, 200px);
    --card-padding: clamp(16px, 2vw, 24px);
}

/* ===== CONTAINER IGUAL AO CHAMPIONS ===== */
.classificacao-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ===== ABAS PRINCIPAIS - ESTILO UNIFICADO ===== */
.champions-botoes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.champions-botoes button {
    padding: 8px 20px;
    background-color: #2e2e2e;
    color: #eee;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--fs-sm);
}

.champions-botoes button:hover {
    background-color: #444;
    color: #fff;
}

.champions-botoes button.ativo {
    background-color: var(--libertadores-blue);
    color: white;
    border-color: var(--libertadores-blue);
}

/* ===== CONTEÚDO DAS ABAS ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== FASE DE GRUPOS - ESTILO MODERNO ===== */

/* Cabeçalho da competição */
.cabecalho-liga .titulo-liga-bloco {
    display: flex;
    flex-direction: column;
    font-size: 30px !important;
    height: 40px !important;
}

.cabecalho-liga .subtitulo-liga {
    font-size: var(--fs-sm);
    color: var(--libertadores-text-secondary);
}

.season-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
}

/* ===== GRUPOS EMPILHADOS - SEMPRE UMA COLUNA ===== */
.grupos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.grupo-card {
    /* cinza escuro, sem preto chapado */
    background: #232323;
    padding: 12px 16px 16px;
    transition: all 0.3s ease;
    min-height: auto;
}

/* CABEÇALHO DO GRUPO - ALTURA AJUSTADA PARA ~40px */
.grupo-header {
    padding: 12px 0 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.grupo-header h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f9f9f9;
    line-height: 1.2;
}

/* Tabela de grupos */
.tabela-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
}

.tabela-grupo {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    min-width: 650px;
    background: var(--libertadores-dark);
    border-radius: 4px;
    overflow: hidden;
}

.tabela-grupo thead tr {
    background: #222222;
}

.tabela-grupo th {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 2px solid var(--libertadores-border);
    white-space: nowrap;
    font-weight: 600;
    color: var(--libertadores-text);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabela-grupo td {
    padding: 10px 10px;
    text-align: center;
    border-bottom: 1px solid #2b2b2b;
    white-space: nowrap;
    color: var(--libertadores-text);
    transition: background 0.2s ease;
}

.tabela-grupo tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.tabela-grupo th:nth-child(2),
.tabela-grupo td:nth-child(2) {
    text-align: left;
}

/* Destaques para classificados */
.tabela-grupo tr:nth-child(-n+2) td:first-child {
    border-left: 4px solid var(--libertadores-blue);
}

.tabela-grupo tr:nth-child(3) td:first-child,
.tabela-grupo tr:nth-child(4) td:first-child {
    border-left: 4px solid #9C27B0;
}

.tabela-grupo tr:nth-last-child(-n+2) td:first-child {
    border-left: 4px solid #F44336;
}

/* Equipe com logo */
.equipe-com-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.logo-time {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.nome-equipe-tabela {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Forma recente (V/E/D) */
.forma {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.forma span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    margin: 0;
}

.forma span.vitoria {
    background: var(--libertadores-success);
    color: #fff;
}

.forma span.empate {
    background: var(--libertadores-warning);
    color: #111;
}

.forma span.derrota {
    background: var(--libertadores-danger);
    color: #fff;
}

/* Sem dados */
.sem-dados {
    padding: 40px 20px;
    text-align: center;
    background: var(--libertadores-dark);
    border-radius: 8px;
    border: 2px dashed var(--libertadores-border);
    color: var(--libertadores-text-secondary);
}

.sem-dados p {
    margin: 0;
    font-size: var(--fs-lg);
}

/* ===== CORES ESPECÍFICAS DA LEGENDA ===== */
.csp-5fb14063 { background-color: var(--libertadores-blue); } /* Fase de Grupos */
.csp-b10cf466 { background-color: #9C27B0; } /* Play-offs */
.csp-61813737 { background-color: #FF9800; } /* Europa League */
.csp-cdb2064a { background-color: #F44336; } /* Eliminado */

/* ===== DESTAQUES ESPECIAIS PARA LIBERTADORES ===== */
.tabela tr:nth-child(-n+2) td:first-child {
    border-left: 4px solid var(--libertadores-blue);
}

.tabela tr:nth-child(3) td:first-child,
.tabela tr:nth-child(4) td:first-child {
    border-left: 4px solid #9C27B0;
}

.tabela tr:nth-last-child(-n+2) td:first-child {
    border-left: 4px solid #F44336;
}

/* ===== ÍCONES ESPECIAIS ===== */
.rank-icon.bola {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.rank-icon.chuteira {
    background: linear-gradient(135deg, var(--libertadores-blue), #0055cc);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
}

.rank-icon.chuteira::before {
    content: "⚽";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: white;
}

/* ===== GARANTIR QUE TODOS OS BOTÕES TENHAM O MESMO ESTILO BASE ===== */
.cabecalho-liga .season-selector-container > *,
.champions-botoes button {
    font-family: inherit !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    vertical-align: middle !important;
}

/* ================= AJUSTES CLASSIFICAÇÃO – GRUPOS ================= */

/* Borda única por linha para evitar "degraus" entre PTS e FORMA */
.classificacao-wrapper .tabela-grupo td {
    border-bottom: none;
}

.classificacao-wrapper .tabela-grupo tbody tr {
    border-bottom: 1px solid #2b2b2b;
}

.classificacao-wrapper .tabela-grupo tbody tr:last-child {
    border-bottom: none;
}

/* Remove sublinhado apenas na coluna FORMA do último colocado */
.classificacao-wrapper .tabela-grupo tbody tr:last-child td.forma {
    border-bottom: none;
}

/* Garante que a célula de FORMA continue sendo célula de tabela (e não flex) */
.classificacao-wrapper .tabela-grupo td.forma {
    display: table-cell;
    padding: 10px 10px;
    text-align: center;
    vertical-align: middle;
}

/* Bolinhas de forma */
.classificacao-wrapper .tabela-grupo td.forma span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    margin: 0;
}

.classificacao-wrapper .tabela-grupo td.forma span + span {
    margin-left: 2px;
}

/* CABEÇALHO DOS GRUPOS - ALTURA DE ~40px */
.classificacao-wrapper .grupo-card {
    padding: 8px 16px 12px;
}

.classificacao-wrapper .grupo-header {
    padding: 10px 0 6px 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.classificacao-wrapper .grupo-header h3 {
    font-size: var(--fs-md);
    line-height: 1.2;
    margin: 0;
    font-weight: 600;
}

/* Estados de toque para mobile */
@media (hover: none) and (pointer: coarse) {
    .grupo-card:hover {
        transform: none;
        box-shadow: 0 4px 14px rgba(0,0,0,.35);
    }
    
    .champions-botoes button:active {
        transform: scale(0.98);
    }
}

/* ===== RESPONSIVIDADE PARA FASE DE GRUPOS ===== */

/* Tablets (768px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 768px) {
    .tabela-grupo {
        min-width: 600px;
    }
    
    .nome-equipe-tabela {
        max-width: 120px;
    }
}

/* Mobile (até 767px) */
@media screen and (max-width: 767px) {
    .grupos-grid {
        gap: 16px;
    }
    
    .grupo-card {
        padding: 8px 12px 12px;
    }
    
    .tabela-grupo {
        min-width: 550px;
        font-size: var(--fs-xs);
    }
    
    .tabela-grupo th,
    .tabela-grupo td {
        padding: 8px 6px;
    }
    
    .nome-equipe-tabela {
        max-width: 100px;
    }
    
    .logo-time {
        width: 16px;
        height: 16px;
    }
    
    .forma span {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

/* Telas muito pequenas (até 400px) */
@media screen and (max-width: 400px) {
    .tabela-grupo {
        min-width: 500px;
    }
    
    .tabela-grupo th,
    .tabela-grupo td {
        padding: 6px 4px;
    }
    
    .nome-equipe-tabela {
        max-width: 80px;
    }
    
    .champions-botoes button {
        padding: 6px 12px;
        font-size: var(--fs-xs);
    }
}

/* Override explícito: cabeçalho do grupo em cinza escuro (sem preto) */
.grupo-header {
    background: #262626;
}


/* Override final: header do grupo igual ao card, sem borda/sombra e texto centralizado */
.grupo-card {
    background: #232323;
}

.grupo-header {
    background: inherit;       /* mesma cor do grupo-card */
    border-bottom: none;       /* remove a borda inferior */
    box-shadow: none;          /* garante sem sombra extra */
    display: flex;
    align-items: center;
    justify-content: center;   /* centraliza o conteúdo (texto) */
}

.grupo-header h3 {
    margin: 0;
    text-align: center;
    width: 100%;
}


/* ===== Ajuste thead e header da fase de grupos ===== */

/* Header do grupo sem borda inferior (override extra) */
.grupo-header {
    border-bottom: none !important;
}

/* THEAD da tabela com mesma cor do card, sem bordas laterais/superior nem sombra */
.tabela-grupo thead tr {
    background: #232323 !important; /* mesma cor do .grupo-card */
    box-shadow: none !important;
}

/* Células do cabeçalho: só borda inferior suave */
.tabela-grupo thead th {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}


/* ===== Ajuste: remover borda esquerda só do THEAD, mantendo destaques no corpo ===== */

/* Remove o efeito de destaque no cabeçalho (thead conta como 1º tr) */
.tabela-grupo tr:nth-child(-n+2) th:first-child {
    border-left: none !important;
}

/* Reaplica o destaque apenas nas 2 primeiras linhas do TBODY */
.tabela-grupo tbody tr:nth-child(-n+2) td:first-child {
    border-left: 4px solid var(--libertadores-blue);
}


/* Remove a borda esquerda do contorno da tabela, mantendo apenas as bordas de classificação */
.tabela-grupo {
    border-left: none !important;
}


/* Remover qualquer borda esquerda só da célula de cabeçalho (#) */
.tabela-grupo thead tr:first-child th:first-child,
.tabela-grupo thead tr:first-child td:first-child {
    border-left: none !important;
    box-shadow: none !important;
}

/* ===== Overrides para borda superior e direita no THEAD da tabela de grupos ===== */
.tabela-grupo thead th {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.tabela-grupo thead th:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}
