/* ========================================
   LMS: 교육후기 커뮤니티 게시판
======================================== */

/* ───── 필터 탭 ───── */
.cm-filter { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.cm-tab {
    padding: 8px 20px;
    border: 1.5px solid var(--border);
    border-radius: 40px;
    font-size: 16px; font-weight: 600; color: var(--text-3);
    background: transparent; cursor: pointer;
    transition: var(--transition);
}
.cm-tab:hover { border-color: var(--point); color: var(--point); }
.cm-tab.active {
    background: var(--point); border-color: var(--point); color: #fff;
    font-weight: 700;
}

/* ───── 검색 + 글쓰기 툴바 ───── */
.cm-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; }
.cm-search { display: flex; gap: 0; flex: 1; max-width: 400px; }
.cm-search-input {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid var(--border); border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px; color: var(--text);
    outline: none; transition: var(--transition);
}
.cm-search-input:focus { border-color: var(--point); }
.cm-search-btn {
    padding: 10px 16px;
    background: var(--point); color: #fff; border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer; font-size: 16px;
    transition: var(--transition);
}
.cm-search-btn:hover { background: var(--point-dark); }

.cm-write-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    background: var(--point); color: #fff;
    border-radius: 8px; font-size: 16px; font-weight: 600;
    text-decoration: none; transition: var(--transition);
    white-space: nowrap;
}
.cm-write-btn:hover { background: var(--point-dark); }

/* ───── 테이블 ───── */
.cm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-light); }
.cm-table thead { background: var(--surface); }
.cm-table th { padding: 14px 16px; font-size: 17px; font-weight: 700; color: var(--text-2); text-align: left; border-bottom: 2px solid var(--border); }
.cm-table td { padding: 14px 16px; font-size: 16px; color: var(--text-2); border-bottom: 1px solid var(--border-light); }
.cm-table tr:hover td { background: rgba(85,58,231,.03); }
.cm-table tr.cm-pinned td { background: rgba(85,58,231,.04); }

.cm-th-num { width: 60px; text-align: center; }
.cm-th-cat { width: 80px; }
.cm-th-date { width: 100px; }
.cm-th-view { width: 60px; text-align: center; }
.cm-th-author { width: 90px; }
.cm-th-rating { width: 70px; text-align: center; }
.cm-num { text-align: center; color: var(--text-3); font-size: 17px; }
.cm-date { color: var(--text-3); font-size: 17px; }
.cm-view { text-align: center; color: var(--text-3); font-size: 17px; }
.cm-author { color: var(--text-3); font-size: 17px; }
.cm-title-cell { font-weight: 500; }
.cm-pin { color: var(--point); font-size: 17px; margin-right: 2px; }

/* ───── 배지 ───── */
.cm-badge { display: inline-block; padding: 3px 10px; border-radius: 5px; font-size: 17px; font-weight: 700; }
.cm-badge--review { background: var(--primary-bg); color: var(--point); }
.cm-badge--course_review { background: #eff6ff; color: #2563eb; }
.cm-badge--free { background: #f0fdf4; color: #16a34a; }
.cm-badge--case { background: #fef3c7; color: #d97706; }
.cm-badge--qna { background: #fefce8; color: #ca8a04; }

/* ───── 별점 (목록) ───── */
.cm-stars-sm { color: #f59e0b; font-size: 17px; }

/* ═══════ 상세 페이지 ═══════ */

.cd-header {
    border-bottom: 2px solid var(--text);
    padding-bottom: 20px; margin-bottom: 32px;
}
.cd-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cd-pin { font-size: 16px; color: var(--point); font-weight: 600; }
.cd-title { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.4; margin-bottom: 12px; }
.cd-info { display: flex; gap: 16px; font-size: 17px; color: var(--text-3); flex-wrap: wrap; }
.cd-info i { margin-right: 4px; }
.cd-rating { color: #f59e0b; }
.cd-rating span { color: var(--text-3); margin-left: 4px; }

.cd-body {
    min-height: 200px; padding: 32px 0;
    font-size: 17px; line-height: 1.8; color: var(--text-2);
    border-bottom: 1px solid var(--border-light);
    white-space: pre-wrap;
    word-break: break-word;
}
.cd-body p { margin-bottom: 12px; }

.cd-post-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 16px 0; border-bottom: 1px solid var(--border-light);
}
.cm-btn-edit, .cm-btn-delete {
    padding: 8px 16px; border-radius: 6px;
    font-size: 17px; font-weight: 600; cursor: pointer;
    border: 1.5px solid var(--border); background: #fff; color: var(--text-2);
    transition: var(--transition);
}
.cm-btn-edit:hover { border-color: var(--point); color: var(--point); }
.cm-btn-delete:hover { border-color: #ef4444; color: #ef4444; }

/* ───── 이전글/다음글 ───── */
.cd-nav { border-bottom: 1px solid var(--border-light); }
.cd-nav-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 16px; color: var(--text-2);
    transition: var(--transition);
    text-decoration: none;
}
.cd-nav-item:last-child { border-bottom: none; }
a.cd-nav-item:hover { color: var(--point); }
.cd-nav-label { flex-shrink: 0; width: 80px; font-size: 16px; font-weight: 700; color: var(--text-3); }
.cd-nav-label i { margin-right: 4px; }
.cd-nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-disabled { color: var(--text-3); opacity: .5; }

.cd-actions { padding-top: 24px; text-align: center; }

/* ───── 비밀번호 모달 ───── */
.cm-pw-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center;
}
.cm-pw-modal {
    background: #fff; border-radius: 12px; padding: 32px;
    width: 90%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.cm-pw-modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cm-pw-modal p { font-size: 16px; color: var(--text-3); margin-bottom: 16px; }
.cm-pw-input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 16px; outline: none;
    transition: var(--transition);
}
.cm-pw-input:focus { border-color: var(--point); }
.cm-pw-error { color: #ef4444; font-size: 17px; margin-top: 8px; }
.cm-pw-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ═══════ 글쓰기 페이지 ═══════ */

.cw-form { max-width: 720px; margin: 0 auto; }
.cw-row { margin-bottom: 20px; }
.cw-label { display: block; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.cw-input, .cw-select, .cw-textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 16px; color: var(--text);
    outline: none; transition: var(--transition);
    font-family: inherit;
}
.cw-input:focus, .cw-select:focus, .cw-textarea:focus { border-color: var(--point); }
.cw-select { background: #fff; cursor: pointer; }
.cw-textarea { resize: vertical; min-height: 200px; line-height: 1.7; }

.cw-stars { display: flex; gap: 4px; }
.cw-stars i { font-size: 24px; color: #d1d5db; cursor: pointer; transition: color .15s; }
.cw-stars i.active { color: #f59e0b; }
.cw-stars i:hover { color: #f59e0b; }

.cw-actions { display: flex; gap: 12px; justify-content: center; padding-top: 16px; }

.cm-btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 24px;
    background: var(--point); color: #fff; border: none;
    border-radius: 8px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.cm-btn-primary:hover { background: var(--point-dark); }

/* ───── 반응형 ───── */
@media (max-width: 768px) {
    .cm-toolbar { flex-direction: column; align-items: stretch; }
    .cm-search { max-width: 100%; }
    .cm-th-num, .cm-num { display: none; }
    .cm-th-view, .cm-view { display: none; }
    .cm-th-rating, .cm-table .cm-rating-cell { display: none; }
    .cm-table th, .cm-table td { padding: 12px 10px; }
    .cd-title { font-size: 20px; }
    .cd-nav-item { gap: 10px; }
    .cd-nav-label { width: 60px; font-size: 17px; }
}
