/* Unit Test Styles */

.unit-test-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.test-header {
  margin-bottom: 2rem;
}

.test-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary, #9ca3af);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary, #e5e7eb);
  border-radius: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width 0.3s ease;
}

.test-question {
  margin-bottom: 2rem;
}

.question-wrapper {
  margin-bottom: 2rem;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  color: var(--text-primary, #1f2937);
}

.dark-mode .question-text {
  color: #f3f4f6;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 0.75rem;
  background: var(--bg-primary, #ffffff);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.dark-mode .option-label {
  background: #1f2937;
  border-color: #374151;
}

.option-label:hover {
  background: var(--bg-hover, #f9fafb);
  border-color: #3b82f6;
}

.dark-mode .option-label:hover {
  background: #111827;
}

.option-label.selected {
  background: #dbeafe;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark-mode .option-label.selected {
  background: #1e3a8a;
  border-color: #60a5fa;
}

.option-label input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  width: 28px;
  height: 28px;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.option-label.selected .option-letter {
  background: #1e40af;
}

.option-text {
  flex: 1;
  color: var(--text-primary, #1f2937);
}

.dark-mode .option-text {
  color: #e5e7eb;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
}

.dark-mode .question-meta {
  border-top-color: #374151;
  color: #9ca3af;
}

.question-id {
  font-weight: 600;
}

.attempt-counter {
  background-color: var(--bg-secondary, #f3f4f6);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.dark-mode .attempt-counter {
  background-color: #374151;
  color: #e5e7eb;
}

.question-meta-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.skip-button {
  background-color: var(--bg-secondary, #f3f4f6);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary, #6b7280);
}

.skip-button:hover:not(:disabled) {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

.skip-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-meta-button {
  background-color: var(--bg-secondary, #f3f4f6);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary, #6b7280);
}

.nav-meta-button:hover:not(:disabled) {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

.nav-meta-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dark-mode .skip-button {
  background-color: #374151;
  color: #e5e7eb;
  border-color: #4b5563;
}

.dark-mode .skip-button:hover:not(:disabled) {
  background-color: #4b5563;
  border-color: #6b7280;
}

.dark-mode .nav-meta-button {
  background-color: #374151;
  color: #e5e7eb;
  border-color: #4b5563;
}

.dark-mode .nav-meta-button:hover:not(:disabled) {
  background-color: #4b5563;
  border-color: #6b7280;
}

.attempt-remaining {
  font-style: italic;
  color: #f59e0b;
  margin-top: 0.5rem;
}

.dark-mode .attempt-remaining {
  color: #fbbf24;
}

.no-attempts {
  font-weight: 600;
  color: #ef4444;
  margin-top: 0.5rem;
}

.dark-mode .no-attempts {
  color: #fca5a5;
}

.difficulty-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.difficulty-easy {
  background: #d1fae5;
  color: #065f46;
}

.dark-mode .difficulty-easy {
  background: #064e3b;
  color: #a7f3d0;
}

.difficulty-medium {
  background: #fef3c7;
  color: #92400e;
}

.dark-mode .difficulty-medium {
  background: #78350f;
  color: #fcd34d;
}

.difficulty-hard {
  background: #fee2e2;
  color: #991b1b;
}

.dark-mode .difficulty-hard {
  background: #7c2d12;
  color: #fca5a5;
}

.question-id {
  font-family: 'Courier New', monospace;
  color: var(--text-secondary, #9ca3af);
}

.test-navigation {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.dark-mode .test-navigation {
  background: #111827;
}

.nav-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: 2px solid #3b82f6;
  background: #3b82f6;
  color: white;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
  background: #2563eb;
  border-color: #1d4ed8;
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.test-summary {
  padding: 1rem;
  background: var(--bg-secondary, #f0f9ff);
  border-left: 4px solid #3b82f6;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.dark-mode .test-summary {
  background: #0c2340;
}

.test-summary h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary, #1f2937);
  font-size: 0.95rem;
}

.dark-mode .test-summary h4 {
  color: #e5e7eb;
}

.test-summary p {
  margin: 0.25rem 0;
  color: var(--text-secondary, #6b7280);
  font-size: 0.9rem;
}

.dark-mode .test-summary p {
  color: #d1d5db;
}

.submit-button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-button:hover {
  background: #059669;
}

.another-button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.another-button:hover {
  background: #2563eb;
}

.dark-mode .another-button:hover {
  background: #1d4ed8;
}

/* Results Styles */

.test-results {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.results-card {
  background: var(--bg-primary, #ffffff);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-mode .results-card {
  background: #111827;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.dark-mode .score-display {
  border-bottom-color: #374151;
}

.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
}

.score-percentage {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.score-grade {
  font-size: 1.25rem;
  font-weight: 600;
}

.score-summary {
  flex: 1;
}

.score-summary p {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary, #1f2937);
}

.dark-mode .score-summary p {
  color: #f3f4f6;
}

.review-section {
  margin-bottom: 2rem;
}

.review-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #1f2937);
}

.dark-mode .review-section h3 {
  color: #f3f4f6;
}

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.answer-item {
  padding: 1rem;
  border-left: 4px solid #e5e7eb;
  border-radius: 0.5rem;
  background: var(--bg-secondary, #f9fafb);
}

.dark-mode .answer-item {
  background: #1f2937;
  border-left-color: #374151;
}

.answer-item.correct {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.dark-mode .answer-item.correct {
  background: #064e3b;
}

.answer-item.incorrect {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.dark-mode .answer-item.incorrect {
  background: #7c2d12;
}

.answer-number {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #3b82f6;
  color: white;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.answer-details p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.answer-question {
  font-weight: 500;
  color: var(--text-primary, #1f2937);
}

.dark-mode .answer-question {
  color: #f3f4f6;
}

.answer-user {
  color: var(--text-secondary, #6b7280);
}

.dark-mode .answer-user {
  color: #d1d5db;
}

.answer-correct {
  color: #10b981;
  font-weight: 500;
}

.answer-item.incorrect .answer-user {
  color: #ef4444;
}

.test-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 2rem;
}

.action-button {
  padding: 0.75rem 2rem;
  border: 2px solid #3b82f6;
  background: #3b82f6;
  color: white;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button:hover {
  background: #2563eb;
  border-color: #1d4ed8;
}

.action-button:last-child {
  border-color: #9ca3af;
  background: transparent;
  color: #3b82f6;
}

.dark-mode .action-button:last-child {
  color: #93c5fd;
}

.action-button:last-child:hover {
  background: var(--bg-secondary, #f9fafb);
  border-color: #3b82f6;
}

.dark-mode .action-button:last-child:hover {
  background: #1f2937;
}

/* Answer Feedback Styles (for Quiz Immediate Feedback) */

.answer-feedback {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

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

.correct-feedback {
  background-color: #d1fae5;
  border-color: #10b981;
}

.dark-mode .correct-feedback {
  background-color: #065f46;
  color: #d1fae5;
}

.incorrect-feedback {
  background-color: #fee2e2;
  border-color: #ef4444;
}

.dark-mode .incorrect-feedback {
  background-color: #7f1d1d;
  color: #fee2e2;
}

.feedback-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.correct-feedback .feedback-header {
  color: #059669;
}

.dark-mode .correct-feedback .feedback-header {
  color: #6ee7b7;
}

.incorrect-feedback .feedback-header {
  color: #dc2626;
}

.dark-mode .incorrect-feedback .feedback-header {
  color: #fca5a5;
}

.feedback-content p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

/* Responsive Design */

@media (max-width: 768px) {
  .score-display {
    flex-direction: column;
    gap: 1rem;
  }

  .score-circle {
    width: 150px;
    height: 150px;
  }

  .score-percentage {
    font-size: 2rem;
  }

  .test-navigation {
    flex-direction: column;
  }

  .nav-button {
    padding: 1rem;
  }

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

  .action-button {
    width: 100%;
  }
}
