@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f4f4f9;
    --text-color: #333;
    --container-bg: #fff;
    --border-color: #ddd;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

[data-theme='dark'] {
    --primary-color: #1e90ff;
    --secondary-color: #8a9aab;
    --background-color: #1a1a2e;
    --text-color: #e0e0e0;
    --container-bg: #162447;
    --border-color: #3a3a5e;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    transition: background-color 0.3s;
}

header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    align-items: center;
}

header h1 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 600px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
}

header h1 .fa-futbol {
    margin-right: 10px;
}

.bet-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bet-option {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bet-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.bet-option h2, .team-name-input {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: bold;
    color: var(--text-color);
    width: 100%;
    background: transparent;
    border: none;
    text-align: center;
}

.team-name-input::placeholder {
    color: var(--secondary-color);
}

.team-name-input:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.odd-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    gap: 5px;
}

.odd-input {
    width: 70px;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    text-align: center;
    background-color: var(--container-bg);
    color: var(--text-color);
}

.bet-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    text-align: center;
    background-color: var(--container-bg);
    color: var(--text-color);
    margin-bottom: 1rem;
}

.bet-option .return {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.bet-option .profit {
    font-size: 1rem;
    color: var(--primary-color);
}

footer {
    text-align: center;
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.simulation-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

#total-simulation-input {
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background-color: var(--container-bg);
    color: var(--text-color);
    width: 100%;
    max-width: 300px;
}

#calculate-stakes-button {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#calculate-stakes-button:hover {
    background-color: #218838;
}

#odds-diagnosis {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

#odds-diagnosis.profit {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

#odds-diagnosis.loss {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.total-invested h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

#confirm-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#confirm-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.credits {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.credits a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.credits a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--container-bg);
    margin: auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.9);}
    to {opacity: 1; transform: scale(1);}
}

.close-button {
    color: var(--secondary-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: var(--danger-color);
}

#modal-summary-content p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.modal-total {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 1.2rem;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .bet-option h2 {
        font-size: 1.2rem;
    }
}

/* =================== ESTILOS DO MÓDULO SISTEMA DE PALPITES =================== */

.palpites-module {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--background-color);
    border-radius: 10px;
    padding: 1rem;
}

.palpites-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    padding: 1rem;
    padding-bottom: 1rem;
    background-color: var(--container-bg);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    margin-bottom: 1rem;
}

.palpites-header h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 600px) {
    .palpites-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .palpites-header h2 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
}

.toggle-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.toggle-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.palpites-content {
    background-color: var(--container-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.palpites-content.hidden {
    display: none !important;
}

.palpites-input-section {
    margin-bottom: 2rem;
}

.total-pirulitos {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.total-pirulitos label {
    font-weight: bold;
    color: var(--text-color);
}

.total-pirulitos input {
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background-color: var(--container-bg);
    color: var(--text-color);
    max-width: 200px;
}

.mercados-section {
    margin-bottom: 2rem;
}

.mercados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mercados-header h3 {
    color: var(--text-color);
    margin: 0;
}

.add-button {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.add-button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.mercado-item {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: stretch;
}

.mercado-item input[type="text"] {
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--container-bg);
    color: var(--text-color);
    width: 100%;
}

.mercado-item input[type="number"] {
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--container-bg);
    color: var(--text-color);
    text-align: center;
    width: 100%;
}

.mercado-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.mercado-peso-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
}

.mercado-peso-container label {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.peso-display {
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
}

.remove-mercado {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.remove-mercado:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.palpites-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.calc-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
}

.calc-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.export-button {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
}

.export-button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.export-button.hidden {
    display: none !important;
}

.resultado-section {
    background-color: var(--background-color);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.resultado-section.hidden {
    display: none !important;
}

.resultado-section h3 {
    color: var(--success-color);
    margin-bottom: 1rem;
    text-align: center;
}

.resultado-item {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resultado-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resultado-item .mercado-nome {
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.1rem;
}

.resultado-item .peso-percent {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.resultado-item .pirulitos-quantidade {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1rem;
}

.resultado-item .retorno-estimado {
    color: var(--success-color);
    font-weight: bold;
    font-size: 1rem;
}

.resultado-total {
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Responsive para o módulo de palpites */
@media (max-width: 768px) {
    .mercados-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .mercado-item {
        padding: 1rem 0.5rem;
    }
    
    .mercado-controls {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .palpites-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .calc-button, .export-button {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .bet-option h2 {
        font-size: 1.2rem;
    }
    
    .palpites-module {
        margin-top: 2rem;
        padding: 0.5rem;
    }
    
    .palpites-content {
        padding: 1rem;
    }
    
    .total-pirulitos input {
        width: 100%;
    }
}

/* =================== FIM DOS ESTILOS DO MÓDULO SISTEMA DE PALPITES =================== */
