/**
 * Summernote Custom CSS
 * 프로젝트 커스텀 스타일 (아이콘, 색상 팔레트 등)
 * 최종 수정: 2025-12-03
 */

/* ============================================
   커스텀 아이콘 이미지 (PNG)
   ============================================ */

/* 정렬 아이콘 */
.note-icon-align-center:before { content: url("/summernote/img/edit_align-center_icon.png"); }
.note-icon-align-indent:before { content: url("/summernote/img/edit_align-indent_icon.png"); }
.note-icon-align-justify:before { content: url("/summernote/img/edit_align-justify_icon.png"); }
.note-icon-align-left:before { content: url("/summernote/img/edit_align-left_icon.png"); }
.note-icon-align-outdent:before { content: url("/summernote/img/edit_align-outdent_icon.png"); }
.note-icon-align-right:before { content: url("/summernote/img/edit_align-right_icon.png"); }

/* 텍스트 서식 아이콘 */
.note-icon-bold:before { content: url("/summernote/img/edit_bold_icon.png"); }
.note-icon-underline:before { content: url("/summernote/img/edit_underline_icon.png"); }
.note-icon-eraser:before { content: url("/summernote/img/edit_eraser_icon.png"); }

/* 폰트 아이콘 (PNG 없음 - summernote 폰트 사용) */
.note-icon-italic:before { font-family: summernote !important; content: "\ea1e" !important; }
.note-icon-strikethrough:before { font-family: summernote !important; content: "\ea2e" !important; }
.note-icon-undo:before { font-family: summernote !important; content: "\ea36" !important; }
.note-icon-redo:before { font-family: summernote !important; content: "\ea27" !important; }
.note-icon-superscript:before { font-family: summernote !important; content: "\ea31" !important; }
.note-icon-subscript:before { font-family: summernote !important; content: "\ea2f" !important; }
.note-icon-caret:before { font-family: summernote !important; content: "\ea10" !important; }
.note-icon-table:before { font-family: summernote !important; content: "\ea32" !important; }
.note-icon-trash:before { font-family: summernote !important; content: "\ea34" !important; }
.note-icon-close:before { font-family: summernote !important; content: "\ea13" !important; }
.note-icon-question:before { font-family: summernote !important; content: "\ea26" !important; }
.note-icon-minus:before { font-family: summernote !important; content: "\ea22" !important; }
.note-icon-special-character:before { font-family: summernote !important; content: "\ea2c" !important; }
.note-icon-pencil:before { font-family: summernote !important; content: "\f118" !important; }

/* 목록 아이콘 */
.note-icon-orderedlist:before { content: url("/summernote/img/edit_orderedlist_icon.png"); }
.note-icon-unorderedlist:before { content: url("/summernote/img/edit_unorderedlist_icon.png"); }

/* 삽입 아이콘 */
.note-icon-link:before { content: url("/summernote/img/edit_link_icon.png"); }
.note-icon-picture:before { content: url("/summernote/img/edit_picture_icon.png"); }
.note-icon-video:before { content: url("/summernote/img/edit_video_icon.png"); }

/* 기타 아이콘 */
.note-icon-magic:before { content: url("/summernote/img/edit_magic_icon.png"); }
.note-icon-code:before { content: url("/summernote/img/edit_code_icon.png"); }
.note-icon-arrows-alt:before { content: url("/summernote/img/edit_arrows-alt_icon.png"); }

/* ============================================
   글자색 아이콘 - 한글 "가" 표시
   ============================================ */
.note-icon-font:before {
    content: "\AC00";
    font-size: 15px;
    line-height: 1;
}

/* 글자색 버튼 색상 표시 */
.note-toolbar .note-color .note-btn-group:first-of-type .note-icon-font:before {
    color: #ea1c5b;
}

/* 배경색 버튼 색상 표시 - 수직 중앙 정렬 */
.note-toolbar .note-color .note-btn-group:last-of-type .note-icon-font {
    background: #ffeb03;
    display: inline-block;
    line-height: 20px;
    height: 20px;
    vertical-align: middle;
}

/* ============================================
   테이블 아이콘 (popover용)
   ============================================ */
.note-icon-row-below:before { content: url("/img/note-icon-row-below.png"); }
.note-icon-row-above:before { content: url("/img/note-icon-row-above.png"); }
.note-icon-col-before:before { content: url("/img/note-icon-col-before.png"); }
.note-icon-col-after:before { content: url("/img/note-icon-col-after.png"); }
.note-icon-col-sum:before { content: url("/img/note-icon-col-sum.png"); }
.note-icon-row-sum:before { content: url("/img/note-icon-row-sum.png"); }
.note-icon-col-remove:before { content: url("/img/note-icon-col-remove.png"); }
.note-icon-row-remove:before { content: url("/img/note-icon-row-remove.png"); }

/* ============================================
   색상 팔레트 너비 조정
   ============================================ */
.note-color .note-dropdown-menu {
    min-width: 170px;
}

/* ============================================
   에디터 내 리스트 스타일
   ============================================ */
.note-editor.note-frame .note-editing-area .note-editable ol {
    list-style: decimal;
    margin: auto;
    padding: inherit;
    -webkit-padding-start: 40px;
}

.note-editor.note-frame .note-editing-area .note-editable ul {
    list-style: inside;
    margin: auto;
    padding: inherit;
    -webkit-padding-start: 40px;
}

/* ============================================
   툴바 스타일 조정
   ============================================ */
.note-toolbar h4,
.note-editing-area h4 {
    font-size: 0.95em;
    text-align: left;
}

/* 툴바 패딩 조정 */
.note-toolbar {
    padding: 0;
    margin: 0;
}

/* ============================================
   테이블 리사이즈
   ============================================ */
.table-resizable td {
    position: relative;
}

/* ============================================
   기타 스타일 조정
   ============================================ */

/* 에디터 테두리 */
.note-editor.note-frame {
    border: 1px solid #a9a9a9;
}

/* 코드뷰 스타일 */
.note-editor.note-frame .note-editing-area .note-codable {
    font-family: Menlo, Monaco, monospace, sans-serif;
    font-size: 14px;
    color: #ccc;
    background-color: #222;
}

/* 상태바 스타일 */
.note-editor.note-frame .note-statusbar {
    background-color: #f5f5f5;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* 플레이스홀더 스타일 */
.note-placeholder {
    position: absolute;
    display: none;
    color: gray;
}

/* ============================================
   Summernote 모달 스타일 (프로젝트 통일)
   ============================================ */

/* 모달 배경 오버레이 */
.note-modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* 모달 컨텐츠 */
.note-modal .note-modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 100px auto;
    overflow: hidden;
}

/* 모달 헤더 */
.note-modal .note-modal-header {
    background: #fff;
    border-bottom: none;
    padding: 25px 30px 10px;
    text-align: center;
}

.note-modal .note-modal-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* 모달 닫기 버튼 */
.note-modal .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    color: #999;
    opacity: 1;
}

.note-modal .close:hover {
    color: #e91e63;
}

/* 모달 바디 */
.note-modal .note-modal-body {
    background: #fff;
    padding: 20px 30px 30px !important;
}

.note-modal .note-modal-body .note-form-group,
.note-modal-body .note-form-group {
    margin-bottom: 30px !important;
    padding-bottom: 10px !important;
}

/* 폼 그룹 */
.note-modal .note-form-group {
    margin-bottom: 25px !important;
}

.note-modal .note-form-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px !important;
    display: block;
}

/* 파일 선택 영역 */
.note-modal .note-group-select-from-files {
    margin-bottom: 25px !important;
}

/* 입력 필드 */
.note-modal .note-input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.note-modal .note-input:focus {
    border-color: #e91e63;
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

/* 모달 푸터 */
.note-modal .note-modal-footer {
    background: #fff;
    border-top: none;
    padding: 0 30px 25px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ============================================
   Summernote 커스텀 모달 스타일
   ============================================ */

/* 모달 오버레이 */
.sn-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: snModalFadeIn 0.2s ease-out;
}

@keyframes snModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 모달 컨테이너 */
.sn-modal-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    padding: 30px;
    position: relative;
    animation: snModalSlideIn 0.2s ease-out;
}

@keyframes snModalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 닫기 버튼 */
.sn-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.sn-modal-close:hover {
    color: var(--color-primary01, #e91e63);
}

/* 모달 제목 */
.sn-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 25px;
}

/* 모달 바디 */
.sn-modal-body {
    margin-bottom: 25px;
}

/* 폼 그룹 */
.sn-form-group {
    margin-bottom: 20px;
}

.sn-form-group:last-child {
    margin-bottom: 0;
}

.sn-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

/* 입력 필드 */
.sn-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.sn-form-input:focus {
    outline: none;
    border-color: var(--color-primary01, #e91e63);
}

/* 파일 입력 */
.sn-form-file {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 체크박스 */
.sn-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.sn-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 도움말 */
.sn-form-help {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* 버튼 영역 */
.sn-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 버튼 공통 */
.sn-modal-btn {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
    min-height: 45px;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.sn-modal-btn:hover {
    opacity: 0.85;
}

/* 확인 버튼 */
.sn-modal-btn.confirm {
    background: var(--color-primary01, #e91e63);
    color: #fff;
}

/* 취소 버튼 */
.sn-modal-btn.cancel {
    background: #fff;
    color: var(--color-primary01, #e91e63);
    border: 1px solid var(--color-primary01, #e91e63);
}

/* ============================================
   특수문자 모달 스타일
   ============================================ */
.sn-modal-specialchar {
    max-width: 360px !important;
    padding: 25px !important;
}

.sn-modal-specialchar .sn-modal-body {
    margin-bottom: 20px;
}

.sn-special-char-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
}

.sn-special-char-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
}

.sn-special-char-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sn-special-char-btn:hover {
    background: var(--color-primary01, #e91e63);
    color: #fff;
    border-color: var(--color-primary01, #e91e63);
    transform: scale(1.1);
}

.sn-special-char-btn:active {
    transform: scale(0.95);
}

/* 스크롤바 스타일 */
.sn-special-char-container::-webkit-scrollbar {
    width: 8px;
}

.sn-special-char-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sn-special-char-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.sn-special-char-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ============================================
   드롭다운 메뉴 라운드 처리
   ============================================ */
.note-dropdown-menu {
    border-radius: 8px;
    overflow: hidden;
}

/* ============================================
   색상 버튼 - 현재 색상 표시 수직 중앙 정렬
   ============================================ */
.note-current-color-button .note-recent-color {
    vertical-align: middle !important;
}

/* ============================================
   폰트 크기 드롭다운 - 각 항목 해당 크기로 표시
   ============================================ */
.dropdown-fontsize a[data-value="8"] { font-size: 8px !important; }
.dropdown-fontsize a[data-value="9"] { font-size: 9px !important; }
.dropdown-fontsize a[data-value="10"] { font-size: 10px !important; }
.dropdown-fontsize a[data-value="11"] { font-size: 11px !important; }
.dropdown-fontsize a[data-value="12"] { font-size: 12px !important; }
.dropdown-fontsize a[data-value="14"] { font-size: 14px !important; }
.dropdown-fontsize a[data-value="16"] { font-size: 16px !important; }
.dropdown-fontsize a[data-value="18"] { font-size: 18px !important; }
.dropdown-fontsize a[data-value="24"] { font-size: 24px !important; }
.dropdown-fontsize a[data-value="36"] { font-size: 36px !important; }

/* ============================================
   팝오버 스타일 (테이블, 이미지 등)
   ============================================ */
.note-popover .popover-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
}

.note-popover .popover-content .note-btn {
    border-radius: 6px;
}

.note-popover .popover-content .note-btn:hover {
    background: #fce4ec;
}

/* ============================================
   Summernote 기본 모달 스타일 (imageTitle 등)
   ============================================ */
.note-modal {
    z-index: 10050 !important;
}

.note-modal .modal-dialog {
    max-width: 400px;
    margin: 100px auto;
}

.note-modal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.note-modal .modal-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 20px 24px;
    position: relative;
}

.note-modal .modal-header .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.note-modal .modal-header .close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #999;
    opacity: 1;
    background: none;
    border: none;
    cursor: pointer;
}

.note-modal .modal-header .close:hover {
    color: #333;
}

.note-modal .modal-body {
    padding: 24px;
}

.note-modal .modal-body .form-group {
    margin-bottom: 16px;
}

.note-modal .modal-body label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.note-modal .modal-body .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.note-modal .modal-body .form-control:focus {
    outline: none;
    border-color: #ea1c5b;
    box-shadow: 0 0 0 3px rgba(234, 28, 91, 0.1);
}

.note-modal .modal-footer {
    padding: 16px 24px 24px;
    border-top: none;
    text-align: center;
}

.note-modal .modal-footer .btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.note-modal .modal-footer .btn-primary,
.note-modal .modal-footer .note-image-title-btn {
    background: #ea1c5b;
    border: none;
    color: #fff;
}

.note-modal .modal-footer .btn-primary:hover,
.note-modal .modal-footer .note-image-title-btn:hover {
    background: #d01850;
}

/* ============================================
   에디터 내 구분선(hr) 스타일
   ============================================ */
.note-editor .note-editable hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 15px 0;
    height: 0;
    display: block;
}

/* ============================================
   에디터 내 표(table) 테두리 스타일
   ============================================ */
.note-editor .note-editable table td,
.note-editor .note-editable table th {
    border: 1px solid #bbb;
}

/* ============================================
   테이블 플러그인 아이콘 (폰트 파일 대체 - 유니코드)
   ============================================ */
.note-icon-table-merge:before {
    font-family: sans-serif !important;
    content: "▢" !important; /* 셀 합치기 - 흰색 사각형 */
    font-size: 14px;
}

.note-icon-table-cell-split:before {
    font-family: sans-serif !important;
    content: "⊞" !important; /* 셀 나누기 */
    font-size: 14px;
}

.note-icon-table-margin:before {
    font-family: summernote !important;
    content: "\ea20" !important; /* margin - magic */
}

.note-icon-table-width-height-reset:before {
    font-family: summernote !important;
    content: "\ea28" !important; /* reset - rollback */
}

