/*==========================================================================
   TSEARCH 탭 스타일
===========================================================================*/

/* JSP 탭 버튼 스타일 */
.tab-btn {
    display: flex;
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
    overflow: hidden;
}

.tab-btn li {
    flex: 1;
    border-right: 1px solid #e9ecef;
}

.tab-btn li:last-child {
    border-right: none;
}

.tab-btn .search-tab-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    text-align: center;
    background-color: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn .search-tab-btn:hover {
    background-color: #e9ecef;
    color: #495057;
    text-decoration: none;
}

.tab-btn .search-tab-btn.active {
    background-color: #fff;
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.tab-btn .search-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #fff;
    z-index: 2;
}

.tab-btn .search-tab-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

.tab-btn .search-tab-btn:focus:not(:focus-visible) {
    outline: none;
}

/* 탭 버튼 애니메이션 */
.tab-btn .search-tab-btn {
    transform: translateY(0);
}

.tab-btn .search-tab-btn:hover {
    transform: translateY(-1px);
}

.tab-btn .search-tab-btn.active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

/* 단일 탭 결과 스타일 */
.single_tab_result {
    width: 100%;
    margin-top: 20px;
}

.single_tab_result .tab_header {
    border-bottom: 2px solid #007bff;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.single_tab_result .category_title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.single_tab_result .tab_content {
    padding: 0;
}

.single_tab_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 단일 탭 항목 스타일 - 카테고리 항목과 동일한 스타일 적용 */
.single_tab_item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    background: #fff;
}

.single_tab_item:last-child {
    border-bottom: none;
}

.single_tab_item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

/* 단일 탭 항목 제목 스타일 */
.single_tab_item .tit {
    display: block;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
}

.single_tab_item .tit:hover {
    text-decoration: none;
}

.single_tab_item .tit .fc-blue {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    display: inline-block;
    margin-right: 8px;
}

.single_tab_item .tit:hover .fc-blue {
    color: #007bff;
}

.single_tab_item .tit .score {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
}

/* 단일 탭 항목 내용 스타일 */
.single_tab_item .txt-over2 {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 단일 탭 항목 정보 스타일 */
.single_tab_item .item_info {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.single_tab_item .department {
    font-size: 13px;
    color: #6c757d;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.single_tab_item .category_tag {
    font-size: 13px;
    color: #007bff;
    background: #e3f2fd;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* 기존 스타일 유지 (호환성) */
.single_tab_list .tsearch_item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fff;
    transition: all 0.2s ease;
}

.single_tab_list .tsearch_item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

/* 결과 없음 스타일 */
.no_result_area {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.no_result_icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no_result_text h4 {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.no_result_text p {
    color: #868e96;
    margin: 0;
    font-size: 0.9rem;
}

/* 오류 스타일 */
.error_area {
    text-align: center;
    padding: 60px 20px;
    background: #fff5f5;
    border-radius: 12px;
    border: 2px dashed #fed7d7;
}

.error_icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error_text h4 {
    font-size: 1.1rem;
    color: #e53e3e;
    margin-bottom: 10px;
    font-weight: 500;
}

.error_text p {
    color: #a0aec0;
    margin: 0;
    font-size: 0.9rem;
}

/* 탭 콘텐츠 컨테이너 */
.total-rslt {
    margin-top: 20px;
}

.rslt-box-wrap {
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px;
}

/* 탭 콘텐츠 컨테이너 */
.tab_content_container {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.tab_pane {
    display: none;
    padding: 20px;
    min-height: 200px;
}

.tab_pane.active {
    display: block;
}

.tab_pane .no_results {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
}

/* 개선된 검색결과 없음 스타일 */
.no_results_container {
    text-align: center;
    padding: 50px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.no_results_icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no_results_title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.no_results_desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* 결과 헤더 */
.rslt-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.rslt-header .search_result_tit {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 탭별 리스트 스타일 */
.tab_list .tsearch_item.tab_item {
    border-bottom: 1px solid #f1f3f4;
    padding: 20px 0;
}

.tab_list .tsearch_item.tab_item:last-child {
    border-bottom: none;
}

.tab_list .tsearch_item.tab_item .tit {
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tab_list .tsearch_item.tab_item .tit:hover {
    text-decoration: underline;
}

.tab_list .tsearch_item.tab_item .tit .fc-blue {
    color: #007bff;
    font-weight: 500;
    font-size: 16px;
}

.tab_list .tsearch_item.tab_item .tit .score {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

.tab_list .tsearch_item.tab_item .txt-over2 {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
    font-size: 14px;
}

.tab_list .tsearch_item.tab_item .info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tab_list .tsearch_item.tab_item .info li {
    font-size: 13px;
    color: #6c757d;
}

.tab_list .tsearch_item.tab_item .info li .label {
    font-weight: 500;
    color: #495057;
}

/* 추가 결과 스타일 */
.tab_list .tsearch_item.additional_result {
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-top: 10px;
    padding: 15px;
    border-bottom: none !important;
}

.tab_list .tsearch_item.additional_result .tit {
    font-size: 14px;
}

.tab_list .tsearch_item.additional_result .txt-over2 {
    font-size: 13px;
    color: #6c757d;
}

/* 탭 로딩 표시 */
.tab_loading {
    text-align: center;
    padding: 20px;
    color: #007bff;
    font-style: italic;
    font-size: 14px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin: 10px 0;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

/* 결과 카운트 스타일 */
.result_count {
    font-size: 14px;
    color: #007bff;
    font-weight: 500;
}

/* 전체 탭 스타일 */
.tab_pane.all_tab .tsearch_item {
    border-left: 3px solid #007bff;
    padding-left: 15px;
    margin-bottom: 15px;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .tab-btn {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .tab-btn li {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .tab-btn li:last-child {
        border-bottom: none;
    }
    
    .tab-btn .search-tab-btn {
        padding: 12px 15px;
        font-size: 13px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab-btn .search-tab-btn.active {
        border-left-color: #007bff;
        border-bottom: none;
    }
    
    .tab_pane {
        padding: 15px;
    }
    
    .tab_list .tsearch_item.tab_item .info {
        flex-direction: column;
        gap: 8px;
    }
    
    .rslt-header {
        padding: 12px 15px;
    }
    
    .rslt-header .search_result_tit {
        font-size: 16px;
    }
    
    .tab_list .tsearch_item.tab_item .tit .fc-blue {
        font-size: 15px;
    }
}

/* 추가 결과 스타일 */
.tab_list .tsearch_item.additional_result {
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-top: 10px;
    padding: 15px;
    border-bottom: none !important;
}

.tab_list .tsearch_item.additional_result .tit {
    font-size: 14px;
}

.tab_list .tsearch_item.additional_result .txt-over2 {
    font-size: 13px;
    color: #6c757d;
}

/* 탭 로딩 표시 */
.tab_loading {
    text-align: center;
    padding: 20px;
    color: #007bff;
    font-style: italic;
    font-size: 14px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin: 10px 0;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

/* 결과 카운트 스타일 */
.result_count {
    font-size: 14px;
    color: #007bff;
    font-weight: 500;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .tab_navigation {
        flex-direction: column;
    }
    
    .tab_navigation .tab_item button {
        font-size: 13px;
        padding: 12px 15px;
    }
    
    .tab_pane {
        padding: 15px;
    }
    
    .tab_list .tsearch_item.tab_item .info {
        flex-direction: column;
        gap: 8px;
    }
}

/* 페이징 스타일 */
.pagination_wrap {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 10px;
}

.page_btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 40px;
}

.page_btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.page_btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.page_btn:disabled {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.page_btn.prev_btn,
.page_btn.next_btn {
    font-weight: 500;
}

.page_info {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* 모바일 페이징 스타일 */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .page_btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .pagination_wrap {
        padding: 15px 0;
        margin-top: 20px;
    }
}

/*==========================================================================
   카테고리 섹션 스타일
===========================================================================*/

.category_sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

.category_section {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category_section_header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 기존 category_header도 지원 (JavaScript와의 호환성) */
.category_header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.category_section_title,
.category_title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex-grow: 1;
}

.category_result_count,
.category_count {
    font-size: 14px;
    color: #666;
    background: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-left: 8px;
}

.category_section_content {
    padding: 0;
}

/* 카테고리 목록 스타일 */
.category_list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category_item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.category_item:last-child {
    border-bottom: none;
}

.category_item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

/* 카테고리 항목 제목 스타일 */
.category_item .tit {
    display: block;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
}

.category_item .tit:hover {
    text-decoration: none;
}

.category_item .tit .fc-blue {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    display: inline-block;
    margin-right: 8px;
}

.category_item .tit:hover .fc-blue {
    color: #007bff;
}

.category_item .tit .score {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
}

/* 카테고리 항목 내용 스타일 */
.category_item .txt-over2 {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 카테고리 항목 정보 스타일 */
.category_item .item_info {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.category_item .department {
    font-size: 13px;
    color: #6c757d;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* 기존 tab_list 스타일 (호환성 유지) */
.category_section .tab_list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category_section .tab_list li {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.category_section .tab_list li:last-child {
    border-bottom: none;
}

.category_section .tab_list li:hover {
    background: #f8f9fa;
}

.category_section_footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.view_more_btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 10px;
}

.view_more_btn:hover {
    background: #0056b3;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.view_more_btn:active {
    transform: translateY(0);
}

.view_more_btn::after {
    content: '→';
    font-size: 12px;
}

/* 카테고리 섹션 모바일 반응형 */
@media (max-width: 768px) {
    .category_sections {
        gap: 20px;
        padding: 15px 0;
    }
    
    .category_section_header,
    .category_header {
        padding: 12px 15px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    
    .category_section_title,
    .category_title {
        font-size: 16px;
        flex-grow: 1;
    }
    
    .category_result_count,
    .category_count {
        font-size: 12px;
        padding: 2px 8px;
        margin-left: 4px;
    }
    
    .view_more_btn {
        font-size: 11px;
        padding: 4px 8px;
        margin-left: 6px;
    }
    
    .view_more_btn::after {
        font-size: 11px;
    }
    
    .category_section .tab_list li,
    .category_item {
        padding: 15px;
    }
    
    /* 모바일 카테고리 항목 스타일 */
    .category_item .tit .fc-blue {
        font-size: 15px;
    }
    
    .category_item .txt-over2 {
        font-size: 13px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .category_item .department {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .category_item .category_tag {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    /* 모바일 단일 탭 항목 스타일 */
    .single_tab_item {
        padding: 15px;
    }
    
    .single_tab_item .tit .fc-blue {
        font-size: 15px;
    }
    
    .single_tab_item .txt-over2 {
        font-size: 13px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .single_tab_item .department,
    .single_tab_item .category_tag {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .category_section .tab_list li {
        padding: 15px;
    }
    
    .category_section_footer {
        padding: 12px 15px;
    }
    
    .view_more_btn {
        font-size: 13px;
        padding: 7px 14px;
    }
}

/* 로딩 상태 스타일 */
.category_section.loading {
    opacity: 0.7;
    pointer-events: none;
}

.category_section.loading .category_section_content::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
