body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
    /* Prevents horizontal scrolling on the body */
}

#questions {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    overflow-x: hidden;
    /* Prevents horizontal scrolling on the container */
}

/* Ensure images scale correctly without overflowing */
img {
    max-width: 100%;
    /* Scale images to fit the width of their container */
    height: auto;
    /* Maintain aspect ratio */
    display: block;
    /* Prevent extra space below images */
    margin: 10px 0;
}

/* Prevent MathJax content from overflowing and ensure it breaks into the next line */
.mjx-container {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
    word-break: break-word;
}

/* Handle LaTeX overflow: allow wrapping and prevent horizontal scroll */
.mathjax-container {
    max-width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scroll on container */
    overflow-y: hidden;
    /* Hide vertical overflow */
    white-space: normal;
    /* Allow LaTeX to wrap */
    word-wrap: break-word;
    /* Break long lines if necessary */
    word-break: break-word;
    /* Ensure breaking long words or formulas */
}

/* Apply responsive behavior for smaller screens */
@media (max-width: 600px) {
    .mjx-container {
        font-size: 0.9em;
    }
}

/* Style for questions and answers */
.question-container {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #1e1e1e;
    transition: transform 0.3s ease;
    word-wrap: break-word;
}

.question-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.question-body {
    margin-bottom: 15px;
    word-wrap: break-word;
}

/* Handle the layout of answers */
.answer {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #1e1e1e;

    overflow-x: scroll;
}

/* Styling the file selector and buttons */
#file-selector {

    align-items: center;
    justify-content: center;

}

.file-button {
    font-size: 20px;
    padding: 20px;
    margin: 10px;
    width: 60%;
    max-width: 300px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-button:hover {
    background-color: #0056b3;
}

#reselect-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: none;
}

/* Styling the question container */
.question-container {
    margin: 20px;
}

.question-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.question-body,
.answer-body {
    font-size: 18px;
    margin-bottom: 15px;
}

.answer {
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 8px;
}

.accepted {
    background-color: #c8e6c9;
}


.answer .score {
    font-weight: bold;
    color: #80cbc4;
}

.accepted {
    border: 2px solid #388e3c;
    background-color: #1e1e1e;
}

/* For links */
a {
    color: #64b5f6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Adjustments for smaller screens */
@media (max-width: 600px) {
    .question-container {
        padding: 10px;
    }

    .question-title {
        font-size: 1.2em;
    }

    .answer {
        padding: 8px;
    }

    #questions {
        padding: 10px;
    }
}

.select-another-button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    /* Add space above the button */
}

.select-another-button:hover {
    background-color: #0056b3;
}


/* Centering the file-selector container and making it take up full height and width */
#file-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    /* Full screen height */
    width: 100vw;
    /* Full screen width */
    text-align: center;
}

/* Styling the file buttons */
/* Centering the file-selector container and making it take up full height and width only when visible */
#file-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    /* Full screen height */
    width: 100vw;
    /* Full screen width */
    text-align: center;
    position: absolute;
    /* Ensures it doesn't take up space when not displayed */
    top: 0;
    left: 0;
    visibility: hidden;
    /* Hide the container by default */
}

/* Styling the file buttons */
.file-button {
    font-size: 20px;
    padding: 20px;
    margin: 10px;
    width: 60%;
    max-width: 300px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-button:hover {
    background-color: #0056b3;
}

/* Styling the reselect button */
#reselect-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: none;
}