/* === 에디터 팝업 스타일 === */

.editor-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /*z-index: 1;*/
}

.editor-popup-container {
    position: relative;
    width: 50vw;
    max-height: 80vh;
    background: #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden
    /*overflow: visible;*/
    /*z-index: 2;*/
}

.editor-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #16213e;
    border-bottom: 1px solid #2a2a4a;
}

.editor-popup-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.editor-title-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    outline: none;
    transition: border-color 0.2s;
}

.editor-title-input:hover {
    border-bottom-color: #444;
}

.editor-title-input:focus {
    border-bottom-color: #4dabf7;
}

.editor-title-input::placeholder {
    color: #666;
    font-weight: 400;
}

.editor-popup-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 4px;
    transition: color 0.2s;
}

.editor-popup-close:hover {
    color: #fff;
}

.editor-popup-body {
    flex: 1;
    padding: 16px;
    /*overflow: visible;*/
    overflow-y: auto;
    min-height: 300px;
    /*background: #fff;*/
}

.editor-popup-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #16213e;
    border-top: 1px solid #2a2a4a;
}

/* 에디터 버튼 스타일 */
.chart-editor-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #888;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-editor-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
    color: #fff;
}

.chart-editor-btn.has-content {
    color: #4dabf7;
    border-color: #4dabf7;
}

/* 텍스트 에디터 버튼 활성화 상태 */
#textEditorBtn.active {
    background: var(--krds-color-light-primary-60, #0052a3);
    border-color: var(--krds-color-light-primary-50, #0066cc);
    color: #fff;
}

/* === Summernote 에디터 컨테이너 === */
#summernote-container {
    min-height: 250px;
}

#summernote-container .note-editable {
    font-family: '맑은 고딕', 'Malgun Gothic', sans-serif;
    background: #fff;
}

/* 색상 팔레트 양쪽 배치 (foreColor, backColor 나란히) */
.note-editor .note-dropdown-menu.dropdown-menu {
    min-width: 340px !important;
}

.note-editor .note-btn-group.note-color .note-dropdown-menu {
    min-width: 340px !important;
    white-space: nowrap !important;
}

.note-editor .note-palette {
    display: inline-block !important;
    width: 160px !important;
    vertical-align: top !important;
    margin: 0 !important;
}

.note-editor .note-palette:first-child {
    margin: 0 5px !important;
    margin-right: 15px !important;
}

/* reset.css 덮어쓰기 - 에디터 내 리스트/이탤릭 스타일 복원 */
#summernote-container .note-editable ul {
    list-style: disc !important;
    padding-left: 20px !important;
    margin-left: 10px !important;
}

#summernote-container .note-editable ol {
    list-style: decimal !important;
    padding-left: 20px !important;
    margin-left: 10px !important;
}

#summernote-container .note-editable i,
#summernote-container .note-editable em {
    font-style: italic !important;
}

/* 팝업에서 보여지는 내용 배경색 */
.summernote-content {
    color: #333;
    /*padding: 16px;*/
    border-radius: 6px;
    min-height: 100%;
}

/* reset.css 덮어쓰기 - readonly 리스트/이탤릭 스타일 복원 */
.summernote-content ul {
    list-style: disc !important;
    padding-left: 20px !important;
    margin-left: 10px !important;
}

.summernote-content ol {
    list-style: decimal !important;
    padding-left: 20px !important;
    margin-left: 10px !important;
}

.summernote-content i,
.summernote-content em {
    font-style: italic !important;
}

/* === Summernote 모달 레이아웃 수정 === */
.note-modal .note-modal-footer {
    height: auto !important;
    min-height: 40px;
    overflow: hidden;  /* float clear */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
}

.note-modal .note-modal-footer .note-btn {
    float: none !important;
}

/* === Summernote 모달 버튼 스타일 (reset.css 덮어쓰기) === */
.note-modal .note-btn-primary,
.note-modal button.note-btn-primary {
    background: #fa6362 !important;
    color: #fff !important;
    border: 1px solid #fa6362 !important;
}

.note-modal .note-btn-primary:hover,
.note-modal .note-btn-primary:focus,
.note-modal button.note-btn-primary:hover,
.note-modal button.note-btn-primary:focus {
    background: #e05554 !important;
    border-color: #e05554 !important;
    color: #fff !important;
}

/* === Summernote 모달 체크박스 스타일 (KRDS 덮어쓰기) === */
.note-modal .checkbox input[type="checkbox"],
.note-modal .sn-checkbox-open-in-new-window input[type="checkbox"] {
    position: relative !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    margin-right: 6px !important;
    padding: 0 !important;
    opacity: 1 !important;
    clip: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    cursor: pointer;
    vertical-align: middle;
}

.note-modal .checkbox label,
.note-modal .sn-checkbox-open-in-new-window label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #42515f;
    font-size: 14px;
}

/* === Summernote 드롭다운 스크롤 === */
.note-editor .note-dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
}

/* 색상 팔레트는 스크롤 제외 (가로 배치 유지) */
.note-editor .note-btn-group.note-color .note-dropdown-menu {
    max-height: none;
    overflow-y: visible;
}

