/* =============================================
   📌 게시판 통합 레이아웃 CSS (공통)
   Ported from educodingnplay/public/css/board-layout.css
   ============================================= */

/* 전체 게시판 컨테이너 */
.board-layout-container {
    max-width: 1400px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 0 15px;
}

/* 왼쪽 네비게이션 (항상 고정) */
.board-sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    /* 헤더 높이만큼 여백 */
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 메인 콘텐츠 영역 (고정 너비) */
.board-main-content {
    flex: 1;
    max-width: 900px;
    min-width: 900px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 🔥 오른쪽 버튼 그룹 (상단 고정으로 수정) */
.board-action-buttons {
    width: 100px;
    min-width: 100px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    /* 헤더 높이만큼 여백 (사이드바와 동일) */
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

/* ========== 사이드바 스타일 ========== */
.board-sidebar-header {
    background-color: #495057;
    color: white;
    padding: 15px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
}

.board-category-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #6c757d;
    text-decoration: none;
    display: block;
}

.board-category-item:hover {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.board-category-item.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.board-category-item i {
    margin-right: 8px;
    width: 16px;
}

/* ========== 액션 버튼 스타일 ========== */
.board-floating-btn {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap;
    justify-content: center;
    gap: 6px;
}

.board-floating-btn:hover {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
    transform: translateX(-3px);
    text-decoration: none;
}

.board-floating-btn i {
    font-size: 14px;
}

.board-floating-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== 반응형 ========== */
@media (max-width: 1200px) {
    .board-layout-container {
        max-width: 100%;
        margin: 10px;
    }

    .board-main-content {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 992px) {
    .board-layout-container {
        flex-direction: column;
        gap: 15px;
    }

    .board-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }

    .board-action-buttons {
        position: fixed;
        right: 15px;
        bottom: 20px;
        top: auto;
        transform: none;
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        z-index: 1000;
    }

    .board-floating-btn .btn-text {
        display: none;
    }

    .board-floating-btn {
        min-width: 50px;
        padding: 10px;
        border-radius: 50%;
    }
}

@media (max-width: 768px) {
    .board-layout-container {
        margin: 5px;
        padding: 0 5px;
    }

    .board-sidebar {
        order: 2;
    }

    .board-main-content {
        order: 1;
    }
}

/* 버튼 간격 조정 */
.board-action-buttons {
    padding-top: 10px;
}

.board-action-buttons .board-floating-btn:first-child {
    margin-top: 0;
}


/* =============================================
   📌 목록 (List) 스타일
   Ported from list.ejs
   ============================================= */

.list-header {
    padding: 25px 30px 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.list-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 28px;
}

.category-icon.notice {
    color: #dc3545;
}

.category-icon.education {
    color: #28a745;
}

.category-icon.free {
    color: #17a2b8;
}

.search-section {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.list-controls {
    padding: 15px 30px;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-count {
    color: #6c757d;
    font-size: 14px;
}

.post-list {
    background-color: white;
}

.post-item {
    padding: 12px 25px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-item:hover {
    background-color: #f8f9fa;
}

.post-item.notice {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.post-item.pinned {
    background-color: #f0f7ff;
    border-left: 4px solid #0066cc;
}

.post-number {
    min-width: 50px;
    text-align: center;
    font-weight: 500;
    color: #6c757d;
    font-size: 13px;
    flex-shrink: 0;
}

.post-title-section {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 15px;
    color: #495057;
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-title:hover {
    color: #0066cc;
}

.post-badges {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.badge-new {
    background-color: #dc3545;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.post-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
    flex-shrink: 0;
}

.meta-author {
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.meta-views {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.meta-time {
    min-width: 50px;
    text-align: center;
}

.attachment-icon {
    color: #6c757d;
    font-size: 12px;
}

.pagination-container {
    background-color: #fff;
    padding: 20px 30px;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 8px 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #fff;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}


/* =============================================
   📌 상세 보기 (View) 스타일
   Ported from view.ejs
   ============================================= */

.post-category-badge {
    display: inline-block;
    background-color: #4a90e2;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 15px;
}

.post-title-view {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
    line-height: 1.4;
}

.post-number-view {
    color: #e74c3c;
    font-size: 18px;
    margin-left: 8px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item i {
    font-size: 12px;
}

.post-content {
    padding: 30px 30px 20px 30px;
    line-height: 1.8;
    font-size: 15px;
    color: #333;
    min-height: 300px;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
}

.post-header {
    padding: 25px 30px 15px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.post-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-title-section-view {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.post-main-action-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.post-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-action-btn-edit {
    background-color: #fff;
    color: #6c757d;
    border-color: #6c757d;
}

.post-action-btn-edit:hover {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
}

.post-action-btn-delete {
    background-color: #fff;
    color: #6c757d;
    border-color: #6c757d;
    cursor: pointer;
}

.post-action-btn-delete:hover {
    background-color: #6c757d;
    color: white;
}


/* =============================================
   📌 글쓰기 (Write) 스타일
   Ported from write.ejs
   ============================================= */

.write-header {
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.write-title {
    font-size: 24px;
    font-weight: bold;
    color: #495057;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn-cancel {
    background-color: #fff;
    color: #6c757d;
    border-color: #dee2e6;
}

.header-btn-cancel:hover {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
    text-decoration: none;
}

.header-btn-submit {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
    cursor: pointer;
}

.header-btn-submit:hover:not(:disabled) {
    background-color: #0052a3;
    border-color: #0052a3;
}

.write-form-container {
    padding: 25px;
    background-color: #fff;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.required {
    color: #dc3545;
}

.ck-editor__editable {
    min-height: 300px;
    border-radius: 6px;
}