/* ----------------------------------------
   Base & General Styling
   ---------------------------------------- */
body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 20px;
}
.tasks-heading {
    text-align: center; font-size: 1.25rem; font-weight: 600;
    margin-bottom: 0.5rem; color: #444;
}
.subheading-box {
    background-color: #f7fdf7; border-left: 4px solid #3c763d;
    padding: 0.75rem 1rem; margin: 1rem 3% 1.5rem 3%; border-radius: 4px;
}
.subheading-box .title { color: #3c763d; font-size: 1.25rem; margin: 0; font-weight: 600; }

/* ----------------------------------------
   Experiment-Specific Styling
   ---------------------------------------- */
.task-panel {
    background-color: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.task-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #3273dc;
    border-bottom: 2px solid #3273dc;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.task-prompt {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Step 1: Equation Inference */
.description-box {
    background-color: #f5f5f5;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}
#process-description {
    font-style: italic;
    color: #555;
}
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.equation-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.equation-option:hover {
    background-color: #f0f8ff;
}
.equation-option input[type="radio"] {
    margin-right: 1.5rem;
    transform: scale(1.5);
}
.equation-option math {
    font-size: 1.4em;
}

/* Steps 2 & 3: Plot Identification */
.plots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}
.plot-wrapper {
    position: relative; /* CRITICAL for Chart.js responsive sizing */
    border: 3px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 250px; /* Ensure wrapper has a size */
    width: 100%;       /* Ensure wrapper fills the grid cell */
    max-width: 400px;
}
.plot-wrapper.selected {
    border-color: #3273dc;
    background-color: #eef5ff;
}
.plot-wrapper canvas {
    max-width: 100%;
}

/* Submit and Feedback */
.submit-container {
    text-align: center;
    margin-top: 2rem;
}
.feedback-message {
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1em;
    display: none;
    /* CORRECTED alignment rules */
    width: -moz-fit-content;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.feedback-message.correct {
    background-color: #f6fff9;
    border: 2px solid #23d160;
    color: #0e6b2e;
    display: block; /* Use block for centering */
}
.feedback-message.incorrect {
    background-color: #fff5f7;
    border: 2px solid #ff3860;
    color: #cc0f35;
    display: block; /* Use block for centering */
}

/* Step 4: Final Explanation */
#final-explanation-content .explanation-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
#final-explanation-content h4 {
    font-weight: 600;
    font-size: 1.3em;
    color: #333;
    margin-bottom: 0.5rem;
}
#final-explanation-content .final-plot-container {
    position: relative; /* Added for Chart.js */
    max-width: 500px;
    min-height: 250px; /* Added for Chart.js */
    margin: 1rem auto;
}

.recap-box {
    background-color: #f5f5f5;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.recap-box h4 {
    font-size: 1.1em;
    font-weight: 600;
    color: #363636;
    margin-bottom: 0.75rem;
}

.recap-box .equation-box {
    font-size: 1.25em;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    display: inline-block;
}

.recap-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.recap-grid > div {
    flex-basis: 50%;
}

.recap-plot-container {
    height: 150px;
    max-width: 300px;
    margin: 0 auto;
}

/* Other styles from original file */
.task-panel { margin-bottom: 2rem; }
.task-title { font-size: 1.75rem; text-align: center; margin-bottom: 1.5rem; font-weight: 600; }
.description-box { background-color: #f5f5f5; padding: 1.5rem; border-radius: 6px; margin-bottom: 1.5rem; }
.options-container { display: flex; flex-direction: column; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.equation-option { display: block; width: 80%; max-width: 600px; }
.equation-option label { display: flex; align-items: center; justify-content: center; padding: 1rem; border: 1px solid #dbdbdb; border-radius: 4px; cursor: pointer; background-color: white; }
.equation-option input[type="radio"] { display: none; }
.equation-option input[type="radio"]:checked + label { border-color: #3273dc; box-shadow: 0 0 10px rgba(50, 115, 220, 0.2); background-color: #eff5fb; }
.submit-container { text-align: center; margin-top: 1rem; }
.feedback-message { margin-top: 1rem; font-weight: bold; }
.feedback-message.correct { color: #23d160; }
.feedback-message.incorrect { color: #ff3860; }
.task-prompt { text-align: center; margin-bottom: 1.5rem; font-size: 1.1em; }
.plots-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.plot-wrapper { border: 2px solid transparent; border-radius: 6px; padding: 0.5rem; cursor: pointer; background-color: white; }
.plot-wrapper.selected { border-color: #3273dc; }
.explanation-section { margin-bottom: 2rem; }
.final-plot-container { height: 250px; margin-top: 1rem; }