@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;
  border: 1px solid #e8eaef;
  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 #ffeaa7 !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;
}

