/* QUILL EDITOR STYLES - 다크 테마로 통일 */

/* ===== SIMPLE TOOLBAR STYLES ===== */

/* 툴바 컨테이너 - 단순하고 깔끔하게 */
.ql-toolbar {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-bottom: none !important;
  border-radius: 8px 8px 0 0 !important;
  padding: 12px 16px !important;
}

/* 툴바 그룹 사이 간격 */
.ql-toolbar .ql-formats {
  margin-right: 12px !important;
}

.ql-toolbar .ql-formats:last-child {
  margin-right: 0 !important;
}

/* 툴바 버튼 기본 스타일 - 단순하게 */
.ql-toolbar button {
  background: white !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  color: #4b5563 !important;
  padding: 6px 8px !important;
  margin: 0 1px !important;
  transition: all 0.15s ease !important;
}

/* 툴바 버튼 호버 효과 - 부드럽게 */
.ql-toolbar button:hover {
  background: #f3f4f6 !important;
  border-color: #9ca3af !important;
  color: #1f2937 !important;
}

/* 활성화된 버튼 스타일 */
.ql-toolbar button.ql-active {
  background: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

/* 셀렉트 박스 스타일 */
.ql-toolbar select {
  background: white !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  color: #4b5563 !important;
  padding: 6px 10px !important;
  margin: 0 1px !important;
}

.ql-toolbar select:hover {
  border-color: #9ca3af !important;
}

.ql-toolbar select option {
  background: white !important;
  color: #4b5563 !important;
}

/* 에디터 컨테이너 */
.ql-container {
  border: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
}

/* 에디터 영역 - 테마에 맞게 */
.ql-editor {
  padding: 24px !important;
  min-height: 400px !important;
  border-radius: 0 0 8px 8px;
}

/* === 공통 텍스트 스타일 (3곳 모두 동일) - 강제 적용 === */
.ql-editor, .quill-content {
  line-height: 1.8 !important;
  font-size: 1rem !important;
}

.ql-editor p, .quill-content p {
  margin-bottom: 1.5rem !important;
  line-height: 1.8 !important;
  font-size: 1rem !important;
}

.ql-editor h1, .quill-content h1 {
  font-size: 2.25rem !important;
  font-weight: 700 !important;
  margin-top: 2.5rem !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 3px solid currentColor !important;
  padding-bottom: 0.5rem !important;
}

.ql-editor h2, .quill-content h2 {
  font-size: 1.875rem !important;
  font-weight: 600 !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
}

.ql-editor h3, .quill-content h3 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.75rem !important;
}

.ql-editor h4, .quill-content h4 {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-top: 1.25rem !important;
  margin-bottom: 0.5rem !important;
}

.ql-editor h5, .quill-content h5 {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.ql-editor h6, .quill-content h6 {
  font-size: 1rem !important;
  font-weight: 600 !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.ql-editor ul, .ql-editor ol, .quill-content ul, .quill-content ol {
  margin-bottom: 1.5rem !important;
  padding-left: 1.5rem !important;
  font-size: 1rem !important;
  line-height: 1.8 !important;
}

.ql-editor li, .quill-content li {
  margin-bottom: 0.5rem !important;
  font-size: 1rem !important;
  line-height: 1.8 !important;
}

.ql-editor blockquote, .quill-content blockquote {
  border-left: 4px solid !important;
  padding-left: 1.5rem !important;
  margin: 1.5rem 0 !important;
  font-style: italic !important;
  padding: 1rem 1.5rem !important;
  border-radius: 0.5rem !important;
  font-size: 1rem !important;
  line-height: 1.8 !important;
}

.ql-editor strong, .quill-content strong {
  font-weight: 600 !important;
}

.ql-editor em, .quill-content em {
  font-style: italic !important;
}

.ql-editor a, .quill-content a {
  text-decoration: underline !important;
  font-weight: 500 !important;
}

.ql-editor code, .quill-content code {
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.375rem !important;
  font-size: 0.875rem !important;
  font-family: 'Courier New', monospace !important;
}

.ql-editor pre, .quill-content pre {
  padding: 1rem !important;
  border-radius: 0.5rem !important;
  overflow-x: auto !important;
  margin: 1.5rem 0 !important;
  font-size: 0.9rem !important;
}

.ql-editor pre code, .quill-content pre code {
  background-color: transparent !important;
  padding: 0 !important;
  font-size: 0.9rem !important;
}

.ql-editor img, .quill-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  margin: 1.5rem 0 !important;
}

/* 반응형 - 폰트 크기는 동일하게 유지 */
@media (max-width: 768px) {
  .ql-toolbar {
    padding: 8px 12px !important;
  }
  
  .ql-toolbar .ql-formats {
    margin-right: 8px !important;
  }
  
  .ql-toolbar button {
    padding: 4px 6px !important;
  }
  
  .ql-editor {
    padding: 16px !important;
    min-height: 300px !important;
  }
  
  /* 모바일에서도 동일한 폰트 크기 강제 적용 */
  .ql-editor, .quill-content {
    font-size: 1rem !important;
    line-height: 1.8 !important;
  }
  
  .ql-editor p, .quill-content p {
    font-size: 1rem !important;
    line-height: 1.8 !important;
  }
  
  .ql-editor h1, .quill-content h1 {
    font-size: 2rem !important;
  }
  
  .ql-editor h2, .quill-content h2 {
    font-size: 1.75rem !important;
  }
  
  .ql-editor h3, .quill-content h3 {
    font-size: 1.375rem !important;
  }
}

/* === Quill 특정 클래스들 (3곳 모두 동일) === */
.ql-editor .ql-align-center, .quill-content .ql-align-center {
  text-align: center !important;
}

.ql-editor .ql-align-right, .quill-content .ql-align-right {
  text-align: right !important;
}

.ql-editor .ql-align-justify, .quill-content .ql-align-justify {
  text-align: justify !important;
}

.ql-editor .ql-indent-1, .quill-content .ql-indent-1 {
  padding-left: 3rem !important;
}

.ql-editor .ql-indent-2, .quill-content .ql-indent-2 {
  padding-left: 6rem !important;
}

.ql-editor .ql-indent-3, .quill-content .ql-indent-3 {
  padding-left: 9rem !important;
}

/* 테이블 스타일 (3곳 모두 동일) */
.ql-editor table, .quill-content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.5rem 0 !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  font-size: 1rem !important;
}

.ql-editor th, .ql-editor td, .quill-content th, .quill-content td {
  border: 1px solid !important;
  padding: 0.75rem !important;
  text-align: left !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
}

.ql-editor th, .quill-content th {
  font-weight: 600 !important;
}

.ql-editor hr, .quill-content hr {
  border: none !important;
  height: 1px !important;
  margin: 2rem 0 !important;
}

/* 첫 번째/마지막 요소 마진 조정 */
.ql-editor > *:first-child, .quill-content > *:first-child {
  margin-top: 0 !important;
}

.ql-editor > *:last-child, .quill-content > *:last-child {
  margin-bottom: 0 !important;
}

/* 빈 p 태그 처리 */
.ql-editor p:empty, .quill-content p:empty {
  margin-bottom: 1rem !important;
}

.ql-editor p br:only-child, .quill-content p br:only-child {
  display: block !important;
  margin-bottom: 1rem !important;
}