/**
 * 파일명: board.css
 * 파일위치: /wp-content/plugins/minimal-board-standalone/assets/css/board.css
 * 설명: 독립형 미니멀 게시판 프론트엔드 스타일시트
 */

/* 기본 리셋 및 공통 스타일 */
.mb-container,
.mb-board-container {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
}

.mb-container * {
    box-sizing: border-box;
}

/* 상단 고정 헤더 탭 */
.mb-header-tabs {
    position: fixed;
    top: 32px; /* 워드프레스 관리바 아래 */
    left: 0;
    right: 0;
    background: #2c3e50;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mb-header-tabs .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
}

.mb-header-tabs .tab-item {
    flex: 1;
    text-align: center;
}

.mb-header-tabs .tab-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    border-right: 1px solid #34495e;
    transition: all 0.3s ease;
}

.mb-header-tabs .tab-item:last-child a {
    border-right: none;
}

.mb-header-tabs .tab-item a:hover {
    background-color: #34495e;
    color: #3498db;
}

.mb-header-tabs .tab-item.active a {
    background-color: #3498db;
    color: white;
}

/* 관리바 조정 */
.admin-bar .mb-header-tabs {
    top: 32px;
}

body {
    padding-top: 50px;
}

.admin-bar body {
    padding-top: 82px;
}

/* 메인 컨테이너 */
.mb-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.mb-board-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* 게시판 네비게이션 탭 */
.board-nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #ecf0f1;
}

.board-nav-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.board-nav-tab:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.board-nav-tab.active {
    background: #3498db;
    color: white;
}

/* 게시판 헤더 */
.board-header {
    padding: 20px;
    background: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.write-btn {
    background: #27ae60;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.write-btn:hover {
    background: #229954;
    color: white;
    text-decoration: none;
}

/* 게시판 테이블 */
.board-table {
    width: 100%;
    border-collapse: collapse;
}

.board-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    font-size: 14px;
}

.board-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    color: #555;
    font-size: 14px;
}

.board-table tr:hover {
    background: #f8f9fa;
}

/* 게시글 제목 */
.post-title {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.post-title:hover {
    color: #3498db;
    text-decoration: none;
}

/* 공지사항 배지 */
.notice-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 댓글 수 */
.comment-count {
    color: #3498db;
    font-size: 12px;
    margin-left: 4px;
}

/* 답변 상태 */
.status-complete {
    color: #27ae60;
    font-weight: 600;
}

.status-pending {
    color: #e74c3c;
    font-weight: 600;
}

/* 페이지네이션 */
.pagination {
    padding: 20px;
    text-align: center;
}

.pagination .page-number {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-number:hover,
.pagination .page-number.current {
    background: #3498db;
    color: white;
    border-color: #3498db;
    text-decoration: none;
}

/* 검색 폼 */
.search-form-container {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ecf0f1;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form select,
.search-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.search-form select:focus,
.search-form input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.search-form button {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-form button:hover {
    background: #2980b9;
}

/* 글쓰기 폼 */
.write-form-container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.form-header {
    padding: 20px;
    background: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-cancel:hover {
    background: #7f8c8d;
    color: white;
    text-decoration: none;
}

.write-form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.btn-secondary,
.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* 게시글 보기 */
.post-view-container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.post-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb a:hover {
    color: #2980b9;
    text-decoration: none;
}

.breadcrumb .separator {
    color: #bdc3c7;
}

.breadcrumb .current {
    color: #7f8c8d;
}

.post-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-list,
.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-list {
    background: #95a5a6;
    color: white;
}

.btn-list:hover {
    background: #7f8c8d;
    color: white;
    text-decoration: none;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.post-content {
    padding: 30px;
}

.post-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.post-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #7f8c8d;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-body {
    line-height: 1.8;
    color: #444;
    word-break: break-word;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
}

.post-body p {
    margin-bottom: 15px;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Q&A 댓글 섹션 */
.qa-comments-section {
    padding: 30px;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
}

.comments-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-count {
    color: #7f8c8d;
    font-weight: normal;
}

.comments-list {
    margin-bottom: 30px;
}

.comment-item {
    background: white;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-author {
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-date {
    color: #95a5a6;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-comment-delete {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-comment-delete:hover {
    background: #e74c3c;
    color: white;
}

.comment-content {
    line-height: 1.6;
    color: #555;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-style: italic;
}

/* 댓글 작성 폼 */
.comment-form-container {
    background: white;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form input,
.comment-form textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* 이전/다음 게시글 네비게이션 */
.post-navigation {
    padding: 30px;
    border-top: 1px solid #ecf0f1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nav-item {
    display: block;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 80px;
}

.nav-item a:hover {
    background: #ecf0f1;
    color: #3498db;
    text-decoration: none;
}

.nav-content {
    flex: 1;
}

.nav-label {
    display: block;
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 4px;
}

.nav-title {
    font-weight: 500;
    line-height: 1.3;
}

.nav-prev a {
    text-align: left;
}

.nav-next a {
    text-align: right;
}

/* 로딩 메시지 */
.loading-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

/* 에러 메시지 */
.mb-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

/* 빈 콘텐츠 메시지 */
.no-items {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.no-items p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 반응형 디자인 */
@media screen and (max-width: 782px) {
    /* 모바일에서 관리바 높이 조정 */
    .admin-bar .mb-header-tabs {
        top: 46px;
    }
    
    .mb-header-tabs .container {
        flex-direction: column;
    }
    
    .mb-header-tabs .tab-item a {
        border-right: none;
        border-bottom: 1px solid #34495e;
    }
    
    .mb-header-tabs .tab-item:last-child a {
        border-bottom: none;
    }
    
    .admin-bar body {
        padding-top: 136px; /* 관리바 + 탭 높이 */
    }
    
    body {
        padding-top: 90px;
    }
}

@media screen and (max-width: 768px) {
    .mb-container {
        margin: 10px;
        padding: 0 10px;
    }
    
    .mb-board-container {
        margin: 10px;
        border-radius: 4px;
    }
    
    /* 게시판 탭 */
    .board-nav-tabs {
        flex-direction: column;
    }
    
    /* 검색 폼 */
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form select,
    .search-form input[type="text"] {
        width: 100%;
        max-width: 300px;
    }
    
    /* 게시판 테이블 */
    .board-table {
        font-size: 12px;
    }
    
    .board-table th,
    .board-table td {
        padding: 10px 8px;
    }
    
    /* 게시판 헤더 */
    .board-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* 글쓰기 폼 */
    .form-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .write-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    /* 게시글 보기 */
    .post-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .post-actions {
        justify-content: center;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-title {
        font-size: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-meta {
        gap: 15px;
    }
    
    .qa-comments-section {
        padding: 20px;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .nav-next {
        grid-row: 1;
    }
}

@media screen and (max-width: 480px) {
    /* 아주 작은 화면에서 */
    .board-table th,
    .board-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .notice-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .board-title {
        font-size: 16px;
    }
    
    .write-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .post-title {
        font-size: 18px;
    }
    
    .comment-item {
        padding: 15px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .mb-board-container,
    .write-form-container,
    .post-view-container {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .board-table th {
        background: #404040;
        color: #e0e0e0;
    }
    
    .board-table td {
        color: #d0d0d0;
        border-bottom-color: #404040;
    }
    
    .board-table tr:hover {
        background: #404040;
    }
    
    .post-title {
        color: #e0e0e0;
    }
    
    .post-title:hover {
        color: #5dade2;
    }
    
    .search-form-container {
        border-top-color: #404040;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #404040;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .comment-item {
        background: #404040;
    }
}

/* 접근성 개선 */
.board-nav-tab:focus,
.write-btn:focus,
.post-title:focus,
.search-form button:focus,
.search-form select:focus,
.search-form input:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 프린트 스타일 */
@media print {
    .mb-header-tabs,
    .board-nav-tabs,
    .board-header,
    .search-form-container,
    .pagination,
    .post-actions,
    .comment-form-container {
        display: none;
    }
    
    .mb-board-container,
    .write-form-container,
    .post-view-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .board-table {
        font-size: 12px;
    }
}

/* 커스텀 스크롤바 (webkit 브라우저) */
.mb-container ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.mb-container ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mb-container ::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.mb-container ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}