/* ============== 페이지 타이틀 섹션 ============== */

.page-title-section {
    background: white;
    padding: 8px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.title-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-container p {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0 0 0;
}

.admin-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.write-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.write-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.write-btn:active {
    transform: translateY(0);
}

.admin-manage-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-manage-btn:hover {
    background: #667eea;
    color: white;
}


/* ============== 카테고리 탭 ============== */

.category-tabs-section {
    background: white;
    padding: 12px 20px;
    border-bottom: 2px solid #f0f0f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-tabs {
    display: flex;
    gap: 8px;
    min-width: min-content;
}

.category-tab {
    padding: 8px 16px;
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}


/* ============== 게시글 리스트 ============== */

.posts-list-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.posts-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.post-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.post-item.notice {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
    border-color: #ffa500;
}


/* 공지 게시물 사이 간격 축소 */

.post-item.notice-compact+.post-item.notice-compact {
    margin-top: -3px;
}


/* 제목과 카테고리를 한 줄에 표시 */

.post-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.post-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.post-category-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}


/* 기존 post-header와 post-category는 공지사항용으로 유지 */

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-category {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-category.notice {
    background: #ffa500;
    color: white;
    border-color: #ffa500;
}

.post-content-preview {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #999;
    margin-top: 10px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ============== 로딩 및 빈 상태 ============== */

.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.empty-icon {
    font-size: 4rem;
}


/* ============== 페이지네이션 ============== */

#paginationContainer {
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 20px 6px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    color: #667eea;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover:not(.pagination-disabled) {
    border-color: #667eea;
    background: #f5f7ff;
}

.pagination-btn.pagination-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.pagination-btn.pagination-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-dots {
    color: #999;
    padding: 0 8px;
}


/* ============== 모달 ============== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.modal-overlay.modal-small .modal-content {
    max-width: 400px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.detail-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    padding-bottom: 100px;
    /* 하단 네비게이션 여유 공간 */
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.btn-cancel,
.btn-submit,
.btn-delete {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-delete {
    background: #ff4444;
    color: white;
}

.btn-delete:hover {
    background: #cc0000;
}


/* ============== 상세보기 모달 ============== */

.modal-detail .detail-category {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-detail .detail-category.notice {
    background: #ffa500;
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #999;
}

.detail-author {
    font-weight: 600;
    color: #666;
}

.detail-content {
    line-height: 1.8;
    color: #333;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.admin-edit-btn,
.admin-delete-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-edit-btn {
    background: #e3f2fd;
    color: #2196f3;
}

.admin-edit-btn:hover {
    background: #2196f3;
    color: white;
}

.admin-delete-btn {
    background: #ffebee;
    color: #f44336;
}

.admin-delete-btn:hover {
    background: #f44336;
    color: white;
}

.detail-stats {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    font-size: 0.9rem;
    color: #666;
}

.detail-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ============== 좋아요/싫어요 버튼 ============== */

.reaction-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.reaction-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.reaction-btn .reaction-icon {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.reaction-btn:hover .reaction-icon {
    transform: scale(1.2);
}

.reaction-btn.like-btn {
    color: #2196f3;
}

.reaction-btn.like-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.reaction-btn.like-btn.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

.reaction-btn.dislike-btn {
    color: #f44336;
}

.reaction-btn.dislike-btn:hover {
    background: #ffebee;
    border-color: #f44336;
}

.reaction-btn.dislike-btn.active {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.reaction-count {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}


/* ============== 댓글 섹션 ============== */

.comments-section {
    margin-top: 30px;
}

.comments-header {
    margin-bottom: 20px;
}

.comments-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.comment-form {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 2px solid #e0e0e0;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
    box-sizing: border-box;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.char-count {
    font-size: 0.85rem;
    color: #999;
}

.btn-submit-comment {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-submit-comment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* 댓글 목록 */

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s;
}

.comment-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #999;
}

.comment-content {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.comment-delete-btn {
    padding: 6px 12px;
    background: #ffebee;
    color: #f44336;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-delete-btn:hover {
    background: #f44336;
    color: white;
}

.empty-comments {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 0.9rem;
}


/* ============== 카테고리 관리 ============== */

.category-manage-section {
    margin-bottom: 30px;
}

.category-manage-section h3,
.category-add-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.category-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.category-manage-item:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.category-manage-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.category-manage-count {
    color: #999;
    font-size: 0.9rem;
    margin-right: 15px;
}

.category-delete-btn {
    padding: 6px 12px;
    background: #ffe0e0;
    color: #ff4444;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.category-delete-btn:hover {
    background: #ff4444;
    color: white;
}

.category-delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.category-add-section {
    margin-top: 30px;
}

.category-add-form {
    display: flex;
    gap: 10px;
}

.category-add-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.category-add-form input:focus {
    outline: none;
    border-color: #667eea;
}

.category-add-form button {
    padding: 12px 24px;
    white-space: nowrap;
}


/* ============== 모바일 반응형 ============== */

@media (max-width: 768px) {
    .page-title-section {
        padding: 10px 15px;
    }
    .title-container h1 {
        font-size: 1.5rem;
    }
    .admin-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    .write-btn,
    .admin-manage-btn {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    .category-tabs-section {
        padding: 10px 15px;
    }
    .posts-list-section {
        padding: 15px;
    }
    .post-item {
        padding: 12px;
    }
    .post-title {
        font-size: 0.95rem;
    }
    .post-content-preview {
        font-size: 0.85rem;
    }
    .modal-overlay {
        padding: 10px;
    }
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    .modal-body {
        padding: 20px 16px;
        padding-bottom: 120px;
        /* 모바일에서 하단 네비 여유 */
    }
    .modal-header {
        padding: 20px 16px;
    }
    .form-actions {
        padding-bottom: 30px;
        /* 추가 여유 */
    }
    #paginationContainer {
        padding: 12px 20px 5px 20px;
    }
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}


/* ============== 공지사항 한 줄 스타일 ============== */

.notice-compact {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border-left: 4px solid #ff9800;
    padding: 10px 16px;
    margin-bottom: 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.notice-compact:hover {
    background: linear-gradient(135deg, #ffe6cc 0%, #ffd9b3 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

.notice-compact-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    /* 절대 줄바꿈 안 함 */
}

.notice-label {
    font-weight: 700;
    font-size: 0.7rem;
    padding: 3px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.notice-label.global-notice {
    background: #ff5722;
    color: white;
}

.notice-label.category-notice {
    background: #ff9800;
    color: white;
}

.notice-title {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.notice-date {
    color: #666;
    font-size: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.notice-stats {
    display: flex;
    gap: 8px;
    color: #666;
    font-size: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.notice-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}


/* 모바일 최적화 - 한 줄 유지 */

@media (max-width: 768px) {
    .notice-compact {
        padding: 8px 12px;
    }
    .notice-compact-content {
        gap: 8px;
        flex-wrap: nowrap;
        /* 강제 한 줄 */
    }
    .notice-label {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    .notice-title {
        font-size: 0.8rem;
        flex: 1;
        min-width: 80px;
        /* 최소 너비 확보 */
    }
    .notice-date {
        font-size: 0.7rem;
        display: none;
        /* 작은 화면에서 날짜 숨김 */
    }
    .notice-stats {
        gap: 6px;
        font-size: 0.7rem;
    }
}


/* 아주 작은 화면 (480px 이하) */

@media (max-width: 480px) {
    .notice-compact {
        padding: 8px 10px;
    }
    .notice-compact-content {
        gap: 6px;
    }
    .notice-label {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    .notice-title {
        font-size: 0.75rem;
        min-width: 60px;
    }
    .notice-date {
        display: none;
        /* 날짜 숨김 */
    }
    .notice-stats {
        gap: 5px;
        font-size: 0.65rem;
    }
}


/* ============== 게시글 상세 페이지 ============== */

.back-button-container {
    margin-bottom: 20px;
}

.back-button {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.back-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.post-detail-container {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}


/* 게시글 헤더 */

.post-detail-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.post-detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
    position: relative;
}

.post-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}


/* 메뉴 버튼 */

.post-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #666;
    flex-shrink: 0;
}

.post-menu-btn:hover {
    background: #e0e0e0;
}


/* 드롭다운 메뉴 */

.post-menu-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 100;
    min-width: 120px;
}

.post-menu-dropdown .menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s;
}

.post-menu-dropdown .menu-item:hover {
    background: #f5f5f5;
}

.post-menu-dropdown .menu-item.delete {
    color: #f44336;
}

.post-menu-dropdown .menu-item.delete:hover {
    background: #ffebee;
}

.post-detail-category {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.post-detail-category.notice {
    background: #ffa500;
    color: white;
    border-color: #ffa500;
}

.post-detail-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #999;
}

.post-detail-author,
.post-detail-date {
    display: flex;
    align-items: center;
}


/* 게시글 본문 */

.post-detail-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    padding: 12px 0 20px 0;
    min-height: 200px;
    white-space: pre-wrap;
    word-break: break-word;
}


/* 좋아요/싫어요 */

.post-detail-actions {
    display: flex;
    gap: 10px;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
    margin: 20px 0;
}

.reaction-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reaction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reaction-btn.like-btn.active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
}

.reaction-btn.dislike-btn.active {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}


/* 관리 버튼 */


/* 댓글 영역 */

.comments-section {
    margin-top: 30px;
}

.comments-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.submit-comment-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-comment-btn:hover {
    background: #5568d3;
}

.cancel-reply-btn {
    padding: 10px 20px;
    background: #999;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.cancel-reply-btn:hover {
    background: #777;
}


/* 댓글 목록 */

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* 댓글 래퍼 (부모 댓글 + 대댓글들) */

.comment-wrapper {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}


/* 부모 댓글 */

.comment-item.parent-comment {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.comment-item.parent-comment:last-child {
    border-bottom: none;
}


/* 일반 댓글 아이템 (이전 코드와 호환성 유지) */

.comment-item {
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 0.75rem;
    color: #999;
}

.comment-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin: 0 0 10px 0;
}


/* 댓글 액션 버튼 컨테이너 */

.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.comment-reply-btn {
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-reply-btn:hover {
    background: #5568d3;
}

.comment-delete-btn {
    padding: 5px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-delete-btn:hover {
    background: #d32f2f;
}


/* 답글 입력 폼 */

.reply-form-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed #d0d0d0;
}

.reply-form {
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.reply-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.reply-input:focus {
    outline: none;
    border-color: #667eea;
}

.reply-form-actions {
    display: flex;
    gap: 8px;
}

.reply-submit-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-submit-btn:hover {
    background: #5568d3;
}

.reply-cancel-btn {
    padding: 8px 16px;
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-cancel-btn:hover {
    background: #d0d0d0;
}


/* 대댓글 컨테이너 */

.replies-container {
    background: #ffffff;
    padding: 0;
}


/* 대댓글 아이템 */

.reply-item {
    padding: 12px 15px;
    background: #fafbff;
    border-top: 1px solid #e8ecf7;
    position: relative;
}

.reply-item:first-child {
    border-top: none;
}


/* 중첩된 답글 (들여쓰기) */

.reply-item.nested-reply {
    margin-left: 50px;
    padding: 10px 12px;
    background: #ffffff;
    border: 2px solid #d0d8f0;
    border-radius: 8px;
    margin-top: 8px;
}

.reply-item.nested-reply .reply-author {
    color: #5568d3;
    font-size: 0.75rem;
}

.reply-item.nested-reply .reply-arrow {
    color: #5568d3;
    font-weight: 600;
}

.reply-item.nested-reply .reply-content {
    font-size: 0.8rem;
    padding-left: 15px;
}

.reply-item.nested-reply .reply-actions {
    padding-left: 15px;
}


/* 대댓글 답글 입력창 */

.nested-reply-form-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px dashed #d0d8f0;
}

.nested-reply-form {
    background: #e8f0ff;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #a8b8f5;
}

.nested-reply-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #d0d8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
    background: white;
}

.nested-reply-input:focus {
    outline: none;
    border-color: #a8b8f5;
}

.nested-reply-form-actions {
    display: flex;
    gap: 6px;
}

.nested-reply-submit-btn {
    padding: 6px 14px;
    background: #a8b8f5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.nested-reply-submit-btn:hover {
    background: #8a9fe5;
}

.nested-reply-cancel-btn {
    padding: 6px 14px;
    background: #d0d8f0;
    color: #666;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.nested-reply-cancel-btn:hover {
    background: #b8c5e0;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.reply-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
}

.reply-arrow {
    margin-left: 6px;
    color: #999;
    font-weight: 400;
    font-size: 0.75rem;
}

.reply-date {
    font-size: 0.7rem;
    color: #999;
}

.reply-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #555;
    margin: 0 0 8px 0;
}


/* 대댓글 액션 버튼 */

.reply-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.reply-reply-btn {
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-reply-btn:hover {
    background: #5568d3;
}

.reply-delete-btn {
    padding: 4px 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-delete-btn:hover {
    background: #d32f2f;
}


/* 대댓글 안의 답글 입력창 */

.nested-reply-form-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px dashed #d0d0d0;
}

.nested-reply-form {
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
    border: 2px solid #667eea;
}

.nested-reply-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 6px;
}

.nested-reply-input:focus {
    outline: none;
    border-color: #667eea;
}

.nested-reply-form-actions {
    display: flex;
    gap: 6px;
}

.nested-reply-submit-btn {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.nested-reply-submit-btn:hover {
    background: #5568d3;
}

.nested-reply-cancel-btn {
    padding: 6px 12px;
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.nested-reply-cancel-btn:hover {
    background: #d0d0d0;
}

.comment-delete-btn:hover {
    background: #d32f2f;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 0.9rem;
}


/* 에러 상태 */

.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-state p {
    font-size: 1.2rem;
    color: #999;
    margin-bottom: 20px;
}


/* 로딩 스피너 */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* 반응형 */

@media (max-width: 768px) {
    .post-detail-title {
        font-size: 1.2rem;
    }
    .post-detail-category {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    .post-detail-content {
        font-size: 0.95rem;
    }
    .reaction-btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    /* 댓글 패딩 축소 */
    .comment-item.parent-comment {
        padding: 12px;
    }
    .reply-item {
        padding: 10px 12px;
    }
    /* 중첩 답글 들여쓰기 축소 */
    .reply-item.nested-reply {
        margin-left: 30px;
        padding: 8px 10px;
    }
    .reply-item.nested-reply .reply-content,
    .reply-item.nested-reply .reply-actions {
        padding-left: 10px;
    }
    /* 답글 폼 */
    .reply-form {
        padding: 10px;
    }
    .reply-input {
        font-size: 0.8rem;
    }
    .reply-submit-btn,
    .reply-cancel-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    /* 중첩 답글 폼 */
    .nested-reply-form {
        padding: 8px;
    }
    .nested-reply-input {
        font-size: 0.75rem;
    }
    .nested-reply-submit-btn,
    .nested-reply-cancel-btn {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
}


/* ============== 글쓰기 페이지 ============== */

.write-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.write-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.write-header .back-btn {
    position: absolute;
    left: 0;
}

.write-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.back-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #5568d3;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.submit-btn {
    padding: 14px 60px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.write-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
}

@media (max-width: 768px) {
    .write-container {
        padding: 15px;
    }
    .write-form {
        padding: 20px;
    }
    .write-header h1 {
        font-size: 1.2rem;
    }
    .back-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .submit-btn {
        padding: 12px 40px;
        font-size: 0.9rem;
    }
}