/* ============================================================
   qna.css  ─  Q&A 게시판 페이지 전용 스타일
   평생학습도시 기초자료 조사 시스템
============================================================ */

/* ── 페이지 레이아웃 ── */
.qna-page { background: var(--color-bg, #f0f4fa); min-height: 100vh; }

.qna-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── 페이지 타이틀 영역 ── */
.qna-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.qna-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #1a3a6b;
}
.qna-page-title i { color: #4a7fc1; font-size: 20px; }

.qna-breadcrumb {
  font-size: 12.5px;
  color: #7a8a9a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qna-breadcrumb a { color: #7a8a9a; text-decoration: none; }
.qna-breadcrumb a:hover { color: #1a3a6b; }
.qna-breadcrumb i { font-size: 10px; }

/* ── 안내 배너 ── */
.qna-notice-bar {
  background: #eef3fb;
  border: 1.5px solid #c5d5eb;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  color: #2a4a7a;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}
.qna-notice-bar i { color: #4a7fc1; margin-top: 1px; flex-shrink: 0; }

/* ── 검색/필터 영역 ── */
.qna-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.qna-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qna-filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0dce8;
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  color: #4a5a6a;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Noto Sans KR', sans-serif;
}
.qna-filter-tab:hover,
.qna-filter-tab.active {
  background: #1a3a6b;
  border-color: #1a3a6b;
  color: #fff;
}

.qna-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qna-search-wrap { display: flex; gap: 6px; }
.qna-search-input {
  padding: 7px 12px;
  border: 1.5px solid #d0dce8;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #2a3a4e;
  background: #fff;
  width: 200px;
  transition: border-color .15s;
}
.qna-search-input:focus { outline: none; border-color: #4a7fc1; }
.qna-search-btn {
  padding: 7px 16px;
  background: #1a3a6b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: background .15s;
}
.qna-search-btn:hover { background: #2c5aa0; }
.qna-write-btn {
  padding: 8px 18px;
  background: #2e86c1;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
  white-space: nowrap;
}
.qna-write-btn:hover { background: #1a6a9a; }

/* ── Q&A 목록 테이블 ── */
.qna-table-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #d0dce8;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,58,107,.06);
}
.qna-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.qna-table thead th {
  background: #f0f4fa;
  color: #1a3a6b;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1.5px solid #d0dce8;
  white-space: nowrap;
}
.qna-table thead th.col-no     { width: 56px;  text-align: center; }
.qna-table thead th.col-status { width: 90px;  text-align: center; }
.qna-table thead th.col-cat    { width: 110px; text-align: center; }
.qna-table thead th.col-title  { }
.qna-table thead th.col-author { width: 90px;  text-align: center; }
.qna-table thead th.col-date   { width: 100px; text-align: center; }
.qna-table thead th.col-view   { width: 60px;  text-align: center; }

.qna-table tbody tr {
  border-bottom: 1px solid #e8eef6;
  transition: background .12s;
  cursor: pointer;
}
.qna-table tbody tr:last-child { border-bottom: none; }
.qna-table tbody tr:hover { background: #f5f8fd; }
.qna-table td {
  padding: 13px 16px;
  vertical-align: middle;
  color: #2a3a4e;
}
.qna-table td.col-no,
.qna-table td.col-author,
.qna-table td.col-date,
.qna-table td.col-view { text-align: center; color: #7a8a9a; font-size: 12.5px; }
.qna-table td.col-status { text-align: center; }
.qna-table td.col-cat    { text-align: center; }

/* 구분 배지 */
.qna-cat-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cat-검증및제출  { background: #fde8d8; color: #c0392b; }
.cat-조사입력    { background: #dbe8f8; color: #1a3a6b; }
.cat-조사지침    { background: #d5f5e3; color: #1e8449; }
.cat-시스템로그인 { background: #fdf0e0; color: #e67e22; }
.cat-기타       { background: #eaeaea; color: #555; }

/* 답변현황 배지 */
.qna-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-대기       { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.status-답변완료    { background: #d4edda; color: #155724; border: 1px solid #28a745; }

/* 제목 셀 */
.qna-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qna-lock-icon { color: #aab; font-size: 12px; flex-shrink: 0; }
.qna-new-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.qna-attach-icon { color: #7a8a9a; font-size: 12px; flex-shrink: 0; }
.qna-title-text {
  font-weight: 500;
  color: #1a2a3a;
  flex: 1;
}
.qna-title-text.secret { color: #8899aa; font-style: italic; }

/* ── 페이지네이션 ── */
.qna-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
}
.qna-page-btn {
  min-width: 34px;
  height: 34px;
  border: 1.5px solid #d0dce8;
  background: #fff;
  color: #4a5a6a;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-family: 'Noto Sans KR', sans-serif;
}
.qna-page-btn:hover { background: #f0f4fa; border-color: #4a7fc1; color: #1a3a6b; }
.qna-page-btn.active { background: #1a3a6b; border-color: #1a3a6b; color: #fff; font-weight: 700; }
.qna-page-btn:disabled { opacity: .4; cursor: default; }

/* ── 결과 없음 ── */
.qna-empty {
  text-align: center;
  padding: 60px 20px;
  color: #7a8a9a;
}
.qna-empty i { font-size: 40px; margin-bottom: 12px; color: #bccad8; display: block; }
.qna-empty p { font-size: 14px; }

/* ══════════════════════════════════════════════
   Q&A 상세 뷰
══════════════════════════════════════════════ */
.qna-detail-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #d0dce8;
  box-shadow: 0 2px 8px rgba(26,58,107,.06);
  overflow: hidden;
}

/* 질문 헤더 */
.qna-detail-header {
  background: #f0f4fa;
  border-bottom: 1.5px solid #d0dce8;
  padding: 22px 28px 18px;
}
.qna-detail-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.qna-detail-title {
  font-size: 19px;
  font-weight: 700;
  color: #1a2a3a;
  line-height: 1.5;
  margin-bottom: 12px;
}
.qna-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12.5px;
  color: #7a8a9a;
  flex-wrap: wrap;
}
.qna-detail-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 질문 본문 */
.qna-detail-body {
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.85;
  color: #2a3a4e;
  min-height: 120px;
  border-bottom: 1px solid #e8eef6;
}
.qna-detail-body p { margin-bottom: 10px; }
.qna-detail-body ul, .qna-detail-body ol { margin: 8px 0 8px 20px; }
.qna-detail-body li { margin-bottom: 4px; }

/* 첨부파일 (질문) */
.qna-detail-attach {
  margin: 0 28px 20px;
  padding: 13px 18px;
  background: #f5f8fd;
  border: 1px solid #d0dce8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #2a3a4e;
}
.qna-detail-attach i { color: #4a7fc1; font-size: 16px; }
.qna-detail-attach a { color: #1a3a6b; text-decoration: none; font-weight: 500; }
.qna-detail-attach a:hover { text-decoration: underline; }

/* 답변 영역 */
.qna-answer-section {
  background: #f8fbf0;
  border-top: 3px solid #27ae60;
  padding: 24px 28px;
}
.qna-answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.qna-answer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1a5c35;
}
.qna-answer-label i { color: #27ae60; }
.qna-answer-meta {
  font-size: 12px;
  color: #5a7a6a;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.qna-answer-meta span { display: flex; align-items: center; gap: 4px; }
.qna-answer-body {
  font-size: 14px;
  line-height: 1.85;
  color: #1a2a2a;
}
.qna-answer-body p { margin-bottom: 8px; }

/* 답변 대기 */
.qna-answer-pending {
  background: #fff8e1;
  border: 1.5px dashed #f0c050;
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  color: #7a6010;
}
.qna-answer-pending i { font-size: 32px; color: #f0c050; display: block; margin-bottom: 8px; }
.qna-answer-pending p { font-size: 13.5px; line-height: 1.6; }

/* 답변 작성/수정 폼 (관리자) */
.qna-answer-form {
  background: #fff;
  border: 1.5px solid #b8e0c8;
  border-radius: 10px;
  padding: 20px 22px;
  margin-top: 20px;
}
.qna-answer-form-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a5c35;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qna-answer-textarea {
  width: 100%;
  min-height: 160px;
  padding: 10px 14px;
  border: 1.5px solid #c8d8e8;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #2a3a4e;
  resize: vertical;
  line-height: 1.7;
  box-sizing: border-box;
  transition: border-color .15s;
}
.qna-answer-textarea:focus { outline: none; border-color: #27ae60; box-shadow: 0 0 0 3px rgba(39,174,96,.1); }
.qna-answer-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.qna-ans-save-btn {
  padding: 8px 20px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.qna-ans-save-btn:hover { background: #1e8449; }
.qna-ans-cancel-btn {
  padding: 8px 18px;
  background: #fff;
  color: #4a5a6a;
  border: 1.5px solid #d0dce8;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: all .15s;
}
.qna-ans-cancel-btn:hover { background: #f0f4fa; }

/* 하단 버튼 영역 */
.qna-detail-footer {
  padding: 16px 28px;
  border-top: 1px solid #e8eef6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
}
.qna-detail-footer-left,
.qna-detail-footer-right { display: flex; gap: 8px; }

.qd-btn {
  padding: 8px 18px;
  border-radius: 6px;
  border: 1.5px solid #d0dce8;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.qd-btn-list   { background: #fff; color: #4a5a6a; }
.qd-btn-list:hover { background: #f0f4fa; border-color: #4a7fc1; color: #1a3a6b; }
.qd-btn-edit   { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }
.qd-btn-edit:hover { background: #2c5aa0; }
.qd-btn-delete { background: #fff; color: #c0392b; border-color: #e0b0b0; }
.qd-btn-delete:hover { background: #fde8e8; }
.qd-btn-answer { background: #27ae60; color: #fff; border-color: #27ae60; }
.qd-btn-answer:hover { background: #1e8449; }

/* ── 이전/다음 글 ── */
.qna-nav-posts {
  margin-top: 20px;
  border: 1.5px solid #d0dce8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qna-nav-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 14px;
  border-bottom: 1px solid #e8eef6;
  cursor: pointer;
  transition: background .12s;
  font-size: 13.5px;
}
.qna-nav-row:last-child { border-bottom: none; }
.qna-nav-row:hover { background: #f5f8fd; }
.qna-nav-label { font-size: 12px; font-weight: 600; color: #7a8a9a; min-width: 40px; }
.qna-nav-title { flex: 1; color: #2a3a4e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qna-nav-date  { font-size: 12px; color: #7a8a9a; }

/* ══════════════════════════════════════════════
   Q&A 작성/수정 폼
══════════════════════════════════════════════ */
.qna-form-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #d0dce8;
  box-shadow: 0 2px 8px rgba(26,58,107,.06);
  padding: 30px 32px;
}
.qna-form-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a3a6b;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e8eef6;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qna-form-group { margin-bottom: 18px; }
.qna-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2a3a4e;
  margin-bottom: 6px;
}
.qna-form-label .req { color: #e74c3c; margin-left: 2px; }
.qna-form-input,
.qna-form-select,
.qna-form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d0dce8;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #2a3a4e;
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}
.qna-form-input:focus,
.qna-form-select:focus,
.qna-form-textarea:focus {
  outline: none;
  border-color: #4a7fc1;
  box-shadow: 0 0 0 3px rgba(74,127,193,.1);
}
.qna-form-textarea { resize: vertical; min-height: 220px; line-height: 1.7; }
.qna-form-select { cursor: pointer; }
.qna-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.qna-form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.qna-form-checkrow {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.qna-form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13.5px;
  color: #2a3a4e;
}
.qna-form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2e86c1;
  cursor: pointer;
}
.qna-form-hint {
  font-size: 12px;
  color: #8899aa;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.qna-attach-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qna-attach-input-wrap input[type="text"] {
  flex: 1;
}
.qna-attach-browse-btn {
  padding: 8px 14px;
  background: #eef3fb;
  border: 1.5px solid #c5d5eb;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #1a3a6b;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.qna-attach-browse-btn:hover { background: #dce8f8; }

.qna-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8eef6;
}
.qna-form-cancel-btn {
  padding: 9px 24px;
  background: #fff;
  color: #4a5a6a;
  border: 1.5px solid #d0dce8;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.qna-form-cancel-btn:hover { background: #f0f4fa; }
.qna-form-submit-btn {
  padding: 9px 28px;
  background: #2e86c1;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.qna-form-submit-btn:hover { background: #1a6a9a; }

/* ── 삭제 확인 모달 ── */
.qna-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qna-modal {
  background: #fff;
  border-radius: 12px;
  padding: 30px 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  text-align: center;
}
.qna-modal i { font-size: 40px; color: #e74c3c; margin-bottom: 14px; }
.qna-modal h3 { font-size: 17px; font-weight: 700; color: #1a2a3a; margin-bottom: 8px; }
.qna-modal p  { font-size: 13.5px; color: #5a6a7a; margin-bottom: 24px; line-height: 1.6; }
.qna-modal-btns { display: flex; gap: 10px; justify-content: center; }
.qna-modal-cancel { padding: 9px 28px; background: #fff; color: #4a5a6a; border: 1.5px solid #d0dce8; border-radius: 6px; font-size: 14px; font-family: 'Noto Sans KR',sans-serif; cursor: pointer; transition: all .15s; }
.qna-modal-cancel:hover { background: #f0f4fa; }
.qna-modal-confirm { padding: 9px 28px; background: #c0392b; color: #fff; border: none; border-radius: 6px; font-size: 14px; font-family: 'Noto Sans KR',sans-serif; font-weight: 700; cursor: pointer; transition: background .15s; }
.qna-modal-confirm:hover { background: #a93226; }

/* ── 로딩 스피너 ── */
.qna-loading {
  text-align: center;
  padding: 50px 20px;
  color: #7a8a9a;
  font-size: 14px;
}
.qna-loading i { display: block; font-size: 28px; margin-bottom: 10px; color: #4a7fc1; }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .qna-container { padding: 20px 12px 40px; }
  .qna-toolbar { flex-direction: column; align-items: stretch; }
  .qna-toolbar-right { flex-direction: column; align-items: stretch; }
  .qna-search-input { width: 100%; }
  .qna-table thead th.col-view,
  .qna-table td.col-view { display: none; }
  .qna-form-row,
  .qna-form-row-3 { grid-template-columns: 1fr; }
  .qna-detail-header { padding: 16px 16px 14px; }
  .qna-detail-body   { padding: 16px; }
  .qna-answer-section { padding: 16px; }
  .qna-detail-footer  { padding: 12px 16px; }
  .qna-form-wrap { padding: 20px 16px; }
  .qna-answer-form { padding: 14px 14px; }
}
@media (max-width: 480px) {
  .qna-table thead th.col-author,
  .qna-table td.col-author { display: none; }
  .qna-table thead th.col-date,
  .qna-table td.col-date { display: none; }
}
