@charset "UTF-8";

/* ══════════════════════════════════════════════════════════════
   안개숲 도서관 - 전용 글쓰기 에디터 스타일 (css/editor.css)
   ══════════════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.editor-body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #fbfcfc;
  color: #191f28;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 1. 에디터 상단 고정 헤더 바 ── */
.editor-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e8eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.editor-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  font-size: 13px;
  color: #4e5968;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-exit:hover {
  background: #f2f4f6;
  color: #191f28;
  border-color: #abb3ba;
}

/* 2단 카테고리 셀렉터 */
.category-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-select {
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: #333d4b;
  background-color: #f8fafb;
  border: 1.5px solid #dcdfe4;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  min-width: 220px;
}

.category-select:focus {
  border-color: #2b7a4b;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

.category-select optgroup {
  font-weight: 700;
  color: #191f28;
  background: #f8fafb;
  padding: 4px 0;
}

.category-select option {
  font-weight: 500;
  color: #333d4b;
  background: #ffffff;
  padding: 4px 8px;
}

.editor-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-draft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4e5968;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-draft:hover {
  background: #f2f4f6;
  color: #191f28;
}

.btn-draft-badge {
  background: #e5e8eb;
  color: #4e5968;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

.btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  background: #2b7a4b;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(43, 122, 75, 0.25);
  transition: all 0.15s ease;
}

.btn-publish:hover {
  background: #23653d;
  box-shadow: 0 4px 10px rgba(43, 122, 75, 0.35);
  transform: translateY(-1px);
}

/* ── 2. 에디터 메인 워크스페이스 컨테이너 ── */
.editor-workspace {
  max-width: 960px;
  width: 100%;
  margin: 32px auto 80px;
  padding: 0 24px;
  flex: 1;
}

.editor-card {
  background: #ffffff;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  padding: 44px 52px;
  display: flex;
  flex-direction: column;
}

/* 제목 입력 영역 */
.editor-title-container {
  margin-bottom: 24px;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: 20px;
}

.editor-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: "Nanum Myeongjo", "Pretendard", serif;
  font-size: 28px;
  font-weight: 700;
  color: #191f28;
  line-height: 1.4;
  letter-spacing: -0.5px;
  background: transparent;
}

.editor-title-input::placeholder {
  color: #abb3ba;
  font-weight: 500;
}

/* ── 3. 맞춤형 서식 툴바 (도서 첨부, 인용구 등) ── */
.editor-custom-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafb;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  margin-bottom: 20px;
}

.toolbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333d4b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-action-btn:hover {
  background: #eaf6ee;
  border-color: #2b7a4b;
  color: #2b7a4b;
}

.toolbar-action-btn.primary-highlight {
  background: #eaf6ee;
  border-color: #92d3aa;
  color: #2b7a4b;
}

.toolbar-action-btn.primary-highlight:hover {
  background: #d8edd9;
  border-color: #2b7a4b;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: #dcdfe4;
  margin: 0 4px;
}

/* Quill 기본 툴바 커스텀 */
#quill-toolbar {
  border: none !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

#quill-toolbar .ql-formats {
  margin-right: 8px !important;
}

/* ── 4. Quill 에디터 본문 영역 ── */
#editor-container {
  min-height: 480px;
  font-family: "Pretendard", -apple-system, sans-serif;
  font-size: 16px;
  color: #333d4b;
  line-height: 1.85;
}

.ql-container.ql-snow {
  border: none !important;
  font-family: inherit !important;
  font-size: inherit !important;
}

.ql-editor {
  padding: 12px 4px 40px !important;
  min-height: 440px;
  outline: none;
}

.ql-editor.ql-blank::before {
  color: #abb3ba !important;
  font-style: normal !important;
  font-size: 16px;
  left: 4px !important;
}

/* 에디터 내부 본문 서식 일치 (메인 포스트 뷰와 동일) */
.ql-editor p {
  margin-bottom: 12px;
  word-break: keep-all;
}

.ql-editor h1,
.ql-editor h2 {
  font-family: "Nanum Myeongjo", serif;
  font-weight: 700;
  color: #191f28;
  margin: 24px 0 10px;
}

.ql-editor h2 {
  font-size: 20px;
  border-bottom: 1px solid #f0f2f4;
  padding-bottom: 6px;
}

.ql-editor blockquote {
  margin: 18px 0;
  padding: 18px 22px;
  background: #f4f8f5;
  border-left: 4px solid #2b7a4b !important;
  border-radius: 0 8px 8px 0;
  font-family: "Nanum Myeongjo", serif;
  font-size: 16px;
  font-style: italic;
  color: #234731;
  line-height: 1.75;
}

/* 윈도우 탐색기 파일 드래그오버 시각적 피드백 */
.ql-editor.drag-over {
  outline: 2px dashed #2b7a4b !important;
  background-color: rgba(43, 122, 75, 0.04) !important;
  border-radius: 8px;
}

/* 에디터 본문 내 삽입된 이미지 */
.ql-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 본문에 삽입된 도서 정보 카드 서식 (상세뷰와 일치) */
.inserted-book-card {
  background: #f8fafb;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  margin: 20px 0 26px;
  user-select: none;
  position: relative;
}

.inserted-book-card .card-delete-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 4px;
  color: #8b95a1;
  font-size: 11px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inserted-book-card .card-delete-btn:hover {
  background: #fef0f2;
  color: #e03131;
  border-color: #f7a8b8;
}

.inserted-book-cover {
  width: 90px;
  height: 125px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6;
}

.inserted-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inserted-book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inserted-book-title {
  font-family: "Nanum Myeongjo", serif;
  font-size: 17px;
  font-weight: 700;
  color: #191f28;
}

.inserted-book-author {
  font-size: 13px;
  color: #4e5968;
}

.inserted-book-stars {
  color: #f59f00;
  font-size: 13.5px;
  letter-spacing: 2px;
}

.inserted-book-quote {
  font-size: 12.5px;
  color: #6b7684;
  line-height: 1.5;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #edf0f2;
  margin-top: 4px;
}

/* ── 5. 하단 태그 입력 영역 ── */
.editor-tag-section {
  border-top: 1px solid #eef1f4;
  padding-top: 20px;
  margin-top: 20px;
}

.tag-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #eaf6ee;
  color: #2b7a4b;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
}

.tag-badge button {
  background: transparent;
  border: none;
  color: #2b7a4b;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}

.tag-input {
  border: none;
  outline: none;
  font-size: 13.5px;
  color: #191f28;
  padding: 6px 4px;
  min-width: 180px;
  flex: 1;
  font-family: inherit;
}

.tag-input::placeholder {
  color: #abb3ba;
}

/* ── 하단 사진 첨부 안내 팁 & 샘플 버튼 ── */
.editor-guide-tip {
  margin-top: 20px;
  padding: 12px 18px;
  background: #f8fafb;
  border: 1px dashed #dcdfe4;
  border-radius: 8px;
  font-size: 13px;
  color: #4e5968;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-guide-tip strong {
  color: #2b7a4b;
}

.btn-sample-test {
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #333d4b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sample-test:hover {
  background: #eaf6ee;
  border-color: #2b7a4b;
  color: #2b7a4b;
}

/* ── 6. 도서 정보 첨부 모달 팝업 ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: translateY(15px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eef1f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #8b95a1;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #333d4b;
}

.form-input {
  height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: #2b7a4b;
}

.form-textarea {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  outline: none;
  resize: vertical;
  height: 70px;
  font-family: inherit;
}

.form-textarea:focus {
  border-color: #2b7a4b;
}

/* 별점 선택 라디오/버튼 */
.star-rating-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  color: #dcdfe4;
  cursor: pointer;
  user-select: none;
}

.star-rating-box span.active {
  color: #f59f00;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eef1f4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fbfcfc;
}

.btn-modal-cancel {
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  font-size: 13px;
  color: #4e5968;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-submit {
  padding: 8px 20px;
  background: #2b7a4b;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-submit:hover {
  background: #23653d;
}

@media (max-width: 768px) {
  .editor-header-inner {
    padding: 0 16px;
  }
  .editor-workspace {
    padding: 0 12px;
    margin: 16px auto 40px;
  }
  .editor-card {
    padding: 24px 20px;
  }
  .editor-title-input {
    font-size: 22px;
  }
  .category-selectors {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
