/* General styles for all screen sizes */
body {
    background-color: #ADD8E6;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 10px; /* Add 10px padding at the top */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 600px;
    padding: 1rem; /* Reduced padding to minimize space */
    text-align: center;
}

/* Styles for the initial screen */
.container-inicio {
    width: 90%;
    max-width: 800px;
    padding: 1rem; /* Reduced padding to minimize space */
    text-align: justify;
}

h1, h2, h3, p, label, button {
    font-weight: bold;
    color: #000000; /* Black text */
}

h1 {
    font-size: 2rem; /* Using rem for scalability */
    margin-bottom: 1rem; /* Reduced margin to minimize space */
    text-align: center;
}

/* Text: "Please enter the patient's symptoms:" or equivalent */
p {
    font-size: 1.2rem; /* Using rem for scalability */
    margin-top: 1rem; /* Reduced margin to minimize space */
    line-height: 1.5; /* Improved readability */
}

h2 {
    font-size: 1.5rem; /* Using rem for scalability */
    margin-top: 1rem; /* Reduced margin to minimize space */
}

h3 {
    font-size: 1.2rem; /* Using rem for scalability */
    margin-top: 1rem; /* Reduced margin to minimize space */
}

textarea {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem; /* Using rem for scalability */
    font-weight: bold;
    margin-bottom: 0.5rem; /* Reduced margin to minimize space */
    resize: none;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.botoes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
}

/* Styles for the buttons on the initial screen */
.botoes-inicio {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem; /* Reduced margin to minimize space */
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
}

button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem; /* Using rem for scalability */
    cursor: pointer;
    border: none;
    background-color: #f0f0f0;
    white-space: nowrap; /* Prevents text from wrapping inside buttons */
}

button:hover {
    background-color: #e0e0e0;
}

#result {
    margin-top: 1rem; /* Reduced margin to minimize space */
}

/* Text: "**COVID-19** (confidence: 50.00%)" or equivalent */
#result p:first-child {
    font-size: 1.2rem; /* Using rem for scalability */
}

/* Style for notices about extra and missing symptoms */
.notice {
    font-size: 1rem; /* Using rem for scalability */
    color: #d32f2f; /* Red to highlight */
    font-weight: bold;
    margin-top: 1rem; /* Reduced margin to minimize space */
    line-height: 1.5; /* Improved readability */
}

.recommendations {
    text-align: left;
    background-color: #ffffff; /* White background */
    padding: 1rem;
    border: 1px solid #ccc; /* Gray border */
    margin-top: 1rem; /* Reduced margin to minimize space */
}

/* Media Queries for Responsive Design */

/* Tablets (screens smaller than 768px) */
@media (max-width: 768px) {
    .container, .container-inicio {
        width: 95%;
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    p, h2, h3 {
        font-size: 1.1rem;
    }

    textarea, button, .notice, #result p:first-child {
        font-size: 0.9rem;
    }

    .botoes, .botoes-inicio {
        gap: 1rem;
    }

    button {
        padding: 0.6rem 1.2rem;
    }

    /* Ensure .recommendations and .notice styles are preserved */
    .recommendations {
        background-color: #ffffff; /* White background */
        padding: 0.8rem;
        border: 1px solid #ccc;
    }

    .notice {
        color: #d32f2f; /* Red color */
        font-weight: bold;
    }
}

/* Smartphones (screens smaller than 480px) */
@media (max-width: 480px) {
    .container, .container-inicio {
        width: 98%;
        padding: 0.8rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    p, h2, h3 {
        font-size: 1rem;
    }

    textarea, button, .notice, #result p:first-child {
        font-size: 0.85rem;
    }

    .botoes, .botoes-inicio {
        flex-direction: column; /* Stack buttons vertically on small screens */
        gap: 0.8rem;
    }

    button {
        padding: 0.5rem 1rem;
        width: 100%; /* Full width for better touch interaction */
        max-width: 200px; /* Prevent buttons from becoming too wide */
        margin: 0 auto;
    }

    /* Ensure .recommendations and .notice styles are preserved */
    .recommendations {
        background-color: #ffffff; /* White background */
        padding: 0.8rem;
        border: 1px solid #ccc;
    }

    .notice {
        color: #d32f2f; /* Red color */
        font-weight: bold;
    }
}

/* Very small screens (e.g., older phones, screens smaller than 360px) */
@media (max-width: 360px) {
    h1 {
        font-size: 1.3rem;
    }

    p, h2, h3 {
        font-size: 0.9rem;
    }

    textarea, button, .notice, #result p:first-child {
        font-size: 0.8rem;
    }

    .container, .container-inicio {
        padding: 0.6rem;
    }

    /* Ensure .recommendations and .notice styles are preserved */
    .recommendations {
        background-color: #ffffff; /* White background */
        padding: 0.6rem;
        border: 1px solid #ccc;
    }

    .notice {
        color: #d32f2f; /* Red color */
        font-weight: bold;
    }
}