/* MyAiSchool Learning Tools - Mathematics Assessment Module Styles */
/*
  This stylesheet provides styling for the Mathematics Assessment Module.
  It uses specific class prefixes 'myaischool-lt-math-' to avoid conflicts.
*/

/* --- Module Container & General Layout --- */
.myaischool-lt-math-assessment-module {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #f9f9f9;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

.myaischool-lt-math-assessment-module p em {
    color: #555;
    font-size: 0.95em;
}
.myaischool-lt-math-assessment-module p em strong {
    font-style: normal;
    font-weight: bold;
    color: #333;
}

/* --- Setup Form --- */
.myaischool-lt-math-assessment-setup-form div {
    margin-bottom: 15px;
}
.myaischool-lt-math-assessment-setup-form label {
    display: inline-block;
    min-width: 180px; /* Adjusted for longer labels if needed */
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    vertical-align: middle;
}
.myaischool-lt-math-assessment-setup-form select,
.myaischool-lt-math-assessment-setup-form input[type="number"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
    vertical-align: middle;
    font-size: 1em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
.myaischool-lt-math-assessment-setup-form input[type="number"] {
    width: 80px;
    min-width: 80px;
}

/* --- Buttons --- */
#myaischool-lt-generate-assessment-button,
#myaischool-lt-submit-assessment-button {
    margin-top: 10px;
    padding: 10px 18px;
    font-size: 1.05em;
    cursor: pointer;
    background-color: #0073aa; /* WordPress primary button blue */
    color: #fff;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
#myaischool-lt-generate-assessment-button:hover,
#myaischool-lt-submit-assessment-button:hover {
    background-color: #005177;
}
#myaischool-lt-generate-assessment-button:disabled,
#myaischool-lt-submit-assessment-button:disabled {
    background-color: #a0a5aa;
    cursor: not-allowed;
}


/* --- Status Messages --- */
.myaischool-lt-math-assessment-status {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #e3f2fd; /* Light blue for info */
    color: #0d47a1; /* Dark blue for info */
    text-align: center;
    font-weight: bold;
}
.myaischool-lt-math-assessment-status.myaischool-lt-error-message {
    background-color: #ffebee; /* Light red for error */
    border-color: #ef9a9a; /* Red border */
    color: #c62828; /* Dark red text */
}

/* --- Assessment Form --- */
.myaischool-lt-math-assessment-form {
    margin-top: 25px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
}

/* --- Progress Bar --- */
.myaischool-lt-math-assessment-progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    height: 20px;
    position: relative;
    overflow: hidden; /* Ensure inner bar doesn't break out */
}
.myaischool-lt-math-assessment-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50; /* Green */
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
}
.myaischool-lt-math-assessment-progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 20px;
    color: #333;
    font-size: 0.9em;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255,255,255,0.7); /* For readability over bar */
}

/* --- Individual Question Styling --- */
.myaischool-lt-math-assessment-question {
    background-color: #fff;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.myaischool-lt-math-assessment-q-text strong {
    font-size: 1.15em;
    margin-bottom: 12px;
    color: #222;
    display: block;
}
.myaischool-lt-math-assessment-q-marks {
    font-size: 0.9em;
    color: #777;
    font-weight: normal;
}

/* Input Wrapper for voice/image buttons */
.myaischool-lt-input-wrapper {
    position: relative;
    display: flex; /* Allows textarea and buttons to sit side-by-side */
    align-items: flex-start; /* Aligns items to the top (important for textareas) */
    margin-top: 8px;
}

/* Styles for text/textarea inputs */
.myaischool-lt-math-assessment-question textarea.myaischool-lt-math-answer-input,
.myaischool-lt-math-assessment-question input[type="text"].myaischool-lt-math-answer-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    flex-grow: 1; /* Allows input field to take up available space */
    resize: vertical; /* Allow vertical resizing for textareas */
}
.myaischool-lt-math-assessment-question textarea.myaischool-lt-math-answer-input {
    min-height: 100px; /* Increased min-height for math solutions */
}

/* Styles for Voice Input Button */
.myaischool-lt-voice-input-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 10px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    height: fit-content; /* Adjusts height to content */
    align-self: flex-start; /* Aligns button to the top of the flex container */
    transition: background-color 0.2s ease;
}
.myaischool-lt-voice-input-button:hover {
    background-color: #e0e0e0;
}
.myaischool-lt-voice-input-button.myaischool-lt-voice-listening {
    background-color: #ffcdd2; /* Light red when listening */
    border-color: #ef9a9a;
}

/* Styles for Image Input Button (NEW) */
.myaischool-lt-image-input-button {
    background-color: #e0f2f7; /* Lighter blue for image */
    border: 1px solid #a7d9eb;
    border-radius: 4px;
    padding: 8px 10px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 1em; /* Smaller font as text might be longer */
    line-height: 1;
    height: fit-content;
    align-self: flex-start;
    white-space: nowrap; /* Prevent text wrapping */
    transition: background-color 0.2s ease;
}
.myaischool-lt-image-input-button:hover {
    background-color: #c9eaf5;
}
.myaischool-lt-image-input-button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
}

/* Hide the actual file input (it's triggered by the custom button) */
.myaischool-lt-image-upload-input {
    display: none;
}

/* Styles for Radio Button Inputs */
.myaischool-lt-math-assessment-question input[type="radio"].myaischool-lt-math-answer-input {
    margin-right: 8px;
    vertical-align: middle;
}
.myaischool-lt-math-assessment-question label {
    margin-right: 20px;
    font-weight: normal;
}

/* --- Results Display --- */
.myaischool-lt-math-assessment-results-display {
    margin-top: 25px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
}
.myaischool-lt-math-assessment-results-display h3 {
    margin-top: 0;
    color: #1a237e; /* Dark blue heading */
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 20px;
}
.myaischool-lt-math-assessment-detailed-results {
    margin-top: 15px;
}
.myaischool-lt-math-assessment-result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left-width: 5px;
    border-left-style: solid;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.myaischool-lt-math-assessment-result-item.correct { background-color: #e8f5e9; border-left-color: #4caf50; } /* Light green */
.myaischool-lt-math-assessment-result-item.partial { background-color: #fff3e0; border-left-color: #ff9800; } /* Light orange */
.myaischool-lt-math-assessment-result-item.incorrect { background-color: #ffebee; border-left-color: #f44336; } /* Light red */

.myaischool-lt-math-assessment-result-item p {
    margin: 5px 0;
    line-height: 1.5;
}
.myaischool-lt-math-assessment-result-item p em {
    color: #444;
}

.myaischool-lt-math-assessment-feedback {
    font-style: italic;
    color: #333;
    margin-top: 8px !important;
    padding: 8px;
    background-color: rgba(0,0,0,0.03);
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.05);
}
.myaischool-lt-math-assessment-review-suggestion small {
    display: block;
    margin-top: 8px;
    color: #555;
    font-size: 0.9em;
}

/* Ideal Answer Toggle */
.myaischool-lt-ideal-answer-container {
    margin-top: 10px;
}
.myaischool-lt-toggle-ideal-answer {
    display: inline-block;
    margin-bottom: 5px;
    color: #0073aa; /* WordPress link blue */
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    border-bottom: 1px dotted #0073aa; /* Dotted underline */
}
.myaischool-lt-toggle-ideal-answer:hover {
    text-decoration: none; /* Remove solid underline on hover */
    border-bottom: 1px solid #0073aa; /* Solid underline on hover */
}

.myaischool-lt-math-assessment-ideal-answer {
    margin-top: 5px;
    padding: 10px;
    background-color: #f0f8ff; /* Alice blue */
    border: 1px solid #d1e7fd;
    border-radius: 3px;
    font-size: 0.95em;
    color: #01579b; /* Darker blue text */
    word-wrap: break-word; /* Ensure long content breaks */
    overflow-wrap: break-word; /* Ensure long content breaks */
}
.myaischool-lt-math-assessment-ideal-answer strong {
    color: #004d40; /* Dark green for emphasis */
}

.myaischool-lt-math-assessment-results-display h4 {
    margin-top: 20px;
    color: #0d47a1;
}