/* Container & Layout */
body {
    background-color: #f8fafc !important;
}

.app-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 30px !important;
}

/* Card Panel Override for a softer look */
.panel {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 30px !important;
}

/* Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 폼 스타일 */
.fg {
    display: flex;
    flex-direction: column;
}
.fg label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
}
.required {
    color: #ef4444;
}

.edit-form input[type="text"],
.edit-form select {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif !important;
    width: 100% !important;
    height: 42px !important;
    padding: 10px 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #334155 !important;
    transition: all 0.2s ease !important;
    background-color: #ffffff !important;
    box-sizing: border-box !important;
}

.edit-form select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    padding-right: 38px !important;
}

.edit-form input[type="text"]:focus,
.edit-form select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Toast UI Editor 폰트 강제 적용 및 보정 */
.toastui-editor-defaultUI, .toastui-editor-contents,
.toastui-editor-defaultUI *, .toastui-editor-contents * {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif !important;
}
.toastui-editor-defaultUI {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden;
}
.toastui-editor-contents p, .toastui-editor-contents li {
    font-size: 15px !important;
    line-height: 1.6 !important;
}
.toastui-editor-contents h1, .toastui-editor-contents h2, .toastui-editor-contents h3 {
    border-bottom: none !important;
}

/* 유틸리티 및 뱃지 */
.view-section {
    display: none;
}
.view-section.active {
    display: block;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background-color: #f1f5f9;
    color: #475569;
    margin-right: 5px;
    white-space: nowrap;
}
.badge-category {
    background-color: #e0e7ff;
    color: #4338ca;
}
.badge-tag {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* ===== Editor.js Notion-like Styles ===== */
#editor, .editorjs-read-only {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif !important;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
}

/* Editor Container */
.codex-editor__redactor {
    padding-bottom: 50px !important;
}

/* Blocks */
.ce-block__content, .ce-toolbar__content {
    max-width: 100% !important;
    margin: 0 !important;
}

/* Paragraphs */
.ce-paragraph {
    line-height: 1.7em;
    padding: 0.3em 0;
}

/* Headers */
.ce-header {
    font-weight: 600;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    padding: 0;
}

h1.ce-header { font-size: 2em; }
h2.ce-header { font-size: 1.5em; }
h3.ce-header { font-size: 1.25em; }

/* Lists */
.cdx-list {
    margin: 0;
    padding-left: 20px;
}
.cdx-list__item {
    padding: 4px 0;
    line-height: 1.6em;
}

/* Image Tool */
.image-tool__image-picture {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.image-tool__caption {
    font-size: 13px;
    color: #64748b;
    border: none;
    border-bottom: 1px dashed #cbd5e1;
    border-radius: 0;
    box-shadow: none;
    margin-top: 8px;
}

/* Checklist */
.cdx-checklist__item {
    display: flex;
    align-items: flex-start;
    padding: 5px 0;
}
.cdx-checklist__item-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border-color: #cbd5e1;
    margin-top: 4px;
}
.cdx-checklist__item-checkbox-check {
    width: 10px;
    height: 10px;
}

/* Table Tool */
.tc-table {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.tc-row {
    border-bottom: 1px solid #e2e8f0;
}
.tc-cell {
    padding: 10px 14px;
    border-right: 1px solid #e2e8f0;
}

/* Quote Tool */
.cdx-quote {
    border-left: 3px solid #3b82f6;
    padding: 10px 20px;
    background-color: #f8fafc;
    border-radius: 0 8px 8px 0;
    margin: 1.5em 0;
}
.cdx-quote__text {
    font-size: 1.1em;
    font-style: italic;
    color: #334155;
    margin-bottom: 5px;
}
.cdx-quote__caption {
    font-size: 0.9em;
    color: #64748b;
}

/* Selection and Marker */
.cdx-marker {
    background: rgba(250, 204, 21, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
}
::selection {
    background: rgba(59, 130, 246, 0.2);
}

/* Toolbar tools menu (Notion style) */
.ce-toolbox {
    background-color: transparent;
}
.ce-toolbox__button {
    color: #64748b;
}
.ce-toolbox__button:hover {
    background-color: #f1f5f9;
    color: #3b82f6;
}

/* Tag Truncation Badge (+N) */
.tag-more {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: help;
    font-weight: 600;
    transition: all 0.2s ease;
}
.tag-more:hover {
    background-color: #e2e8f0;
    color: #3b82f6;
}
