@charset "utf-8";

/* 게시판 목록 스킨 CSS - 최적화 버전 */

/* 카테고리 스타일 */
#bo_cate {
    margin: 25px 0;
}

#bo_cate ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#bo_cate li {
    display: inline-block;
}

#bo_cate a {
    display: block;
    padding: 8px 15px;
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--body-color);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.bo_sch .bo_sch_cls {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 1.5rem;
    color: var(--secondary-color);
    background: transparent;
    border: 0;
    cursor: pointer;
}

/* 하단 버튼 영역 */
.bo_fx {
    margin: 20px 0;
    display: flex;
    justify-content: flex-end;
    padding: 0 15px; /* 우측 여백을 위한 패딩 추가 */
}

/* 체크박스 열 숨김 */
.is_checkbox_hide {
    display: none !important;
}

/* 반응형 스타일 - 모바일 최적화 */
@media (max-width: 992px) {
    /* 대형 태블릿 - 고정 너비 유지 */
    .tbl_head01 .td_name {
        width: 70px !important;
        min-width: 70px !important;
    }

    .tbl_head01 .td_datetime {
        width: 75px !important;
        min-width: 75px !important;
    }

    .tbl_head01 .td_subject {
        width: auto !important;
    }

    /* 992px 이하에서 분류 조정 */
    .tbl_head01 .td_category {
        width: 70px !important;
        min-width: 70px !important;
    }
}

@media (max-width: 768px) {
    /* 태블릿 및 소형 태블릿 */
    /* 체크박스 열 항상 숨김 */
    .tbl_head01 .all_chk,
    .tbl_head01 .td_chk {
        display: none !important;
    }

    /* 글쓴이 열 숨김 */
    .tbl_head01 .td_name {
        display: none !important;
    }

    /* 번호 열 */
    .tbl_head01 .td_num2 {
        width: 45px !important;
    }

    /* 분류 열 */
    .tbl_head01 .td_category {
        width: 60px !important;
    }

    /* 제목 열 확장 */
    .tbl_head01 .td_subject {
        width: auto !important;
    }

    /* 날짜 열 */
    .tbl_head01 .td_datetime {
        width: 70px !important;
    }
    
    /* 모바일 카테고리 최적화 */
    #bo_cate {
        margin: 20px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 10px;
    }
    
    #bo_cate ul {
        justify-content: flex-start;
        flex-wrap: nowrap;
        padding-bottom: 5px; /* 스크롤바를 위한 공간 */
        width: max-content;
    }
    
    #bo_cate a {
        white-space: nowrap;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    /* 스마트폰 */
    /* 조회 열 숨김 */
    .tbl_head01 .td_num {
        display: none !important;
    }

    /* 분류 열 숨김 */
    .tbl_head01 .td_category {
        display: none !important;
    }

    /* 번호 열 */
    .tbl_head01 .td_num2 {
        width: 40px !important;
    }

    /* 제목 열 더 확장 */
    .tbl_head01 .td_subject {
        width: auto !important;
        padding-left: 10px !important;
    }

    /* 날짜 열 */
    .tbl_head01 .td_datetime {
        width: 60px !important;
    }
    
    /* 페이지 정보 숨김 */
    #bo_list_total {
        display: none;
    }
    
    /* 제목 텍스트 크기 조정 */
    .bo_tit a {
        font-size: 0.9rem;
    }
    
    /* 테이블 헤더 텍스트 축소 */
    .tbl_head01 thead th {
        font-size: 0.8rem;
        padding: 10px 4px;
    }
    
    /* 테이블 본문 패딩 축소 */
    .tbl_head01 td {
        padding: 12px 4px;
        font-size: 0.9rem;
    }
    
    /* 모바일 카테고리 강화 */
    #bo_cate {
        margin: 15px 0;
    }
    
    #bo_cate a {
        padding: 7px 14px;
        font-size: 0.85rem;
        font-weight: 500;
    }
    
    /* 카테고리 스크롤 인디케이터 (스크롤 힌트) */
    #bo_cate:after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 100%;
        background: linear-gradient(to right, transparent, var(--card-bg) 70%);
        pointer-events: none;
        z-index: 1;
    }
}

@media (max-width: 420px) {
    /* 소형 스마트폰 */
    /* 테이블 간격 감소 */
    .tbl_head01 {
        padding: 0 8px;
    }

    /* 페이지 버튼 크기 축소 */
    .pg_page, .pg_current {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 0.9rem;
    }

    /* 번호 열 더 축소 */
    .tbl_head01 .td_num2 {
        width: 35px !important;
    }

    /* 제목 열 더 확장 */
    .tbl_head01 .td_subject {
        width: auto !important;
        padding-left: 5px !important;
    }

    /* 날짜 열 축소 */
    .tbl_head01 .td_datetime {
        width: 50px !important;
        font-size: 0.8rem;
    }
    
    /* 초소형 모바일에서 카테고리 더욱 콤팩트하게 */
    #bo_cate a {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* 카테고리 간격 축소 */
    #bo_cate ul {
        gap: 6px;
    }
}

#bo_cate a:hover, #bo_cate a:focus {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

#bo_cate #bo_cate_on {
    background: var(--accent-color);
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(93, 95, 239, 0.3);
}

/* 상단 영역 */
#bo_btn_top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

#bo_list_total {
    font-size: 0.95rem;
    color: var(--secondary-color);
}

#bo_list_total span {
    font-weight: bold;
    color: var(--accent-color);
}

/* 버튼 영역 */
.btn_bo_user {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.btn_bo_user li {
    position: relative;
}

/* 버튼 스타일 */
.btn_bo_user .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%; 
    background: var(--input-bg);
    color: var(--secondary-color);
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
    position: relative;
}

.btn_bo_user .btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.btn_bo_user .btn i {
    font-size: 1.1rem;
    margin: 0 !important; /* style.css의 margin-right 제거 */
}

/* 아이콘만 있는 버튼에서 sound_only 숨김 처리 개선 */
.btn_bo_user .btn .sound_only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 게시판 테이블 */
.tbl_head01 {
    margin-top: 15px;
    padding: 0 15px; /* 테이블 전체에 패딩 추가 */
}

.tbl_head01 table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* 내용에 맞게 자동 조절 */
}

.tbl_head01 caption {
    visibility: hidden;
    overflow: hidden;
    width: 0;
    height: 0;
    font-size: 0;
    line-height: 0;
}

/* 테이블 헤더 */
.tbl_head01 thead th {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-align: center;
    font-weight: normal;
    white-space: nowrap;
}

/* 테이블 셀 내 chk_box의 display:flex 재정의 - 테이블 셀 레이아웃 유지 */
.tbl_head01 th.chk_box,
.tbl_head01 td.chk_box {
    display: table-cell !important;
}

/* 체크박스 열 - 관리자용 */
.tbl_head01 .all_chk,
.tbl_head01 .td_chk {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* 체크박스 내부 레이블 정렬 */
.tbl_head01 .all_chk label,
.tbl_head01 .td_chk label {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
}

/* 번호 열 */
.tbl_head01 .td_num2 {
    width: 50px !important;
    min-width: 50px !important;
    text-align: center !important;
}

/* 분류 열 */
.tbl_head01 .td_category {
    width: 80px !important;
    min-width: 80px !important;
    text-align: center !important;
}

/* 테이블 내 분류 특별 처리 */
.td_category a.bo_cate_link:after {
    content: none !important; /* 분류 뒤 점(.) 제거 */
}

/* 제목 열 - 나머지 공간 모두 차지 */
.tbl_head01 .td_subject {
    width: auto !important;
    max-width: 0 !important; /* 테이블 셀에서 ellipsis 작동을 위해 필요 */
    text-align: left !important;
    padding-left: 15px !important;
    overflow: hidden !important;
}

/* 글쓴이 열 */
.tbl_head01 .td_name {
    width: 80px !important;
    min-width: 80px !important;
    text-align: center !important;
}

/* 조회 열 */
.tbl_head01 .td_num {
    width: 50px !important;
    min-width: 50px !important;
    text-align: center !important;
}

/* 날짜 열 */
.tbl_head01 .td_datetime {
    width: 85px !important;
    min-width: 85px !important;
    text-align: center !important;
}

.tbl_head01 tbody tr {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.tbl_head01 tbody tr:hover {
    background: var(--input-bg);
    border-left: 3px solid var(--accent-color);
}

.tbl_head01 tbody tr.even {
    background: var(--input-bg);
    opacity: 0.9;
}

.tbl_head01 td {
    padding: 15px 8px;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
    vertical-align: middle;
    text-align: center; /* 모든 셀 중앙 정렬 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 체크박스 셀 내부 정렬 */
.td_chk,
.all_chk {
    vertical-align: middle !important;
}

.td_chk .chk_box,
.all_chk .chk_box {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100%;
    width: 100%;
    min-height: 20px;
}

/* 테이블 내 체크박스 스타일 */
.tbl_head01 .chk_box input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tbl_head01 .chk_box input[type="checkbox"] + label {
    padding: 0;
    margin: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tbl_head01 .chk_box input[type="checkbox"] + label span {
    position: relative;
    top: 0;
    left: 0;
    margin: 0;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--card-bg) !important;
    border: 2px solid var(--secondary-color) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease;
}

/* 체크 안 됐을 때 - 점/내용 제거 */
.tbl_head01 .chk_box input[type="checkbox"] + label span:after {
    content: '' !important;
    display: none !important;
}

/* 체크됐을 때 스타일 */
.tbl_head01 .chk_box input[type="checkbox"]:checked + label span {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

.tbl_head01 .chk_box input[type="checkbox"]:checked + label span:after {
    content: '\f00c' !important;
    display: block !important;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
}

/* sound_only 숨김 */
.tbl_head01 .chk_box .sound_only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bo_tit {
    display: flex;
    align-items: center;
    font-weight: 500;
    width: 100%;
    min-width: 0; /* flex 컨테이너가 줄어들 수 있도록 */
    overflow: hidden;
}

/* 제목 영역에서 텍스트 넘침 처리 */
.bo_tit a {
    color: var(--body-color);
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1; /* 가능한 모든 공간 차지 */
    min-width: 0; /* flex 항목이 내용 크기 이하로 줄어들 수 있도록 설정 */
    text-align: left; /* 제목 텍스트 좌측 정렬 */
    max-width: 100%;
    display: flex;
    align-items: center;
}

.bo_tit a:hover {
    color: var(--accent-color);
}

/* 카테고리 링크 */
.bo_cate_link {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-color);
    color: white;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    flex-shrink: 0; /* 아이콘 크기 유지 */
    font-weight: 500;
}

.bo_cate_link:hover {
    background: var(--accent-color);
    opacity: 0.9;
    color: white;
    transform: translateY(-1px);
}

/* 새글 아이콘 */
.new_icon {
    display: inline-flex;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--success-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0; /* 아이콘 크기 유지 */
    vertical-align: middle;
    align-items: center;
    justify-content: center;
}

/* 댓글 수 */
.cnt_cmt {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0; /* 아이콘 크기 유지 */
}

/* 검색 */
.bo_sch_wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
}

.bo_sch {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.bo_sch h3 {
    margin: 0;
    padding: 15px 20px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.bo_sch form {
    padding: 20px;
}

.bo_sch select {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--body-color);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%23666' d='M0 0h8L4 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 8px 6px;
}

.bo_sch .sch_bar {
    position: relative;
    margin-top: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    overflow: hidden;
}

.bo_sch .sch_input {
    width: calc(100% - 45px);
    height: 45px;
    border: 0;
    padding: 0 15px;
    background: transparent;
    color: var(--body-color);
}

.bo_sch .sch_btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 45px;
    height: 45px;
    border: 0;
    background: var(--accent-color);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 페이지네이션 스타일 - 기본 CSS 오버라이드 */
.pg_wrap {
    margin: 25px 0;
    padding: 15px;
    text-align: center;
}

.pg_page,
.pg_current {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 34px;
    padding: 0 12px;
    margin: 0 3px;
    background: var(--input-bg) !important;
    color: var(--body-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.pg_page:hover {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
}

.pg_current {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
    font-weight: bold;
}

/* 처음, 이전, 다음, 맨끝 */
.pg_start,
.pg_prev,
.pg_next,
.pg_end {
    padding: 0 14px;
}

.pg_start:hover,
.pg_prev:hover,
.pg_next:hover,
.pg_end:hover {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
}
