/* General body styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    color: #333;
}

h1, h2 {
    text-align: center;
    color: #070807;
}

/* Main container */
#build-set-section, #submitted-set-section {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button styling */
button {
    background-color: #1d307e;
    color: white;
    border: none;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 5px 2px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #21378e;
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

label {
    font-weight: bold;
}

input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto; /* Let the browser decide the column widths based on content */
}

table, th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    overflow-wrap: break-word; /* Modern browsers */
    word-break: break-word; /* Break long words */
    white-space: normal;
}

th, td {
    word-wrap: break-word; /* Enables wrapping */
    word-break: break-word; /* Breaks long words */
    max-width: 300px; /* Limits the maximum width of the cell */
    padding: 12px;
    text-align: left;
}

th {
    background-color: #2c3e50;
    color: white;
}

table th:nth-child(1) { /* For the 'Question' column */
    width: 10%;
}

table th:nth-child(2) { /* For the 'Question' column */
    width: 10%;
}

table th:nth-child(3) { /* For the 'Question' column */
    width: 30%;
}

table th:nth-child(4) { /* For the 'Question' column */
    width: 10%;
}

table th:nth-child(5) { /* For the 'Question' column */
    width: 10%;
}

table th:nth-child(6) { /* For the 'Question' column */
    width: 70%;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #ddd;
}

/* Button styles inside the table */
table button {
    background-color: #1d307e;
    color: white;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

table button:hover {
    background-color: #1d307e;
}

/* Styling for the spinner */
#loading-spinner img {
    width: 35px; /* Resize the spinner to be smaller */
    height: 35px;
    display: block;
}

/* Navigation Bar Styling */
nav {
    margin: 0;
    background-color: #2c3e50;
    padding: 10px;
    text-align: center;
}
nav a {
    color: #fff;
    margin: 0 15px;
    text-decoration: none;
}

.hidden {
    display: none; /* Hide the element */
}

/* Registration Form Styles */
#registration-form {
    display:none;
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.2);
    padding: 30px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

/* Ensure all input fields in the registration form have the same width */
#registration-form .login-form-group input {
    width: 100%;  /* Ensures all inputs take full width of the container */
    padding: 12px;  /* Consistent padding */
    font-size: 16px;  /* Uniform font size */
    border: 1px solid #ccc;  /* Consistent border */
    border-radius: 5px;  /* Rounded corners */
    box-sizing: border-box;  /* Ensures padding does not affect width */
    margin-bottom: 10px;  /* Spacing between input fields */
}

/* Ensure the container does not affect input sizes */
#registration-form .login-form-group {
    width: 100%;  /* Ensures parent div does not shrink input fields */
}

/* Buttons should match login form */
#registration-form .login-submit-btn {
    background-color: #1d307e;
    color: #fff;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#registration-form .login-submit-btn:hover {
    background-color: #21378e;
    transform: scale(1.02);
}

/* Back to Login button styling */
#back-to-login {
    background-color: transparent;
    color: #1d307e;
    border: 1px solid #1d307e;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#back-to-login:hover {
    background-color: #1d307e;
    color: #fff;
    transform: scale(1.02);
}

/* Close Button for Registration */
#register-close {
    position: absolute;
    top: 0px;
    right: 0px;
    background: none;
    border: none;
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

#register-close:hover {
    color: #151414;
}

/* Close button styles */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: #999999;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

.close-btn:hover {
    color: #333333;
}


/* Login Modal Styling */
.login-modal {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.2);
    padding: 30px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

/* Close Button for Login */
.login-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none !important;
    border: none;
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
    outline: none; /* Remove the default blue outline */
}

.login-close-btn:hover {
    color: #151414;
}

.login-close-btn:focus {
    outline: none; /* Ensure no outline when focused */
    box-shadow: none;
}

/* Form Group for Login */
.login-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: center; /* Center horizontally */
    gap: 10px; /* Add spacing between buttons */
}

.login-form-group label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.login-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.login-form-group input:focus {
    border-color: #1d307e;
    outline: none;
    box-shadow: 0 0 4px rgba(29, 48, 126, 0.5);
}

/* Buttons Section */
.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Button Styling */
button.login-submit-btn,
button.login-otp-button,
button.switch-to-register {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button.login-submit-btn {
    background-color: #1d307e;
    color: #fff;
}

button.login-otp-button {
    background-color: #30230c;
    color: #fff;
}

button.login-otp-button:hover {
    background-color: #453629;
    transform: scale(1.02);
}



button.login-submit-btn:hover {
    background-color: #21378e;
    transform: scale(1.02);
}


/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}


* Process button styling */
button#process-btn {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #0056b3;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}



button#process-btn:hover {
    background-color: #003d80;
}

/* Process Student Answers section styling */
#process-student-answers {
    max-width: 600px; /* Ensure it aligns with other sections */
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Label and input styling for form elements */
#process-student-answers label {
    display: block;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
}

#process-student-answers select,
#process-student-answers input[type="file"] {
    width: 100%; /* Full width for better alignment */
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Sidebar styling */
.sidebar {
    width: 200px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #2c3e50;
    color: #fff;
    padding: 20px;
    box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1);
}

.sidebar h3 {
    color: #f1f1f1;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 15px;
}

.sidebar ul li a {
    color: #f1f1f1;
    text-decoration: none;
}

.sidebar ul li a:hover {
    color: #ffdd57;
}

/* Main content adjustment */
.main-content {
    margin-left: 220px; /* Adjust based on sidebar width */
    padding: 20px;
}

#success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 20px;
    border: 1px solid #cccccc;
    text-align: center;
    z-index: 1000;
    font-weight: bold;
}

#ai-answer-generator:disabled {
    background-color: #cccccc !important; /* Gray background for disabled state */
    color: #666666 !important;           /* Lighter text color */
    cursor: not-allowed;                 /* Change cursor to indicate disabled state */
    opacity: 0.6;                        /* Make it slightly transparent */
}

.disabled-input {
    background-color: #f0f0f0; /* Light gray background */
    color: #666666;           /* Gray text */
    cursor: not-allowed;      /* Change cursor to indicate it's disabled */
}


#answer-text {
    background-color: #dae5f2; /* Light blue background */
    color: #002f6c; /* Dark navy blue text */
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #647fb9; /* Border color similar to background */
    resize: vertical; /* Allow vertical resizing only */
    overflow-y: auto; /* Ensure scrollbar appears if text overflows */
}

/* Container to align the textarea and spinner side by side */
.answer-container {
    display: flex;
    align-items: flex-start; /* Align items at the top */
    gap: 10px; /* Space between textarea and spinner */
    margin-top: 20px;
}

/* General Modal Styling */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    align-items: center;
    justify-content: center;
    visibility: hidden; /* Hide modal by default */
    opacity: 0; /* Make it invisible initially */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
}

.modal.show {
    visibility: visible;
    opacity: 1;
    /* display: flex; */
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.modal-icon {
    font-size: 50px;
    color: #a8cdaa; /* Green color for checkmark */
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.modal-message {
    font-size: 16 px;
    color: #777;
    margin-bottom: 20px;
}

.modal-button {
    background-color: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.modal-button:hover {
    background-color: #1a252f;
}

#start-header-image {
    width: 80%;
    max-width: 600px;
    height: auto;
    margin: 0 auto 20px auto;
    opacity: 0.9;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

table td[contenteditable="true"] {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    outline: none;
    cursor: text;
    padding: 5px;
}
table td[contenteditable="true"]:hover {
    background-color: rgb(223, 228, 179);
}

/* Disabled Button Styling */
button.upload-qp-disabled-button {
    background-color: #cccccc !important; /* Force grey background */
    color: #666666 !important;           /* Force grey text */
    cursor: not-allowed !important;      /* Ensure pointer is 'not-allowed' */
    border: 1px solid #999999 !important;
    opacity: 0.7;                        /* Add opacity for disabled effect */
}

/* Tooltip Styling */
[upload-qp-data-tooltip] {
    position: relative; /* Position for tooltip */
    cursor: pointer;
}

[upload-qp-data-tooltip]::after {
    content: attr(upload-qp-data-tooltip); /* Display the tooltip text */
    position: absolute;
    top: 100%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: #482f0f;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0; /* Initially hidden */
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

[upload-qp-data-tooltip]:hover::after {
    opacity: 1; /* Show tooltip on hover */
}

.flash-message {
    position: fixed;
    top: 30px;
    left: calc((100vw - 200px) / 2 + 200px); /* Adjust based on sidebar width (200px) */
    transform: translate(-50%); /* Horizontally and vertically center */
    padding: 10px 20px;
    background-color: #482f0f; /* Green for success */
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out; /* Smooth fade-out effect */
}

.flash-message.error {
    background-color: #dc3545; /* Red for error */
}
.flash-message.hide {
    opacity: 0 !important;
}

button.switch-to-register {
    background-color: transparent;
    color: #1d307e;
    border: 1px solid #1d307e;
}

button.switch-to-register:hover {
    background-color: #1d307e;
    color: #fff;
    transform: scale(1.02);
}

/* 🔹 Change Login Button Style When Register Button is Hovered */
button.switch-to-register:hover ~ button.login-submit-btn {
    background-color: transparent !important; /* Make login button transparent */
    color: #1d307e !important; /* Make login text dark blue */
    border: 1px solid #1d307e;
    transform: scale(1.0); /* Prevent unintended scaling */
}

/* Specific Styles for the Submitted Questions Table */
#question-table-build th:nth-child(1), /* Question No. */
#question-table-build td:nth-child(1) {
    width: 10%; /* Adjust column width for Question No. */
}

#question-table-build th:nth-child(2), /* Sub-part No. */
#question-table-build td:nth-child(2) {
    width: 10%; /* Adjust column width for Sub-part No. */
}

#question-table-build th:nth-child(3), /* Question Text */
#question-table-build td:nth-child(3) {
    width: 20%; /* Adjust column width for Question Text */
}

#question-table-build th:nth-child(4), /* Answer Text */
#question-table-build td:nth-child(4) {
    width: 50%; /* Larger column for Answer Text */
    max-width: 600px; /* Optional: restrict max width */
    word-wrap: break-word; /* Ensure text wraps onto the next line */
    word-break: break-word; /* Break long words if necessary */
}

#question-table-build th:nth-child(5), /* Actions */
#question-table-build td:nth-child(5) {
    width: 10%; /* Adjust column width for Actions */
}

.upload-answer-sheets-btn-dashboard {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.upload-answer-sheets-btn-dashboard:hover {
    background-color: #003d80;
}

.upload-answer-sheets-btn-dashboard i {
    font-size: 16px;
}

/* General Styling for Dashboard Table */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden; /* For rounded borders */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.dashboard-table th, .dashboard-table td {
    padding: 15px;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.dashboard-table th {
    background-color: #2c3e50;
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 13px;
}

.dashboard-table td {
    background-color: #f9f9f9;
    font-size: 14px;
}

.dashboard-table tr:nth-child(even) td {
    background-color: #f2f2f2;
}

.dashboard-table tr:hover td {
    background-color: #d8e4f0;
    color: #333;
}

/* Buttons Inside the Dashboard Table */
.dashboard-table button {
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.dashboard-table .view-btn, .dashboard-table .action-btn, .dashboard-table .upload-btn {
    background-color: #2c3e50;
    color: #fff;
}

.dashboard-table .view-btn:hover, .dashboard-table .action-btn:hover, .dashboard-table .upload-btn:hover {
    background-color: #003d80;
}

/* Specific Column Styling for Dashboard Table */
.dashboard-table th:nth-child(1), .dashboard-table td:nth-child(1) {
    width: 5%;
}

.dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2) {
    text-align: left;
    width: 25%;
    font-weight: 600;
}

.dashboard-table th:nth-child(3), .dashboard-table td:nth-child(3) {
    width: 15%;
}

.dashboard-table th:nth-child(4), .dashboard-table td:nth-child(4) {
    width: 10%;
}

.dashboard-table th:nth-child(5), .dashboard-table td:nth-child(5) {
    width: 10%;
}

.dashboard-table th:nth-child(6), .dashboard-table td:nth-child(6) {
    width: 20%;
}

.dashboard-table th:nth-child(7), .dashboard-table td:nth-child(7) {
    width: 15%;
}

/* Modal Background */
#modal_block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Ensure it’s on top */
}

/* Modal Content Box */
#modal_block .modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 400px; /* Fixed width */
    max-width: 80%;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Message */
#modal_block .modal-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

/* Close Button */
#modal_block .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

/* Disable Background Interaction */
body.modal-open {
    overflow: hidden;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

h3 {
    color: black;
}