/* 공통 스타일 */
@import "./core/ui/common.css";
@import "./core/ui/nav.css";

/* 알림 컴포넌트 스타일 */
@import "./core/ui/notifications/toast.css";
@import "./core/ui/notifications/modal.css";

/* 페이지별 스타일 */
@import "dashboard.css";

/* 파일 업로드 영역 공통 스타일 */
.file-upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-upload-area:hover {
  border-color: #0d6efd;
  background-color: #f8f9fa;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
  transform: translateY(-2px);
}

.file-upload-area.dragover {
  border-color: #0d6efd;
  background-color: #e9f0ff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.2);
}

.file-info {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  display: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

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

/* 기본 폰트 및 색상 설정 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  padding-top: 93.8px; /* navbar 높이만큼 상단 패딩 추가 */
  padding-bottom: 0; /* footer는 패딩이 아닌 flex로 처리 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 기본 링크 스타일 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--secondary-color);
}

/* 메인 컨텐츠 영역 */
main {
  flex: 1 0 auto;
  display: block;
  width: 100%;
}

/* 기본 버튼 스타일 */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* 기본 입력 필드 스타일 */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* 텍스트 선택 스타일 */
::selection {
  background-color: var(--primary-color);
  color: var(--text-light);
}

/* 접근성 관련 스타일 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0000ff;
    --danger-color: #ff0000;
    --success-color: #008000;
    --warning-color: #808000;
    --info-color: #000080;
  }
}

/* 컨텐츠 컨테이너 스타일 */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-bottom: 3rem;
}

/* GNB 컨테이너는 제외 */
.navbar.main-nav .container {
  background-color: transparent;
  padding: 0 1rem;
  border-radius: 0;
  box-shadow: none;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1200px) {
  .content-container,
  .navbar.main-nav .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.translation-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.source-text,
.target-text {
  display: flex;
  flex-direction: column;
}

textarea {
  height: 250px;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}

.controls {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.textarea_small {
  height: 120px;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}

select,
button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

/* 2026-05-20: Bootstrap nav-tabs 의 button 들이 위의 광범위 button 룰 (#007bff fill) 에
   영향 받아 hover 시 blue fill + 흰 글자로 텍스트가 보이지 않음.
   nav-tabs 의 button 만 background transparent 로 회복 → Bootstrap native 동작.
   영향 페이지: text/excel/sheet/pdf/quality_evaluation translation + hyper_excel.
   .tm-tabs / .term-tabs / .rag-tabs (custom wrapper) 는 별도 룰로 이미 처리. */
.nav-tabs .nav-link,
.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  background-color: transparent;
}

.button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4285f4;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* 카드 스타일링 */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: none;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* 폼 요소 스타일링 */
.form-floating > .form-control,
.form-floating > .form-select {
  height: calc(3.5rem + 2px);
}

/* 축소된 form-group 스타일 */
.form-group-sm > .form-control,
.form-group-sm > .form-select {
  height: calc(2.5rem + 2px);
}

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

/* 버튼 스타일링 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn i {
  font-size: 1rem;
  display: flex;
  align-items: center;
}

/* 기본 아웃라인 버튼 스타일 - GNB 외 영역에서 사용 */
.btn-outline-primary:not(.navbar.main-nav .btn) {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:not(.navbar.main-nav .btn):hover {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-secondary:not(.navbar.main-nav .btn) {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
  background-color: transparent;
}

.btn-outline-secondary:not(.navbar.main-nav .btn):hover {
  color: #fff;
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* 프롬프트 섹션 스타일링 */
.prompt-section {
  margin-bottom: 2rem;
  display: block;
  width: 100%;
}

.prompt-section .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.75rem;
}

.prompt-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  resize: both;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

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

/* 탭 컨텐츠 스타일링 */
.tab-content {
  padding: 1.5rem 0;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block !important;
}

.tab-pane.show {
  opacity: 1;
}

/* 버튼 그룹 스타일링 */
.prompt-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* 탭 버튼 활성화 상태 스타일 */
.btn-outline-primary.active {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* 모달 기본 스타일 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 2000;
}

.modal.modal-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-container {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 1200px;
  margin: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-content {
  position: relative;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-button {
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background-color: #0d6efd;
  color: white;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

/* 모달이 열려있을 때 스크롤 방지 */
body.modal-open {
  overflow: hidden;
}

/* 패널 스타일 */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1030;
  display: none;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
}

.settings-panel.show {
  transform: translateX(0);
  display: block;
}

/* 애니메이션 */
.fade {
  transition: opacity 0.15s linear;
}

.fade:not(.show) {
  opacity: 0;
}

/* 모바일 UI 기본 스타일 */
@media (max-width: 1000px) {
  /* 모바일 UI 최적화 */

  /* 버튼 크기 조정 */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  /* 상위 메뉴 항목 스타일 - 좌측 정렬 강화 */
  .navbar.main-nav .nav-link {
    background-color: #f5f5f5;
    text-align: left !important;
    justify-content: flex-start !important;
    padding-left: 1rem !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* 상위 메뉴 아이콘 정렬 */
  .navbar.main-nav .nav-link i {
    margin-right: 0.5rem !important;
    text-align: left !important;
  }

  /* 하위 메뉴 항목 스타일 - 간격 축소 */
  .navbar.main-nav .dropdown-item {
    background-color: #f8f8f8;
    padding: 0.3rem 1rem 0.3rem 3rem !important;
    margin: 0 !important;
    border-bottom: none !important;
  }

  /* 드롭다운 메뉴 배경색 */
  .navbar.main-nav .dropdown-menu {
    background-color: #f8f8f8 !important;
    padding: 0 !important;
  }

  /* 메뉴 간격 조정 */
  .navbar.main-nav .nav-item:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
    margin: 0 !important;
  }

  /* 메뉴 컨테이너 정렬 */
  .navbar.main-nav .navbar-collapse {
    padding: 0 !important;
    background-color: #f5f5f5 !important;
  }

  /* 네비게이션 아이템 그룹 정렬 */
  .navbar.main-nav .navbar-nav {
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* 더 작은 화면에서 추가 스타일 */
@media (max-width: 800px) {
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  /* 컨텐츠 컨테이너 패딩 */
  .content-container {
    padding: 1rem;
  }
  
  /* 모바일에서 컨텐츠와 푸터 사이 간격 확보 */
  body {
    padding-bottom: 0; /* flex layout이 있으므로 패딩 불필요 */
  }
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  margin-top: 4rem;
  color: #6c757d;
  clear: both;
}

.footer-heading {
  color: #495057;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
  font-size: 0.9rem;
}

.footer-links a:hover:not(.disabled) {
  color: #0d6efd;
  text-decoration: none;
}

.footer-links a.disabled {
  color: #adb5bd;
  cursor: not-allowed;
  pointer-events: none;
}

.footer-bottom-links a {
  text-decoration: none;
}

.footer-bottom-links a:hover:not(.disabled) {
  text-decoration: underline;
  color: #0d6efd;
}

.footer-bottom-links a.disabled {
  color: #adb5bd;
  cursor: not-allowed;
  pointer-events: none;
}

.footer-bottom-links i {
  font-size: 1.25rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.footer-bottom-links a:hover i {
  transform: scale(1.2);
  color: #0d6efd;
}

.footer hr {
  border-color: #dee2e6;
}

/* Footer 컨테이너와 위치 개선 */
.footer .container {
  max-width: 1226px;
  margin: 0 auto;
}

.footer .row {
  display: flex;
  justify-content: center; /* 중앙 정렬 */
}

.footer-left-col {
  padding-left: 10px; /* 왼쪽 열을 오른쪽으로 50px 이동 */
}

/* 푸터 연락처 스타일 */
.footer-contact {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact:hover {
  color: #0d6efd !important;
  text-decoration: underline;
}

.footer-contact i {
  font-size: 0.9rem;
}

/* Footer legal links (이용약관, 개인정보처리방침) */
.footer-legal-links {
  margin-top: 0.5rem;
}

.footer-legal-links a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-links a:hover:not(.disabled) {
  color: #0d6efd !important;
  text-decoration: underline;
}

.footer-legal-links a.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

/* Footer responsive adjustments */
@media (max-width: 992px) {
  .footer {
    text-align: center;
  }
  
  .footer-links {
    margin-bottom: 1.5rem;
  }
  
  .footer-bottom-links {
    margin-top: 1rem;
  }
  
  .footer-left-col {
    padding-left: 15px; /* 모바일에서는 패딩 줄임 */
  }
}

@media (max-width: 768px) {
  .footer {
    padding-bottom: 2rem;
  }
  
  .footer-heading {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
}
