/* === Global Container === */
.notice-container {
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
  background: #f9fcff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* === Title === */
.notice-container h2 {
  font-size: 24px;
  color: #1a365d;
  margin-bottom: 18px;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 6px;
}

/* === Table === */
.notice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px; /* 행 간격 */
}

.notice-table th {
  background: #e0f2fe;
  color: #1e3a8a;
  text-align: center;
  padding: 12px;
  font-weight: bold;
  font-size: 14px;
}

/* === Table Row (카드 효과) === */
.notice-table tr.notice-row {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.notice-table tr.notice-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

/* === Cell 공통 스타일 === */
.notice-table td {
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}
.notice-table td:first-child,
.notice-table th:first-child {
  border-radius: 10px 0 0 10px;
  border-left: 1px solid #f1f5f9;
}
.notice-table td:last-child,
.notice-table th:last-child {
  border-radius: 0 10px 10px 0;
  border-right: 1px solid #f1f5f9;
}

/* === Title Cell === */
.title-cell {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}
.title-cell .notice-pinned {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #e53e3e;
  font-size: 14px;
}
.title-cell a {
  color: #2563eb;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.title-cell a:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* === Buttons === */
.form-actions {
  margin-top: 20px;
  text-align: right;
}
.notice-btn-primary {
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}
.notice-btn-primary:hover {
  background: #1e40af;
}

/* === Notice Detail === */
.notice-detail-header {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}
.notice-detail-header h2 {
  font-size: 24px;
  font-weight: bold;
  color: #1a365d;
  margin-bottom: 10px;
}
.notice-meta {
  font-size: 14px;
  color: #4a5568;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.notice-meta b {
  color: #2d3748;
  margin-right: 6px;
}

/* === Notice Content === */
.notice-content {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  background: white;
  font-size: 15px;
  line-height: 1.7;
  color: #2d3748;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* === Buttons Area === */
.notice-actions {
  margin-bottom: 25px;
  text-align: right;
}

/* === Comments Section === */
.notice-comments {
  margin-top: 20px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.notice-comments h3 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2d3748;
}
.comment-form textarea {
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  font-size: 14px;
  margin-bottom: 10px;
}
.comment-form button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background-color: #1a73e8;
  color: white;
  font-size: 14px;
  cursor: pointer;
}
.comment-form button:hover {
  background-color: #1558b0;
}
.comment-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}
.comment-list li {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 0;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.comment-list li b {
  color: #2d3748;
}
.comment-list a {
  color: #e53e3e;
  margin-left: 10px;
  font-size: 13px;
}

/* === Buttons (Common) === */
.notice-btn {
  display: inline-block;
  padding: 8px 14px;
  margin: 5px 3px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  text-decoration: none;
  color: white;
}
.notice-btn-primary {
  background-color: #1a73e8;
}
.notice-btn-primary:hover {
  background-color: #1558b0;
}
.notice-btn-secondary {
  background-color: #718096;
}
.notice-btn-secondary:hover {
  background-color: #4a5568;
}
.notice-btn-danger {
  background-color: #e53e3e;
}
.notice-btn-danger:hover {
  background-color: #c53030;
}

/* 댓글 삭제용 링크 버튼 */
.comment-delete-btn {
  background: none;
  border: none;
  color: #e53e3e;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.comment-delete-btn:hover {
  color: #c53030;
}

/* === Comment List (리스트 스타일링) === */
.comment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}
.comment-main {
  flex: 1;
  color: #2d3748;
}
.comment-writer {
  font-weight: bold;
  margin-right: 5px;
  color: #1a365d;
}
.comment-date {
  font-size: 12px;
  color: #718096;
  margin-right: 5px;
}
.comment-content {
  margin-left: 3px;
}
.comment-actions {
  white-space: nowrap;
}
.comment-edit {
  margin-right: 10px;
  color: #1a73e8 !important;
  text-decoration: none;
  font-weight: bold;
}
.comment-edit:hover {
  text-decoration: underline;
}
.comment-delete {
  color: #e53e3e;
  text-decoration: none;
  font-weight: bold;
}
.comment-delete:hover {
  text-decoration: underline;
}

/* === Modal Base === */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
  background: #f9fafb;
  margin: 10% auto;
  padding: 20px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease-in-out;
  font-family: Arial, sans-serif;
}
@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-20px);}
  to {opacity: 1; transform: translateY(0);}
}
.modal-content h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #1a365d;
  border-bottom: 1px solid #d0d7e2;
  padding-bottom: 8px;
}
.modal-content textarea {
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  font-size: 14px;
  margin-bottom: 15px;
  background: #fff;
  color: #2d3748;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
#deleteNoticeModal .modal-content {
  max-width: 420px;
  text-align: center;
}
#deleteNoticeModal .modal-content p {
  margin: 15px 0;
  color: #2d3748;
  font-size: 14px;
}

/* === Notice Form === */
.notice-form {
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 14px;
}
.notice-form .form-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}
.notice-form label {
  display: inline-block;
  width: 130px;
  font-weight: bold;
  color: #2d3748;
  font-size: 14px;
}
.notice-form input[type="text"],
.notice-form textarea {
  flex: 1;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  background: #fff;
  transition: border 0.2s;
}
.notice-form input[type="text"]:focus,
.notice-form textarea:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.notice-form textarea {
  resize: vertical;
  min-height: 100px;
}
.checkbox-group {
  display: flex;
  gap: 20px;
  margin-left: 130px;
  font-size: 14px;
  color: #4a5568;
}
.form-actions {
  margin-top: 20px;
  text-align: right;
}
.notice-btn {
  display: inline-block;
  padding: 8px 16px;
  margin-left: 8px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease-in-out;
  text-decoration: none;
}
.notice-btn-primary {
  background-color: #2563eb;
  color: #fff;
}
.notice-btn-primary:hover {
  background-color: #1e40af;
}
.notice-btn-secondary {
  background-color: #718096;
  color: #fff;
}
.notice-btn-secondary:hover {
  background-color: #4a5568;
}

.expired { color: #e53e3e; }

.pagination {
  margin-top: 20px;
  text-align: center;
}
.page-btn {
  display: inline-block;
  margin: 0 4px;
  padding: 6px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  text-decoration: none;
  transition: background 0.2s ease;
}
.page-btn:hover {
  background: #e0f2fe;
}
.page-btn.active {
  background: #2563eb;
  color: #fff;
  font-weight: bold;
}

/* === Mobile Responsive (<=600px) === */
@media (max-width: 600px) {
  .notice-container {
    margin: 15px 10px;
    padding: 15px;
    font-size: 14px;
  }
  .notice-container h2 { font-size: 20px; }

  /* 테이블 카드형 전환 */
  .notice-table,
  .notice-table thead,
  .notice-table tbody,
  .notice-table th,
  .notice-table td,
  .notice-table tr {
    display: block;
    width: 100%;
  }
  .notice-table thead { display: none; }
  .notice-table tr.notice-row {
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  .notice-table td {
    text-align: left;
    border: none;
    padding: 8px 6px;
    font-size: 13px;
  }
  .notice-table td:before {
    content: attr(data-label);
    font-weight: bold;
    color: #1e3a8a;
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
  }

  /* 제목 + 작성자 레이아웃 */
  .title-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
  }
  .title-cell .notice-pinned {
    position: static;
    transform: none;
    color: #e53e3e;
    font-size: 14px;
    flex-shrink: 0;
  }
  .title-cell a {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
  }
  .title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
  }
  .title-right {
    font-size: 13px;
    color: #4a5568;
    margin-left: 10px;
    white-space: nowrap;
  }

  /* ID + 조회수 숨김 */
  .notice-table td:first-child,
  .notice-table th:first-child,
  .notice-table td:last-child,
  .notice-table th:last-child {
    display: none;
  }

  /* 버튼/폼/댓글/모달 반응형 */
  .form-actions { text-align: center; }
  .notice-btn {
    display: block;
    width: 92%;
    margin: 6px 0;
    font-size: 14px;
  }
  .notice-detail-header h2 { font-size: 20px; }
  .notice-meta { font-size: 13px; padding: 10px; }
  .notice-content { font-size: 14px; padding: 15px; }
  .notice-comments { padding: 12px; }
  .comment-item { flex-direction: column; align-items: flex-start; }
  .comment-actions { margin-top: 6px; }
  .modal-content { width: 90%; margin: 30% auto; padding: 15px; }
  .page-btn { padding: 6px 8px; font-size: 13px; }

  .notice-actions {
    display: flex;
    justify-content: space-between; /* 버튼들을 가로로 나열 */
    gap: 8px;
    flex-wrap: wrap; /* 혹시 너무 좁으면 자동 줄바꿈 */
  }

  .notice-actions .notice-btn {
    flex: 1; /* 버튼이 균등 분배되도록 */
    margin: 0; /* 기존 margin 제거 */
    font-size: 14px;
    text-align: center;
  }

  /* 폼 컨테이너 */
  .notice-form {
    padding: 15px;
    font-size: 14px;
  }

  /* 라벨과 필드 세로 정렬 */
  .notice-form .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .notice-form label {
    width: 100%;
    margin-bottom: 6px;
  }
  .notice-form input[type="text"],
  .notice-form textarea {
    width: 100%;
  }

  /* 체크박스 세로 배치 */
  .checkbox-group {
    flex-direction: column;
    gap: 8px;
    margin-left: 0;
  }

  /* 버튼 영역 가로 정렬 */
  .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
  }
  .form-actions .notice-btn {
    flex: 1;
    margin: 0;
    text-align: center;
  }
}
