/* quiz.css - 맞춤법 퀴즈 스타일 (개선된 버전) */

/* 퀴즈 섹션 기본 스타일 */
.quiz-content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.quiz-container {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  padding: 2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 섹션 제목 스타일 */
.section-title {
  font-size: 1.8rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.section-description {
  color: var(--text-medium);
  margin-bottom: 2rem;
  line-height: 1.6;
  font-size: 1.1rem;
}

/* 심사모드 토글 스타일 */
.review-mode-container {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border: 2px solid var(--border-color);
}

body.dark-mode .review-mode-container {
  background: rgba(31, 41, 55, 0.95);
  border-color: var(--border-color);
}

.review-mode-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.review-mode-label i {
  color: var(--primary-color);
}

/* 토글 스위치 스타일 */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background-color: #ccc;
  border-radius: 34px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  transform: translateX(24px);
}

/* 심사모드 켜졌을 때 토글 색상 */
.toggle-switch input:checked ~ .toggle-switch,
.toggle-switch:has(input:checked) {
  background-color: var(--primary-color, #6366f1);
}

.toggle-switch.active {
  background-color: var(--primary-color, #6366f1);
}

/* 퀴즈 유형 타일 그리드 */
.quiz-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.quiz-type-tile {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 도전! 맞춤법 탭 특별 스타일 */
.quiz-type-tile.challenge-tile {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border: 3px solid #FF8C00;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.quiz-type-tile.challenge-tile i {
  color: #8B4513;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.quiz-type-tile.challenge-tile span {
  color: #8B4513;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.3rem);
  line-height: 1.3;
}

.quiz-type-tile.challenge-tile:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 165, 0, 0.4);
  border-color: #FF6347;
}

.quiz-type-tile.challenge-tile.locked::after {
  color: #8B4513;
  opacity: 0.5;
}

.quiz-type-tile.challenge-tile.active {
  background: linear-gradient(135deg, #FFA500 0%, #FF6347 100%);
  border-color: #DC143C;
  box-shadow: 0 10px 35px rgba(255, 99, 71, 0.5);
}

.quiz-type-tile.challenge-tile.active i,
.quiz-type-tile.challenge-tile.active span {
  color: white;
}

/* 퀴즈 카테고리 표시 스타일 */
.quiz-category-display {
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quiz-category-display span {
  color: var(--primary-color);
  font-weight: 700;
}

body.dark-mode .quiz-category-display {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  color: var(--text-light);
}

.quiz-type-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.quiz-type-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.quiz-type-tile:hover::before {
  opacity: 0.05;
}

.quiz-type-tile i,
.quiz-type-tile span {
  pointer-events: none;
}

.quiz-type-tile i {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 1rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.quiz-type-tile:hover i {
  transform: scale(1.1);
}

.quiz-type-tile span {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

/* 완료 상태 스타일 */
.quiz-type-tile.completed {
  background-color: var(--success-light-bg);
  border-color: var(--success-color);
  border-width: 2px;
}

.quiz-type-tile.completed i {
  color: var(--success-color);
}

.quiz-type-tile.completed::after {
  content: "\f058";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--success-color);
  font-size: 1.3rem;
  background: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 활성 상태 스타일 */
.quiz-type-tile.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4);
}

.quiz-type-tile.active i,
.quiz-type-tile.active span {
  color: white;
}

.quiz-type-tile.active::before {
  opacity: 1;
}

/* 잠금 상태 스타일 */
.quiz-type-tile.locked {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.8;
}

.quiz-type-tile.locked::after {
  content: "\f023";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #d1d5db;
  font-size: 2.5rem;
  opacity: 0.3;
}

.quiz-type-tile.locked i {
  opacity: 0.5;
}

/* 도전! 맞춤법 탭 잠금 상태 특별 스타일 */
.quiz-type-tile.challenge-tile.locked {
  background: linear-gradient(135deg, #D3D3D3 0%, #A9A9A9 100%);
  border-color: #808080;
}

.quiz-type-tile.challenge-tile.locked::after {
  color: #4B4B4B;
  font-size: 3rem;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.quiz-type-tile.challenge-tile.locked i {
  color: #696969;
  opacity: 0.4;
}

.quiz-type-tile.challenge-tile.locked span {
  color: #696969;
  opacity: 0.7;
}

/* 진행 상태 스타일 */
.quiz-progress-status {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-item i {
  font-size: 1.3rem;
}

.progress-item:nth-child(1) i { color: #10b981; }
.progress-item:nth-child(2) i { color: #ef4444; }
.progress-item:nth-child(3) i { color: #6366f1; }

.progress-item strong {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1.1rem;
}

/* 퀴즈 패널 */
.quiz-panel {
  border-radius: 10px;
  margin-bottom: 2rem;
}

/* 퀴즈 헤더 */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e9ecef;
}

.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.quiz-progress-text {
  font-size: 1.1rem;
  color: var(--text-medium);
  font-weight: 600;
}

.progress-bar {
  height: 12px;
  background-color: #e9ecef;
  border-radius: 100px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ===== 개선된 퀴즈 문제 스타일 ===== */
.quiz-question {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 24px;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.quiz-question::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
}

.quiz-question i {
  font-size: 2.5rem;
  opacity: 0.9;
  flex-shrink: 0;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.quiz-question div {
  flex: 1;
  position: relative;
  z-index: 1;
}

#pronunciationQuestion,
#spacingQuestion,
#expressionQuestion,
#punctuationQuestion,
#correctionQuestion,
#challengeQuestion {
  font-size: 1.4rem;
  line-height: 1.6;
  color: white;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  word-break: keep-all;
  white-space: pre-wrap;
}

#pronunciationQuestion::before,
#spacingQuestion::before,
#expressionQuestion::before,
#punctuationQuestion::before,
#correctionQuestion::before,
#challengeQuestion::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.05) 100%);
  z-index: -1;
  border-radius: 15px;
}

#pronunciationQuestion::after,
#spacingQuestion::after,
#expressionQuestion::after,
#punctuationQuestion::after,
#correctionQuestion::after,
#challengeQuestion::after {
  content: '💭';
  position: absolute;
  top: 0.8rem;
  right: 1.5rem;
  font-size: 1.2rem;
  opacity: 0.7;
  z-index: 1;
}

/* ===== 퀴즈 옵션 컨테이너 ===== */
.quiz-options {
  display: grid;
  gap: 1.2rem;
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ===== 교정 부호 옵션 컨테이너 - 3x2 그리드 ===== */
.correction-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* 4지 선다형일 때 2x2 그리드 레이아웃 */
.quiz-options[data-option-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 3지 선다형일 때 특별 레이아웃 */
.quiz-options[data-option-count="3"] {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-options[data-option-count="3"] .quiz-option:last-child {
  grid-column: 1 / -1;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* 2지 선다형일 때 */
.quiz-options[data-option-count="2"] {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 5지 선다형 이상일 때는 기본 레이아웃 유지 */
.quiz-options[data-option-count="5"],
.quiz-options[data-option-count="6"] {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 개선된 퀴즈 옵션 스타일 - 마우스 오버 텍스트 가독성 개선 ===== */
.quiz-option {
  background: white;
  border: 2px solid #e5e7eb;
  padding: 1.75rem 2rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 500;
  color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  min-height: 85px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  animation: slideIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.quiz-option:nth-child(1) { animation-delay: 0.1s; }
.quiz-option:nth-child(2) { animation-delay: 0.2s; }
.quiz-option:nth-child(3) { animation-delay: 0.3s; }
.quiz-option:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 마우스 오버 시 텍스트 가독성 개선 */
.quiz-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #6366f1;
  background: #6366f1;
  color: white !important; /* 텍스트 색상 강제 적용 */
}

/* 호버 효과용 오버레이 제거 (텍스트 가시성을 위해) */
.quiz-option::before,
.quiz-option::after {
  display: none;
}

/* 선택된 옵션 */
.quiz-option.selected {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white !important;
  border-color: transparent;
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

/* ===== 정답/오답 하이라이트 개선 ===== */
.quiz-option.correct-answer-highlight,
.quiz-option.correct {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: transparent;
  animation: correctBounce 0.6s ease;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

.quiz-option.wrong-answer-highlight,
.quiz-option.wrong {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: transparent;
  animation: wrongShake 0.5s ease;
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.3);
}

@keyframes correctBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===== 교정 부호 문제 스타일 개선 ===== */
.quiz-instruction-box {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.quiz-instruction-box i {
  font-size: 2rem;
  opacity: 0.9;
  flex-shrink: 0;
  color: white;
}

.correction-sentence-area {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.correction-sentence-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px 16px 0 0;
}

.correction-sentence {
  font-size: 1.3rem;
  line-height: 1.8;
  color: #1f2937;
  font-weight: 500;
  text-align: center;
  letter-spacing: -0.02em;
}

/* 교정 문장 스타일 개선 - 앞뒤 문장 차이 표시 */
.original-sentence {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.08));
  border: 2px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  color: #dc2626;
  font-weight: 600;
  backdrop-filter: blur(8px);
  display: inline-block;
  margin: 0 0.8rem;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
  position: relative;
  transition: all 0.3s ease;
}

.original-sentence::before {
  content: '수정전';
  position: absolute;
  top: -8px;
  left: 8px;
  background: #dc2626;
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.9;
}

.corrected-sentence {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.08));
  border: 2px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  color: #059669;
  font-weight: 600;
  backdrop-filter: blur(8px);
  display: inline-block;
  margin: 0 0.8rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
  position: relative;
  transition: all 0.3s ease;
}

.corrected-sentence::before {
  content: '수정후';
  position: absolute;
  top: -8px;
  left: 8px;
  background: #059669;
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.9;
}

.arrow-emoji {
  display: inline-block;
  font-size: 1.8rem;
  margin: 0 1.2rem;
  animation: pulse-arrow 2.5s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
  transform-origin: center;
}

@keyframes pulse-arrow {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: scale(1.1) rotate(-2deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 0.7;
  }
  75% {
    transform: scale(1.1) rotate(2deg);
    opacity: 0.9;
  }
}

/* 교정 부호 옵션 마우스 오버 개선 */
.correction-option {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-height: 140px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.correction-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-color: #6366f1;
  background: #6366f1;
}

.correction-option:hover .correction-symbol-image {
  transform: scale(1.1);
}

.correction-option:hover p {
  color: white !important; /* 텍스트 색상 강제 적용 */
}

/* 호버 효과용 오버레이 제거 (텍스트 가시성을 위해) */
.correction-option::before {
  display: none;
}

.correction-symbol-image {
  width: 70px;
  height: 70px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.correction-option p {
  margin: 0;
  font-size: 0.95rem;
  color: #4b5563;
  font-weight: 600;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

.correction-option.correct-answer-highlight,
.correction-option.correct {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: transparent;
  animation: correctBounce 0.6s ease;
}

.correction-option.correct-answer-highlight p,
.correction-option.correct p {
  color: white;
}

.correction-option.wrong-answer-highlight,
.correction-option.wrong {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: transparent;
  animation: wrongShake 0.5s ease;
}

.correction-option.wrong-answer-highlight p,
.correction-option.wrong p {
  color: white;
}

/* 심사모드일 때 정답 표시 */
.review-mode .quiz-option[data-is-correct="true"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
  border-color: transparent !important;
  position: relative;
}

.review-mode .quiz-option[data-is-correct="true"]::after {
  content: "정답";
  position: absolute;
  top: 8px;
  right: 12px;
  background: white;
  color: #10b981;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* 심사모드일 때 교정 부호 정답 표시 */
.review-mode .correction-option[data-is-correct="true"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: transparent !important;
}

.review-mode .correction-option[data-is-correct="true"] p {
  color: white !important;
}

.review-mode .correction-option[data-is-correct="true"]::after {
  content: "정답";
  position: absolute;
  top: 8px;
  right: 12px;
  background: white;
  color: #10b981;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 3;
}

/* 퀴즈 시작 컨테이너 */
.start-quiz-container {
  margin-top: 2.5rem;
  text-align: center;
}

.start-quiz-button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 1.5rem 3.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.start-quiz-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.start-quiz-button:hover::before {
  width: 400px;
  height: 400px;
}

.start-quiz-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
}

.start-quiz-button:disabled {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  cursor: not-allowed;
  box-shadow: none;
}

.start-quiz-button i {
  font-size: 1.5rem;
  pointer-events: none;
}

.start-quiz-guide {
  color: var(--text-medium);
  font-size: 1.1rem;
  font-weight: 500;
}

/* 버튼 공통 스타일 */
.primary-btn, .secondary-btn {
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
  background: white;
  color: #6366f1;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.secondary-btn:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 퀴즈 액션 버튼 */
.quiz-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* 퀴즈 피드백 모달 스타일 */
.quiz-feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* z-index 증가 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-feedback-modal.show {
  opacity: 1;
  visibility: visible;
}

.quiz-feedback-content {
  background: white;
  border-radius: 24px;
  padding: 3rem;
  max-width: 90%;
  width: 500px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-feedback-modal.show .quiz-feedback-content {
  transform: scale(1);
}

/* 레벨 5, 6 특별 축하 효과 */
.quiz-feedback-modal.level-5 .level-up-content,
.quiz-feedback-modal.level-6 .level-up-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  animation: specialLevelUp 0.8s ease;
}

.quiz-feedback-modal.level-5 .level-up-title,
.quiz-feedback-modal.level-6 .level-up-title {
  color: white;
  font-size: 2rem;
  animation: titleGlow 2s ease infinite;
}

@keyframes specialLevelUp {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes titleGlow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(255, 255, 255, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 30px rgba(255, 255, 255, 0.5);
  }
}

.quiz-feedback-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: iconPop 0.6s ease;
}

@keyframes iconPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.quiz-feedback-icon.success { color: #10b981; }
.quiz-feedback-icon.error { color: #ef4444; }

.quiz-feedback-message {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1f2937;
}

.quiz-feedback-detail {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.quiz-feedback-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.quiz-feedback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
}

/* 토스트 메시지 스타일 */
#toastContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}

.toast {
  background: white;
  color: #1f2937;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  min-width: 300px;
  border-left: 4px solid transparent;
  animation: toastSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastSlide {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.toast-info { border-left-color: #3b82f6; }
.toast.toast-success { border-left-color: #10b981; }
.toast.toast-warning { border-left-color: #f59e0b; }
.toast.toast-error { border-left-color: #ef4444; }

.toast i {
  margin-right: 12px;
  font-size: 1.2rem;
}

/* 로그인 프롬프트 스타일 */
#loginPrompt {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
}

/* ===== 다크 모드 스타일 ===== */
body.dark-mode .quiz-container { 
  background-color: var(--card-bg); 
  color: var(--text-dark); 
}

body.dark-mode .quiz-type-tile { 
  background-color: var(--card-bg); 
  border-color: var(--border-color); 
}

body.dark-mode .quiz-type-tile span {
  color: var(--text-dark);
}

body.dark-mode .quiz-type-tile i { 
  color: #a5b4fc; 
}

body.dark-mode .quiz-type-tile:hover {
  border-color: #8b5cf6;
}

body.dark-mode .quiz-type-tile.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

body.dark-mode .quiz-type-tile.completed {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}

body.dark-mode .quiz-type-tile.completed i {
  color: #10b981;
}

body.dark-mode .quiz-type-tile.locked {
  background-color: rgba(107, 114, 128, 0.1);
  border-color: #4b5563;
  color: #6b7280;
}

body.dark-mode .quiz-type-tile.challenge-tile {
  background: linear-gradient(135deg, #FFB700 0%, #FF8C00 100%);
  border-color: #FF6347;
}

body.dark-mode .quiz-type-tile.challenge-tile i,
body.dark-mode .quiz-type-tile.challenge-tile span {
  color: #FFF8DC;
}

/* 다크 모드에서 도전! 맞춤법 탭 잠금 상태 */
body.dark-mode .quiz-type-tile.challenge-tile.locked {
  background: linear-gradient(135deg, #4B4B4B 0%, #2B2B2B 100%);
  border-color: #1A1A1A;
}

body.dark-mode .quiz-type-tile.challenge-tile.locked::after {
  color: #1A1A1A;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

body.dark-mode .quiz-type-tile.challenge-tile.locked i,
body.dark-mode .quiz-type-tile.challenge-tile.locked span {
  color: #808080;
  opacity: 0.6;
}

body.dark-mode .quiz-progress-status {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: #4b5563;
}

body.dark-mode .progress-item {
  background: #1f2937;
  color: var(--text-medium);
}

body.dark-mode .quiz-question {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

body.dark-mode .quiz-option {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

body.dark-mode .quiz-option:hover {
  border-color: #8b5cf6;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
  background: #8b5cf6 !important; /* 다크 모드에서도 배경색 강제 적용 */
  color: white !important;
}

body.dark-mode .correction-option:hover {
  border-color: #8b5cf6;
  background: #8b5cf6 !important; /* 다크 모드에서도 배경색 강제 적용 */
}

body.dark-mode .correction-option:hover p {
  color: white !important;
}

body.dark-mode .secondary-btn {
  background: #374151;
  color: #e5e7eb;
  border-color: #4b5563;
}

body.dark-mode .secondary-btn:hover {
  background: #4b5563;
  border-color: #8b5cf6;
}

body.dark-mode .quiz-feedback-content {
  background: #1f2937;
}

body.dark-mode .quiz-feedback-message {
  color: #f9fafb;
}

body.dark-mode .quiz-feedback-detail {
  color: #d1d5db;
}

body.dark-mode .toast {
  background: #374151;
  color: #f9fafb;
}

body.dark-mode #loginPrompt {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: #4b5563;
}

/* 다크모드에서 심사모드 정답 표시 */
body.dark-mode.review-mode .quiz-option[data-is-correct="true"] {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  color: white !important;
}

body.dark-mode.review-mode .correction-option[data-is-correct="true"] {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  color: white !important;
}

body.dark-mode .correction-sentence-area {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: #4b5563;
  color: #e5e7eb;
}

body.dark-mode .correction-sentence-area::before {
  background: linear-gradient(90deg, #a78bfa 0%, #f472b6 100%);
}

/* 다크모드에서 교정 문장 스타일 */
body.dark-mode .original-sentence {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

body.dark-mode .original-sentence::before {
  background: #f87171;
  color: #1f2937;
}

body.dark-mode .corrected-sentence {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.12));
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

body.dark-mode .corrected-sentence::before {
  background: #34d399;
  color: #1f2937;
}

/* 모바일 반응형 스타일 */
@media (max-width: 768px) {
  .quiz-type-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 1rem;
  }
  
  .review-mode-container {
    position: static !important;
    margin-bottom: 1rem;
    background: var(--bg-white);
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
  
  .quiz-question {
    padding: 2rem 1.5rem;
    font-size: 0.95rem;
    flex-direction: column;
    text-align: center;
  }
  
  .quiz-question i {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  #pronunciationQuestion,
  #spacingQuestion,
  #expressionQuestion,
  #punctuationQuestion,
  #correctionQuestion,
  #challengeQuestion {
    font-size: 1.2rem;
    padding: 1.2rem 1.5rem;
  }

  #pronunciationQuestion::after,
  #spacingQuestion::after,
  #expressionQuestion::after,
  #punctuationQuestion::after,
  #correctionQuestion::after,
  #challengeQuestion::after {
    top: 0.6rem;
    right: 1rem;
    font-size: 1rem;
  }
  
  .quiz-options {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    max-width: none !important;
  }

  /* 모바일에서는 모든 선택지를 세로로 배치 */
  .quiz-options[data-option-count="2"],
  .quiz-options[data-option-count="3"],
  .quiz-options[data-option-count="4"],
  .quiz-options[data-option-count="5"],
  .quiz-options[data-option-count="6"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: unset !important;
  }

  .quiz-options[data-option-count="3"] .quiz-option:last-child {
    grid-column: unset !important;
    max-width: none !important;
    margin-left: unset !important;
    margin-right: unset !important;
  }
  
  .quiz-option {
    padding: 1.5rem;
    min-height: 70px;
    font-size: 1rem;
  }
  
  .correction-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
  }
  
  .correction-option {
    padding: 1.2rem 0.8rem;
    min-height: 120px;
  }
  
  .correction-symbol-image {
    width: 50px;
    height: 50px;
  }
  
  .quiz-progress-status { 
    flex-direction: column; 
    gap: 0.75rem; 
    padding: 1rem;
  }
  
  .progress-item {
    width: 100%;
    justify-content: center;
  }
  
  .quiz-actions { 
    flex-direction: column; 
    gap: 1rem; 
  }
  
  .primary-btn, .secondary-btn { 
    width: 100%; 
    justify-content: center; 
  }
  
  .quiz-feedback-content { 
    width: 90%; 
    padding: 2rem; 
  }
  
  .start-quiz-button {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .quiz-type-grid { 
    grid-template-columns: 1fr; 
  }
  
  .quiz-type-tile {
    padding: 1.5rem 1rem;
  }
  
  .quiz-type-tile i {
    font-size: 2.5rem;
  }
  
  .correction-options { 
    grid-template-columns: 1fr; 
  }
  
  .quiz-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .quiz-question {
    padding: 1.75rem 1.25rem;
    min-height: 120px;
    gap: 1rem;
  }
  
  .quiz-instruction-box {
    padding: 1.2rem 1.5rem;
  }
  
  .correction-sentence-area {
    padding: 1.2rem 1.5rem;
  }
  
  .correction-sentence {
    font-size: 1.15rem;
  }
  
  .start-quiz-button { 
    width: 100%; 
    padding: 1.25rem 1.5rem; 
    font-size: 1.1rem; 
  }
  
  #toastContainer { 
    right: 10px; 
    bottom: 10px; 
    max-width: calc(100% - 20px); 
  }
  
  .toast { 
    min-width: auto; 
    width: 100%; 
  }
  
  .quiz-feedback-content { 
    padding: 2rem 1.5rem; 
  }
  
  .quiz-feedback-icon { 
    font-size: 3.5rem; 
  }
  
  .quiz-feedback-message { 
    font-size: 1.5rem; 
  }
  
  .quiz-feedback-detail {
    font-size: 1rem;
  }
}