/* Board Styles */
.board-section {
    padding: 120px 0 80px;
    background: #f8f9fa;
    min-height: 100vh;
}

.board-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.board-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.board-actions {
    text-align: right;
    margin-bottom: 2rem;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.post-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.post-author {
    font-weight: 500;
    color: #e74c3c;
}

.post-date {
    color: #999;
}

.post-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-delete {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto; /* 모달 자체에 스크롤 허용 */
}

.modal-content {
    background-color: #fff;
    margin: 2% auto; /* 상하 마진 줄임 */
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 95vh; /* 최대 높이 제한 */
    overflow-y: auto; /* 콘텐츠에 스크롤 허용 */
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative; /* position 추가 */
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    position: sticky; /* 헤더 고정 */
    top: 0;
    background: #fff;
    border-radius: 15px 15px 0 0;
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
}

.close:hover {
    color: #e74c3c;
}

.modal form {
    padding: 1.5rem;
    max-height: calc(95vh - 120px); /* 헤더와 여백 고려한 최대 높이 */
    overflow-y: auto; /* 폼 내용에 스크롤 허용 */
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box; /* box-sizing 추가 */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group textarea {
    min-height: 120px; /* 최소 높이 설정 */
    resize: vertical; /* 세로 리사이즈만 허용 */
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    position: sticky; /* 액션 버튼 고정 */
    bottom: 0;
    background: #fff;
    border-radius: 0 0 15px 15px;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-posts i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-posts h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* 삭제 모달 (작은 모달) */
.modal-content.delete-modal {
    max-width: 400px;
    max-height: none; /* 삭제 모달은 높이 제한 없음 */
}

.modal-body {
    padding: 1.5rem;
    text-align: center;
}

.modal-body p {
    margin: 0 0 1rem 0;
    color: #333;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0 1.5rem 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .board-title {
        font-size: 2rem;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .modal-content {
        margin: 1% auto;
        width: 95%;
        max-height: 98vh; /* 모바일에서 더 큰 높이 */
    }
    
    .modal form {
        max-height: calc(98vh - 140px); /* 모바일에서 조정된 높이 */
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal form {
        padding: 1rem;
    }
    
    .form-actions {
        padding: 1rem;
    }
}

/* Navigation Active State */
.nav-menu a.active {
    color: #e74c3c;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
