body {
    font-family: "Time New Roman", sans-serif;
    max-width: 90%;
    width: 60%;
    background-color: #CCFFFF;
    margin: 0 auto;
    padding: 20px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-top: 5px;
}

h2 {
    color: #2980b9;
}

#content {
    border: 2px solid #007bff;
    border-radius: 10px;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: none;
}

#content[style*="display: block"] {
    display: block;
}

.question {
    margin-bottom: 10px;
}

.question p {
    font-size: 18px;
}

.question .sub-question {
    font-size: 18px;
    margin-bottom: 0px;
}

.options {
    margin-left: 20px;
}

.options p {
    margin-top: 5px;
}

.correct {
    color: #28a745;
}

.incorrect {
    color: red;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

#start-btn, #submit-btn, #reload-btn-2 {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#start-btn, #submit-btn {
    background-color: #28a745;
}

#start-btn:hover, #submit-btn:hover {
    background-color: #218838;
    transform: scale(1.05);
}

#reload-btn-2 {
    background-color: #007bff;
}

#reload-btn-2:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

#start-btn:disabled, #submit-btn:disabled, #reload-btn-2:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    padding: 20px;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #f9f9f9;
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
}

#result p {
    margin: 10px 0;
    font-size: 24px;
    text-align: center;
    line-height: 1.5;
}

#result p:first-child {
    font-size: 32px;
    font-weight: bold;
}

#result.score-high {
    background-color: #e0f7e0;
    border: 2px solid #4caf50;
    color: blue;
}

#result.score-medium {
    background-color: #fff9e0;
    border: 2px solid #ffca28;
    color: green;
}

#result.score-low {
    background-color: #ffebee;
    border: 2px solid #ef5350;
    color: red;
}

.top-buttons {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 10px 0;
}

#q4-table {
    width: 100%;
    border-collapse: collapse;
}

#q4-table td {
    padding: 10px;
    font-size: 18px;
    text-align: center;
    border: 0px solid #ddd;
}

.calculation-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.calculation-inline input {
    width: 80px;
    text-align: center;
    font-size: 18px;
}

#q5-table {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#q5-table td {
    padding: 5px;
    font-size: 18px;
    text-align: center;
    border: 0px solid #ddd;
}

.calculation {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.calculation div {
    margin: 2px 0;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.calculation .underline {
    margin-top: 0;
    margin-bottom: 5px;
}

.calculation input {
    width: 60px;
    text-align: right;
    font-size: 18px;
    margin: 0;
    margin-left: auto;
    display: block;
}

#q6-table {
    width: 100%;
    border-collapse: collapse;
    padding: 0px;
}

#q6-table td {
    padding: 0px;
    font-size: 18px;
    text-align: center;
    border: 0px solid #ddd;
}

#q6-table tr {
    padding: 0px;
    display: table-row;
}

#q6-table tr:first-child td {
    padding: 0px;
}

#q6-feedback {
    color: red;
}

#q7-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    min-width: 650px;
}

#q7-table td {
    padding: 2px 10px 0 10px;
    font-size: 18px;
    text-align: center;
    vertical-align: middle;
}

#q7-table td.center {
    text-align: center;
    font-size: clamp(18px, 2.5vw, 20px);
}

#q7-table input {
    padding: 5px;
    font-size: 18px;
    text-align: center;
    margin: 0 auto;
    display: block;
    height: 28px;
    width: 300px;
    box-sizing: border-box;
}

.expression-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.expression-row input {
    width: 80px;
    text-align: center;
    font-size: 18px;
    margin: 0px;
}

.expression-row input.step-input {
    width: 160px;
}

.check-mark, .cross-mark {
    display: none;
    font-size: clamp(12px, 2vw, 18px);
}

.check-mark.visible {
    display: inline;
    color: #28a745;
}

.cross-mark.visible {
    display: inline;
    color: #dc3545;
}

#h1 {
    color: blue;
}

label {
    font-size: clamp(18px, 2.5vw, 20px);
}

input {
    font-size: clamp(18px, 2.5vw, 20px);
    padding: 5px;
}

#reload-btn-2 {
    display: none;
}

#reload-btn-2.visible {
    display: inline-block;
}

.draggable {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background-color: #e9ecef;
    border-radius: 4px;
    cursor: move;
    border: 1px solid #ccc;
    user-select: none;
}

.draggable[draggable="false"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.droppable {
    display: inline-block;
    min-width: 100px;
    min-height: 30px;
    border: 2px dashed #ccc;
    padding: 5px;
    text-align: center;
    vertical-align: middle;
    background-color: #f9f9f9;
    cursor: pointer;
}

.draggable:hover {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background-color: blue;
    color: white;
    border-radius: 4px;
}

.droppable.filled {
    border: 2px solid #007bff;
    background-color: #e6f3ff;
}

.droppable.wrong {
    border: 2px solid #dc3545;
    background-color: #ffe6e6;
}

.drag-container {
    margin: 10px 0;
}

.draggable img {
    width: 100px;
    height: 100px;
}

.drop-container {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px dashed #666;
}

.dropped {
    position: absolute;
}

.rotate-btn {
    display: block;
    margin: 2px auto;
    padding: 2px 5px;
    font-size: 12px;
    cursor: pointer;
}

.correct-drop {
    border: 2px solid #28a745;
    background-color: #e6ffe6;
}

.incorrect-drop, .wrong-drop {
    border: 2px solid #dc3545;
    background-color: #ffe6e6;
}

.question-text {
    display: inline;
    font-size: 16px;
}

.question-text input {
    width: 100px;
    padding: 5px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.correct-input {
    border-color: #28a745 !important;
    background-color: #e6ffed !important;
}

.incorrect-input {
    border-color: #dc3545 !important;
    background-color: #ffe6e6 !important;
}

.drag-options {
    margin-top: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#q8b-drop-container {
    width: 200px;
    height: 200px;
    border: 2px dashed #666;
    position: relative;
    margin: 10px 0;
}

#q8b-drag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#textarea {
    width: 400px;
    height: 28px;
    padding: 5px;
    text-align: center;
    font-size: 18px;
    resize: vertical;
    box-sizing: border-box;
    vertical-align: middle;
}

#q7-explanation1 textarea,
#q7-explanation2 textarea {
    width: 400px;
    height: 28px;
    padding: 5px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    resize: vertical;
    box-sizing: border-box;
    vertical-align: middle;
}

#q8a-input, #q8b-input {
    text-align: center;
}

#q7-step1 input, #q7-step2 input {
    font-family: Arial, sans-serif !important;
}

#q7-result input {
    width: 250px;
    height: 28px;
    padding: 5px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    resize: vertical;
    box-sizing: border-box;
    vertical-align: middle;
}

.header {
    padding: 10px;
    text-align: center;
}

.datetime {
    font-size: 18px;
    color: #333;
}

.footer {
    padding: 10px;
    text-align: center;
}

button {
    padding: 10px 20px;
    margin-left: 10px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#captureBtn {
    font-size: 18px;
}

#student-info {
    background-color: #FFFF99;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px; /* Space between label-input pairs */
    margin-bottom: 0; /* No gap between student-info and content */
    width: 100%; /* Match the width of content */
    box-sizing: border-box;
}

#student-info label {
    margin: 0;
    font-weight: bold;
    color: blue;
    font-size: clamp(14px, 2vw, 16px);
    white-space: nowrap; /* Prevent label text from wrapping */
}

#student-info input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: clamp(14px, 2vw, 16px);
    margin-left: 0; /* No gap between label and input */
}

#student-info #school {
    width: 200px;
}

#student-info #class {
    width: 50px;
}

#student-info #student-name {
    width: 200px;
}