/*
 * BoardTableView - 사용자 페이지 기본 스타일 (기존 사이트 디자인: table_01, act_*, pagination)
 * 관리자 전용은 .admin-board-table 블록에서 오버라이드
 */

/* 상단 툴바(필터 등): 비어 있으면 공간 안 차지 */
#custom-responsive-table .bt__top:has(.bt__top-left:empty):has(.bt__top-right:empty) {
    display: none;
}

/* 테이블 (table_01) */
.bt__table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 14px;
    border: none !important;
}

/* 헤더 행 (act_bg_* / comu_bg_*) */
.bt__thead,
.bt__thead .bt__tr--head {
    background: #a5a5a5 !important;
    border: 0 solid #fff !important;
}

.bt__tr--head {
    border-bottom: none;
}

.bt__th {
    color: #fff !important;
    font-weight: 500;
    font-size: 14px;
    padding: 15px 1rem !important;
    border: 0;
    background-color: transparent !important;
    text-align: left;
    vertical-align: middle;
}

/* 셀 (act_td, act_padding) */
.bt__td {
    color: #404040 !important;
    font-size: 14px;
    font-weight: 300;
    border: none;
    border-bottom: 1px solid #eaeaea !important;
    padding: 12px 1rem;
    text-align: left;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .bt__td {
        font-size: 13px;
    }
}

.bt__tbody .bt__tr:hover {
    background-color: #f9f9f9;
}

.bt__td--center, .bt__th--center { text-align: center; }
.bt__td--right, .bt__th--right { text-align: right; }

/* 첫 번째 셀 왼쪽 여백 (p_left) - 데스크톱만 */
.bt__tbody .bt__tr .bt__td:first-child {
    padding-left: 17px !important;
}

/*
 * 반응형 테이블 - /academic, /communication 과 동일 (800px 이하 카드형 + data-title 라벨)
 * 보드가 #custom-responsive-table 안에 있을 때 적용
 */
@media only screen and (max-width: 800px) {
    #custom-responsive-table .bt__table,
    #custom-responsive-table .bt__thead,
    #custom-responsive-table .bt__tbody,
    #custom-responsive-table .bt__th,
    #custom-responsive-table .bt__td,
    #custom-responsive-table .bt__tr {
        display: block;
    }

    /* 인라인 width(JS에서 col.width%) 제거 - 카드형에서 셀 전체 폭 사용 */
    #custom-responsive-table .bt__tbody .bt__tr,
    #custom-responsive-table .bt__th,
    #custom-responsive-table .bt__td {
        width: 100% !important;
        box-sizing: border-box;
    }

    #custom-responsive-table .bt__thead .bt__tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    #custom-responsive-table .bt__tbody .bt__tr {
        border: 0 solid #ccc;
        margin-bottom: 40px;
        border-top: 1px solid #ccc;
    }

    #custom-responsive-table .bt__td {
        border: none !important;
        border-bottom: 1px solid #eee !important;
        position: relative;
        padding-left: 30% !important;
        white-space: normal;
        text-align: left;
        background: #f6f6f6;
        color: #404040 !important;
        font-size: 14px;
    }

    #custom-responsive-table .bt__td:before {
        position: absolute;
        top: 9px;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 500;
        font-size: 14px;
        content: attr(data-title);
    }

    @media (max-width: 768px) {
        #custom-responsive-table .bt__tbody .bt__tr {
            margin-bottom: 40px;
        }
        #custom-responsive-table .bt__td {
            font-size: 13px;
        }
        #custom-responsive-table .bt__td:before {
            font-size: 13px;
        }
    }
}

/* 페이지네이션 (기존 .pagination) */
.bt__pagination-host {
    margin-top: 50px;
    display: block;
    text-align: center;
    white-space: nowrap;
    height: 40px;
    line-height: 40px;
}
@media (max-width: 768px) {
    .bt__pagination-host {
        margin-top: 10px;
    }
}

.bt__pagination {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* 모바일: 페이지네이션 줄바꿈·작은 버튼 (넓은 화면은 main.css #custom-responsive-table이 테이블 반응형 처리) */
@media (max-width: 768px) {
    .bt__pagination-host {
        height: auto;
        line-height: normal;
        padding: 10px 0;
        white-space: normal;
    }
    .bt__pagination {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    .bt__page {
        min-width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 14px;
    }
}

.bt__page {
    display: inline-block;
    box-sizing: border-box;
    min-width: 40px;
    height: 40px;
    padding: 0;
    line-height: 40px;
    border: 1px solid #f7f7f7;
    background: #f7f7f7;
    color: #898989;
    font-size: 15px;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.bt__page:hover:not(.bt__page--disabled) {
    background: #ebebeb;
    color: #333;
}

.bt__page--disabled {
    color: #ccc;
    cursor: not-allowed;
}

.bt__page--active {
    color: #fff !important;
    font-weight: bold;
    background: #175cdd !important;
    border-color: #175cdd !important;
}

.bt__page--active:hover {
    color: #fff !important;
    background: #175cdd !important;
}

.bt__page--prev, .bt__page--next, .bt__page--first, .bt__page--last {
    margin: 0 2px;
}
.bt__page--first { margin-right: 11px; }
.bt__page--last { margin-left: 11px; }

/* Table cell content styles */
.tbl-btn {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.sky-btn {
    background-color: #e0f2fe;
    color: #0ea5e9;
    border-color: #bae6fd;
}

.gray-btn {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.danger-btn {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.danger-btn:hover {
    background-color: #fecaca;
    color: #b91c1c;
}

/* Admin: communication 스타일 참고 (table_01, comu_bg) */
.admin-board-table .bt__table {
    border: none;
    font-size: 14px;
}
/* 테이블 헤더(번호, 이름, 아이디, 이메일, 관리) 회색 배경 */
.admin-board-table .bt__thead,
.admin-board-table .bt__thead .bt__tr--head {
    background-color: #a5a5a5 !important;
}
.admin-board-table .bt__tr--head {
    border-bottom: none;
}
.admin-board-table .bt__th {
    color: #fff !important;
    font-weight: 500;
    padding: 15px 1rem;
    border: 0;
    background-color: transparent !important;
}
.admin-board-table .bt__td {
    color: #404040;
    font-weight: 300;
    border: none;
    border-bottom: 1px solid #eaeaea;
    padding: 12px 1rem;
}
.admin-board-table .bt__tbody .bt__tr:hover {
    background-color: #f9f9f9;
}
.admin-board-table .bt__top {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.admin-board-table .bt__top-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-board-table .bt__pagination-host {
    margin-top: 1.5rem;
}
.admin-board-table .bt__page {
    min-width: 40px;
    height: 40px;
    border: 1px solid #f7f7f7;
    background: #f7f7f7;
    color: #898989;
    border-radius: 6px;
}
.admin-board-table .bt__page:hover:not(.bt__page--disabled) {
    background: #ebebeb;
    color: #333;
}
.admin-board-table .bt__page--active {
    background: #175cdd;
    border-color: #175cdd;
    color: #fff;
}
.admin-board-table .bt__page--disabled {
    color: #ccc;
}
.admin-board-table .bt__page i {
    font-size: 1rem;
}
.admin-board-table [data-bt-total] {
    font-size: 14px;
    color: #404040;
}
