/**
 * Toast UI Editor 커스텀 스타일
 * PENGSU Blog
 */

/* 에디터 컨테이너 */
#toastui-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

/* 에디터 본문 영역 */
.toastui-editor-defaultUI {
    border: none !important;
}

/* 툴바 스타일 */
.toastui-editor-toolbar {
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 8px !important;
}

.toastui-editor-toolbar-icons {
    background-color: transparent !important;
}

.toastui-editor-toolbar-icons:hover {
    background-color: #e5e7eb !important;
    border-radius: 4px;
}

/* 에디터 영역 */
.toastui-editor-md-container,
.toastui-editor-ww-container {
    background: #ffffff !important;
}

/* 마크다운 에디터 영역 */
.toastui-editor-md-container .toastui-editor {
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 미리보기 영역 */
.toastui-editor-md-preview {
    padding: 16px 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #111827;
}

/* 미리보기 제목 스타일 */
.toastui-editor-md-preview h1,
.toastui-editor-md-preview h2,
.toastui-editor-md-preview h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    color: #111827;
}

.toastui-editor-md-preview h1 {
    font-size: 1.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.toastui-editor-md-preview h2 {
    font-size: 1.5rem;
}

.toastui-editor-md-preview h3 {
    font-size: 1.25rem;
}

/* 미리보기 코드 블록 */
.toastui-editor-md-preview pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.toastui-editor-md-preview code {
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.toastui-editor-md-preview p code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 미리보기 인용 */
.toastui-editor-md-preview blockquote {
    border-left: 4px solid #6366f1;
    padding-left: 16px;
    margin: 16px 0;
    color: #4b5563;
    font-style: italic;
}

/* 미리보기 링크 */
.toastui-editor-md-preview a {
    color: #6366f1;
    text-decoration: none;
}

.toastui-editor-md-preview a:hover {
    text-decoration: underline;
}

/* 미리보기 이미지 */
.toastui-editor-md-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* 미리보기 리스트 */
.toastui-editor-md-preview ul,
.toastui-editor-md-preview ol {
    padding-left: 24px;
    margin: 16px 0;
}

.toastui-editor-md-preview li {
    margin: 8px 0;
}

/* 미리보기 테이블 */
.toastui-editor-md-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.toastui-editor-md-preview th,
.toastui-editor-md-preview td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
}

.toastui-editor-md-preview th {
    background: #f9fafb;
    font-weight: 600;
}

/* 미리보기 구분선 */
.toastui-editor-md-preview hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

/* 스플릿 뷰 구분선 */
.toastui-editor-md-splitter {
    background: #e5e7eb !important;
    width: 1px !important;
}

/* 모드 전환 탭 */
.toastui-editor-mode-switch {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

.toastui-editor-mode-switch .tab-item {
    color: #6b7280 !important;
}

.toastui-editor-mode-switch .tab-item.active {
    color: #6366f1 !important;
    border-bottom-color: #6366f1 !important;
}

/* 팝업 스타일 */
.toastui-editor-popup {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* 버튼 스타일 */
.toastui-editor-popup button {
    border-radius: 6px !important;
}

/* 에러 메시지 스타일 */
.toastui-error {
    color: #dc2626;
    font-size: 13px;
    padding: 8px 0;
    margin-bottom: 8px;
}

/* Placeholder 스타일 개선 */
.ProseMirror .placeholder {
    color: #9ca3af !important;
    font-style: italic !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* 반응형 */
@media (max-width: 768px) {
    #toastui-editor {
        border-radius: 0;
    }

    .toastui-editor-md-preview {
        padding: 12px 16px !important;
    }
}
