/* Cores inspiradas na Copa 2026 (América do Norte: Verde, Azul, Vermelho, Branco e Dourado) */
:root {
    --primary-color: #004d99; /* Azul */
    --secondary-color: #cc0000; /* Vermelho */
    --accent-color: #ffd700; /* Dourado */
    --bg-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
    --success: #28a745;
    --error: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header e Nav */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-flex-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
}

.user-avatar-header {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 28px;
    color: white;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.3s;
}

.user-avatar-header:hover {
    transform: scale(1.05);
}

.user-avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-content-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.header-title-row h1 {
    margin: 0;
    font-size: 24px;
}

.header-title-row h1 a {
    color: white;
    text-decoration: none;
}

.header-nav-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.header-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.saudacao-bottom {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.saudacao-bottom a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.saudacao-bottom a:hover {
    text-decoration: underline;
}

.separator-sair {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.link-sair {
    color: orange;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: color 0.3s;
}

.link-sair:hover {
    color: white;
    text-decoration: underline;
}

.header-nav-row a {
    white-space: nowrap;
}

/* Páginas de Autenticação */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(rgba(0, 77, 153, 0.7), rgba(0, 45, 90, 0.7)), url('img/login_bg.jpg');
    background-size: cover;
    background-position: center;
}

.auth-container {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-container h1 { color: var(--primary-color); margin-bottom: 30px; }

form input, form select, form button {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

form button {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

form button:hover { background-color: #a30000; }

/* Grid de Jogos */
.secao-jogos {
    margin-bottom: 40px;
}

.secao-titulo {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.toggle-content {
    display: grid; /* Mantém o grid original */
}

.jogos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.jogo-header {
    background: #f8f9fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    border-bottom: 1px solid #eee;
}

.header-info-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.placar-central {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.aposta-form-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.acao-card-right {
    flex: 1.5;
    display: flex;
    justify-content: flex-end;
    padding-left: 10px;
}ter;
    gap: 5px;
    justify-content: center;
    flex: 1;
}

.acao-card {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.resultado-real-container {
    text-align: center;
    margin-top: 8px;
    width: 100%;
    white-space: nowrap; /* Garante que não haja quebra de linha */
}

.resultado-real-texto {
    margin: 0;
    font-size: 0.9em;
    color: #333;
    display: block;
}

.pontos-ganhos-texto {
    display: none; /* Removido daqui, agora está no header */
}

.aguardando-resultado {
    margin: 0;
    font-size: 0.85em;
    color: var(--secondary-color);
    font-style: italic;
}

.status-encerrado-badge {
    background: var(--secondary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8em;
}

.pontos-badge {
    background: var(--success);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8em;
}

.jogo-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-top: 5px solid var(--primary-color);
}

.jogo-card.finalizado { border-top-color: #666; opacity: 0.9; }

.jogo-header {
    background: #eee;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    font-weight: bold;
}

.jogo-body {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.time { 
    flex: 1.5; /* Aumentado o peso para dar mais espaço ao nome */
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px; 
    min-width: 80px; /* Garante um espaço mínimo */
}
.time-nome { 
    font-weight: bold; 
    display: block; 
    font-size: 0.9em; 
    word-wrap: break-word; /* Permite quebra de linha em nomes muito longos */
    line-height: 1.2;
}
.flag { 
    width: 40px; 
    height: 28px; 
    object-fit: cover;
    border: 1px solid #ddd; 
    border-radius: 3px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background-color: #eee; /* Cor de fundo caso a imagem falhe */
}

.aposta-form { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    flex: 2; /* Aumentado para acomodar o botão ao lado dos inputs */
    justify-content: center;
    flex-wrap: wrap; /* Permite quebra em telas muito pequenas */
}
.aposta-form input { 
    width: 45px; /* Reduzido levemente para ganhar espaço lateral */
    text-align: center; 
    padding: 5px; 
    margin: 0; 
    font-size: 1em; 
}
.aposta-form button { width: auto; padding: 8px 15px; font-size: 0.9em; }

.jogo-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid #eee;
    font-size: 0.9em;
}

/* Ranking */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.ranking-table th, .ranking-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking-table th { background-color: var(--primary-color); color: var(--white); }
.ranking-table tr.current-user { background-color: #fff9c4; }

/* Mensagens */
.error { color: var(--error); font-size: 0.9em; }
.success { color: var(--success); font-size: 0.9em; }
.info-msg { background: #d1ecf1; color: #0c5460; padding: 10px; border-radius: 5px; margin-bottom: 20px; }

/* Rodapé Compacto e Elegante */
.site-footer {
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.85em;
    color: #777;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.site-footer .separator {
    color: #ccc;
    font-weight: 300;
}

.site-footer.auth-footer {
    border-top: none;
    color: #002b5c; /* Azul marinho para contraste no fundo branco da caixa de login */
    text-shadow: none;
    margin-top: 30px;
    width: 100%;
    justify-content: center;
    font-weight: 500;
    opacity: 0.8;
}

.site-footer.auth-footer strong {
    color: #002b5c;
    font-weight: bold;
}

/* Admin */
.admin-container { padding: 20px; }
.add-game { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 30px; }
.inline-form { display: flex; gap: 5px; align-items: center; }

/* Estilos Adicionais para Ligas */
.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

.btn:hover {
    background-color: #003366;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-small {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 80px;
    box-sizing: border-box;
}

.btn-card {
    font-size: 0.85em !important;
    padding: 8px 12px !important;
    min-width: 80px !important;
}

.btn-small:hover {
    background-color: #003366;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-danger {
    background-color: var(--secondary-color);
}

.btn-danger:hover {
    background-color: #a30000;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: #218838;
}

code {
    background: #eee;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
    color: var(--secondary-color);
}

.header-banner {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.header-banner img {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
    object-position: center;
}

/* Estilos para o Mural de Recados */
.mural-container {
    margin-top: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}
.mural-header {
    background: #002b5c;
    color: #fff;
    padding: 15px;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
}
.mural-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}
.mensagem-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.mensagem-item.criador {
    justify-content: flex-end;
}
.mensagem-item.usuario {
    justify-content: flex-start;
}
.mensagem-bubble {
    max-width: 70%;
    padding: 10px 12px;
    border-radius: 12px;
    word-wrap: break-word;
}
.mensagem-item.criador .mensagem-bubble {
    background: #004d99;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.mensagem-item.usuario .mensagem-bubble {
    background: #e8e8e8;
    color: #333;
    border-bottom-left-radius: 4px;
}
.mensagem-info {
    font-size: 0.75em;
    color: #999;
    margin-bottom: 2px;
}
.mensagem-texto {
    font-size: 0.95em;
    line-height: 1.4;
    margin: 0;
}
.mural-footer {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}
.mural-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mural-form textarea {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    min-height: 45px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95em;
}

.mural-form button {
    width: auto; /* sobrescreve o width:100% global */
    flex-shrink: 0; /* impede o botão de esticar */
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.mural-form button:hover {
    background-color: #003366;
}

/* Badge para identificar o criador da liga */
.badge {
    display: inline-block;
    background: #002b5c;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    margin-left: 5px;
}


/* Relógio Flutuante */
#floating-clock {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(0, 77, 153, 0.98) 0%, rgba(0, 51, 102, 0.98) 100%);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    min-width: 130px;
    line-height: 1.4;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: block;
    visibility: visible;
    opacity: 1;
}

#floating-clock:hover {
    background-color: rgba(0, 77, 153, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

#floating-clock .data {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
    font-weight: normal;
}

#floating-clock .hora {
    font-size: 16px;
    color: #ffffff;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Responsivo para telas pequenas */
@media (max-width: 768px) {
    #floating-clock {
        bottom: 10px;
        right: 10px;
        padding: 12px 15px;
        font-size: 12px;
        min-width: 140px;
    }
    
    #floating-clock .hora {
        font-size: 14px;
    }
}

/* Status de Apostas */
.status-encerrado-badge {
    background-color: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    display: inline-block;
}

.status-encerrado {
    color: var(--secondary-color);
    font-weight: bold;
    margin-top: 5px;
}

.pontos-badge {
    background-color: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: bold;
    display: inline-block;
}

/* Dashboard de Pontos em ver_palpites.php */
.dashboard-pontos {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
}

.ponto-item {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-width: 100px;
    flex: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.ponto-item:hover {
    transform: translateY(-3px);
}

.ponto-label {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.ponto-valor {
    display: block;
    font-size: 1.5em;
    font-weight: 800;
    color: #333;
}

.ponto-item small {
    color: #666;
    font-size: 0.75em;
    display: block;
    margin-top: 5px;
}

@media (max-width: 600px) {
    .ponto-item {
        min-width: 45%;
    }
}
