/*=============================================================================
 * EXAM SPECIFIC styling
 *============================================================================*/

/* 1. Question Grid */
.question-overview {
  height: 90%;
  width: 85%;
  margin: 0 auto;
  overflow-y: auto;
  flex: 1;
  border: 6px solid #2f74fd;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
}

.question-square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f6fa;
  border: 1px solid #bcd;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.question-square.active {
  background-color: #3a7bfd;
  color: white;
  border-color: #3a7bfd;
}

.question-square.answered {
  background-color: #e3eafc;
  border-color: #3a7bfd;
}

.question-square.marked {
  border: 2px solid #ffb300;
}

.mark-indicator {
  position: absolute;
  top: 2px;
  right: 4px;
  color: #ffb300;
  font-size: 10px;
}

/* Submit button container - positioned at bottom */
.sidebar-submit-container {
  text-align: center;
  padding: 15px 0;
  margin: auto auto 20px auto;
}

/* 2. Question Layout */
.exam-question {
  margin-bottom: 24px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.question-number, .question-subject {
  font-size: 0.95rem;
  color: #666;
  display: inline-block;
  margin-right: 15px;
}

.question-text {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.mark-btn {
  background: #ffe082;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95em;
}

.exam-nav {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.nav-btn, .results-nav-btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 10px;
}

.prev-btn, .next-btn {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 10px 28px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 12px;
}

.next-btn {
  margin-right: 32px;
}

.results-nav-btn {
  background: #ff6600;
  color: white;
  font-size: 1.2rem;
}

.nav-btn:hover, .results-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 3. Question Types */
.choices {
  list-style: none;
  padding: 0;
}

.choices li {
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.choices li:hover {
  background-color: #f5f5f5;
}

.choices label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.choices input {
  margin-right: 10px;
}

/* Multiple correct answers styling */
.multiple-correct-container {
  margin: 15px 0;
}

.multiple-correct-instruction {
  font-weight: 500;
  color: #07376b;
  margin-bottom: 10px;
}

.choices.multiple-correct li {
  margin-bottom: 10px;
}

.choices.multiple-correct input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
}

/* 4. Drag and Drop */
.drag-drop-container {
  margin: 20px 0;
}

.matched-pairs {
  margin-bottom: 30px;
}

.matched-pair {
  display: flex;
  align-items: center;
  background: #e3eafc;
  border: 1px solid #3a7bfd;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  position: relative;
}

.matched-pair.correct {
  background-color: #e8f5e9;
  border-color: #4caf50;
}

.matched-pair.incorrect {
  background-color: #ffebee;
  border-color: #f44336;
}

.matched-drag, .matched-target {
  flex: 1;
  padding: 0 10px;
}

.matched-drag {
  font-weight: 500;
}

.unmatch-btn {
  background: #ffcdd2;
  border: none;
  color: #c62828;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-drop-interaction {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.drag-items, .drop-targets {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
}

.drag-item {
  background: #3a7bfd;
  color: white;
  padding: 10px 15px;
  margin: 8px 0;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s;
  touch-action: none;
}

.drag-item.dragging {
  opacity: 0.7;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.drag-item.touch-dragging {
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  opacity: 0.8;
  transform: scale(1.02);
}

.drag-item:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.drop-target {
  margin-bottom: 15px;
}

.target-text {
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
}

.drop-zone {
  min-height: 50px;
  border: 2px dashed #bcd;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  transition: background-color 0.2s, border-color 0.2s;
}

.drop-zone.dragover {
  background-color: #e3eafc;
  border-color: #3a7bfd;
}

.drop-zone.dropped {
  background-color: #e8f5e9;
  border-color: #43a047;
}

/* 5. Review Mode & Results */
.exam-question.correct {
  border-left: 4px solid #4caf50;
  padding-left: 15px;
}

.exam-question.incorrect {
  border-left: 4px solid #f44336;
  padding-left: 15px;
}

.question-result {
  font-weight: bold;
  border-radius: 4px;
  padding: 4px 8px;
}

.question-result.correct {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.question-result.incorrect {
  background-color: #ffebee;
  color: #c62828;
}

.review-choices li {
  position: relative;
  padding-right: 40px;
}

.review-choices li.correct {
  background-color: #e8f5e9;
}

.review-choices li.incorrect {
  background-color: #ffebee;
}

.correct-marker, .incorrect-marker {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
}

.correct-marker {
  color: #2e7d32;
}

.incorrect-marker {
  color: #c62828;
}

.question-feedback {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
}

.question-feedback.correct {
  background-color: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.question-feedback.incorrect {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
}

/* Results page */
.results-page {
  padding: 20px 0;
}

.score-summary {
  display: flex;
  align-items: center;
  background-color: #f9f9fa;
  padding: 30px;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  margin-right: 30px;
  flex-shrink: 0;
}

.score-circle.pass {
  background: linear-gradient(135deg, #4caf50, #8bc34a);
  color: white;
}

.score-circle.fail {
  background: linear-gradient(135deg, #f44336, #ff9800);
  color: white;
}

.score-details {
  flex-grow: 1;
}

.score-status {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 10px;
}

.results-actions {
  margin: 30px auto;
  text-align: center;
}

.review-btn {
  background-color: #3a7bfd;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.review-btn:hover {
  background-color: #1d5cf0;
}

.subject-scores {
  margin-top: 40px;
}

.subject-score-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.subject-score-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
  flex: 1;
  min-width: 180px;
}

.subject-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 10px auto;
}

.subject-score-circle.pass {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 4px solid #4caf50;
}

.subject-score-circle.fail {
  background-color: #ffebee;
  color: #c62828;
  border: 4px solid #f44336;
}