/* 시트 미리보기 CSS */

/* 모달 기본 스타일 */
.sheet-preview-modal .modal-dialog {
  max-width: 100vw;
  width: 100vw;
  margin: 10px auto;
}

.sheet-preview-modal .modal-content {
  height: 95vh;
  display: flex;
  flex-direction: column;
}

.sheet-preview-modal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* 시트 선택 섹션 */
.sheet-selector-section {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.sheet-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sheet-tab {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: white;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.sheet-tab:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.sheet-tab.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

/* 테이블 컨테이너 */
.sheet-table-container {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background-color: #fafafa;
}

.sheet-preview-table {
  font-size: 0.75rem;
  min-width: 100%;
  background-color: white;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sheet-preview-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 0.5rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.sheet-preview-table td {
  border: 1px solid #dee2e6;
  padding: 0.375rem 0.5rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

/* 행 번호 열 */
.row-number-header {
  width: 60px;
  min-width: 60px;
  background-color: #e9ecef !important;
}

.row-number {
  width: 60px;
  min-width: 60px;
  background-color: #f8f9fa;
  text-align: center;
  font-weight: 600;
  color: #6c757d;
}

/* 열 선택 컨트롤 */
.column-selector {
  min-width: 150px;
  padding: 0.25rem !important;
}

.column-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.column-letter {
  font-weight: bold;
  font-size: 1rem;
  color: #495057;
  margin-bottom: 0.25rem;
}

.column-role-selector {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.7rem;
}

.column-role-selector label {
  margin: 0;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.column-role-selector label:hover {
  background-color: #e9ecef;
}

.column-role-selector input[type="radio"]:checked + span,
.column-role-selector input[type="checkbox"]:checked + span {
  background-color: #007bff;
  color: white;
  border-radius: 0.25rem;
  padding: 0.125rem 0.25rem;
}

/* 역할별 열 스타일 */
.source-column {
  background-color: #e3f2fd !important;
  border-left: 4px solid #2196f3 !important;
}

.target-column {
  background-color: #e8f5e8 !important;
  border-left: 4px solid #4caf50 !important;
}

.reference-column {
  background-color: #fff3e0 !important;
  border-left: 4px solid #ff9800 !important;
}

/* 셀 내용 */
.cell-content {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cell-content:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.cell-content.empty {
  background-color: #f8f9fa;
  color: #6c757d;
  font-style: italic;
}

/* 범위 선택 섹션 */
.range-selector-section {
  padding: 1rem;
  border-top: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.range-inputs {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.range-input-group {
  flex: 1;
  min-width: 120px;
}

.range-input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #495057;
}

.range-input-group input {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.range-preview {
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.range-preview strong {
  color: #1976d2;
}

/* 통계 정보 */
.sheet-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background-color: white;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  min-width: 100px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #007bff;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* 언어 감지 배지 */
.language-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: #e7f3ff;
  color: #0066cc;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 데이터 타입 배지 */
.data-type-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.data-type-text {
  background-color: #e3f2fd;
  color: #1976d2;
}

.data-type-number {
  background-color: #e8f5e8;
  color: #388e3c;
}

.data-type-date {
  background-color: #fff3e0;
  color: #f57c00;
}

.data-type-empty {
  background-color: #f5f5f5;
  color: #757575;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .sheet-preview-modal .modal-dialog {
    width: 100vw;
    margin: 5px auto;
  }
  
  .sheet-preview-modal .modal-content {
    height: 98vh;
  }
  
  .sheet-tabs {
    justify-content: center;
  }
  
  .sheet-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .sheet-preview-table {
    font-size: 0.7rem;
  }
  
  .sheet-preview-table td {
    max-width: 120px;
    padding: 0.25rem;
  }
  
  .range-inputs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .sheet-stats {
    justify-content: center;
  }
}

/* 스크롤바 커스터마이징 */
.sheet-table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sheet-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.sheet-table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.sheet-table-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 로딩 상태 */
.sheet-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6c757d;
}

.sheet-loading .spinner-border {
  margin-bottom: 1rem;
}

/* 에러 상태 */
.sheet-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 0.375rem;
  margin: 1rem;
  padding: 2rem;
}

.sheet-error .bi {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* 툴팁 */
.column-tooltip {
  position: relative;
  cursor: help;
}

.column-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.column-tooltip:hover::after {
  opacity: 1;
}

/* 분석 열 표시 영역 스타일 */
.analysis-column-display {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.analysis-column-display .no-selection {
    width: 100%;
    text-align: center;
    font-size: 0.875rem;
}

.column-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.column-role-badge.source {
    background-color: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.column-role-badge.target {
    background-color: #e8f5e8;
    color: #388e3c;
    border-color: #c8e6c9;
}

.column-role-badge.reference {
    background-color: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.pattern-status {
    font-weight: 500;
}

.pattern-status.detecting {
    color: #ffc107;
}

.pattern-status.detected {
    color: #28a745;
}

.pattern-status.not-detected {
    color: #6c757d;
} 