@charset "utf-8";

/* ========================================
   Classification 테이블 전용 최적화
   테이블 구조, 글씨 잘림, 반응형 처리
   ======================================== */

/* -------------------- 테이블 바디 -------------------- */
.result_table tbody tr {
  transition: background 0.2s;
}

.result_table tbody tr:hover {
  background: #f5f7fa;
}

.result_table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.result_table tbody tr:nth-child(even):hover {
  background: #f0f2f6;
}

.result_table tbody td {
  padding: 12px 10px;
  font-size: 13px;
  line-height: 1.5;
  vertical-align: middle;
  text-align: center;
}

/* -------------------- 텍스트 말줄임 + Tooltip 개선 -------------------- */
.table-scroll span.wdItem {
  width: 180px;
  max-width: 100%;
}

.table-scroll span.wdDetail {
  width: 130px;
  max-width: 100%;
}

.table-scroll span.wdParts {
  width: 130px;
  max-width: 100%;
}

.table-scroll span.wdSegment,
.table-scroll span.wdFamily,
.table-scroll span.wdClass,
.table-scroll span.wdBrick {
  width: 120px;
  max-width: 100%;
}

.table-scroll span.wdClass2 {
  width: 100px;
  max-width: 100%;
}

.table-scroll span.wdClass3 {
  width: 160px;
  max-width: 100%;
}

/* 모든 말줄임 요소에 호버 효과 */
.table-scroll span[title] {
  cursor: help;
  position: relative;
}

/* 긴 텍스트 강조 */
.table-scroll span[title]:hover {
  color: #004190;
  font-weight: 600;
}
/* -------------------- rowspan 처리된 셀 -------------------- */
.result_table tbody td[rowspan] {
  background: #f8f9fa;
  font-weight: 600;
  padding-top: 15px;
}

.result_table tbody td.no_rowspan {
  background: #fff;
}

/* -------------------- 검색 결과 카운트 -------------------- */
.result_table tbody td.search_count {
  border-left: 3px solid #004190;
}

/* -------------------- 유사 데이터 헤더 -------------------- */
.similar_data_header {
  background: #fff3cd !important;
  color: #856404 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 15px !important;
  text-align: center !important;
  /* 그리드와 동일 두께 — 노란 배경만 구분 */
  border: 1px solid #ccc !important;
}

/* -------------------- 반응형: 태블릿 (1024px 이하) -------------------- */
@media (max-width: 1400px) {
  .result_table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .result_table table {
    width: 100%;
  }
  
  /* 스크롤 힌트 */
  .result_table:after {
    content: '← 좌우로 스크롤하세요 →';
    display: block;
    text-align: center;
    padding: 10px;
    background: #fff9e6;
    color: #856404;
    font-size: 12px;
    font-weight: 600;
  }
}

/* -------------------- 반응형: 모바일 (768px 이하) -------------------- */
@media (max-width: 768px) {
  .result_table {
    overflow-x: visible;
  }
  
  .result_table:after {
    display: none;
  }
  
  .result_table table {
    min-width: auto;
    border: 0;
  }
  
  /* 헤더 숨김 */
  .result_table thead {
    display: none;
  }
  
  /* 카드형 레이아웃 */
  .result_table tbody tr {
    display: block;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  
  .result_table tbody tr:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }
  
  .result_table tbody td {
    display: flex;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
  }
  
  .result_table tbody td:last-child {
    border-bottom: 0;
  }
  
  /* data-label을 왼쪽에 표시 */
  .result_table tbody td:before {
    content: attr(data-label);
    font-weight: 700;
    width: 100px;
    flex-shrink: 0;
    color: #004190;
    font-size: 12px;
    display:none !important;
  }
  .no-results .search-tips{
      display:none !important;
  }

  /* 소관부처/법령은 라벨 없이 표시*/
  .result_table tbody td.classification_ministry:before {
    display: none;
  }
  
  .result_table tbody td.classification_ministry {
    padding-top: 0;
    border-bottom: 2px solid #004190;
    font-weight: 600;
    font-size: 14px;
  }
  
  .result_table tbody td.classification_ministry span.ministry {
    color: #004190;
  }
  
  .result_table tbody td.classification_ministry span.law {
    color: #666;
  }
  
  .result_table tbody td.classification_ministry span.ministry:after {
    color: #ccc;
    margin: 0 8px;
  }
  
  .result_table tbody td.no_rowspan {
    background: #fff;
  }
  
  /* 모든 말줄임 해제 */
  .table-scroll span.wdItem,
  .table-scroll span.wdDetail,
  .table-scroll span.wdParts,
  .table-scroll span.wdSegment,
  .table-scroll span.wdFamily,
  .table-scroll span.wdClass,
  .table-scroll span.wdBrick,
  .table-scroll span.wdClass2,
  .table-scroll span.wdClass3 {
    width: 100%;
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin: 0;
    word-break: keep-all;
  }
  

  /* rowspan 속성 무시 (모바일) */
  .result_table tbody td[rowspan] {
    background: #fff;
    font-weight: inherit;
    vertical-align: middle;
  }

  .table-scroll span.law{
      margin:0 0 0 5px;
  }
  .table-scroll span.category{
      margin:0 5px 0 0;
    }
}

/* -------------------- 검색 블록 반응형 -------------------- */
@media (max-width: 1024px) {
  #content .content_box .block {
    padding: 30px 20px;
  }
  
  #content .content_box .searchKgpc {
    padding: 15px 20px;
  }
  
  #content .content_box .block .block_content {
    flex-direction: column;
  }
  
  #content .content_box .block .block_code,
  #content .content_box .block .block_parts,
  #content .content_box .block .block_Detail,
  #content .content_box .block .block_item,
  #content .content_box .block .block_authority,
  #content .content_box .block .block_sortation {
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  #content .content_box .block {
    padding: 20px 15px;
  }
  
  #content .content_box .block .search {
    flex-direction: column;
  }
  
  #content .content_box .block .search .table {
    width: 100%;
    padding: 0;
    margin-bottom: 15px;
  }
  
  #content .content_box .block .search .btn {
    width: 100%;
    padding: 35px 20px 15px;
    background-position: center top 10px;
  }
}

/* -------------------- 속성 선택 박스 반응형 -------------------- */
@media (max-width: 768px) {
  .attribute_box,
  .gpcAttribute_box {
    padding: 20px !important;
  }
  
  .attribute_box > ul > li {
    padding: 12px;
  }
  
  .attribute_box > ul > li > ul > li {
    padding: 8px;
  }
  
  .attribute_box input[type="radio"] {
    width: 16px;
    height: 16px;
  }
  
  .attribute_box label {
    font-size: 13px;
  }
}

/* -------------------- 셀렉트 박스 반응형 -------------------- */
@media (max-width: 768px) {
  .classification_select {
    width: 100% !important;
    margin-bottom: 10px;
  }
  
  select.classification_select {
    font-size: 14px;
    padding: 10px;
  }
}

/* -------------------- 로딩 인디케이터 -------------------- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #004190;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------- 하이라이트 (검색어 강조) -------------------- */
.highlight {
  background: #fff3cd !important;
  color: #856404 !important;
  font-weight: 600 !important;
  padding: 2px 4px;
  border-radius: 3px;
}

/* -------------------- 더보기 버튼 -------------------- */
.result_more_btn {
  display: inline-block;
  margin: 30px auto;
  padding: 12px 40px;
  background: #fff;
  color: #004190;
  border: 2px solid #004190;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.result_more_btn:hover {
  background: #004190;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 65, 144, 0.3);
}

/* 접기 버튼 스타일 */
.result_more_btn.collapse {
  background: #6c757d;
  color: #fff;
  border: 2px solid #6c757d;
}

.result_more_btn.collapse:hover {
  background: #5a6268;
  border-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

#toggleButtonContainer,
#toggleButtonContainer2 {
  text-align: center;
  margin: 20px 0;
}

/* -------------------- Tooltip (CSS 기반) -------------------- */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.tooltip-text:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* -------------------- 검색 정확도 표시 -------------------- */
p.accurate_text {
  padding: 15px 20px;
  background: #e8f4ff;
  border-left: 4px solid #004190;
  border-radius: 4px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

p.accurate_text span.user_keyword {
  font-weight: 700;
  color: #004190;
}

p.accurate_text span.accurate {
  font-weight: 600;
  color: #d76628;
}

/* -------------------- 추천 데이터 박스 -------------------- */

.recData h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #fff;
}

.recData span {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.6;
}

.recData i.clickItem {
  color: #ffd93d;
  text-decoration: underline;
  cursor: pointer;
  font-style: normal;
  font-weight: 700;
  transition: all 0.3s;
}

.recData i.clickItem:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* -------------------- 테이블 스크롤 버튼 개선 -------------------- */
.scroll-btn {
  background-color: rgba(0, 65, 144, 0.9);
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-btn:hover {
  background-color: #004190;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 4px 15px rgba(0, 65, 144, 0.4);
}

.scroll-btn:active {
  transform: translateY(-50%) scale(1.05);
}

/* -------------------- 속성 정의/예외사항 팝업 -------------------- */
.definition-excludes-content {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.definition-excludes-content p {
  margin: 8px 0;
  color: #444;
}

.definition-excludes-content p:first-child {
  font-weight: 600;
  color: #004190;
}

/* -------------------- 프린트 최적화 -------------------- */
@media print {
  .result_table thead {
    position: static;
  }
  
  .result_table tbody tr {
    page-break-inside: avoid;
  }

  .scroll-btn {
    display: none;
  }
  
  .result_more_btn {
    display: none;
  }
}

/* -------------------- 접근성 개선 -------------------- */
.result_table tbody tr:focus-within {
  outline: 2px solid #004190;
  outline-offset: 2px;
}

.result_table tbody td a:focus,
.result_table tbody td button:focus {
  outline: 2px solid #004190;
  outline-offset: 2px;
}

/* ========================================
   결과표 그리드 — 근본 규칙 (예외 최소화)
   1) 래퍼(.table-scroll)에 border 두지 않음
   2) 모든 th/td 동일: 1px solid #ccc
   3) border-collapse 로 인접선 합침 → 외곽·내부 동일 두께
   4) sticky/border_rightFF 도 보더 예외 없음
   ======================================== */

#content .content_box .result_table.table-scroll,
#content .content_box .result_table .table-scroll,
.result_table.table-scroll,
.result_table .table-scroll,
.total_search .table-scroll,
.total_search .keyword-search-result-section .result {
  border: none !important;
  box-sizing: border-box;
}

#content .content_box .result_table table,
#content .content_box .result_table .table-scroll > table,
.result_table table,
.total_search .table-scroll > table,
.total_search .keyword-search-result-section .result > table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  border: none !important;
  outline: none;
}

/* ★ 유일한 보더 규칙: 모든 셀 동일 */
#content .content_box .result_table table tr th,
#content .content_box .result_table table tr td,
#content .content_box .result_table .table-scroll table tr th,
#content .content_box .result_table .table-scroll table tr td,
#content .content_box .total_search .keyword-search-result-section .result table tr th,
#content .content_box .total_search .keyword-search-result-section .result table tr td,
.result_table table tr th,
.result_table table tr td,
.total_search .table-scroll table tr th,
.total_search .table-scroll table tr td,
.total_search .keyword-search-result-section .result table tr th,
.total_search .keyword-search-result-section .result table tr td {
  border: 1px solid #ccc !important;
  box-sizing: border-box;
}

/* border_rightFF / sticky 도 위 규칙과 동일 (별도 두께·색 금지) */
#content .content_box .result_table table tr th.border_rightFF,
#content .content_box .result_table table tr td.border_rightFF,
#content .content_box .result_table table tr th.sticky-col,
#content .content_box .result_table table tr td.sticky-col,
#content .content_box .result_table table tr td.classification_detail_btn,
#content .content_box .result_table table tr th.kgpc-detail-head,
.result_table table tr th.border_rightFF,
.result_table table tr td.border_rightFF,
.result_table table tr th.sticky-col,
.result_table table tr td.sticky-col,
.result_table table tr td.classification_detail_btn,
.result_table table tr th.kgpc-detail-head {
  border: 1px solid #ccc !important;
}

/* 헤더 1행 */
#content .content_box .result_table table tr.result_table_tr1,
#content .content_box table tr.result_table_tr1,
.result_table table tr.result_table_tr1 {
  background-color: #e6effb !important;
  color: #004190 !important;
}

#content .content_box .result_table table tr.result_table_tr1 th,
#content .content_box table tr.result_table_tr1 th,
.result_table table tr.result_table_tr1 th {
  background-color: #e6effb !important;
  color: #004190 !important;
  font-weight: 600;
  font-size: 15px;
  vertical-align: middle;
  padding: 12px 8px !important;
}

/* 헤더 2행 */
#content .content_box .result_table table tr.result_table_tr2,
#content .content_box .result_table tr.result_table_tr2,
.result_table table tr.result_table_tr2 {
  background-color: #f3f6fb !important;
}

#content .content_box .result_table table tr.result_table_tr2 th,
#content .content_box .result_table tr.result_table_tr2 th,
.result_table table tr.result_table_tr2 th {
  background-color: #f3f6fb !important;
  color: #000 !important;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  padding: 10px 8px !important;
  min-height: 52px;
  height: 52px;
  vertical-align: middle;
}

#content .content_box .result_table table thead,
.result_table table thead {
  border: none !important;
}

/* 상세보기 열 폭/스티키 (보더는 위에서 통일) */
.result_table colgroup col:not(.colW-detail) {
  width: auto;
  min-width: 0;
}

.result_table colgroup col.colW-detail {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
}

.result_table table th.sticky-col,
.result_table table td.sticky-col,
.result_table table td.classification_detail_btn,
.result_table table th.kgpc-detail-head {
  width: 72px !important;
  max-width: 72px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  box-sizing: border-box;
  vertical-align: middle;
}

.result_table table tr.result_table_tr1 th.sticky-col,
.result_table table tr.result_table_tr1 th.kgpc-detail-head,
.total_search .table-scroll table tr.result_table_tr1 th.sticky-col {
  padding: 12px 4px !important;
  overflow: visible !important;
  background-color: #e6effb !important;
  color: #004190 !important;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none !important;
}

#content .content_box .result_table table tbody td.sticky-col,
#content .content_box .result_table table tbody td.classification_detail_btn,
.result_table table tbody td.sticky-col,
.result_table table tbody td.classification_detail_btn,
.total_search .table-scroll table tbody td.sticky-col,
.total_search .table-scroll table tbody td.classification_detail_btn {
  background: #fff;
  box-shadow: none !important;
}

.result_table table td.sticky-col,
.result_table table td.classification_detail_btn {
  padding: 8px 4px !important;
  overflow: hidden !important;
}

.result_table table td.classification_detail_btn .detail_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
}

.result_table table td.classification_detail_btn .detail_btn img,
.result_table table td.classification_detail_btn img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px;
  object-fit: contain;
}

.result_table table th:not(.sticky-col):not(.kgpc-detail-head),
.result_table table td:not(.classification_detail_btn):not(.sticky-col) {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  box-sizing: border-box;
}

.result_table table tr.result_table_tr2 th {
  white-space: normal;
  word-break: keep-all;
  line-height: 1.35;
}

