/* ./css/board.css 파일 내용 (수정됨) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* 1. CSS 변수 정의 */
:root {
    --line:#d5d7db; --text:#222; --sub:#666; --title:#000;
    --bg:#fff; --link:#0D4765; --primary-blue:#0D4765;
}

/* 2. 기본/공통 스타일 */
.board-body {
    margin: 0;
    margin-top: 200px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Pretendard', sans-serif;
}

/* ********** 애니메이션 정의 ********** */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. 게시판 컨테이너 및 제목 스타일 */
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.board-container { margin-top: 80px; margin-bottom: 80px; } /* mt-5 */

/* ********** .board-header 스타일 ********** */
.board-header {
    display: flex;
    justify-content: space-between; /* 양 끝 정렬 */
    align-items: flex-end; /* 제목 텍스트와 수직 중앙 정렬 */
    /*border-bottom: 2px solid var(--line);*/
    padding-bottom: 12px;
    margin-bottom: 10px;

    /* 애니메이션 적용 */
    animation: fadeInUp 0.5s ease-out forwards;
}

/* <h2> 공지사항 스타일 (목록 뷰) */
.board-container h2 {
    margin: 0;
    font-size: 60px;
    color: var(--title);
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 600;
}

/* 글쓰기 뷰의 제목 스타일 (폰트 크기 줄임) */
#view-write h2 {
    font-size: 32px; /* 글 작성 폰트 크기 소폭 키움 */
    margin-top: 0;
    margin-bottom: 50px; /* 여백 증가 (여백미 확보) */
    padding-bottom: 15px;
    /* --- 요청 수정 사항 반영 --- */
    border-bottom: 2px solid var(--title); /* 2px 검은색 선으로 변경 */
    /* ------------------------ */
    animation: none; /* 작성 뷰에서는 애니메이션 제거 */
}

/* 추가된 p 문구 스타일 (보더 제거 반영) */
.board-info-text {
    font-size: 16px;
    color: var(--sub);
    margin-bottom: 40px;
    padding-bottom: 0;
    border-bottom: none;
    /* 애니메이션 적용 (0.3s 지연) */
    animation: fadeInUp 0.5s ease-out 0.3s forwards;
    opacity: 0; /* 초기 상태 숨김 */
}

/* 4. 버튼 스타일 */
.btn {
    padding: 10px 40px;
    border: 1px solid var(--line);
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 6px;
}

.btn-default { background: #fff; color: var(--text); }
.btn-default:hover { background: #f2f2f2; }

/* ********** 요청 수정 사항 반영: 등록하기 버튼 검은색 ********** */
.btn-primary {
    background: var(--title); border-color: var(--title);
    color: #fff;
}
.btn-primary:hover { background: #444; border-color: #444; }
/* ************************************************************ */

.btn-danger { background: #dc2626; border-color: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { font-size: 12px; padding: 6px 15px; } /* 상세 뷰 수정/삭제 버튼 크기 조정 */
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ********** 글쓰기 버튼 (원형, 아이콘 전용) 스타일 수정 ********** */
#write-btn {
    padding: 10px; /* 패딩을 줄여 원형에 맞춤 */
    width: 40px;
    height: 40px;
    border-radius: 50%; /* 원형으로 만듦 */
    background: var(--title); /* 검은색 배경 */
    border-color: var(--title); /* 검은색 테두리 */
    color: #fff; /* 흰색 아이콘 */
    font-size: 18px; /* 아이콘 크기 조정 */
    margin-bottom: 3px;
    margin-right: 0;
}
#write-btn:hover {
    background: #444;
    border-color: #444;
}
#write-btn i {
    margin-right: 0; /* 아이콘 전용이므로 여백 제거 */
}

/* ********** [수정] 글쓰기 뷰 버튼 스타일 통합 및 개인화 ********** */
/* 상세 뷰 목록 버튼(.btn-list-center)과 모양 통일 */
#submit-post-btn, #view-write .btn-default {
    margin-top: 30px; /* 여백 증가 (여백미 확보) */
    margin-right: 10px;
    background: #fff;
    padding: 10px 50px;
    border-radius: 20px;
    transition: all 0.2s;
    font-size: 16px; /* 기본 버튼 크기 유지 */
    font-weight: 500;
}

/* 글쓰기 뷰 등록 버튼 (색상 개인화) */
#submit-post-btn {
    background: var(--title);
    color: #fff;
    border: 1px solid var(--title); /* 테두리도 검은색 */
}

#submit-post-btn:hover {
    background: #444;
    border-color: #444;
}

/* 글쓰기 뷰 목록보기 버튼 (색상 개인화) */
#view-write .btn-default {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line); /* 라인 색상 테두리 */
}

#view-write .btn-default:hover {
    background: #f2f2f2;
    border-color: var(--line);
}
/* ************************************************************ */

/* 5. 입력 필드/텍스트 영역 (폰트 크기 및 여백 조정) */
input, textarea {
    width: 100%; padding: 15px; /* 패딩 증가 (여백미 확보) */
    border: 1px solid var(--line);
    font-size: 16px; /* 폰트 크기 조정 */
    margin-bottom: 5px; /* 인풋 사이 여백 증가 (여백미 확보) */
    background: #fff;
    border-radius: 6px;
    box-sizing: border-box; /* 패딩이 전체 너비에 포함되도록 */
}
textarea {
    height: 300px; /* 높이 대폭 증가 (여백미 확보) */
    resize: none;
}

/* 글쓰기 화면 - 파일 첨부 영역 안내 문구 스타일 */
.file-attach-area {
    margin-bottom: 30px; /* 하단 여백 증가 */
    padding-top: 15px;
    border-top: 1px dashed var(--line);
}
.file-attach-area p {
    font-size: 14px; /* 안내 문구 폰트 크기 조정 */
    color: var(--sub);
    margin-top: 5px;
    margin-bottom: 15px;
    text-align: left;
}

/* 파일 입력 컨테이너 (버튼, 인풋, 파일명 표시) */
.file-input-container {
    display: flex;
    align-items: center;
    gap: 15px; /* 간격 증가 */
}

/* 실제 파일 인풋 숨김 */
#write-file-input {
    display: none;
}

/* 파일 선택 버튼 스타일 (label 사용) */
.file-label {
    padding: 10px 20px; /* 패딩 증가 */
    font-size: 14px;
    font-weight: 400;
    border-radius: 6px;
    flex-shrink: 0; /* 크기가 줄어들지 않도록 고정 */
    background: #eee;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s;
}

.file-label:hover {
    background: #ddd;
}

/* 선택된 파일 이름 표시 */
.file-name-display {
    font-size: 14px;
    color: var(--sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}


/* 6. 테이블 스타일 */
table {
    width: 100%; border-collapse: collapse; border-top: 2px solid var(--line);
    border-radius: 6px 6px 0 0; overflow: hidden; background: #fff;
    margin-bottom: 20px;
}

/* 게시글 목록의 최소 높이를 고정하여, 글이 적어도 레이아웃이 유지되도록 수정 */
#post-list {
    display: block;
    min-height: 425px;
    width: 100%;
}

#post-list tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}


/* 기본 TD 스타일 */
td {
    border-bottom: 1px solid var(--line);
    padding: 30px 30px;
    color: #000;
    font-size: 20px;
    vertical-align: middle;
}

/* 제목이 있는 TD의 스타일 (post-link가 제목 셀임) */
.post-link { cursor: pointer; color: #000; }
.post-link:hover { text-decoration: underline; }

/* 요청: 날짜 셀 스타일 (글자 크기 줄이고, 회색으로 변경) */
.post-date {
    font-size: 14px;
    color: var(--sub);
    text-align: right;
}

table tr:hover td { background: #f3f4f6; }


/* 7. 상세 보기 스타일 */

/* 제목과 날짜를 같은 행에 배치하기 위한 flex 컨테이너 */
.detail-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.detail-title {
    font-size: 26px;
    font-weight: 600;
    color: #1c1c1c;
}

/* 등록일자 스타일: 회색, 작은 글자 */
.detail-date {
    font-size: 13px;
    color: #999;
}

/* 작성자 정보는 숨겨졌으므로, 이 메타 정보는 수정/삭제 버튼을 포함하는 행이 됨 */
.detail-meta {
    font-size: 14px; color: var(--sub); margin-bottom: 20px;
    padding-bottom: 12px;
    display: flex; justify-content: flex-end;
    align-items: center;
    border-bottom: none;
}
.detail-meta-left { display: none; } /* 작성자 숨김 */

/* author-actions: 수정/삭제 버튼 그룹 */
.author-actions {
    display: flex;
    gap: 8px;
}

/* ********** [요청 수정 사항 반영] 상세 내용 스타일 ********** */
.detail-content {
    white-space: pre-line;
    line-height: 1.8;
    min-height: 150px; /* 높이 및 줄간격 증가 */
    margin-bottom: 40px;
    padding: 20px; /* 패딩은 유지하여 여백 확보 */

    /* 요청 수정: 테두리 및 배경 제거 */
    border: none;
    background: none;

    border-radius: 6px;
    box-shadow: none; /* 그림자 제거 */

    /* 요청 수정: 중앙 정렬 */
    text-align: center;
}
/* ************************************************************ */

/* 첨부 파일 표시 스타일 */
.detail-file-attach {
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px dashed var(--line);
    text-align: left;
    font-size: 14px;
    color: var(--sub); /* 텍스트 색상 추가 */
}

.detail-file-attach a {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    margin-left: 10px;
}

.detail-file-attach a:hover {
    text-decoration: underline;
}

/* 8. 댓글 스타일 (제거됨) */

/* 9. 모달 및 토스트 스타일 */
#auth-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
}
.auth-box {
    background: #fff; padding: 30px; border-radius: 8px;
    width: 350px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.auth-box h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; text-align: center; }
.auth-box input { margin-bottom: 10px; }
.hidden { display: none !important; }

/* Toast Notification Styles */
.toast {
    position: fixed; top: 20px; right: 20px;
    padding: 12px 24px; border-radius: 6px;
    color: white; z-index: 2010;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0; transition: all 0.5s;
    transform: translateX(100%);
    font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background: #22c55e; }
.toast.error { background: #dc2626; }

/* 10. 페이지네이션 스타일 */
.pagination-controls {
    text-align: center;
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* 페이지 번호 버튼 (기본 스타일) */
.pagination-controls .btn-page-number {
    font-family: "Montserrat", "Pretendard", sans-serif;
    min-width: 48px;
    min-height: 48px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
    border-radius: 4px;
}

/* 활성화된 페이지 번호 스타일 */
.pagination-controls .btn-page-number.active {
    background: #000;
    color: white;
    border-radius: 50%;
    font-weight: 500;
}

/* 호버(Hover) 효과 (수정됨: 배경을 둥글게) */
.btn-page-number:hover {
    background: #e5e7eb;
    /*border-radius: 50%; !* 둥근 배경 적용 *!*/
}

/* 클릭(Active) 효과 */
.pagination-controls button:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 화살표 버튼 스타일 (<< < > >>) */
.pagination-controls .btn-nav-arrow {
    background: none;
    border: none;
    color: var(--link);
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
}

.pagination-controls .btn-nav-arrow:hover {
    color: var(--primary-blue);
    background: #f2f2f2;
    border-radius: 4px;
}

/* 비활성화된 화살표 버튼 스타일 */
.pagination-controls .btn-nav-arrow.disabled-nav {
    color: var(--sub);
    cursor: not-allowed;
    pointer-events: none;
    background: none;
}
.pagination-controls .btn-nav-arrow.disabled-nav:hover {
    background: none;
    color: var(--sub);
}


/* 11. 상세 뷰 내비게이션 및 버튼 스타일 */

/* 이전/목록/다음 버튼 컨테이너: 양 끝 정렬 */
.detail-navigation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 30px;
}

/* 목록으로 버튼 스타일 (이 스타일을 글쓰기 뷰에 복사했습니다) */
.btn-list-center {
    background: #fff;
    color: var(--text);
    border: 1px solid #000;
    padding: 10px 50px;
    border-radius: 20px;
    transition: all 0.2s;
}
.btn-list-center:hover {
    background: #f2f2f2;
}

/* 이전/다음 게시글 버튼 스타일 */
.btn-nav {
    background: none;
    border: none;
    color: var(--link);
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
    border-radius: 0;
}
.btn-nav:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}
/* 이전/다음 버튼의 아이콘 위치 조정 */
.btn-nav i {
    margin: 0 5px;
}
.btn-nav:first-child i {
    margin-right: 5px;
    margin-left: 0;
}
.btn-nav:last-child i {
    margin-left: 5px;
    margin-right: 0;
}