/* style.css */

/* Estilos Globais e Reset */
body {
    font-family: Arial, sans-serif;
    background-color: #1A237E;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Container principal para o layout de duas colunas (sidebar + content) */
.main-wrapper {
    display: flex; /* Ativa o Flexbox para o layout de colunas */
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    overflow-x: hidden; /* Garante que o wrapper não cause scroll horizontal */
}

/* Estilos para a barra lateral */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    overflow-y: auto;
    display: block; /* Garante que o menu lateral é visível em desktop */
}

.sidebar-title {
    color: #ecf0f1;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.league-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.league-menu li {
    margin-bottom: 10px;
}

.league-menu a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.league-menu a:hover {
    background-color: #34495e;
    color: #ffffff;
}

.league-menu a.active {
    background-color: #4CAF50;
    font-weight: bold;
    color: white;
}

/* Estilos para a área de conteúdo principal */
.content-area {
    flex-grow: 1;
    padding: 30px; /* Padding interno para o conteúdo */
    background-color: #0D47A1;
    display: flex;
    flex-direction: column;
}

/* Estilos gerais para o cabeçalho dentro da área de conteúdo */
.header {
    display: flex; /* Habilita o Flexbox */
    justify-content: space-between; /* Afasta os itens para as extremidades */
    align-items: center; /* Alinha os itens verticalmente ao centro */
    padding: 10px 20px; /* Padding nas laterais */
    background-color: #1A237E;
    border-bottom: 1px solid #1A237E;
    margin-bottom: 5px; /* Espaçamento abaixo do header */
}

.header-left {
    display: flex; /* Para alinhar o logo e o link Home */
    align-items: center; /* Alinha verticalmente */
    gap: 15px; /* Espaçamento entre o logo e o link Home */
}

.header-logo {
    height: 200px; /* Altura fixa para o logo */
    width: auto; /* Mantém a proporção */
    /* Para telas muito pequenas, pode ser necessário ajustar a altura máxima */
    max-height: 80px !important;
}

.home-link {
    background-color: #4CAF50;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.home-link:hover {
    background-color: #FFC107;
}

.user-info {
    display: flex; /* Garante que 'Olá, usuário!' e 'Sair' fiquem lado a lado */
    align-items: center;
    gap: 10px; /* Espaçamento entre os itens dentro de user-info */
}

.user-info span {
    font-weight: bold;
    color: #FFC107;
    white-space: nowrap; /* Evita que o nome do usuário quebre a linha */
}

.logout-button, .login-button {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.login-button {
    background-color: #4CAF50;
}

.logout-button:hover {
    background-color: #c82333;
}

.login-button:hover {
    background-color: #FFC107;
}

/* Adicionando estilos para os banners */
.ad-banner {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Oculta o menu mobile por padrão em desktop */
.mobile-league-menu {
    display: none;
}

/* Reajuste do .container */
.container {
    flex-grow: 1; /* Ocupa o espaço restante verticalmente */
    width: 100%;
    margin: 0;
    background-color: transparent;
    padding: 20px;
    box-shadow: none;
    /* Garante que o padding não adicione à largura total */
    box-sizing: border-box;
    overflow-x: hidden; /* Previne rolagem horizontal dentro do container */
}

/* Estilos existentes para a página inicial e outros... (mantidos como estavam) */
h1 {
    text-align: center;
    color: #FFC107;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-form input[type="text"] {
    width: 60%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1em;
}

.search-form button {
    padding: 10px 20px;
    border: none;
    background-color: #4CAF50;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

.search-form button:hover {
    background-color: #FFC107;
}

.league-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.league-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    width: 150px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #f9f9f9;
}

.league-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.league-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.league-item p {
    margin: 0;
    font-weight: bold;
}

.fixture-list {
    color: #080602;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fixture-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fixture-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.fixture-card .date-time {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
}

.fixture-card .teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 10px;
}

.fixture-card .team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.fixture-card .team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.fixture-card .team span {
    font-weight: bold;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.fixture-card .vs {
    font-size: 1.2em;
    font-weight: bold;
    color: #888;
    margin: 0 10px;
}

.fixture-card .score {
    font-size: 1.3em;
    font-weight: bold;
    color: #007bff;
    margin-top: 5px;
    margin-bottom: 10px;
}

.fixture-card .venue, .fixture-card .league-info {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 5px;
}

.predict-button {
    background-color: #28a745;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.2s;
    display: inline-block;
}

.predict-button:hover {
    background-color: #218838;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: #333;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.prediction-container {
    background-color: #e9f7ef;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
    text-align: left;
}
.prediction-container h2 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.prediction-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    color: #333;
}

.loading-message {
    text-align: center;
    font-size: 1.2em;
    color: #007bff;
    padding: 20px;
    border: 1px solid #a7d9ed;
    border-radius: 8px;
    background-color: #e0f2f7;
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
        margin: 10px;
        border-radius: 0;
        box-shadow: none;
        overflow-x: hidden; /* Garante que o wrapper não cause scroll horizontal */
    }

    /* Oculta o sidebar em mobile */
    .sidebar {
        display: none;
    }

    .content-area {
        width: 100%;
        padding: 15px; /* Ajusta o padding para telas pequenas */
    }

    /* Garante que o header mantém a estrutura Flexbox lado a lado */
    .header {
        /* Não precisamos redefinir display: flex ou justify-content: space-between aqui,
           pois já estão definidos globalmente e funcionam.
           Apenas ajustamos o padding para telas menores. */
        padding: 10px 20px;
        /* Remover flex-direction: column; e align-items: flex-start; se existirem */
    }

    .user-info {
        /* Garante que span e botão dentro de user-info fiquem lado a lado */
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .home-link, .login-button, .logout-button {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    /* Estilos para o menu de ligas móvel (deslizante) */
    .mobile-league-menu {
        display: block; /* Torna o menu mobile visível */
        margin-top: 10px;
        margin-bottom: 20px;
        background-color: #1A237E;
        padding: 10px 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .mobile-league-menu h3 {
        margin-top: 0;
        margin-bottom: 10px;
        color: #FFC107;
        text-align: center;
    }

    .mobile-league-menu .scrollable-list {
        list-style: none;
        padding: 0 10px;
        margin: 0;
        display: flex; /* Itens em linha */
        overflow-x: auto; /* Habilita o scroll horizontal */
        -webkit-overflow-scrolling: touch;
        white-space: nowrap; /* Impede quebra de linha dos itens */
        scroll-snap-type: x mandatory; /* Opcional: para um scroll mais "preso" aos itens */
    }

    .mobile-league-menu .scrollable-list::-webkit-scrollbar {
        height: 5px;
    }

    .mobile-league-menu .scrollable-list::-webkit-scrollbar-thumb {
        background: #0D47A1;
        border-radius: 5px;
    }

    .mobile-league-menu li {
        flex-shrink: 0; /* Impede que os itens diminuam */
        margin-right: 10px;
        scroll-snap-align: start;
    }

    .mobile-league-menu li:last-child {
        margin-right: 0;
    }

    .mobile-league-menu a {
        display: block;
        padding: 8px 12px;
        text-decoration: none;
        color: #007bff;
        border: 1px solid #007bff;
        border-radius: 20px;
        background-color: white;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .mobile-league-menu a:hover,
    .mobile-league-menu a:focus {
        background-color: #4CAF50;
        color: white;
    }

    /* Ajustes para formulário de busca e listas em mobile */
    .search-form input[type="text"] {
        width: 80%; /* Aumenta a largura do campo de busca em mobile */
    }

    .league-list, .fixture-list {
        grid-template-columns: 1fr; /* Uma coluna por padrão em mobile */
        gap: 15px;
    }

    .league-item {
        width: 100%; /* Ocupa a largura total disponível */
    }

    .fixture-card .teams {
        flex-direction: column; /* Times empilhados em cards de jogo em mobile */
        gap: 5px;
    }

    .fixture-card .team-logo {
        width: 40px;
        height: 40px;
    }

    .fixture-card .team span {
        font-size: 1em;
    }

    .fixture-card .vs {
        margin: 5px 0; /* Ajusta margem do "vs" */
    }
}

.user-profile-button {
    background-color: #4CAF50; /* Um azul para o botão */
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-right: 10px; /* Espaço entre o botão User e o botão Sair */
    transition: background-color 0.3s ease;
}

.user-profile-button:hover {
    background-color: #FFC107; /* Cor mais escura ao passar o mouse */
}

/* Ajustes para o login-container em mobile */
    .login-content {
        padding: 10px; /* Reduz o padding geral em mobile */
    }
    
    .login-container {
        width: 95%; /* Ocupa a maior parte da largura em mobile */
        max-width: none; /* Remove a largura máxima definida para desktop */
        margin: 20px auto; /* Centraliza e mantém o espaçamento */
        padding: 20px; /* Ajusta o padding interno */
        box-sizing: border-box; /* Garante que padding e border sejam incluídos na largura */
    }

    .login-form input[type="text"],
    .login-form input[type="password"] {
        width: 100%; /* Inputs de login ocupam largura total */
        box-sizing: border-box;
    }

    .login-form button {
        width: 100%; /* Botão de login ocupa largura total */
        box-sizing: border-box;
    }

    .login-options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }