/* ===================================
   게시판 공통 스타일 CSS
   style-board-common.css
   =================================== */

/* ===================================
   게시판 섹션 공통
   =================================== */
.board-section {
    padding: 120px 0 80px;  /* 상단 여백을 80px에서 120px로 증가 */
    min-height: 80vh;
    background: #f8f9fa;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}

.board-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.board-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-form .input-group {
    width: 400px;
}

.search-form .form-select {
    max-width: 100px;
}

/* ===================================
   게시판 뷰 타입 전환
   =================================== */
.view-type-switcher {
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.view-type-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-type-btn:hover {
    background: #f8f9fa;
    color: var(--color-primary);
}

.view-type-btn.active {
    background: var(--color-primary);
    color: white;
}

.view-type-btn i {
    font-size: 1.1rem;
}

/* ===================================
   공통 게시글 요소
   =================================== */
.post-title {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.post-title:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.comment-count {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

/* 공지사항 스타일 */
.notice-row {
    background: #fff5f5;
}

.notice-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===================================
   페이지 헤더
   =================================== */
.page-header {
    padding-top: 100px;  /* 상단 여백 추가 */
    margin-bottom: 2rem;
}

.page-header h1,
.page-header h2,
.page-header .board-title {
    margin-top: 0;
}

/* ===================================
   게시글 작성/수정
   =================================== */
.write-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
}

/* ===================================
   파일 업로드
   =================================== */
.file-upload-area {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.file-drop-zone {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    cursor: pointer;
    transition: all 0.3s;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: #f0f8ff;
}

.file-drop-zone i {
    font-size: 3rem;
    color: #6c757d;
    display: block;
    margin-bottom: 1rem;
}

.file-drop-zone input[type="file"] {
    display: none;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-info i {
    font-size: 1.25rem;
    color: #6c757d;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: #6c757d;
    font-size: 0.875rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #dc3545;
    color: white;
}

/* ===================================
   게시글 보기
   =================================== */
.post-view {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.post-header {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 2rem;
}

.post-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.meta-item i {
    font-size: 1rem;
}

/* 첨부파일 영역 */
.post-attachments {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.attachments-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
}

.attachment-link:hover {
    color: var(--color-primary);
}

.attachment-link i {
    font-size: 1.25rem;
    color: #6c757d;
}

.download-count {
    color: #6c757d;
    font-size: 0.875rem;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 2rem;
    min-height: 300px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.post-actions {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

.btn-like {
    background: white;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s;
}

.btn-like:hover,
.btn-like.liked {
    background: #e74c3c;
    color: white;
}

.btn-like i {
    margin-right: 0.5rem;
}

.post-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* ===================================
   댓글
   =================================== */
.comment-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.comment-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.comment-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s;
}

.comment-item.reply {
    margin-left: 3rem;
    background: #e9ecef;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.comment-writer {
    font-weight: 600;
    color: var(--color-text);
}

.comment-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
}

.secret-comment {
    color: #6c757d;
    font-style: italic;
}

.comment-actions {
    margin-top: 0.75rem;
}

.comment-actions .btn-link {
    padding: 0;
    font-size: 0.875rem;
    color: #6c757d;
    text-decoration: none;
}

.comment-actions .btn-link:hover {
    color: var(--color-primary);
}

/* ===================================
   반응형 공통
   =================================== */
@media (max-width: 768px) {
    .board-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .board-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .search-form .input-group {
        width: 100%;
    }
    
    /* 뷰 타입 전환 버튼 */
    .view-type-switcher {
        width: 100%;
        justify-content: center;
    }
    
    .view-type-btn {
        flex: 1;
        justify-content: center;
    }
    
    .view-type-btn span {
        display: none;
    }
    
    /* 게시글 보기 */
    .post-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* 댓글 */
    .comment-item.reply {
        margin-left: 1.5rem;
    }
}

@media (max-width: 576px) {
    /* 뷰 타입 전환 버튼 초소형 */
    .view-type-btn {
        padding: 0.5rem;
    }
    
    .view-type-btn i {
        font-size: 1rem;
    }
}