/* 게시판 공통 스타일 */
.board-container {
    max-width: 1200px;
    margin: 160px auto 40px; /* 100px → 160px 수정 */
    padding: 20px;
}

.board-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.board-header h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.board-header p {
    color: #777;
    font-size: 14px;
}

.board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.post-count {
    font-size: 14px;
    color: #666;
}

.btn-write {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-write:hover {
    background: #5568d3;
}

/* 게시글 목록 */
.board-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.board-list table {
    width: 100%;
    border-collapse: collapse;
}

.board-list th {
    background: #f8f9fa;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
}

.board-list td {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.board-list .title {
    text-align: left;
}

.board-list .title a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.board-list .title a:hover {
    color: #667eea;
}

.board-list .comment-count {
    color: #667eea;
    font-size: 13px;
    margin-left: 5px;
}

.board-list tr.notice {
    background: #f8f9ff;
}

.badge-notice {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.no-posts {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* 글쓰기 폼 */
.write-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.write-form .form-group {
    margin-bottom: 20px;
}

.write-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.write-form label small {
    font-weight: normal;
    color: #999;
    font-size: 13px;
}

.write-form input[type="text"],
.write-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.write-form textarea {
    resize: vertical;
}

.write-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 5px;
}

#file-list {
    margin-top: 10px;
}

.file-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn-submit,
.btn-cancel {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: #667eea;
    color: white;
}

.btn-submit:hover {
    background: #5568d3;
}

.btn-cancel {
    background: #ddd;
    color: #555;
}

.btn-cancel:hover {
    background: #ccc;
}

/* 게시글 상세보기 */
.post-view {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.post-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: #777;
    font-size: 14px;
}

.post-content {
    padding: 30px 0;
    line-height: 1.8;
    color: #333;
    min-height: 200px;
}

.content-locked {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #999;
    font-size: 16px;
}

.attachments {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.attachments h3 {
    margin-bottom: 15px;
    color: #555;
}

.attached-image {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.attached-video {
    max-width: 100%;
    border-radius: 8px;
}

.post-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-like,
.btn-edit,
.btn-delete,
.btn-list {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-like {
    background: #f8f9fa;
    color: #555;
}

.btn-like.liked {
    background: #ff6b6b;
    color: white;
}

.btn-like:hover {
    background: #ff6b6b;
    color: white;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-edit:hover {
    background: #5568d3;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
}

.btn-delete:hover {
    background: #ff5252;
}

.btn-list {
    background: #ddd;
    color: #555;
    margin-left: auto;
}

.btn-list:hover {
    background: #ccc;
}

/* 댓글 */
.comments-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.comments-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.comments-section .comment-count {
    color: #667eea;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    resize: vertical;
}

.btn-comment {
    margin-top: 10px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.btn-comment:hover {
    background: #5568d3;
}

.login-required {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #666;
}

.login-required a {
    color: #667eea;
    font-weight: 600;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.comment-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-header .nickname {
    font-weight: 600;
    color: #333;
}

.comment-header .date {
    color: #999;
    font-size: 13px;
}

.btn-delete-comment {
    margin-left: auto;
    padding: 4px 10px;
    background: #ff6b6b;
    color: white;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
}

.btn-delete-comment:hover {
    background: #ff5252;
}

.comment-content {
    color: #555;
    line-height: 1.6;
}


/* 모바일 대응 */
@media (max-width: 768px) {
    .board-container {
        margin-top: 130px;
        padding: 10px;
    }
    
    .board-header h1 {
        font-size: 24px;
    }
    
    /* 테이블을 카드 형식으로 변경 */
    .board-list table {
        display: block;
    }
    
    .board-list thead {
        display: none;
    }
    
    .board-list tbody {
        display: block;
    }
    
    .board-list tr {
        display: flex;
        flex-direction: column;
        padding: 15px;
        margin-bottom: 10px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        border: none;
    }
    
    .board-list tr.notice {
        background: #f8f9ff;
        border-left: 3px solid #ff6b6b;
    }
    
    .board-list td {
        display: block;
        padding: 0;
        border: none;
        text-align: left;
    }
    
    /* 카드 내 레이아웃: 1개 행에 작성자 | 제목 | 조회수 */
    .board-list .title {
        order: 2;
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 8px 0;
    }
    
    .board-list .title a {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.4;
        flex: 1;
        color: #333;
    }
    
    .board-list .comment-count {
        color: #667eea;
        font-size: 13px;
        font-weight: 600;
        flex-shrink: 0;
    }
    
    /* 작성자와 조회수를 1개 행에 배치 */
    .board-list tr {
        position: relative;
    }
    
    .board-list td:nth-child(3) {
        /* 작성자 */
        order: 1;
        display: inline-block;
        font-size: 12px;
        color: #666;
        margin-right: 10px;
    }
    
    .board-list td:nth-child(4) {
        /* 조회수 */
        order: 3;
        display: inline-block;
        font-size: 12px;
        color: #999;
        position: absolute;
        right: 15px;
        bottom: 15px;
    }
    
    .board-list td:nth-child(4)::before {
        content: "👁 ";
    }
    
    /* 숨길 요소들 */
    .board-list td:nth-child(1) {
        /* 번호 */
        display: none !important;
    }
    
    .board-list td:nth-child(5) {
        /* 좋아요 */
        display: none !important;
    }
    
    .board-list td:nth-child(6) {
        /* 작성일 */
        display: none !important;
    }
    
    /* 공지 배지 */
    .badge-notice {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* 글쓰기 폼 */
    .write-form {
        padding: 20px 15px;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    /* 게시글 상세보기 */
    .post-view {
        padding: 20px 15px;
    }
    
    .post-header h1 {
        font-size: 20px;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .post-actions {
        flex-wrap: wrap;
    }
    
    .btn-like,
    .btn-edit,
    .btn-delete,
    .btn-list {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 댓글 */
    .comments-section {
        padding: 20px 15px;
    }
}

/* 기존 파일 표시 */
.existing-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.existing-files .file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.existing-files .file-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.existing-files .file-item img {
    max-width: 150px;
    border-radius: 5px;
}
.date {
    display: none !important;
    /* ===== 대댓글 스타일 추가 ===== */

/* 댓글 아이템 기본 */
.comment-item {
    position: relative;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

/* 대댓글 연결선 */
.comment-item .reply-line {
    position: absolute;
    left: -20px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #e0e0e0);
}

.comment-item .reply-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    width: 20px;
    height: 2px;
    background: #3498db;
}

/* 댓글 내용 영역 */
.comment-content-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
}

/* 대댓글 배경 약간 다르게 */
.comment-item[data-depth="1"] .comment-content-wrapper,
.comment-item[data-depth="2"] .comment-content-wrapper,
.comment-item[data-depth="3"] .comment-content-wrapper {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
}

/* 댓글 헤더 */
.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-header .nickname {
    font-weight: 600;
    color: #2c3e50;
}

.comment-header .date {
    color: #7f8c8d;
    font-size: 0.85em;
}

/* 답글 버튼 */
.btn-reply {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
}

.btn-reply:hover {
    background: #3498db;
    color: white;
}

/* 삭제 버튼 */
.btn-delete-comment {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 3px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.3s;
}

.btn-delete-comment:hover {
    background: #e74c3c;
    color: white;
}

/* 답글 폼 컨테이너 */
.reply-form-container {
    margin-top: 10px;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

.reply-form {
    margin: 0 !important;
}

.reply-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.reply-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reply-form-buttons .btn-comment {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.reply-form-buttons .btn-cancel {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.reply-form-buttons button:hover {
    opacity: 0.9;
}

/* 댓글 내용 */
.comment-content {
    color: #34495e;
    line-height: 1.6;
    word-break: break-word;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .comment-item[data-depth="1"],
    .comment-item[data-depth="2"],
    .comment-item[data-depth="3"] {
        margin-left: 20px !important;
    }
    
    .comment-item[data-depth="4"],
    .comment-item[data-depth="5"] {
        margin-left: 20px !important;
    }
    
    .reply-line {
        left: -15px !important;
    }
    
    .comment-header {
        font-size: 0.9em;
    }
}

/* 깊이 있는 대댓글 (4단계 이상) */
.comment-item[data-depth="4"] .comment-content-wrapper,
.comment-item[data-depth="5"] .comment-content-wrapper,
.comment-item[data-depth="6"] .comment-content-wrapper {
    background: #e8f4f8;
    border-left: 3px solid #2980b9;
}

/* 댓글 호버 효과 */
.comment-item:hover .comment-content-wrapper {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 스크롤 애니메이션 */
.comment-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}