@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,700,900');

/* ============================================================================ */
/* BASE STYLES */
/* ============================================================================ */

html,
body {
  height: 100%;
  font-family: Source Sans Pro;
  font-weight: 300;
}

/* Body background - clean white */
body {
  background-color: white;
  margin: 0;
  padding: 0;
}

/* ============================================================================ */
/* CONTAINER & LAYOUT */
/* ============================================================================ */

/* Container for dynamic content */
#exam-container {
  min-height: 80vh;
  padding: 80px 20px 80px 20px;
  transition: opacity 0.3s ease-in-out;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 87px;
}

.main_login_area {
  transform: translateY(-80px);
}

#exam-container.transitioning {
  opacity: 0.5;
}

.container-md {
  max-width: 600px;
  margin-bottom: 100px;
}

.alert h5 {
  /* text-align: center; */
  /* margin-bottom: 25px; */
}
.alert i {
  margin-right: 5px;
}
.alert ol, .alert li {
  margin-top: 10px;
}
.alert li {
  margin-bottom: 8px;
}

.problem_table {
  /* margin-left: 8%; */
  display: inline-block;
}
.problem_table td {
  padding-top: 10px;
  padding-bottom: 8px;
  padding-left: 40px;
  padding-right: 40px;
  /* border: 1px dashed #917324; */
}
.problem_table tr {
  border-bottom: 1px dashed #91732457;
  border-top: 1px dashed #91732457;
}

.inline_icon_info {
  margin: 20px 0;
}
.inline_icon_info .left_part {
  float: left;
  /* display: inline-block; */
  width: 7%;
}
.inline_icon_info .right_part {
  display: inline-block;
  width: 90%;
}

.confirm_checkbox {
  height: 20px;
  width: 20px;
  transform: translateY(3px);
  margin-right: 10px;
}

/* ============================================================================ */
/* LOGO & NAVIGATION */
/* ============================================================================ */

/* Logo - top left corner */
.exam-logo {
  position: fixed;
  top: 12px;
  left: 20px;
  width: 50px;
  height: auto;
  z-index: 1000;
  display: none;
}

.exam-logo.show {
  display: block;
}

/* Logout button - top right corner */
.logout-btn {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 1000;
}

/* ============================================================================ */
/* MODAL STYLES */
/* ============================================================================ */

/* Logout modal */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background: white;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content {
  padding: 0;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  line-height: 1.6;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.close:hover {
  color: #000;
}

/* ============================================================================ */
/* WEBCAM & RECORDING */
/* ============================================================================ */

/* Persistent webcam preview */
#webcam-preview-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #000;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  display: none;
}

#webcam-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.webcam-status {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 12px;
  height: 12px;
  background: #ff0000;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================================ */
/* PROGRESS INDICATORS */
/* ============================================================================ */

/* Progress indicator - at the top */
#exam-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
  z-index: 999;
}

#exam-progress-bar {
  height: 100%;
  background: #12456c8c;
  transition: width 0.5s ease;
  width: 0%;
  box-shadow: 0 0 8px rgba(90, 159, 212, 0.4);
  /* display: none; */
}

/* Progress step indicator - mini timeline showing all steps until exam start */
#progress-step-indicator {
  position: fixed;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  font-size: 12px;
  color: #999;
  text-align: center;
  padding: 8px 16px;
  background: white;
  border-radius: 4px;
  /* box-shadow: 0 1px 3px rgba(0,0,0,0.08); */
  display: none;
  white-space: nowrap;
}

#progress-step-indicator.show {
  display: block;
}

.progress-step-item {
  display: inline-block;
  margin: 0 15px;
  transition: all 0.2s ease;
}

.progress-step-item.completed {
  color: #297e19;
  font-weight: 500;
}

.progress-step-item.active {
  color: #18507cc9;
  font-weight: 600;
  font-size: 11px;
  border: 1px solid #18507cc9;
  border-radius: 1000px;
  padding: 0 5px;
}

.progress-step-item.upcoming {
  color: #bebebe;
}

.step-arrow {
  display: inline-block;
  margin: 0 4px;
  color: #ddd;
}

/* ============================================================================ */
/* LOADING & ERROR STATES */
/* ============================================================================ */

/* Loading spinner */
.loading-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.loading-spinner.active {
  display: block;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

.spinner-border {
  width: 80px;
  height: 80px;
  margin-top: 20px;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error display */
.error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: white;
  padding: 15px 30px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 10000;
  display: none;
}

.error-message.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translate(-50%, -100%); }
  to { transform: translate(-50%, 0); }
}

/* ============================================================================ */
/* TYPOGRAPHY & TEXT ELEMENTS */
/* ============================================================================ */

h1 {
  margin-bottom: 10px;
}

h2 {
  margin-bottom: 40px;
}

ul {
  text-align: left;
}

/* ============================================================================ */
/* BUTTONS */
/* ============================================================================ */

.btn-dark {
  margin-top: 40px;
  width: 70%;
  color: white !important;
}

/* ============================================================================ */
/* FORM & SIGN IN */
/* ============================================================================ */

.form-signin {
  max-width: 350px;
}

/* ============================================================================ */
/* QUESTION STYLES */
/* ============================================================================ */

#answerForm .custom-control-label {
  transform: scale(2);
  margin-bottom: 40px;
}

#answerForm .custom-control-input:focus~.custom-control-label::before {
  box-shadow: none !important;
}

h3 img {
  width: 70%;
}

/* Question text - responsive sizing */
h3 b {
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.exam_option {
  font-size: clamp(1.2rem, 2.5vw, 2.0rem);
  margin-bottom: 0.5em;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.exam_option label {
  display: inline-block;
  max-width: calc(100% - 1.5em);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.exam_option input {
  border: 0px;
  width: 0.7em;
  height: 0.7em;
  flex-shrink: 0;
  vertical-align: top;
  margin-top: 0.15em;
}

.question-type-header {
  border-bottom: 1px solid black;
  display: block;
  margin-bottom: 10px;
  padding-bottom: 5px;
  font-weight: bold;
}

.question-type-example {
  margin-top: 10px;
  border: 1px dotted grey;
  border-radius: 5px;
  padding: 1px 10px;
  background: #f2f2f2;
}

/* ============================================================================ */
/* SHORT ANSWER */
/* ============================================================================ */

.short_answer_container {
  margin: 2em 0;
}

.short-answer-input {
  font-size: 1.5em;
  padding: 0.5em;
  border: 2px solid #ccc;
  border-radius: 5px;
}

/* ============================================================================ */
/* CODE ANSWER & EDITOR */
/* ============================================================================ */

.code_answer_container {
  margin: 2em 0;
}

.code-answer-input {
  font-family: 'Courier New', monospace;
  font-size: 1.2em;
  padding: 0.5em;
  border: 2px solid #ccc;
  border-radius: 5px;
  resize: vertical;
}

/* Language Selector */
.language-selector-container {
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.language-label {
  font-size: 1.2em;
  font-weight: 600;
  margin-right: 10px;
  display: inline-block;
  margin-bottom: 8px;
}

.language-select {
  display: inline-block;
  width: auto;
  min-width: 200px;
  font-size: 1.1em;
  padding: 8px 12px;
  border: 2px solid #444;
  border-radius: 5px;
  background-color: #2d2d2d;
  color: #f8f8f2;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.language-select:hover,
.language-select:focus {
  border-color: #66d9ef;
  outline: none;
  box-shadow: 0 0 5px rgba(102, 217, 239, 0.5);
}

/* CodeMirror Editor */
#codeEditorWrapper {
  max-width: 900px;
  margin: 0 auto;
}

.CodeMirror {
  border: 2px solid #444;
  border-radius: 5px;
  font-size: 14px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  height: auto;
  min-height: 400px;
  text-align: left;
}

.CodeMirror-scroll {
  min-height: 400px;
}

.CodeMirror-gutters {
  background-color: #23241f;
  border-right: 1px solid #3e3d32;
}

.CodeMirror-linenumber {
  color: #75715e;
  padding: 0 5px;
}

.CodeMirror-cursor {
  border-left: 2px solid #f8f8f0;
}

/* ============================================================================ */
/* PREVIEW BANNER */
/* ============================================================================ */

.preview-banner {
  background: #ff9800;
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ============================================================================ */
/* UTILITY CLASSES FOR TEMPLATES */
/* ============================================================================ */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.example-image {
  max-width: 100%;
  height: auto;
  border: 20px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.example-solution-code {
  text-align: left;
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
}

.equation-display {
  font-size: 1.3em;
  margin: 15px 0;
}

.recording-setup-title {
  text-align: center;
  color: #1f2937;
  margin-bottom: 20px;
}

.recording-setup-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 18px;
}

.alert-box-title {
  margin-bottom: 15px;
}

.alert-box-content {
  margin: 0;
  font-weight: bold;
  text-align: center;
}

.test-stage-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #3b82f6;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 10px;
}

.test-stage-info {
  font-size: 14px;
  color: #1e40af;
  margin: 0;
}

.practice-exam-banner {
  border-radius: 0;
  margin: 0;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.example-badge {
  position: relative;
  top: 10px;
}

.exam-info-list {
  max-width: 700px;
  margin: 20px auto;
}

.exam-info-list li {
  margin-bottom: 15px;
}

.test-sandbox-info {
  margin-top: 20px;
}

.test-sandbox-description {
  margin-bottom: 15px;
}

.start-table-name-col {
  width: 30%;
}

.start-table-info-col {
  font-weight: 600;
  padding: 15px 10px;
}

.start-table i {
  opacity: 0.8;
  width: 19px;
}

/* ============================================================================ */
/* RECORDING SETUP (from record-exam-init.html) */
/* ============================================================================ */

.recording-setup-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 30px;
}

.setup-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.camera-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

@media (max-width: 768px) {
  .camera-grid {
    grid-template-columns: 1fr;
  }
}

.camera-box {
  border: 3px solid #e5e7eb;
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s;
}

.camera-box:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.camera-box.webcam {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.camera-box.phone {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}




.camera-icon {
  font-size: 64px;
  margin-bottom: 15px;
}

.camera-box.webcam .camera-icon {
  color: #3b82f6;
}

.camera-box.phone .camera-icon {
  color: #10b981;
}


.camera-box.webcam, .camera-box.phone, .camera-box.webcam .camera-icon, .camera-box.phone .camera-icon {
  border-color: #696969;
  background: #fcfcfc;
  color: grey !important;
}

.camera-icon span {
  font-size: 70px;
  transform: translateY(10px);
}


/* .camera-title-webcam {
  color: #1e40af;
  margin-bottom: 10px;
}

.camera-description-webcam {
  color: #1e3a8a;
  font-size: 14px;
}

.camera-title-phone {
  color: #047857;
  margin-bottom: 10px;
}

.camera-description-phone {
  color: #065f46;
  font-size: 14px;
} */

.camera-title-webcam {
  color: #0c0c0c;
  margin-bottom: 10px;
}

.camera-description-webcam {
  color: #0c0c0c;
  font-size: 14px;
}

.camera-title-phone {
  color: #0c0c0c;
  margin-bottom: 10px;
}

.camera-description-phone {
  color: #0c0c0c;
  font-size: 14px;
}



 

.requirements-list {
  text-align: left;
  margin: 20px 0;
  padding-left: 20px;
}

.requirements-list li {
  margin: 12px 0;
  line-height: 1.6;
  color: #374151;
}

.alert-box {
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
}

.alert-box.warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.alert-box.danger {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert-box.info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.continue-btn {
  font-size: 20px;
  padding: 15px 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 30px;
  transition: transform 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.step-indicator {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  line-height: 30px;
  font-weight: bold;
  margin-right: 10px;
}

/* ============================================================================ */
/* ALL-QUESTIONS EXAM MODE (Pre-Final) */
/* ============================================================================ */

.exam-all-questions {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: -80px -20px; /* Override container padding */
}

.exam-header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  /* background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); */
  color: #000000;
  /* border: 1px solid #888888; */
  border-left: none;
  border-right: none;
  /* border-radius: 8px; */
  background: white;
  padding: 15px 20px;
  /* box-shadow: 0 2px 10px rgba(0,0,0,0.2); */
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  margin-bottom: 50px;
  transform: translateY(-1px);
  width: 100vw;
}

.exam-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 80vw;
  margin: 0 auto;
}

.exam-title {
  font-size: 17px;
  font-weight: 600;
}

.exam-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.timer-display {
  font-size: 22px;
  font-weight: bold;
  /* background: #27ae60; */
  /* padding: 8px 16px; */
  border-radius: 5px;
  min-width: 100px;
  text-align: center;
}

.timer-display.warning {
  background: #f39c12;
  animation: pulse-warning 1s ease-in-out infinite;
}

.timer-display.critical {
  background: #e74c3c;
  animation: pulse-critical 0.5s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.02); }
}

.save-status {
  color: #248421;
  font-size: 14px;
}

.btn-save {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.exam-controls i {
  margin-right: 4px;
  font-size: 0.95em;
}

.btn-save:hover {
  background: #2980b9;
  color: white;
}

.questions-scroll-container {
  flex: 1;
  padding: 20px;
  padding-bottom: 100px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  margin-top: 50px;
}

.exam-instructions-banner {
  background: #e8f4fd;
  border: 1px solid #3498db;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 100px;
  color: #2c3e50;
}

.exam-instructions-banner i {
  color: #3498db;
  margin-right: 10px;
}

.loading-questions {
  text-align: center;
  padding: 60px 20px;
  color: #7f8c8d;
}

.loading-questions i {
  color: #3498db;
  margin-bottom: 15px;
}

.problem-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 80px;
  padding: 25px;
  border: 1px solid #ecf0f1;
  border: 1px solid #0000004d;
}

.problem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  /* padding-bottom: 15px; */
  /* border-bottom: 2px solid #ecf0f1; */
  flex-wrap: wrap;
  gap: 15px;
}

.problem-title {
  font-size: 25px;
  font-weight: 600;
  color: #2c3e50;
  color: black;
  margin: 0;
}

.answer-mode-toggle {
  display: flex;
  gap: 10px;
}

.mode-option {
  cursor: pointer;
  padding: 8px 15px;
  border: 2px solid #bdc3c7;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  user-select: none;
  color: grey;
}


.mode-option input[type="radio"] {
  display: none;
}

.mode-option:hover {
  border-color: #3498db;
  background: #f8f9fa;
}

.mode-option.selected,
.mode-option:has(input:checked) {
  border-color: #3498db;
  background: #e8f4fd;
  color: #2980b9;
}

.mode-option i {
  font-size: 17px;
  transform: translateY(1.5px);
  margin-right: 4px;
}

/* Hand-only notice (when handwritten answers are required) */
.hand-only-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: #fff3cd;
  border: 2px solid #f39c12;
  border-radius: 6px;
  color: #856404;
  font-size: 14px;
  font-weight: 500;
}

.hand-only-notice i {
  font-size: 16px;
  color: #f39c12;
}

.problem-context {
  /* background: #f8f9fa; */
  padding: 20px 0px;
  border-radius: 8px;
  margin-bottom: 20px;
  /* border-left: 4px solid #3498db; */
}

.context-text {
  line-height: 1.7;
  /* color: #2c3e50; */
}

.context-image {
  max-width: 100%;
  height: auto;
  margin-top: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Research Paper Container - for open-ended research questions */
.research-paper-container {
  margin: 20px 0 30px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f8f9fa;
}

.paper-iframe-wrapper {
  width: 100%;
  height: 600px;
  position: relative;
}

.research-paper-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Responsive adjustments for research paper iframe */
@media (max-width: 768px) {
  .paper-iframe-wrapper {
    height: 450px;
  }
}

@media (max-width: 480px) {
  .paper-iframe-wrapper {
    height: 350px;
  }
}

.answer-area {
  margin-top: 20px;
}

.subquestion {
  margin-bottom: 25px;
}

.subq-label {
  display: block;
  font-weight: 500;
  margin-bottom: 10px;
  /* color: #2c3e50; */
  font-size: 16px;
  line-height: 1.5;
}

.subq-answer {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

.subq-answer:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.subq-answer::placeholder {
  color: #95a5a6;
}

.paper-reminder .reminder-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 23px;
  text-align: center;
  opacity: 0.85;
}

.paper-reminder .reminder-box i {
  font-size: 32px;
  color: #f39c12;
  display: block;
  margin-bottom: 10px;
}

.paper-reminder .reminder-box strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
  color: #856404;
}

.paper-reminder .reminder-box p {
  margin: 0;
  color: #856404;
}

/* Hand-only area - shows subquestions read-only with handwritten notice */
.hand-only-area {
  margin-top: 20px;
}

.subquestions-readonly {
  margin-bottom: 20px;
}

.subquestion-readonly {
  margin-bottom: 12px;
  padding: 18px 15px;
  background: hsl(210 17% 98% / 1);
  border-radius: 6px;
  /* border: 1px solid #00000036; */
  /* border-left: 3px solid #3498db; */
}

.subquestion-readonly .subq-label {
  display: block;
  font-size: 15px;
  /* color: #2c3e50; */
  font-weight: 400;
  margin: 0;
}

/* Hand-only reminder box - same block style as paper-reminder */
.hand-only-area .reminder-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 23px;
  text-align: center;
  opacity: 0.85;
  margin-top: 15px;
  display: block;
}

.hand-only-area .reminder-box i {
  font-size: 32px;
  color: #f39c12;
  display: block;
  margin-bottom: 10px;
}

.hand-only-area .reminder-box strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
  color: #856404;
}

.hand-only-area .reminder-box p {
  margin: 0;
  color: #856404;
}

.exam-footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 15px 20px;
  border-top: 2px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-info {
  color: #7f8c8d;
  font-size: 14px;
}

.footer-info i {
  color: #3498db;
  margin-right: 8px;
}

.btn-submit-exam {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  padding: 8px 20px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-submit-exam:hover {
  background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
  /* transform: translateY(-1px); */
  /* box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3); */
  color: white;
}

.btn-submit-exam:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Time warning notification */
.time-warning-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #e74c3c;
  color: white;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease;
}

.time-warning-notification.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes slideIn {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Responsive adjustments for all-questions mode */
@media (max-width: 768px) {
  .exam-header-content {
    flex-direction: column;
    gap: 15px;
  }

  .exam-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .problem-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .answer-mode-toggle {
    width: 100%;
    justify-content: center;
  }

  .exam-footer-fixed {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .footer-info {
    order: 2;
  }

  .btn-submit-exam {
    width: 100%;
    order: 1;
  }
}
/* ====================================
   UPLOAD SOLUTIONS STYLES
   ==================================== */

.upload-instructions {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #0066cc;
}

.upload-instructions h4 {
  color: #0066cc;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.upload-instructions p {
  color: #555;
  margin-bottom: 15px;
}

.upload-tips {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upload-tips li {
  padding: 8px 0;
  color: #666;
  font-size: 0.95rem;
}

.upload-tips li i {
  color: #0066cc;
  margin-right: 8px;
  width: 20px;
}

.paper-problems-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.problem-upload-card {
  border: 2px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #fff;
}

.problem-upload-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.problem-upload-header {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.problem-upload-header h5 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.problem-upload-header h5 i {
  margin-right: 10px;
}

.upload-status {
  font-size: 0.9rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
}

.upload-status.uploaded {
  background: #28a745;
  color: white;
  font-weight: 500;
}

.problem-upload-body {
  padding: 20px;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background: #f9f9f9;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.file-upload-label:hover {
  border-color: #0066cc;
  background: #f0f7ff;
}

.file-upload-label i {
  font-size: 3rem;
  color: #0066cc;
  margin-bottom: 15px;
}

.file-upload-label span {
  font-size: 1.1rem;
  color: #333;
  font-weight: 500;
  margin-bottom: 5px;
}

.file-upload-label small {
  color: #999;
  font-size: 0.9rem;
}

.file-upload-input {
  display: none;
}

/* Responsive design for upload solutions */
@media (max-width: 768px) {
  .upload-instructions {
    padding: 15px;
  }

  .problem-upload-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .file-upload-label {
    padding: 30px 20px;
  }

  .file-upload-label i {
    font-size: 2.5rem;
  }
}

/* ============================================================================ */
/* UPLOAD SOLUTIONS - SOCKET.IO PHOTO GRID */
/* ============================================================================ */

.upload-solutions-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.upload-solutions-header {
  text-align: center;
  margin-bottom: 20px;
}

.upload-solutions-header h4 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

/* Photos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* Photo Card */
.photo-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
  transition: all 0.2s;
  position: relative;
  background: white;
}

.photo-card:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.photo-card.sortable-ghost {
  opacity: 0.4;
}

.photo-card.sortable-drag {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Photo Number Badge */
.photo-number {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 10;
  font-size: 14px;
}

/* Photo Image */
.photo-image {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background-color: #f8f9fa;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

/* Photo Actions */
.photo-actions {
  display: flex;
  gap: 5px;
  padding: 10px;
  background: #f8f9fa;
}

.photo-action-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.photo-action-btn:hover {
  background: #e9ecef;
}

.photo-action-btn.delete:hover {
  background: #f8d7da;
  border-color: #dc3545;
  color: #dc3545;
}

/* Drag Handle */
.drag-handle {
  /* position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: grab;
  z-index: 10;
  font-size: 12px; */
  
  position: absolute;
  top: 40%;
  right: 44%;
  /* background: rgba(0, 0, 0, 0.7); */
  color: #ffffff85;
  /* padding: 6px 8px; */
  border-radius: 4px;
  cursor: grab;
  z-index: 10;
  font-size: 50px;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
  display: block;
}

/* Photo Modal */
.photo-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.photo-modal .modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 90%;
  max-width: 1200px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}

.photo-modal .modal-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.photo-modal .modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
}

.photo-modal .modal-close:hover {
  color: #dc3545;
}

/* Responsive Photos Grid */
@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .photo-actions {
    flex-direction: column;
  }

  .photo-modal .modal-close {
    right: 20px;
    font-size: 30px;
  }
}

/* ============================================================================ */
/* PHONE DISCONNECTION WARNING MODAL */
/* ============================================================================ */

.phone-disconnect-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.phone-disconnect-modal.active .phone-disconnect-content {
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phone-disconnect-modal.dismissed {
  background-color: rgba(0, 0, 0, 0.5);
}

.phone-disconnect-modal.dismissed .phone-disconnect-content {
  transform: scale(0.9);
  opacity: 0.9;
}

.phone-disconnect-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 2px solid #e9a825;
  transition: all 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.phone-disconnect-icon {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.phone-disconnect-icon .fa-mobile-alt {
  font-size: 60px;
  color: #6c757d;
}

.phone-disconnect-icon .warning-badge {
  position: absolute;
  bottom: -5px;
  right: -12px;
  font-size: 28px;
  color: #e9a825;
}

.phone-disconnect-content h2 {
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.disconnect-message {
  color: #495057;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* QR Code Container */
.disconnect-qr-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
}

.disconnect-qr-container #phone-reconnect-qrcode {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.disconnect-qr-container #phone-reconnect-qrcode img {
  border-radius: 8px;
}

.qr-hint {
  color: #6c757d;
  font-size: 13px;
  margin: 0;
}

.disconnect-instructions {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: left;
}

.disconnect-instructions h3 {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.disconnect-instructions ol {
  margin: 0;
  padding-left: 18px;
  color: #495057;
  font-size: 13px;
}

.disconnect-instructions li {
  margin-bottom: 5px;
  line-height: 1.4;
}

.disconnect-note {
  color: #6c757d;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 15px;
  padding: 8px;
  background: #e8f4fd;
  border-radius: 6px;
}

.disconnect-note i {
  font-size: 14px;
  color: #3498db;
}

.btn-dismiss-warning {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 25px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dismiss-warning:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-dismiss-warning:active {
  transform: translateY(0);
}

/* Responsive adjustments for phone disconnect modal */
@media (max-width: 576px) {
  .phone-disconnect-content {
    padding: 25px;
    margin: 15px;
  }

  .phone-disconnect-icon .fa-mobile-alt {
    font-size: 60px;
  }

  .phone-disconnect-icon .warning-badge {
    font-size: 30px;
    right: -10px;
  }

  .phone-disconnect-content h2 {
    font-size: 22px;
  }

  .disconnect-message {
    font-size: 14px;
  }

  .disconnect-instructions {
    padding: 15px;
  }
}

/* ============================================================================ */
/* UPLOAD QR MODAL (Fallback for solution upload problems)                      */
/* ============================================================================ */

.upload-qr-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.upload-qr-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 2px solid #3b82f6;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.upload-qr-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #6c757d;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.upload-qr-close:hover {
  color: #333;
}

.upload-qr-icon {
  margin-bottom: 15px;
}

.upload-qr-icon i {
  font-size: 50px;
  color: #3b82f6;
}

.upload-qr-content h3 {
  color: #2c3e50;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.upload-qr-content p {
  color: #495057;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 15px;
}

.upload-qr-note {
  color: #6c757d;
  font-size: 13px;
  margin-top: 15px;
}

.upload-qr-note i {
  color: #3b82f6;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .upload-qr-content {
    padding: 25px;
    margin: 15px;
  }

  .upload-qr-icon i {
    font-size: 40px;
  }

  .upload-qr-content h3 {
    font-size: 20px;
  }

  .upload-qr-content p {
    font-size: 14px;
  }
}

.example_image_wrapper {
  display: inline-block;
  width: 218px;
  margin-right: 17px;
  margin-bottom: 10px;
  margin-top: 10px;
}
.example_image {
  height: 160px;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0.5px 0.5px 3px 0px black;
  margin-bottom: 5px;
}
.example_text {
  font-size: 14px;
  font-weight: 400;
}

.timer_upload_badge {
  background: #cd2131;
  color: white;
  padding: 1px 6px;
  border-radius: 5px;
}

/* ============================================================================ */
/* EXAM QUEUE COMPONENT */
/* ============================================================================ */

.queue-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-card {
  background: white;
  /* border-radius: 12px; */
  padding: 40px;
  /* box-shadow: 0 4px 6px rgba(0,0,0,0.1); */
}

/* Loading State */
.queue-loading-state {
  padding: 40px 20px;
}

.queue-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: queue-spin 1s linear infinite;
}

@keyframes queue-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.queue-loading-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.queue-loading-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
}

/* Queue View */
.queue-icon {
  font-size: 56px;
  color: #3b82f6;
  margin-bottom: 16px;
}

.queue-title {
  font-size: 28px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.queue-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 24px 0;
}

.queue-position {
  font-size: 64px;
  font-weight: bold;
  color: #1f2937;
  margin: 16px 0 8px 0;
  line-height: 1;
}

.queue-label {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 24px;
}

.queue-info-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  text-align: left;
}

.queue-info-box p {
  color: #374151;
  line-height: 1.6;
  margin: 0 0 12px 0;
  font-size: 15px;
}

.queue-info-box p:last-child {
  margin-bottom: 0;
}

.queue-info-box i {
  color: #3b82f6;
  margin-right: 6px;
}

.queue-server-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.queue-stat-box {
  background: #f3f4f6;
  padding: 16px;
  border-radius: 8px;
}

.queue-stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.queue-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.queue-stat-value.high {
  color: #ef4444;
}

.queue-refresh-notice {
  color: #9ca3af;
  font-size: 13px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.queue-refresh-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: queue-spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 576px) {
  .queue-container {
    padding: 20px;
    margin: 20px auto;
  }

  .queue-card {
    padding: 30px 20px;
  }

  .queue-position {
    font-size: 48px;
  }

  .queue-server-stats {
    grid-template-columns: 1fr;
  }
}