/* ════════════════════════════
   NOTICE LAYOUT
════════════════════════════ */
.notice-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: start;
  flex: 1;
}

/* ════════════════════════════
   NOTICE LIST PANEL
════════════════════════════ */
.notice-list-panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100%;
}

.notice-list-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notice-list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notice-list-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.notice-write-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}

.notice-write-btn:hover {
  background: #005bbf;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.notice-write-btn svg {
  width: 14px;
  height: 14px;
}

/* 검색 */
.notice-search-wrap {
  position: relative;
}

.notice-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.notice-search {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all 0.18s var(--ease);
}

.notice-search:focus {
  border-color: var(--primary-border);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 공지 목록 스크롤 영역 */
.notice-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  max-height: calc(100vh - 220px);
}

.notice-list-scroll::-webkit-scrollbar {
  width: 4px;
}
.notice-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.notice-list-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* 공지 아이템 */
.notice-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
  margin-bottom: 10px;
}

.notice-item:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.notice-item.active {
  border: 1.5px solid var(--project-text);
  background: var(--project-bg);
}

.notice-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* 상단 고정 배지 */
.notice-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
  flex-shrink: 0;
  white-space: nowrap;
}

.notice-pin-badge svg {
  width: 10px;
  height: 10px;
}

/* .notice-item.active .notice-pin-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
} */

.notice-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* .notice-item.active .notice-item-title {
  color: #fff;
} */

.notice-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* .notice-item.active .notice-item-meta {
  color: rgba(255, 255, 255, 0.7);
} */

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

.notice-item-date svg {
  width: 11px;
  height: 11px;
}

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

.notice-item-author svg {
  width: 11px;
  height: 11px;
}

.notice-item-attach {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 600;
}

.notice-item-attach svg {
  width: 11px;
  height: 11px;
}

.notice-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  color: var(--muted);
}

.notice-list-empty svg {
  opacity: 0.4;
}

.notice-list-empty p {
  font-size: 13px;
}

/* ════════════════════════════
   NOTICE DETAIL PANEL
════════════════════════════ */
.notice-detail-panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 빈 상태 */
.notice-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--muted);
}

.notice-detail-empty svg {
  opacity: 0.35;
}

.notice-detail-empty p {
  font-size: 14px;
  text-align: center;
}

/* 상세 컨텐츠 */
.notice-detail-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  animation: noticeSlideIn 0.2s var(--ease);
}

@keyframes noticeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice-detail-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.notice-detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge-pinned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
}

.badge-pinned svg {
  width: 11px;
  height: 11px;
}

.notice-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 12px;
}

.notice-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notice-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.notice-meta-item svg {
  width: 13px;
  height: 13px;
}

/* 본문 */
.notice-detail-body {
  padding: 24px;
  flex: 1;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 액션 버튼 */
.notice-detail-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.notice-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-2);
}

.notice-action-btn:hover {
  background: var(--bg);
  border-color: var(--text-2);
  color: var(--text);
}

.notice-action-btn.pin-btn.active {
  background: rgba(229, 57, 53, 0.07);
  border-color: rgba(229, 57, 53, 0.3);
  color: #e53935;
}

.notice-action-btn.edit-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.notice-action-btn.delete-btn:hover {
  background: rgba(229, 57, 53, 0.07);
  border-color: rgba(229, 57, 53, 0.25);
  color: #e53935;
}

.notice-action-btn svg {
  width: 14px;
  height: 14px;
}

/* ════════════════════════════
   MODAL — 작성 / 수정
════════════════════════════ */
.notice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.35);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFade 0.2s var(--ease);
}

@keyframes overlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.notice-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  animation: modalSlide 0.22s var(--ease);
  overflow: hidden;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notice-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.notice-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all 0.15s;
}

.notice-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.notice-modal-body {
  padding: 20px 22px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-textarea {
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all 0.18s var(--ease);
  resize: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary-border);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-textarea {
  min-height: 200px;
  line-height: 1.7;
}

.form-pin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.form-pin-row:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.form-pin-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-pin-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.form-pin-desc {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.notice-modal-footer {
  padding: 14px 22px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.modal-btn {
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: 1px solid var(--border);
}

.modal-btn.cancel {
  background: var(--white);
  color: var(--text-2);
}

.modal-btn.cancel:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-btn.submit {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-btn.submit:hover {
  background: #005bbf;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}

/* ════════════════════════════
   ATTACHMENT — 모달 업로드
════════════════════════════ */
.form-attach-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  background: var(--bg);
  position: relative;
}

.form-dropzone:hover,
.form-dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.form-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.form-dropzone-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.form-dropzone-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* 첨부 파일 목록 (모달 내) */
.form-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.form-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.form-attach-item-icon {
  flex-shrink: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.form-attach-item-icon svg {
  width: 15px;
  height: 15px;
}

.form-attach-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.form-attach-item-size {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.form-attach-item-del {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.form-attach-item-del:hover {
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
}

.form-attach-item-del svg {
  width: 13px;
  height: 13px;
}

/* ════════════════════════════
   ATTACHMENT — 상세 보기
════════════════════════════ */
.notice-detail-attach {
  padding: 0 24px 20px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.notice-detail-attach-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  padding: 14px 0 10px;
}

.notice-detail-attach-title svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.notice-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notice-attach-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  text-decoration: none;
}

.notice-attach-file:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.notice-attach-file-icon {
  flex-shrink: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.notice-attach-file-icon svg {
  width: 16px;
  height: 16px;
}

.notice-attach-file-info {
  flex: 1;
  min-width: 0;
}

.notice-attach-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-attach-file-size {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.notice-attach-download-icon {
  flex-shrink: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.notice-attach-file:hover .notice-attach-download-icon {
  color: var(--primary);
}

.notice-attach-download-icon svg {
  width: 15px;
  height: 15px;
}

/* ════════════════════════════
   CONFIRM DIALOG
════════════════════════════ */
.notice-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.4);
  backdrop-filter: blur(3px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFade 0.15s var(--ease);
}

.notice-confirm-dialog {
  background: var(--white);
  border-radius: 14px;
  padding: 28px 28px 22px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  animation: modalSlide 0.18s var(--ease);
  text-align: center;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(229, 57, 53, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #e53935;
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.confirm-btn {
  padding: 9px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s var(--ease);
}

.confirm-btn.cancel {
  background: var(--white);
  color: var(--text-2);
}

.confirm-btn.cancel:hover {
  background: var(--bg);
}

.confirm-btn.danger {
  background: #e53935;
  color: #fff;
  border-color: #e53935;
}

.confirm-btn.danger:hover {
  background: #c62828;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

/* ════════════════════════════
   TOAST
════════════════════════════ */
.notice-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--grd);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation:
    toastIn 0.25s var(--ease),
    toastOut 0.3s var(--ease) 2s forwards;
  white-space: nowrap;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 1024px) {
  .notice-container {
    grid-template-columns: 280px 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .notice-container {
    grid-template-columns: 1fr;
  }

  .notice-list-panel {
    position: static;
  }

  .notice-list-scroll {
    max-height: 320px;
  }

  .notice-detail-panel {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .notice-detail-header {
    padding: 16px 16px 14px;
  }

  .notice-detail-body {
    padding: 16px;
  }

  .notice-detail-actions {
    padding: 12px 16px;
  }
}
