/**
 * quiz.css
 * 퀴즈 컴포넌트의 스타일
 */

/* ===================================
   퀴즈 컴포넌트 기본 스타일
   =================================== */

/* 퀴즈 컴포넌트 컨테이너 */
.quiz-component {
  width: 50%;
  height: 100%;
  flex: 0.5;
  background-color: #f9f9f9;
  border-left: 1px solid #dee2e6;
  padding: 0;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, flex 0.3s ease;
  position: relative;
}

/* 퀴즈 컨테이너 */
.quiz-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* ===================================
   퀴즈 헤더 영역
   =================================== */

/* 퀴즈 헤더 */
.quiz-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dee2e6;
}

/* 퀴즈 제목 */
.quiz-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #343a40;
  margin-bottom: 10px;
}

/* 퀴즈 부제목 */
.quiz-subtitle {
  font-size: 1rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

/* ===================================
   퀴즈 진행 상태
   =================================== */

/* 퀴즈 상태 */
.quiz-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #495057;
}

/* 진행 바 */
.quiz-progress {
  background-color: #e9ecef;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  height: 100%;
  background-color: #28a745;
  transition: width 0.3s ease;
}

/* ===================================
   문제 영역
   =================================== */

/* 퀴즈 콘텐츠 */
.quiz-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* 퀴즈 문제 */
.quiz-question {
  margin-bottom: 25px;
}

/* 문제 텍스트 */
.question-text {
  font-size: 1.1rem;
  color: #212529;
  margin-bottom: 15px;
  line-height: 1.5;
}

/* 지시 텍스트 */
.instruction {
  font-size: 1rem;
  color: #495057;
  margin-bottom: 15px;
  font-weight: 500;
}

/* ===================================
   객관식 문제 스타일
   =================================== */

/* 객관식 */
.multiple-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 선택 항목 */
.choice-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 15px;
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-item:hover {
  background-color: #f0f7ff;
  border-color: #b8daff;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.1);
}

.choice-item.selected {
  background-color: #e7f1ff;
  border-color: #b8daff;
}

/* 라디오 버튼 */
.choice-item input[type="radio"] {
  margin-right: 10px;
  margin-top: 3px;
}

/* 선택 항목 레이블 */
.choice-label {
  flex: 1;
  font-size: 1rem;
  color: #212529;
}

/* ===================================
   주관식 문제 스타일
   =================================== */

/* 주관식 */
.short-answer {
  margin-top: 15px;
}

/* 답변 입력 필드 */
.answer-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.answer-input:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===================================
   코딩 문제 스타일
   =================================== */

/* 코딩 문제 */
.coding-quiz {
  margin-top: 15px;
}

/* 테스트 케이스 */
.test-cases {
  margin-top: 20px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  background-color: #f8f9fa;
}

/* 테스트 케이스 테이블 */
.test-cases table {
  width: 100%;
  border-collapse: collapse;
}

.test-cases th,
.test-cases td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  font-size: 0.9rem;
}

.test-cases th {
  background-color: #e9ecef;
  text-align: left;
  font-weight: 600;
}

/* 코드 블록 */
.test-cases code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  background-color: #f1f3f5;
  padding: 2px 5px;
  border-radius: 3px;
}

/* ===================================
   제출 버튼 및 피드백 영역
   =================================== */

/* 퀴즈 액션 */
.quiz-actions {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 제출 버튼 */
.submit-btn {
  background-color: #0d6efd;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover {
  background-color: #0b5ed7;
}

.submit-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.submit-btn i {
  margin-right: 5px;
}

/* 건너뛰기 버튼 */
.skip-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.skip-btn:hover {
  background-color: #5a6268;
}

/* 피드백 컨테이너 */
.feedback-container {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  color: #0c5460;
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
}

/* 정답 피드백 */
.feedback-container.correct {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

/* 오답 피드백 */
.feedback-container.incorrect {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

/* 실행 결과 */
#execution-results {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===================================
   퀴즈 토글 스위치
   =================================== */

/* 퀴즈 토글 스위치 */
.quiz-toggle-switch {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 15px;
  z-index: 100;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* "퀴즈" 텍스트 스타일 */
.quiz-toggle-switch .toggle-label {
  color: #444444;
  font-size: 14px;
  font-weight: bold;
  margin-right: 8px;
}

/* ===================================
   반응형 레이아웃
   =================================== */

/* 태블릿 레이아웃 */
@media (max-width: 992px) {
  .quiz-component {
    width: 100% !important;
    height: 50% !important;
    flex: 0.5 !important;
    border-left: none;
    border-top: 1px solid #dee2e6;
  }
  
  .quiz-container {
    padding: 15px;
  }
  
  .quiz-title {
    font-size: 1.3rem;
  }
  
  .quiz-actions {
    padding-top: 10px;
  }
}

/* 모바일 레이아웃 */
@media (max-width: 576px) {
  .quiz-container {
    padding: 10px;
  }
  
  .quiz-title {
    font-size: 1.2rem;
  }
  
  .quiz-subtitle {
    font-size: 0.9rem;
  }
  
  .choice-item {
    padding: 10px;
  }
  
  .choice-label {
    font-size: 0.95rem;
  }
  
  .quiz-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .submit-btn, .skip-btn {
    width: 100%;
    padding: 8px 15px;
  }
  
  .feedback-container {
    padding: 10px;
    font-size: 0.9rem;
  }
}

/* ===================================
   애니메이션 및 전환 효과
   =================================== */

/* 퀴즈 컨텐츠 페이드 인 */
@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-fadeIn {
  animation: quizFadeIn 0.3s ease-in;
}

/* ===================================
   난이도 배지 스타일
   =================================== */

/* 난이도 1 (쉬움) */
.badge.bg-success {
  background-color: #28a745 !important;
}

/* 난이도 2 (보통) */
.badge.bg-primary {
  background-color: #007bff !important;
}

/* 난이도 3 (어려움) */
.badge.bg-warning.text-dark {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

/* 난이도 4 (매우 어려움) */
.badge.bg-danger {
  background-color: #dc3545 !important;
}

/* 난이도 5 (극도로 어려움) */
.badge.bg-dark {
  background-color: #343a40 !important;
}