/* 모던 받아쓰기 UI 스타일 - 개선된 버전 */

/* 컨테이너 너비 설정 - 가장 높은 우선순위로 적용 */
#dictationSection.main-section {
  max-width: none !important;
}

#dictationSection .content-container,
#dictationSection .dictation-container,
#dictationSection .quiz-section,
#dictationSection .quiz-container {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

/* CSS 변수는 css-variables.css에서 통합 관리됩니다 */
:root {
  --kim-sangung-image: url('sangung.png');
}

body {
    font-family: var(--font-family);
}

/* 콘텐츠 전체 컨테이너 */
.content-container {
  max-width: 1200px !important;
  margin: 0 auto 1rem auto;
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 김상궁 컨셉 */
.dictation-setup {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  border: 1px solid #d1d5db;
  margin: 2rem auto;
  max-width: 1200px;
  position: relative;
  overflow: hidden;
}

/* 학급 정보 배너 - 우리 반 받아쓰기 */
.class-info-banner,
#class-info-banner,
.class-problems-container .class-info-banner {
  background-color: var(--primary-color) !important;
  color: white !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  border-radius: var(--border-radius-md) !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  text-align: center !important;
  display: block !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 초기 로딩 시 메시지 숨기기 */
#no-problems-message {
  display: none;
}

#no-problems-message:not(.hidden) {
  display: block;
}

/* 우리 반 받아쓰기 문제 목록 스타일 */
.problems-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 4px;
}

/* 개별 문제 카드 스타일 */
.problem-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.problem-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(67, 97, 238, 0.15);
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
}

.problem-card.selected {
  background: linear-gradient(135deg, #eff6ff 0%, #e8f2ff 100%);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.problem-card.selected::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

/* 문제 제목 스타일 */
.problem-title {
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 12px 0;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.problem-title::before {
  content: '📝';
  font-size: 20px;
}

/* 문제 설명 스타일 */
.problem-description {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 문제 메타 정보 */
.problem-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  color: #9ca3af;
}

.problem-meta .sentence-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.problem-meta .sentence-count::before {
  content: '📄';
  font-size: 14px;
}

/* 완료된 문제 카드 */
.problem-card.completed {
  border-left: 4px solid #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.problem-completed {
  color: #22c55e;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.problem-completed::before {
  content: '✅';
  font-size: 14px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .problems-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .problem-card {
    padding: 16px;
  }

  .problem-title {
    font-size: 16px;
  }
}

/* 헤더와 설명 텍스트 스타일 */
.dictation-setup .dictation-header,
.dictation-setup .dictation-description {
    position: relative;
    z-index: 1;
    text-align: left;
}

.dictation-header {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.dictation-header .section-title {
  display: flex;
  align-items: center;
  gap: 0;
}

.dictation-setup .dictation-header .icon-heading {
  justify-content: flex-start;
  margin-bottom: 0;
}

.dictation-description {
  font-size: 16px;
  color: var(--text-medium);
  margin-top: -8px;
  margin-bottom: 12px;
}

/* 선택 섹션 스타일 개선 */
.grade-selection-section,
.repeat-selection-section,
.level-selection-section {
  margin-bottom: 24px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.section-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
}

.section-label i {
  color: var(--primary-color);
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 버튼 컨테이너 */
.grade-buttons-container,
.repeat-buttons-container,
.level-buttons-container {
  background-color: var(--background-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

/* 학년 버튼 Grid 레이아웃 - 6열 2행 구조 */
.grade-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  width: 100%;
}

/* 1-6학년은 첫 번째 줄에 배치 */
.grade-buttons .grade-btn-box:nth-child(n+1):nth-child(-n+6) {
  grid-row: 1;
}

/* 우리 반 받아쓰기와 내 점수 확인하기는 두 번째 줄에 배치 */
.grade-buttons .grade-btn-box:nth-child(7) {
  grid-row: 2;
  grid-column: 1 / 4; /* 1-3열 차지 */
}

.grade-buttons .grade-btn-box:nth-child(8) {
  grid-row: 2;
  grid-column: 4 / 7; /* 4-6열 차지 */
}

/* 반복 버튼 Grid 레이아웃 */
.repeat-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  width: 100%;
}

/* 급수 버튼 Grid 레이아웃 */
.level-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  width: 100%;
}

/* 버튼 박스 공통 스타일 */
.grade-btn-box,
.repeat-btn-box,
.level-btn-box {
  position: relative;
  cursor: pointer;
  width: 100%;
}

/* 버튼 내용 스타일 개선 */
.grade-btn-content,
.repeat-btn-content,
.level-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border-radius: var(--border-radius-md);
  background-color: white;
  border: 2px solid #e5e7eb;
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 52px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 호버 효과 */
.grade-btn-box:hover .grade-btn-content,
.repeat-btn-box:hover .repeat-btn-content,
.level-btn-box:hover .level-btn-content {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

/* 선택된 버튼 스타일 강화 */
.grade-radio:checked + .grade-btn-content,
.repeat-radio:checked + .repeat-btn-content,
.level-radio:checked + .level-btn-content,
.grade-btn-box.active .grade-btn-content,
.repeat-btn-box.active .repeat-btn-content,
.level-btn-box.active .level-btn-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
  font-weight: 600;
  transform: scale(1.03);
}

/* 라디오 버튼 숨김 */
.grade-radio,
.repeat-radio,
.level-radio {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 10;
  pointer-events: auto;
}

/* 우리 반 받아쓰기 특별 스타일 */
#class-dictation-btn .grade-btn-content {
  background-color: #f0f7ff;
  border-color: #4a90e2;
  color: #2c5aa0;
  font-weight: 600;
}

#class-dictation-btn:hover .grade-btn-content {
  background-color: #e1f0ff;
  border-color: #2c5aa0;
  box-shadow: 0 3px 10px rgba(74, 144, 226, 0.25);
}

#class-dictation-btn .grade-radio:checked + .grade-btn-content,
#class-dictation-btn.active .grade-btn-content {
  background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
  border-color: #2c5aa0;
  color: white;
}

/* 내 점수 확인하기 특별 스타일 */
.grade-btn-box:nth-child(8) .grade-btn-content {
  background-color: #f0fff4;
  border-color: #10b981;
  color: #047857;
  font-weight: 600;
}

.grade-btn-box:nth-child(8):hover .grade-btn-content {
  background-color: #d1fae5;
  border-color: #047857;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

/* 사용자 학년 하이라이트 */
.grade-btn-box.user-grade .grade-btn-content {
  background-color: #fff9e6;
  border-color: #f5a623;
  color: #d68400;
  position: relative;
}

.grade-btn-box.user-grade .grade-btn-content::after {
  content: "⭐";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
}

/* 잠긴 급수 스타일 */
.level-btn-box.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.level-btn-box.locked .level-btn-content {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
}

.level-btn-box.locked:hover .level-btn-content {
  border-color: #d1d5db;
  box-shadow: none;
  transform: none;
}

/* 완료된 급수 스타일 */
.level-btn-box.completed .level-btn-content {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: white;
}

/* 시작 버튼 개선 */
.start-btn-container {
  text-align: center;
  margin-top: 32px;
  padding: 0 16px;
}

.start-btn {
  padding: 18px 56px;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  font-size: 18px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
  min-width: 220px;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
}

.start-btn:hover::before {
  left: 100%;
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 모바일 반응형 개선 */
@media (max-width: 768px) {
  /* 학년 버튼 3열로 변경 */
  .grade-buttons {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* 1-6학년은 2행에 걸쳐 배치 */
  .grade-buttons .grade-btn-box:nth-child(1),
  .grade-buttons .grade-btn-box:nth-child(2),
  .grade-buttons .grade-btn-box:nth-child(3) {
    grid-row: 1;
  }

  .grade-buttons .grade-btn-box:nth-child(4),
  .grade-buttons .grade-btn-box:nth-child(5),
  .grade-buttons .grade-btn-box:nth-child(6) {
    grid-row: 2;
  }

  /* 우리 반 받아쓰기는 3행 전체 */
  .grade-buttons .grade-btn-box:nth-child(7) {
    grid-row: 3;
    grid-column: 1 / 4;
    margin-top: 8px;
  }

  /* 내 점수 확인하기는 4행 절반 */
  .grade-buttons .grade-btn-box:nth-child(8) {
    grid-row: 4;
    grid-column: 1 / 3;
    margin-top: 4px;
  }

  /* 반복 버튼 2열로 */
  .repeat-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 급수 버튼 2-3열로 */
  .level-buttons {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  /* 패딩 조정 */
  .dictation-setup {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .grade-buttons-container,
  .repeat-buttons-container,
  .level-buttons-container {
    padding: 12px;
  }

  /* 버튼 크기 조정 */
  .grade-btn-content,
  .repeat-btn-content,
  .level-btn-content {
    padding: 13px 10px;
    font-size: 14px;
    min-height: 48px;
    border-width: 1.5px;
  }

  /* 특별 버튼들 폰트 크기 유지 */
  #class-dictation-btn .grade-btn-content,
  .grade-btn-box:nth-child(8) .grade-btn-content {
    font-size: 14px;
    font-weight: 600;
    padding: 14px 12px;
  }

  /* 시작 버튼 조정 */
  .start-btn {
    padding: 16px 40px;
    font-size: 16px;
    min-width: 180px;
  }

  /* 섹션 라벨 크기 조정 */
  .section-label {
    font-size: 16px;
    margin-bottom: 10px;
    grid-template-columns: 20px 1fr;
    gap: 8px;
  }

  .section-label i {
    font-size: 18px;
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  /* 학년 버튼 2열로 변경 */
  .grade-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 버튼 간격 줄이기 */
  .grade-buttons,
  .repeat-buttons,
  .level-buttons {
    gap: 8px;
  }

  /* 더 작은 패딩 */
  .dictation-setup {
    padding: 1rem;
  }

  .grade-buttons-container,
  .repeat-buttons-container,
  .level-buttons-container {
    padding: 10px;
  }

  /* 폰트 크기 더 축소 */
  .grade-btn-content,
  .repeat-btn-content,
  .level-btn-content {
    font-size: 13px;
    padding: 10px 6px;
    min-height: 42px;
  }

  /* 시작 버튼 전체 너비 */
  .start-btn {
    width: 100%;
    padding: 14px 32px;
  }
}

/* 받아쓰기 진행 패널 개선 */
.dictation-listening-panel {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* 헤더 컨트롤 */
.dictation-header-controls {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: -10px;
}

.back-to-setup-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 60px;
  font-size: 14px;
  color: var(--text-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.back-to-setup-btn:hover {
  background: #f3f4f6;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 진행 정보 배지 */
.dictation-progress-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  margin-top: 40px;
}

.progress-badge {
  background: #f0f7ff;
  border: 1px solid #d1e3f8;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.progress-badge i {
  font-size: 14px;
}

/* 아이콘 컨테이너 */
.listening-icon-container,
.pencil-icon-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 10px 0;
}

.listening-icon-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.pencil-icon-container {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 8px 24px rgba(245, 87, 108, 0.3);
}

.listening-icon,
.pencil-icon {
  color: white;
  font-size: 32px;
}

/* 상태 텍스트 */
.dictation-status {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dark);
  margin: 10px 0;
}

/* 음성 속도 조절 */
.voice-speed-control {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px 20px;
  width: 100%;
  max-width: 400px;
  margin: 10px 0;
}

.voice-speed-control label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  justify-content: center;
}

.voice-speed-control label i {
  color: var(--primary-color);
}

.speed-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.speed-label {
  font-size: 12px;
  color: var(--text-medium);
  min-width: 45px;
}

.speed-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.speed-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  border: none;
}

.speed-value-display {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
}

/* 다시 듣기 버튼 */
.listen-again-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  margin-top: 10px;
}

.listen-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.listen-again-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .dictation-listening-panel {
    padding: 20px;
    gap: 16px;
  }

  .progress-badge {
    font-size: 12px;
    padding: 5px 10px;
  }

  .progress-badge i {
    font-size: 12px;
  }

  .listening-icon-container,
  .pencil-icon-container {
    width: 60px;
    height: 60px;
  }

  .listening-icon,
  .pencil-icon {
    font-size: 24px;
  }

  .dictation-status {
    font-size: 16px;
  }

  .voice-speed-control {
    padding: 12px 16px;
    max-width: 100%;
  }

  .voice-speed-control label {
    font-size: 13px;
  }

  .speed-label {
    font-size: 11px;
    min-width: 40px;
  }

  .listen-again-btn {
    padding: 10px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .dictation-listening-panel {
    padding: 16px;
    gap: 12px;
  }

  .back-to-setup-btn {
    font-size: 13px;
    padding: 6px 12px;
  }

  .progress-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .listening-icon-container,
  .pencil-icon-container {
    width: 50px;
    height: 50px;
  }

  .listening-icon,
  .pencil-icon {
    font-size: 20px;
  }

  .dictation-status {
    font-size: 14px;
  }

  .voice-speed-control {
    padding: 10px 12px;
  }

  .speed-slider {
    height: 5px;
  }

  .speed-slider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }

  .speed-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }

  .listen-again-btn {
    padding: 8px 20px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }
}

/* 받아쓰기 입력 패널 개선 */
.dictation-input-panel {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  max-width: 800px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 입력 패널 제목 */
.input-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.input-title i {
  color: var(--primary-color);
  font-size: 22px;
}

/* 심사 모드 컨테이너 - 컴팩트한 디자인 */
.review-mode-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 8px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.review-mode-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #667eea;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin: 0;
}

.review-mode-label i {
  font-size: 16px;
}

/* 토글 스위치 스타일 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin-left: auto;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: all 0.3s ease;
  border-radius: 26px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.review-mode-container small {
  color: #6b7280;
  font-size: 12px;
  flex: 1 1 100%;
  margin-top: -4px;
}

/* 받아쓰기 텍스트 영역 */
.dictation-textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-dark);
  box-sizing: border-box;
  font-family: 'Noto Sans KR', sans-serif;
}

.dictation-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dictation-textarea::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* 제출 버튼 */
.submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  align-self: center;
  min-width: 200px;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.submit-btn.enabled {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.5);
  }
  100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  }
}

/* 모바일 반응형 - 입력 패널 */
@media (max-width: 768px) {
  .dictation-input-panel {
    padding: 20px;
    margin: 16px auto;
    gap: 14px;
  }

  .input-title {
    font-size: 18px;
  }

  .input-title i {
    font-size: 20px;
  }

  .review-mode-container {
    padding: 8px 12px;
  }

  .review-mode-label {
    font-size: 13px;
  }

  .toggle-switch {
    width: 44px;
    height: 24px;
  }

  .toggle-slider:before {
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
  }

  .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }

  .dictation-textarea {
    min-height: 120px;
    padding: 14px;
    font-size: 15px;
  }

  .submit-btn {
    padding: 12px 28px;
    font-size: 15px;
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .dictation-input-panel {
    padding: 16px;
    margin: 12px auto;
    gap: 12px;
  }

  .input-title {
    font-size: 16px;
  }

  .review-mode-container {
    padding: 8px 10px;
    gap: 8px;
  }

  .review-mode-label {
    font-size: 12px;
  }

  .review-mode-container small {
    font-size: 11px;
  }

  .dictation-textarea {
    min-height: 100px;
    padding: 12px;
    font-size: 14px;
    border-radius: 10px;
  }

  .submit-btn {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 40px;
  }
}

/* 다크모드 지원 */
body.dark-mode .dictation-input-panel {
  background-color: #242424;
  border: 1px solid #333;
}

body.dark-mode .input-title {
  color: #e0e0e0;
}

body.dark-mode .review-mode-container {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode .dictation-textarea {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .dictation-textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-mode .dictation-textarea::placeholder {
  color: #666;
}

/* 받아쓰기 결과 요약 */
.dictation-summary {
  background: linear-gradient(135deg, #f0f7ff 0%, #f8f4ff 100%);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  max-width: 900px;
  margin: 24px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.dictation-summary h3 {
  font-size: 24px;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dictation-summary h3 i {
  font-size: 28px;
  color: #ffd700;
}

/* 통계 정보 */
.summary-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.summary-stat {
  text-align: center;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  min-width: 120px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-medium);
  font-weight: 500;
}

/* 요약 메시지 */
.summary-message {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.summary-message i {
  color: var(--primary-color);
  margin-right: 6px;
}

.summary-message strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* 상세 결과 섹션 */
.detailed-results-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

.detailed-results-header {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detailed-results-header h4 {
  font-size: 18px;
  color: var(--text-dark);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detailed-results-header h4 i {
  color: var(--primary-color);
}

.detailed-results-header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-medium);
}

/* 결과 카드 */
.result-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.result-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-medium);
}

.result-accuracy {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.high-accuracy {
  background: #e8f5e9;
  color: #2e7d32;
}

.medium-accuracy {
  background: #fff3e0;
  color: #f57c00;
}

.low-accuracy {
  background: #ffebee;
  color: #c62828;
}

/* 문장 비교 */
.result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sentence-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  position: relative;
}

.correct-box {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
}

.user-box {
  background: #fff8f0;
  border: 1px solid #ffe0b3;
}

.sentence-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.correct-label {
  color: #1976d2;
}

.user-label {
  color: #f57c00;
}

.sentence-label i {
  font-size: 14px;
}

.sentence-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  margin: 0;
  word-break: keep-all;
}

/* 레벨 클리어 메시지 */
.level-clear-message {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.level-clear-message i {
  font-size: 20px;
}

/* 액션 버튼 */
.summary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.primary-btn i {
  font-size: 16px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .dictation-summary {
    padding: 24px 16px;
    margin: 16px;
  }

  .dictation-summary h3 {
    font-size: 20px;
  }

  .summary-stats {
    gap: 16px;
  }

  .summary-stat {
    padding: 12px 16px;
    min-width: 100px;
  }

  .stat-value {
    font-size: 28px;
  }

  .stat-label {
    font-size: 12px;
  }

  .result-comparison {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sentence-box {
    padding: 10px;
  }

  .detailed-results-header h4 {
    font-size: 16px;
  }

  .primary-btn {
    padding: 10px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .dictation-summary {
    padding: 20px 12px;
    margin: 12px;
  }

  .dictation-summary h3 {
    font-size: 18px;
  }

  .dictation-summary h3 i {
    font-size: 22px;
  }

  .summary-stats {
    gap: 12px;
  }

  .summary-stat {
    padding: 10px 12px;
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .stat-value {
    font-size: 24px;
  }

  .summary-message {
    font-size: 14px;
    padding: 16px;
  }

  .result-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .result-card-header {
    margin-bottom: 10px;
  }

  .sentence-text {
    font-size: 13px;
  }

  .level-clear-message {
    font-size: 14px;
    padding: 12px 20px;
  }

  .primary-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
}

/* 다크모드 지원 */
body.dark-mode .dictation-summary {
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
  border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode .summary-stat {
  background: #2a2a3e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .summary-message {
  background: #2a2a3e;
  color: #e0e0e0;
}

body.dark-mode .detailed-results-header {
  background: #2a2a3e;
}

body.dark-mode .detailed-results-header h4 {
  color: #e0e0e0;
}

body.dark-mode .result-card {
  background: #2a2a3e;
}

body.dark-mode .sentence-box {
  background: #1e1e2e;
}

body.dark-mode .correct-box {
  background: #1a2332;
  border-color: #2c5282;
}

body.dark-mode .user-box {
  background: #2d2419;
  border-color: #8b5a00;
}

body.dark-mode .sentence-text {
  color: #e0e0e0;
}

/* 나머지 기존 스타일들은 유지 */