/* ============================================================
   notice.css  ─  공지사항 페이지 전용 스타일
   평생학습도시 기초자료 조사 시스템
============================================================ */

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

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

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

/* ── 검색/필터 영역 ── */
.notice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.notice-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.notice-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;
}
.notice-filter-tab:hover,
.notice-filter-tab.active {
  background: #1a3a6b;
  border-color: #1a3a6b;
  color: #fff;
}
.notice-search-wrap {
  display: flex;
  gap: 6px;
}
.notice-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: 220px;
  transition: border-color .15s;
}
.notice-search-input:focus {
  outline: none;
  border-color: #4a7fc1;
}
.notice-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;
}
.notice-search-btn:hover { background: #2c5aa0; }
.notice-write-btn {
  padding: 8px 18px;
  background: #1e8449;
  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;
}
.notice-write-btn:hover { background: #17703c; }

/* ── 공지 목록 테이블 ── */
.notice-table-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #d0dce8;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,58,107,.06);
}
.notice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.notice-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;
}
.notice-table thead th.col-no    { width: 60px; text-align: center; }
.notice-table thead th.col-cat   { width: 80px; text-align: center; }
.notice-table thead th.col-title { }
.notice-table thead th.col-author { width: 90px; text-align: center; }
.notice-table thead th.col-date  { width: 100px; text-align: center; }
.notice-table thead th.col-view  { width: 70px; text-align: center; }

.notice-table tbody tr {
  border-bottom: 1px solid #e8eef6;
  transition: background .12s;
  cursor: pointer;
}
.notice-table tbody tr:last-child { border-bottom: none; }
.notice-table tbody tr:hover { background: #f5f8fd; }
.notice-table tbody tr.is-pinned { background: #fafbff; }
.notice-table tbody tr.is-pinned:hover { background: #f0f4ff; }

.notice-table td { padding: 13px 16px; vertical-align: middle; color: #2a3a4e; }
.notice-table td.col-no,
.notice-table td.col-author,
.notice-table td.col-date,
.notice-table td.col-view { text-align: center; color: #7a8a9a; font-size: 12.5px; }

/* 카테고리 배지 */
.notice-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-중요  { background: #fde8d8; color: #d35400; }
.badge-공지  { background: #dbe8f8; color: #1a3a6b; }
.badge-안내  { background: #d5f5e3; color: #1e8449; }
.badge-긴급  { background: #fde8e8; color: #c0392b; }

/* 제목 셀 */
.notice-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notice-pin-icon {
  color: #e74c3c;
  font-size: 12px;
  flex-shrink: 0;
}
.notice-new-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.notice-title-text {
  font-weight: 500;
  color: #1a2a3a;
  text-decoration: none;
  flex: 1;
}
.notice-title-text:hover { color: #1a3a6b; text-decoration: underline; }
.notice-attach-icon {
  color: #7a8a9a;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── 페이지네이션 ── */
.notice-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
}
.notice-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;
}
.notice-page-btn:hover { background: #f0f4fa; border-color: #4a7fc1; color: #1a3a6b; }
.notice-page-btn.active { background: #1a3a6b; border-color: #1a3a6b; color: #fff; font-weight: 700; }
.notice-page-btn:disabled { opacity: .4; cursor: default; }

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

/* ══════════════════════════════════════════════
   공지사항 상세 뷰
══════════════════════════════════════════════ */
.notice-detail-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #d0dce8;
  box-shadow: 0 2px 8px rgba(26,58,107,.06);
  overflow: hidden;
}
.notice-detail-header {
  background: #f0f4fa;
  border-bottom: 1.5px solid #d0dce8;
  padding: 22px 28px 18px;
}
.notice-detail-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.notice-detail-title {
  font-size: 19px;
  font-weight: 700;
  color: #1a2a3a;
  line-height: 1.5;
  margin-bottom: 12px;
}
.notice-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12.5px;
  color: #7a8a9a;
  flex-wrap: wrap;
}
.notice-detail-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.notice-detail-body {
  padding: 28px 28px 24px;
  font-size: 14px;
  line-height: 1.85;
  color: #2a3a4e;
  min-height: 200px;
}
.notice-detail-body p { margin-bottom: 10px; }
.notice-detail-body ul, .notice-detail-body ol { margin: 8px 0 8px 20px; }
.notice-detail-body li { margin-bottom: 4px; }
.notice-detail-body strong { font-weight: 700; color: #1a2a3a; }

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

/* 하단 버튼 영역 */
.notice-detail-footer {
  padding: 16px 28px;
  border-top: 1px solid #e8eef6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.notice-detail-footer-left,
.notice-detail-footer-right {
  display: flex;
  gap: 8px;
}
.nd-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;
}
.nd-btn-list   { background: #fff; color: #4a5a6a; }
.nd-btn-list:hover { background: #f0f4fa; border-color: #4a7fc1; color: #1a3a6b; }
.nd-btn-edit   { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }
.nd-btn-edit:hover { background: #2c5aa0; }
.nd-btn-delete { background: #fff; color: #c0392b; border-color: #e0b0b0; }
.nd-btn-delete:hover { background: #fde8e8; }

/* 이전글/다음글 */
.notice-nav-posts {
  margin-top: 20px;
  border: 1.5px solid #d0dce8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.notice-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;
}
.notice-nav-row:last-child { border-bottom: none; }
.notice-nav-row:hover { background: #f5f8fd; }
.notice-nav-label {
  font-size: 12px;
  font-weight: 600;
  color: #7a8a9a;
  min-width: 40px;
}
.notice-nav-title {
  flex: 1;
  color: #2a3a4e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-nav-date { font-size: 12px; color: #7a8a9a; }

/* ══════════════════════════════════════════════
   공지사항 작성/수정 폼
══════════════════════════════════════════════ */
.notice-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;
}
.notice-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;
}
.notice-form-group { margin-bottom: 18px; }
.notice-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2a3a4e;
  margin-bottom: 6px;
}
.notice-form-label .req { color: #e74c3c; margin-left: 2px; }
.notice-form-input,
.notice-form-select,
.notice-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;
}
.notice-form-input:focus,
.notice-form-select:focus,
.notice-form-textarea:focus {
  outline: none;
  border-color: #4a7fc1;
  box-shadow: 0 0 0 3px rgba(74,127,193,.1);
}
.notice-form-textarea { resize: vertical; min-height: 260px; line-height: 1.7; }
.notice-form-select { cursor: pointer; }
.notice-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.notice-form-checkrow {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.notice-form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13.5px;
  color: #2a3a4e;
}
.notice-form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1a3a6b;
  cursor: pointer;
}
.notice-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8eef6;
}
.nf-btn {
  padding: 10px 24px;
  border-radius: 7px;
  border: 1.5px solid #d0dce8;
  font-size: 13.5px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
}
.nf-btn-cancel { background: #fff; color: #4a5a6a; }
.nf-btn-cancel:hover { background: #f0f4fa; }
.nf-btn-save   { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }
.nf-btn-save:hover { background: #2c5aa0; }

/* 첨부파일 버튼 영역 */
.nf-attach-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nf-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f0f4fa;
  border: 1.5px solid #c0cfe0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1a3a6b;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  font-family: 'Noto Sans KR', sans-serif;
}
.nf-file-btn:hover { background: #dce8f8; border-color: #4a7fc1; }
.nf-file-btn i { color: #4a7fc1; }
.nf-file-name {
  font-size: 13px;
  color: #7a8a9a;
  word-break: break-all;
}
.nf-file-name.has-file { color: #2a3a4e; font-weight: 500; }
.nf-file-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #d0dce8;
  background: #fff;
  color: #7a8a9a;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  transition: all .15s;
}
.nf-file-clear:hover { background: #ffe0e0; border-color: #e74c3c; color: #e74c3c; }

/* 글자수 카운터 */
.notice-char-count {
  text-align: right;
  font-size: 11.5px;
  color: #7a8a9a;
  margin-top: 4px;
}

/* ── 모달 오버레이 ── */
.notice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.notice-modal-overlay.open { opacity: 1; pointer-events: all; }
.notice-modal {
  background: #fff;
  border-radius: 12px;
  padding: 30px 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  transform: translateY(-12px);
  transition: transform .2s;
}
.notice-modal-overlay.open .notice-modal { transform: translateY(0); }
.notice-modal-icon { font-size: 36px; color: #e74c3c; margin-bottom: 12px; }
.notice-modal h3 { font-size: 17px; font-weight: 700; color: #1a2a3a; margin-bottom: 8px; }
.notice-modal p  { font-size: 13.5px; color: #4a5a6a; margin-bottom: 22px; line-height: 1.6; }
.notice-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.nm-btn {
  padding: 9px 20px;
  border-radius: 6px;
  border: 1.5px solid #d0dce8;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 600;
  cursor: pointer;
}
.nm-btn-cancel { background: #fff; color: #4a5a6a; }
.nm-btn-confirm { background: #c0392b; color: #fff; border-color: #c0392b; }

/* ── 토스트 ── */
.nt-toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1e8449;
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  font-family: 'Noto Sans KR', sans-serif;
}
.nt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.nt-toast.error { background: #c0392b; }
.nt-toast.warn  { background: #d35400; }

/* ── 로딩 스피너 ── */
.notice-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #7a8a9a;
  gap: 14px;
}
.notice-spinner {
  width: 36px; height: 36px;
  border: 3px solid #d0dce8;
  border-top-color: #1a3a6b;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 회차 필터 셀렉트 ── */
.notice-round-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #d0dce8;
  border-radius: 6px;
  padding: 0 10px;
  height: 36px;
}
.notice-round-select {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #2a3a4e;
  background: transparent;
  cursor: pointer;
  min-width: 90px;
}

/* ── 테이블 회차 컬럼 ── */
.notice-table thead th.col-round { width: 70px; text-align: center; }
.notice-table td.col-round        { text-align: center; }

/* ── 회차 배지 (목록/상세) ── */
.notice-round-badge {
  display: inline-block;
  padding: 2px 9px;
  background: #eef2fb;
  color: #1a3a6b;
  border: 1.5px solid #c4d2e8;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}

/* ── 상세 메타 회차 ── */
#detailRoundWrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eef2fb;
  color: #1a3a6b;
  border: 1.5px solid #c4d2e8;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 700;
}
#detailRoundWrap i { font-size: 11px; }

/* ── 작성 폼 3열 그리드 ── */
.notice-form-row3 {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .notice-form-row3 { grid-template-columns: 1fr; }
}

/* ── 반응형 ── */
@media (max-width: 700px) {
  .notice-toolbar { flex-direction: column; align-items: stretch; }
  .notice-search-wrap { flex: 1; }
  .notice-search-input { flex: 1; width: 100%; }
  .notice-table thead th.col-author,
  .notice-table thead th.col-view,
  .notice-table td:nth-child(5),
  .notice-table td:nth-child(7) { display: none; }
  .notice-form-row { grid-template-columns: 1fr; }
  .notice-detail-header { padding: 16px 18px; }
  .notice-detail-body  { padding: 18px 18px; }
  .notice-form-wrap { padding: 20px 16px; }
}
