@charset "utf-8";

/* =======================================================
   DG PM Premium Dark Theme
======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0f1115;
    --surface-color: #1a1d24;
    --surface-hover: #232730;
    --border-color: #2e333e;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --status-wait: #6b7280;
    --status-done: #10b981;
    --status-backup: #3b82f6;
    --danger: #ef4444;
}

/* 게시판 영역에만 다크 테마 적용 (전체 웹페이지 배경 보호) */
#bo_list, #bo_v, #bo_w {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color) !important;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

#bo_list .tbl_head01 {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border: none !important;
}

#bo_list .dg-list-table,
#bo_list .dg-list-table tbody tr {
    background-color: var(--surface-color) !important;
}

#bo_list .dg-list-table th {
    background-color: #15181e !important;
    color: var(--text-muted) !important;
}

#bo_list .dg-list-table td {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    background-color: var(--surface-color) !important;
}

/* 폼 공통 */
.dg-write-form {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

/* 대상 등록 페이지 상단 커스텀 헤더 */
#dg_write_header {
    text-align: center;
    margin-bottom: 25px;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #15181e, var(--surface-color));
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

#dg_write_header .write-board-name {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.9;
}

#dg_write_header .write-page-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

#dg_write_header .write-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.dg-form-group {
    margin-bottom: 20px;
}

.dg-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.5px;
}

.dg-form-input, .dg-form-select {
    width: 100%;
    padding: 12px 15px;
    background-color: #13151a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.dg-form-input:focus, .dg-form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.dg-form-input[readonly] {
    background-color: #0b0c0f;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 리스트 테이블 */
.dg-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.dg-list-table th, .dg-list-table td {
    padding: 15px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.dg-list-table th {
    background-color: #15181e;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.dg-list-table tbody tr {
    transition: all 0.2s ease;
}

/* 그누보드 기본 hover 배경 강제 무시, 텍스트 색상만 변경 */
#bo_list .dg-list-table tbody tr:hover,
#bo_list .dg-list-table tbody tr.bg0:hover,
#bo_list .dg-list-table tbody tr.bg1:hover,
#bo_list .dg-list-table tbody tr:hover td,
#bo_list .dg-list-table tbody tr.bg0:hover td,
#bo_list .dg-list-table tbody tr.bg1:hover td {
    background-color: var(--surface-color) !important;
}

#bo_list .dg-list-table tbody tr:hover td,
#bo_list .dg-list-table tbody tr:hover td strong,
#bo_list .dg-list-table tbody tr:hover td a {
    color: var(--accent-color) !important;
}

.dg-list-table tbody tr:last-child td {
    border-bottom: none;
}

/* 상태 뱃지 */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.status-wait { background-color: rgba(107, 114, 128, 0.2); color: #d1d5db; border: 1px solid #4b5563; }
.status-done { background-color: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #059669; }
.status-backup { background-color: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid #2563eb; }

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    font-size: 14px;
}

.btn_submit {
    background: linear-gradient(135deg, var(--accent-color), #ea580c);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn_submit:hover {
    background: linear-gradient(135deg, var(--accent-hover), #c2410c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn_cancel {
    background-color: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn_cancel:hover {
    background-color: #2e333e;
}

.btn-csv {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.btn-csv:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.btn_b02 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    gap: 6px;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, var(--accent-color), #ea580c) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.btn_b02:hover {
    background: linear-gradient(135deg, var(--accent-hover), #c2410c) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6) !important;
    color: #fff !important;
}

.btn-slate {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.btn-slate:hover {
    background-color: #fff;
    color: #000;
}

/* 상세 메타 데이터 */
#bo_v_meta {
    background: var(--surface-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#bo_v_meta h3 {
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color) !important;
}

#bo_v_meta th {
    background-color: transparent !important;
    color: var(--text-muted);
    text-align: left;
    padding-left: 20px;
}

#bo_v_meta td {
    color: var(--text-main);
}

/* 댓글 / 상태변경 영역 */
.dg-status-actions {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-status-change {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-status-change:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* 링크 컬러 재정의 (게시판 영역 내부만) */
#bo_list a, #bo_v a, #bo_w a { color: var(--text-main); text-decoration: none; transition: color 0.2s; }
#bo_list a:hover, #bo_v a:hover, #bo_w a:hover { color: var(--accent-color); }

/* 검색폼 */
#bo_sch { 
    border: none; 
    background: transparent; 
    margin-top: 40px; 
    padding-top: 30px; 
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.sch_input { background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; border-radius: 20px; padding: 10px 20px; }
.sch_btn { background: var(--accent-color); color: #000; border-radius: 50%; width: 40px; height: 40px; }
#bo_sch select {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px;
    border-radius: 20px;
    outline: none;
    margin-right: 5px;
}

/* 리스트 하단 영역 간격 조정 */
#bo_list .bo_fx {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#bo_list .btn_bo_user {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}

/* =======================================================
   뷰 페이지 상단 버튼 영역 (수정, 삭제, 목록 등)
======================================================= */
#bo_v_top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#bo_v_top ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#bo_v_top .btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#bo_v_top .btn:hover {
    background: #374151;
    border-color: #4b5563;
    transform: translateY(-2px);
}

#bo_v_top .btn_admin {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

#bo_v_top .btn_admin:hover {
    background: rgba(239, 68, 68, 0.2);
}

#bo_v_top .btn_b02 {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

/* =======================================================
   뷰 페이지 타이틀 & 인포 영역
======================================================= */
#bo_v_title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(245, 158, 11, 0.3);
    letter-spacing: -0.5px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#bo_v_title .bo_v_tit {
    background: linear-gradient(135deg, #fff 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

#bo_v_info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

#bo_v_info .profile_info strong {
    color: var(--text-main);
    font-weight: normal;
}

#bo_v_info .profile_info strong i {
    color: var(--accent-color);
    margin-right: 5px;
}

/* =======================================================
   상태 변경 버튼 (색상별 다르게) & 댓글 영역 디자인
======================================================= */
.btn-status-change {
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
}

.btn-status-wait { background: #6b7280; }
.btn-status-ing { background: #f59e0b; color: #000; }
.btn-status-done { background: #10b981; }
.btn-status-backup { background: #3b82f6; }
.btn-status-finish { background: #8b5cf6; }

#bo_vc {
    margin-top: 40px;
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

#bo_vc h2 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 15px;
}

#bo_vc article {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

#bo_vc article header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-weight: 600;
}

#bo_vc article header h1 { display: none; }
#bo_vc article .cmt_contents {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
}

/* 댓글 내 수정 삭제 답변 버튼 디자인 */
#bo_vc .bo_vc_act {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    gap: 8px;
}

#bo_vc .bo_vc_act li a {
    display: inline-block;
    padding: 6px 12px;
    background: #2e333e;
    color: #f3f4f6;
    font-size: 12px;
    border-radius: 4px;
    transition: background 0.2s;
    font-weight: 500;
}

#bo_vc .bo_vc_act li a:hover {
    background: var(--accent-color);
    color: #000;
}

.bo_vc_hdinfo {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 12px;
}

/* 댓글 등록 버튼 픽스 */
#btn_submit.btn_submit.btn {
    background: linear-gradient(135deg, var(--accent-color), #ea580c) !important;
    color: #fff !important;
    border: none !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

#btn_submit.btn_submit.btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #c2410c) !important;
}

/* =======================================================
   반응형 (Mobile)
======================================================= */
@media (max-width: 768px) {
    /* 폼 영역 */
    .dg-write-form { padding: 15px; }
    
    /* 리스트 테이블 (가로 스크롤 활성화) - 목록 화면 전용 */
    #bo_list .tbl_wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    #bo_list .dg-list-table {
        min-width: 800px; /* 목록 모바일에서 깨지지 않게 최소 너비 강제 적용 */
        margin-top: 0;
        border: none;
        box-shadow: none;
    }

    /* 상세 메타데이터를 모바일 친화적 세로 배치로 변환 */
    #bo_v_meta table, #bo_v_meta thead, #bo_v_meta tbody, #bo_v_meta th, #bo_v_meta td, #bo_v_meta tr {
        display: block;
        width: 100%;
        min-width: 0 !important; /* 800px 오버라이드 무효화 */
        box-sizing: border-box;
    }
    
    #bo_v_meta tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
    #bo_v_meta th {
        text-align: left;
        background: #15181e !important;
        padding: 12px 15px !important;
        font-size: 13px;
        color: var(--accent-color) !important;
    }
    #bo_v_meta td {
        padding: 12px 15px !important;
        text-align: left;
        border-bottom: none;
        font-size: 14px;
    }

    /* 상단 버튼 풀 위드로 변경 */
    #bo_v_top {
        flex-direction: column;
        align-items: stretch;
    }
    #bo_v_top ul {
        justify-content: space-between;
        width: 100%;
        margin-bottom: 5px;
    }
    #bo_v_top .btn {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    /* 댓글 상태 변경 버튼 모바일 정렬 */
    .dg-status-actions { text-align: center; }
    .btn-status-change { margin: 5px; padding: 10px 12px; font-size: 12px; }
}

/* =======================================================
   프린트 (출력) 최적화 (한 페이지 맞춤)
======================================================= */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    
    body {
        zoom: 0.8; /* 내용 축소하여 한 페이지에 들어가도록 유도 */
    }

    body * { visibility: hidden; }
    
    #bo_v, #bo_v * {
        visibility: visible;
    }
    
    #bo_v {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        page-break-inside: avoid;
    }
    
    /* 한 페이지에 넣기 위해 표나 컨텐츠 끊김 방지 */
    #bo_v_meta, .dg-list-table, #bo_v_img {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* 출력 시 불필요한 요소 숨김 */
    #bo_v_top, .dg-status-actions, #bo_vc_w, .btn-slate, .bo_v_com, .bo_v_left, #bo_vc {
        display: none !important;
    }
    
    /* 흑백 출력 및 배경 정리 */
    body, #bo_v, #wrapper, #container {
        background: #fff !important;
        color: #000 !important;
    }
    
    #bo_v_title {
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
    }
    
    #bo_v_title .bo_v_tit {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
        text-shadow: none !important;
    }
    
    #bo_v_info {
        color: #000 !important;
    }
    #bo_v_info .profile_info strong {
        color: #000 !important;
    }
    
    #bo_v_meta {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .dg-list-table th {
        background: #f1f1f1 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .dg-list-table td {
        color: #000 !important;
        border-color: #000 !important;
    }
    
    .status-badge {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: transparent !important;
    }
}

