/* === ASSESSMENT BUILDER CONTAINER === */
#csuk_assessment_builder_container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* === HEADINGS === */
#csuk_assessment_builder_container h2 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

/* === GENERATE CONTAINER === */
.assessment-generate-container {
    border: 2px solid #000;
    border-radius: 20px;
    padding: 20px;
}

#essay_save_options, #exam_save_options {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed #ccc;
}

/* ============================
   CSUK Assessment & Question Builder
   ============================ */

/* Form Wrapper */
#assessment-form {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', sans-serif;
}

/* Headings */
#assessment-form h2,
#assessment-form h3,
#assessment-form h4 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Labels and Inputs */
#assessment-form label {
    font-weight: bold;
    display: block;
    margin-top: 12px;
    color: #444;
}

#assessment-form input[type="text"],
#assessment-form input[type="number"],
#assessment-form input[type="url"],
#assessment-form input[type="datetime-local"],
#assessment-form textarea,
#assessment-form select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: 0.3s ease;
    box-sizing: border-box;
}

#assessment-form input:focus,
#assessment-form textarea:focus,
#assessment-form select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 6px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* === Question Blocks === */
#questions-container .question-item {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-left: 6px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

#questions-container .question-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.question-number {
    font-size: 17px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

.question-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.editable-question {
    background-color: #f1f5f9;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    padding: 12px;
    min-height: 100px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
}


#exam-presentation-area,
#essay-presentation-area {
	margin-top: 20px;
}


/* === YOUTUBE SECTION STYLING for EXAM and ESSAY === */
#exam-youtube .youtube-flex-wrapper,
#essay-youtube .youtube-flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
}

/* Right side: form inputs */
#exam-youtube .youtube-form-content,
#essay-youtube .youtube-form-content {
    flex: 1 1 300px;
    min-width: 300px;
}

/* Left side: video embed */
#exam-youtube .youtube-video-preview,
#essay-youtube .youtube-video-preview {
    flex: 1 1 350px;
    min-width: 300px;
    max-width: 500px;
	border: black dashed 1px;
    min-height: 200px;
    border-radius: 20px;
}

/* Embedded iframe styling */
#exam-youtube .video-embed iframe,
#essay-youtube .video-embed iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}



/* ============================
   Essay Builder Styling
   ============================ */





/* === Marking Options === */
.marking-type {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 15px;
}

.marking-options {
    background: #f8f9fc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dce1e7;
    margin-top: 10px;
}

/* === Points Marking === */
.points-input {
    max-width: 150px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.statement-item {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.statement-item input[type="text"] {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.remove-statement {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-statement:hover {
    background: #b52a38;
}

/* Rubric Table */
.rubric-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.rubric-table th,
.rubric-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
}

.rubric-table th {
    background-color: #f7f7f7;
    font-weight: bold;
    text-align: center;
}

.rubric-level-cell {
    min-width: 200px;
}

.rubric-controls {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

/* Inputs inside table */
.rubric-table input[type="text"],
.rubric-table input[type="number"] {
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.rubric-table textarea {
    width: 100%;
    min-height: 100px;
	font-size: 13px;
    padding: 5px;
    box-sizing: border-box;
    resize: vertical;
	font-weight: bold;
}

.rubric-points-wrapper {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rubric-points-label {
	font-weight: bold;
}


.rubric-level {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px; /* 👈 Key line */
    box-sizing: border-box;
    min-width: 200px;
}

.rubric-level textarea {
    width: 100%;
    resize: vertical; /* Optional: lets user resize up/down only */
    min-height: 100px;
    box-sizing: border-box;
	font-size: 13px;
}

.rubric-table-container {
    overflow-x: auto;
    width: 100%;
}

/* Ensure level cells act like a horizontal flex row */
.criteria-levels {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: max-content; /* 👈 ensures children don't wrap */
}

.criteria-scroll-container {
    max-width: 100%;      /* ensures it doesn't overflow the table cell */
    overflow-x: auto;     /* enables horizontal scrolling */
    padding-bottom: 5px;  /* optional padding for scrollbar space */
    box-sizing: border-box;
}

.rubric-table td.levels-cell {
    padding: 0; /* Optional: helps eliminate inner spacing */
}

.rubric-choice {
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	cursor: pointer;
	background-color: #f9f9f9;
}

.rubric-choice.rubric-selected {
	background-color: #c7f3c7; /* light green */
	border-color: #4CAF50;
	font-weight: bold;
}





.level-marking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.level-marking-table th,
.level-marking-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.level-marking-table th {
    background: #f0f0f0;
}

.level-marking-table input[type="text"],
.level-marking-table input[type="number"] {
    width: 100%;
}



.csuk-highlight-green {
	background-color: #c7f3c7; /* light green */
}

.csuk-highlight-red {
	background-color: #f6c6c6; /* light red */
}

/* === Buttons === */
#assessment-form button:not(.ai-tab-button) {
    padding: 10px 18px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#assessment-form button:not(.ai-tab-button):hover {
    background-color: #005a87;
}

button.remove-question {
    margin-top: 20px;
    background-color: #e74c3c;
}

button.remove-question:hover {
    background-color: #c0392b;
}

button.csuk-btn.danger {
    background-color: #e74c3c;
}

button.csuk-btn.danger:hover {
    background-color: #c0392b;
}

button.add-rubric-criteria,
button.add-statement {
    background-color: #28a745;
    color: white;
}

button.add-rubric-criteria:hover,
button.add-statement:hover {
    background-color: #218838;
}

/* === Title Block (dynamically inserted title) === */
#exam-title-block {
    margin-bottom: 30px;
    padding: 20px;
    background: #f1f5f9;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#exam_main_title_display {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #2c3e50;
}


/* Modal Styling */
#csuk_ai_assessment_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#csuk_ai_assessment_modal .ai-modal-content {
    background: #fff;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
}

#csuk_ai_assessment_modal .close-ai-modal {
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
}



/* Save Assessment Button */
#save-assessment {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: #28a745;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    margin-top: 15px;
}

#save-assessment:hover {
    background: #218838;
}



.ai-tab-ac-content {
    display: none;
}

.ai-tab-ac-content.active {
    display: block;
}


/* Each Tab Button - Clean Modern Tabs */
.ai-ac-tab-button {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 10px 6px 10px;
    cursor: pointer;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transition: background-color 0.3s, border-color 0.3s;
    flex-grow: 1;
    text-align: center;
    font-weight: normal;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Tab button icons */
.ai-ac-tab-button img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-bottom: 5px;
}

/* Tab button text label */
.ai-ac-tab-label {
    margin-top: 2px;
    font-size: 13px;
    color: #555;
}

/* On Active */
.ai-ac-tab-button.active {
    background-color: white;
    border-color: #ddd #ddd white #ddd;
    font-weight: bold;
}

/* Hover */
.ai-ac-tab-button:hover {
    background-color: #e9e9e9;
}



/* ============================
   CSUK Assessment Display
   ============================ */

.csuk-assessment-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f8f8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.csuk-question {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.csuk-question h4 {
    color: #333;
    margin-bottom: 10px;
}

.csuk-question-text {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

.csuk-answer-area {
    min-height: 100px;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    outline: none;  /* Removes the default focus outline */
	white-space: pre-line;
}

button.csuk-submit-answer {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button.csuk-submit-answer:hover {
    background-color: #0056b3;
}

.csuk-marking-container {
    padding: 10px;
    margin-top: 10px;
    background: #e9e9e9;
    border-radius: 4px;
}

.statement-item {
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.statement-item:hover {
    border-color: #bbb;
}

.statement-item.selected {
    background-color: #c8e6c9; /* Light green background */
    border-color: #2e7d32; /* Dark green border */
}

.statement-item.error {
    background-color: #ffcdd2; /* Light red background */
    border-color: #c62828; /* Dark red border */
}

.csuk-answer-area.placeholder {
    color: #444; /* Slightly less black for placeholder */
}

/* When the answer area is not a placeholder, show full black text */
.csuk-answer-area:not(.placeholder) {
    color: #000; /* Full black for user input */
}


/***************RUBRIC AND LEVEL STYLING******************/

.csuk-rubric-table, .csuk-level-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.csuk-rubric-table th, .csuk-rubric-table td,
.csuk-level-table th, .csuk-level-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.csuk-rubric-table th {
    background-color: #f9f9f9;
    width: 25%;
}
