@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #007A7A; /* Um verde-azulado profissional */
    --secondary-color: #4FD1C5; /* Um toque de menta claro */
    --background-color: #F8F9FA; /* Cinza muito claro */
    --surface-color: #FFFFFF; /* Branco para os cards */
    --text-color: #2D3748; /* Cinza escuro para texto */
    --header-gradient: linear-gradient(90deg, #007A7A, #4FD1C5);
    --border-color: #E2E8F0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: var(--header-gradient);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}



.main-header h1 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.2em;
    line-height: 1.2;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.layout {
    display: flex;
    flex-grow: 1;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.sidebar {
    width: 240px;
    background: var(--surface-color);
    padding: 20px 10px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    border-right: 1px solid var(--border-color);
}
.sidebar h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 25px;
    width: 100%;
    text-align: center;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}
.sidebar li {
    margin-bottom: 10px;
}
.sidebar a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1em;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    position: relative;
}

.sidebar a:hover {
    background: #e6fffa; /* Um hover bem sutil */
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar a.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 4px;
    background-color: var(--secondary-color);
    border-radius: 0 4px 4px 0;
}

.container {
    width: 100%;
    max-width: 700px; /* Aumentado para melhor espaçamento */
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

header p {
    color: #555;
    font-size: 1.1em;
}

.content-card {
    background-color: var(--surface-color);
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.content-card h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.8em;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4A5568;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: #FDFDFD;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button, .nav-button {
    flex-grow: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

button:hover, .nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

button {
    background-color: var(--primary-color);
    color: white;
}

button.secondary, .nav-button.secondary {
    background-color: #F0F0F0;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#resultado {
    margin-top: 30px;
    padding: 20px;
    background-color: #e6fffa;
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
}

#resultado h2 {
    margin-top: 0;
    color: var(--primary-color);
}

#resultado .error {
    color: #c53030;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 25px 30px;
    margin-top: auto; /* Empurra o rodapé para o final */
    background: var(--header-gradient);
    color: white;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 0.95em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav-button {
    background-color: var(--primary-color);
    color: white;
}

/* Cores para o status do resultado P/F */
.normal { color: #38A169; } /* Verde */
.leve { color: #DD6B20; } /* Laranja */
.moderada { color: #D69E2E; } /* Amarelo Escuro */
.grave { color: #E53E3E; } /* Vermelho */

/* Tabela de resultados */
#resultado table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 0.95em;
}

#resultado th, #resultado td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

#resultado th {
    background-color: #F7FAFC;
    font-weight: 600;
    color: #4A5568;
}

#resultado tbody tr:nth-child(odd) {
    background-color: #FDFDFD;
}

/* Estilos do formulário da página Paciente */
.paciente-form-group {
    margin-bottom: 20px;
}

.paciente-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4A5568;
}

.paciente-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: #FDFDFD;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.paciente-form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.3);
}

#paciente-form button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
}

#mensagem-sucesso {
    color: #38a169;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    border-left: 4px solid var(--secondary-color);
    padding-left: 10px;
}

#diagnostico-resultado {
    margin-top: 30px;
    padding: 25px;
    background-color: #e6fffa;
    border: 1px solid #b2f5ea;
    border-radius: 12px;
}

#diagnostico-resultado h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5em;
}

#diagnostico-resultado p {
    margin: 12px 0;
    font-size: 1.1em;
}

#diagnostico-resultado strong {
    color: #004444;
    font-weight: 600;
}

/* --- Media Queries para Responsividade --- */

@media (max-width: 992px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        box-shadow: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        align-items: center;
        padding: 0 10px;
        box-sizing: border-box; /* Garante que o padding não aumente a largura */
    }

    .sidebar h2 {
        display: none;
    }

    .sidebar ul {
        display: flex;
        flex-wrap: nowrap; /* Evita quebra de linha */
        justify-content: flex-start;
        gap: 5px;
        width: 100%;
        overflow-x: auto; /* Permite rolagem horizontal */
        -webkit-overflow-scrolling: touch; /* Melhora a rolagem em iOS */
        padding: 10px 0;
        scrollbar-width: none; /* Oculta a barra de rolagem no Firefox */
    }
    
    .sidebar ul::-webkit-scrollbar {
        display: none; /* Oculta a barra de rolagem no Chrome, Safari e Opera */
    }

    .sidebar li {
        margin-bottom: 0;
        flex-shrink: 0; /* Impede que os itens encolham */
    }

    .sidebar a {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .sidebar a.active::before {
        width: 100%;
        height: 3px;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 4px 4px 0 0;
    }

    .main-header {
        padding: 15px;
    }



    .main-header h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }



    .main-header h1 {
        font-size: 1.5em;
        text-align: center;
    }

    .button-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .main-header {
        gap: 15px;
        justify-content: center; /* Corrigido de space-between para center */
    }
    
    .main-header h1 {
        font-size: 1.3em;
    }

    .content-card {
        padding: 20px;
        border-radius: 12px;
    }

    .main-content {
        padding: 15px;
    }
}
