/* ?�역 ?��???�??�이?�웃 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  line-height: 1.6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #212529;
  min-height: 100vh;
}

/* ?�더 ?�션 */
.header-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #ff9966 0%, #ffb84d 100%);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(255, 153, 102, 0.25);
  position: relative;
  overflow: hidden;
}

/* ?�더 컨테?�너 - 로고?�?콘텐�?배치 */
.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  position: relative;
  z-index: 1;
}

/* ?�?�교 로고 */
.university-logo {
  width: 120px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  flex-shrink: 0;
}

/* ?�더 콘텐�?*/
.header-content {
  flex: 1;
  text-align: center;
}

.header-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.header-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

h1 {
  color: white;
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

.subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.25rem;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.header-chip {
  display: inline-block;
  font-size: 16px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: 600;
  margin-top: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}

/* ???��???*/
#survey-form {
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

fieldset {
  margin-bottom: 24px;
  border-radius: 12px;
  border: 2px solid #dee2e6;
  padding: 20px;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

fieldset:hover {
  border-color: #adb5bd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 기본 ?�보 ?�력 ?�드 */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.form-group input[type="text"] {
  padding: 10px 14px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #ff9966;
  box-shadow: 0 0 0 3px rgba(255, 153, 102, 0.1);
}

/* ?�디??버튼 그룹 */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.radio-label {
  flex: 1;
  min-width: 120px;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  display: block;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  transition: all 0.2s ease;
  background: white;
}

/* TOPIK 아이콘 색상 */
.topik-icon {
  font-size: 1.2em;
  margin-right: 2px;
}

.topik3 {
  color: #FFE500;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.topik4 {
  color: #70D709;
}

.topik5 {
  color: #42C7F1;
}

.topik6 {
  color: #EB6F6F;
}

/* ?�국???��? ?�디??버튼 2�??�시 */
.radio-custom-twoline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
}

.radio-grade {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.radio-level {
  font-size: 0.85rem;
  font-weight: 400;
  color: #6c757d;
}

.radio-label:hover .radio-custom {
  border-color: #adb5bd;
  transform: translateY(-2px);
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: #ff9966;
  background: linear-gradient(135deg, #ff9966 0%, #ffb84d 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 153, 102, 0.25);
}

/* ?�택???�디??버튼??grade?�?level 모두 ?�색?�로 */
.radio-label input[type="radio"]:checked + .radio-custom .radio-grade,
.radio-label input[type="radio"]:checked + .radio-custom .radio-level {
  color: white;
}

/* 선택된 상태에서 TOPIK 아이콘 색상 유지 */
.radio-label input[type="radio"]:checked + .radio-custom .topik-icon {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.radio-label input[type="radio"]:checked + .radio-custom .topik3 {
  color: #FFE500;
}

.radio-label input[type="radio"]:checked + .radio-custom .topik4 {
  color: #70D709;
}

.radio-label input[type="radio"]:checked + .radio-custom .topik5 {
  color: #42C7F1;
}

.radio-label input[type="radio"]:checked + .radio-custom .topik6 {
  color: #EB6F6F;
}

/* 체크박스 그룹 */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.checkbox-label {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 160px;
  max-width: 100%;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: block;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  transition: all 0.2s ease;
  background: white;
}

.checkbox-label:hover .checkbox-custom {
  border-color: #adb5bd;
  transform: translateY(-2px);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  border-color: #ff9966;
  background: linear-gradient(135deg, rgba(255, 153, 102, 0.12) 0%, rgba(255, 184, 77, 0.12) 100%);
  color: #ff9966;
  box-shadow: 0 2px 6px rgba(255, 153, 102, 0.2);
}

legend {
  font-weight: 600;
  color: #495057;
  padding: 0 12px;
  font-size: 1rem;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #6c757d;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

label:hover {
  color: #495057;
}

select {
  width: 100%;
  padding: 10px 14px;
  margin-top: 8px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

select:hover {
  border-color: #adb5bd;
}

select:focus {
  outline: none;
  border-color: #ff9966;
  box-shadow: 0 0 0 3px rgba(255, 153, 102, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #ff9966;
}

/* ?�출 버튼 */
button[type="submit"] {
  width: 100%;
  cursor: pointer;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ff9966 0%, #ffb84d 100%);
  color: white;
  font-weight: 600;
  padding: 14px 24px;
  font-size: 1.05rem;
  margin-top: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 153, 102, 0.25);
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 153, 102, 0.35);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* 결과 ?�션 */
#result {
  margin-top: 40px;
  padding: 32px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.5s ease;
}

.result-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #dee2e6;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.download-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.download-btn:active {
  transform: translateY(0);
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#result h2 {
  color: #212529;
  margin-bottom: 12px;
  font-size: 1.5rem;
  font-weight: 700;
}

.result-summary {
  color: #495057;
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.result-summary strong {
  color: #ff9966;
  font-weight: 600;
}

/* 과목 카드 - ???�자??*/
.course-card {
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.course-card:hover {
  border-color: #ff9966;
  box-shadow: 0 4px 12px rgba(255, 153, 102, 0.15);
  transform: translateY(-2px);
}

.course-card:last-child {
  margin-bottom: 0;
}

/* 카드 ?�더 */
.course-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dee2e6;
}

.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9966 0%, #ffb84d 100%);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(255, 153, 102, 0.3);
}

.course-title-section {
  flex: 1;
}

.course-name {
  color: #212529;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6c757d;
  font-size: 0.9rem;
}

.meta-item svg {
  flex-shrink: 0;
}

/* 과목 ?�세 ?�보 */
.course-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.detail-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 0.9rem;
  color: #212529;
  font-weight: 600;
}

.skill-levels {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 400;
}

.skill-item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 3px 6px;
  background: #f8f9fa;
  border-radius: 4px;
  color: #495057;
  white-space: nowrap;
  font-size: 0.7rem;
}

.skill-label {
  font-size: 0.65rem;
  color: #6c757d;
}

.skill-bars {
  display: flex;
  gap: 2px;
  align-items: center;
}

.skill-bar {
  display: inline-block;
  width: 4px;
  height: 12px;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ?�기 - ?�스??블루 */
.skill-bar.skill-listening.filled {
  background: linear-gradient(135deg, #a8d8ea 0%, #7ec8e3 100%);
  box-shadow: 0 1px 2px rgba(126, 200, 227, 0.3);
}

/* 말하�?- ?�스???�크 */
.skill-bar.skill-speaking.filled {
  background: linear-gradient(135deg, #ffb3ba 0%, #ffaec0 100%);
  box-shadow: 0 1px 2px rgba(167, 139, 250, 0.3);
}

/* ?�기 - ?�스??그린 */
.skill-bar.skill-reading.filled {
  background: linear-gradient(135deg, #b4e7ce 0%, #95dab6 100%);
  box-shadow: 0 1px 2px rgba(149, 218, 182, 0.3);
}

/* ?�기 - ?�스???�플 */
.skill-bar.skill-writing.filled {
  background: linear-gradient(135deg, #d4b5e8 0%, #c5a3dd 100%);
  box-shadow: 0 1px 2px rgba(197, 163, 221, 0.3);
}

.skill-bar.empty {
  background: #dee2e6;
}

/* ?�징 ?�그 */
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  color: #ff7733;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #c7d2fe;
}

/* ?�수 ?�션 */
.score-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

.score-label {
  font-size: 0.9rem;
  color: #075985;
  font-weight: 500;
}

.score-value {
  font-size: 1.15rem;
  color: #0c4a6e;
  font-weight: 700;
}

/* 로딩 ?�태 */
.loading {
  text-align: center;
  padding: 40px;
  color: #ff9966;
  font-weight: 500;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* 교과�??�개 ?�션 */
.course-description {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fff5f0 0%, #ffe8d9 5%, #fff 100%);
  border-left: 4px solid #ff9966;
  border-radius: 8px;
}

.description-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ff9966;
  margin-bottom: 8px;
}

.description-text {
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.6;
  margin: 0;
}

/* 추�? ?�보 ?�션 */
.course-extra-info {
  margin-top: 16px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
}

.course-link {
  font-size: 0.85rem;
  color: #ff9966;
  text-decoration: none;
  word-break: break-all;
  transition: all 0.2s ease;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.course-link:hover {
  color: #ff7733;
  background: #fff5f0;
  border-color: #ffcc99;
  text-decoration: underline;
}

.teaching-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.method-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  transition: all 0.2s ease;
}

.method-tag:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  transform: scale(1.05);
}

/* 반응???�자??*/
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  /* 모바?�에??로고?�?콘텐츠�? ?�로�?배치 */
  .header-container {
    flex-direction: column;
    gap: 20px;
  }

  .university-logo {
    width: 80px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.75rem;
  }

  .header-chip {
    font-size: 0.7rem;
    padding: 7px 14px;
  }

  .header-icon {
    font-size: 2.5rem;
  }

  #survey-form {
    padding: 24px 20px;
  }

  fieldset {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .radio-group {
    flex-direction: column;
  }

  .radio-label {
    min-width: auto;
  }

  .checkbox-group {
    flex-direction: column;
  }

  .checkbox-label {
    min-width: auto;
  }

  #result {
    padding: 24px 20px;
  }

  .course-card {
    padding: 20px;
  }

  .course-header {
    flex-direction: column;
    gap: 12px;
  }

  .rank-badge {
    align-self: flex-start;
  }

  .course-name {
    font-size: 1.1rem;
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .skill-levels {
    gap: 4px;
  }

  .skill-item {
    padding: 2px 5px;
    font-size: 0.65rem;
  }

  .skill-label {
    font-size: 0.6rem;
  }

  .skill-bar {
    width: 3px;
    height: 10px;
  }

  .course-description {
    padding: 12px;
  }

  .description-label {
    font-size: 0.8rem;
  }

  .description-text {
    font-size: 0.85rem;
  }

  .course-extra-info {
    padding: 12px;
  }

  .method-tag {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.7rem;
  }

  .header-chip {
    font-size: 0.65rem;
    padding: 6px 12px;
  }

  .header-icon {
    font-size: 2rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .course-description {
    padding: 10px;
  }

  .description-text {
    font-size: 0.8rem;
  }

  .course-extra-info {
    padding: 10px;
  }

  .course-link {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .method-tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}
