/* 기본 스타일 초기화 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.container {
  max-width: 1800px; /* 기존 1200px에서 1800px로 증가 */
  margin: 0 auto;
  padding: 20px;
}

/* 헤더 스타일 */
.header {
  text-align: center;
  color: #ffffff;
  margin-bottom: 40px;
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header h1 {
  font-size: 2.5em;
  margin: 0;
  color: #ffffff;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  letter-spacing: 1px;
}

.header p {
  font-size: 1.1em;
  color: #f8f9fa;
  opacity: 0.95;
  margin-top: 10px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* 업로드 섹션 */
.upload-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-section:hover {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.4);
  transform: translateY(-4px);
}

.upload-area {
  border: 2px dashed rgba(102, 126, 234, 0.4);
  border-radius: 20px;
  padding: 60px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.upload-area:hover {
  border-color: rgba(102, 126, 234, 0.8);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: scale(1.01);
}

.upload-area.dragover {
  border-color: rgba(102, 126, 234, 1);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.upload-icon {
  font-size: 4em;
  color: #3498db;
  margin-bottom: 20px;
}

.upload-content h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: #333;
}

.upload-content p {
  color: #666;
  margin-bottom: 30px;
}

.upload-note {
  font-size: 0.85em !important;
  color: #e74c3c !important;
  margin-bottom: 20px !important;
  font-weight: 500;
}

.upload-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 36px;
  border-radius: 16px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.upload-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.upload-btn:hover::before {
  left: 100%;
}

.upload-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.upload-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

/* 파일 목록 */
.file-list {
  margin-top: 30px;
}

.file-list h3 {
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.file-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fafafa;
  transition: all 0.3s ease;
}

.file-item:hover {
  background: #f0f8ff;
  border-color: #3498db;
}

.file-info {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.file-icon {
  font-size: 1.5em;
  margin-right: 15px;
  color: #3498db;
}

.file-details h4 {
  color: #333;
  margin-bottom: 5px;
}

.file-details p {
  color: #666;
  font-size: 0.9em;
}

.file-actions {
  display: flex;
  gap: 10px;
}

.remove-btn {
  background: #ff4757;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff3742;
  transform: scale(1.05);
}

.upload-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.process-btn,
.clear-btn {
  padding: 14px 36px;
  border: none;
  border-radius: 16px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.process-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(17, 153, 142, 0.3);
}

.process-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.process-btn:hover::before {
  left: 100%;
}

.process-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(17, 153, 142, 0.4);
}

.clear-btn {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(238, 9, 121, 0.3);
}

.clear-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.clear-btn:hover::before {
  left: 100%;
}

.clear-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(238, 9, 121, 0.4);
}

/* 로딩 섹션 */
.loading-section {
  background: white;
  border-radius: 15px;
  padding: 60px 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.loading-spinner i {
  font-size: 3em;
  color: #3498db;
  margin-bottom: 20px;
}

.loading-spinner p {
  font-size: 1.2em;
  color: #333;
  margin-bottom: 15px;
}

.progress-info {
  color: #666;
  font-size: 1em;
}

/* 결과 섹션 */
.results-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-section:hover {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.results-header h2 {
  color: #333;
  font-size: 1.8em;
}

.results-actions {
  display: flex;
  gap: 15px;
}

.download-btn,
.new-process-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.new-process-btn {
  background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 167, 38, 0.3);
}

.new-process-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 167, 38, 0.4);
}

/* 결과 요약 */
.results-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 28px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transition: all 0.6s;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(102, 126, 234, 0.35);
}

.summary-card:hover::before {
  top: -25%;
  right: -25%;
}

.summary-card h3 {
  font-size: 2.2em;
  margin-bottom: 8px;
  font-weight: 700;
}

.summary-card p {
  opacity: 0.95;
  font-size: 0.95em;
  font-weight: 500;
}

/* 결과 테이블 */
.results-table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-table {
  width: 100%;
  min-width: 1800px; /* 컬럼 수 감소로 최소 너비 조정 */
  border-collapse: collapse;
  background: white;
  table-layout: fixed;
}

/* 성적표 테이블 - 26개 컬럼에 맞게 조정 */
.results-table th {
  font-size: 0.85em; /* 폰트 크기 증가 */
  padding: 10px 4px; /* 패딩 증가 */
  text-align: center;
  width: 4%;
  white-space: nowrap; /* 텍스트 줄바꿈 방지 */
}

.results-table td {
  font-size: 0.85em; /* 폰트 크기 증가 */
  padding: 10px 4px; /* 패딩 증가 */
  text-align: center;
  white-space: nowrap; /* 텍스트 줄바꿈 방지 */
}

/* 중요한 컬럼들은 조금 더 넓게 */
/* 테이블 컬럼 너비 조정 - 전체적으로 더 넓게 */
.results-table th:nth-child(1) {
  width: 6%;
} /* 전체No. */
.results-table th:nth-child(2) {
  width: 8%;
} /* 센터 */
.results-table th:nth-child(3) {
  width: 6%;
} /* 온라인응시구분 */
.results-table th:nth-child(4) {
  width: 8%;
} /* 이름 */
.results-table th:nth-child(5) {
  width: 6%;
} /* 생년월일 */
.results-table th:nth-child(6) {
  width: 4%;
} /* 성별 */
.results-table th:nth-child(7) {
  width: 10%;
} /* 국어 선택과목 */
.results-table th:nth-child(8) {
  width: 6%;
} /* 국어 표준점수 */
.results-table th:nth-child(9) {
  width: 6%;
} /* 국어 백분위 */
.results-table th:nth-child(10) {
  width: 5%;
} /* 국어 등급 */
.results-table th:nth-child(11) {
  width: 8%;
} /* 수학 선택과목 */
.results-table th:nth-child(12) {
  width: 6%;
} /* 수학 표준점수 */
.results-table th:nth-child(13) {
  width: 6%;
} /* 수학 백분위 */
.results-table th:nth-child(14) {
  width: 5%;
} /* 수학 등급 */
.results-table th:nth-child(15) {
  width: 5%;
} /* 영어 등급 */
.results-table th:nth-child(16) {
  width: 8%;
} /* 탐구1 과목 */
.results-table th:nth-child(17) {
  width: 6%;
} /* 탐구1 표준점수 */
.results-table th:nth-child(18) {
  width: 6%;
} /* 탐구1 백분위 */
.results-table th:nth-child(19) {
  width: 5%;
} /* 탐구1 등급 */
.results-table th:nth-child(20) {
  width: 8%;
} /* 탐구2 과목 */
.results-table th:nth-child(21) {
  width: 6%;
} /* 탐구2 표준점수 */
.results-table th:nth-child(22) {
  width: 6%;
} /* 탐구2 백분위 */
.results-table th:nth-child(23) {
  width: 5%;
} /* 탐구2 등급 */
.results-table th:nth-child(24) {
  width: 6%;
} /* 제2외국어 등급 */
.results-table th:nth-child(25) {
  width: 15%;
} /* 파일명 */

/* 파일명 컬럼만 텍스트 줄바꿈 허용 */
.results-table td:nth-child(25) {
  white-space: normal;
  word-wrap: break-word;
  max-width: 200px;
}

.results-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #764ba2;
  letter-spacing: 0.5px;
}

.results-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

.results-table .text-content {
  max-width: 500px;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 0.9em;
}

.results-table tr:hover {
  background-color: rgba(102, 126, 234, 0.08);
  transform: scale(1.002);
  transition: all 0.3s ease;
}

.results-table tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.results-table tr:nth-child(even):hover {
  background-color: rgba(102, 126, 234, 0.08);
}

/* 오류 섹션 */
.error-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #ff4757;
  font-size: 1.1em;
}

.error-message i {
  font-size: 1.5em;
}

/* 모달 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.modal-content p {
  color: #666;
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-btn {
  background: linear-gradient(135deg, #2ed573 0%, #1dd1a1 100%);
  color: white;
}

.cancel-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .logo-section {
    flex-direction: column;
    gap: 15px;
  }

  .logo {
    width: 60px;
    height: 60px;
  }

  .header h1 {
    font-size: 1.8em;
  }

  .upload-area {
    padding: 40px 15px;
  }

  .upload-content h3 {
    font-size: 1.2em;
  }

  .results-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .results-actions {
    justify-content: center;
  }

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

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

  .results-table th:nth-child(1) {
    width: 10%;
  } /* 번호 */
  .results-table th:nth-child(2) {
    width: 20%;
  } /* 파일명 */
  .results-table th:nth-child(3) {
    width: 15%;
  } /* 센터명 */
  .results-table th:nth-child(4) {
    width: 10%;
  } /* 페이지 */
  .results-table th:nth-child(5) {
    width: 30%;
  } /* 인식텍스트 */
  .results-table th:nth-child(6) {
    width: 8%;
  } /* 신뢰도 */
  .results-table th:nth-child(7) {
    width: 7%;
  } /* 처리일시 */

  .results-table .text-content {
    max-width: 200px;
    font-size: 0.8em;
  }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* 애니메이션 추가 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.upload-section,
.results-section {
  animation: fadeInUp 0.6s ease-out;
}
