/* =============================================
 * board-form.css
 * 글쓰기/수정 페이지 공통 스타일
 *  - 사용처: unified-write.ejs, unified-edit.ejs, admin/notices.ejs
 *  - 폼 레이아웃 + Summernote 다크 모드 커스텀
 * ============================================= */

/* 로그인 필요 안내 */
.login-required {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.login-required-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.login-required h3 {
    margin-bottom: 10px;
    color: var(--text-light);
}

.login-required p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* 폼 컨테이너 */
.write-container {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.write-form {
    padding: 0;
}

/* 행 + 라벨 */
.form-row {
    border-bottom: 1px solid var(--border);
}

.form-row label {
    display: block;
    padding: 10px 15px;
    background: var(--surface-alt);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-row .required {
    color: var(--danger, #ef4444);
    margin-left: 2px;
}

/* 제목 입력 */
.title-row {
    background: #1c2128;
}

.title-input {
    width: 100%;
    padding: 18px 15px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e6edf3;
    outline: none;
}

.title-input:focus {
    background: #22272e;
}

.title-input::placeholder {
    color: #6e7a88;
}

/* 공지 체크박스 행 */
.notice-row {
    background: #1c2128;
    padding: 12px 15px;
}

.notice-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e6edf3;
    font-size: 0.9rem;
}

.notice-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-text {
    color: #adbac7;
}

/* 일반 입력/텍스트영역 */
.form-input, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-light);
    outline: none;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* 에디터 영역 */
.editor-container {
    min-height: 400px;
}

/* 폼 하단 액션 */
.form-actions {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
}

/* ===========================
 * Summernote 다크모드 커스텀
 * =========================== */
.note-editor.note-frame {
    border: none !important;
    border-radius: 0 !important;
    background: #1e2328 !important;
}

.note-editor .note-toolbar {
    background: #2d333b !important;
    border-bottom: 1px solid #444c56 !important;
    padding: 10px !important;
}

.note-editor .note-btn-group {
    margin-right: 8px !important;
}

.note-editor .note-btn:not(.note-color-btn) {
    background: #373e47 !important;
    color: #e6edf3 !important;
    border: 1px solid #545d68 !important;
    border-radius: 4px !important;
    margin: 1px !important;
}

.note-editor .note-btn:not(.note-color-btn):hover {
    background: #4a5460 !important;
    border-color: #6e7a88 !important;
}

.note-editor .note-btn.active {
    background: #1f6feb !important;
    border-color: #1f6feb !important;
    color: #fff !important;
}

.note-editor .note-editing-area {
    background: #22272e !important;
}

.note-editor .note-editable {
    background: #22272e !important;
    color: #e6edf3;
    min-height: 350px !important;
    padding: 20px !important;
    font-size: 15px;
    line-height: 1.7;
}

.note-editor .note-editable p {
    color: inherit;
}

/* 에디터 내 비디오/iframe 반응형 */
.note-editor .note-editable .note-video-clip {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 16px 0;
    border-radius: 8px;
    background: #000;
}

.note-editor .note-editable .note-video-clip iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.note-editor .note-editable iframe,
.note-editor .note-editable video {
    max-width: 100%;
    border-radius: 8px;
}

.note-editor .note-statusbar {
    background: #2d333b !important;
    border-top: 1px solid #444c56 !important;
}

.note-editor .note-resizebar {
    background: #2d333b !important;
}

.note-editor .note-current-fontname,
.note-editor .note-current-fontsize {
    color: #e6edf3 !important;
}

/* 드롭다운 메뉴 */
.note-editor .dropdown-menu {
    background: #2d333b !important;
    border: 1px solid #444c56 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

.note-editor .dropdown-item {
    color: #e6edf3 !important;
    padding: 8px 16px !important;
}

.note-editor .dropdown-item:hover {
    background: #373e47 !important;
}

/* 색상 팔레트 */
.note-editor .note-color-palette .note-color-btn {
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 2px !important;
    width: 20px !important;
    height: 20px !important;
}

.note-editor .note-color-palette .note-color-btn:hover {
    border-color: #fff !important;
    transform: scale(1.3);
    z-index: 1;
    position: relative;
}

.note-editor .note-color .note-color-palette {
    padding: 8px !important;
}

.note-editor .note-color .dropdown-menu {
    background: #1c2128 !important;
    padding: 10px !important;
    min-width: 280px !important;
}

.note-editor .note-color .note-palette-title {
    color: #e6edf3 !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    font-size: 13px !important;
}

.note-editor .note-color .note-color-reset,
.note-editor .note-color .note-color-select {
    background: #373e47 !important;
    color: #e6edf3 !important;
    border: 1px solid #545d68 !important;
    border-radius: 4px !important;
    margin-bottom: 6px !important;
}

.note-editor .note-color .note-color-reset:hover,
.note-editor .note-color .note-color-select:hover {
    background: #4a5460 !important;
}

/* 한글 폰트 미리보기 */
.note-editor .dropdown-menu .dropdown-item[data-value="Nanum Gothic"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Nanum Gothic"] { font-family: 'Nanum Gothic', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Nanum Myeongjo"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Nanum Myeongjo"] { font-family: 'Nanum Myeongjo', serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Noto Sans KR"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Noto Sans KR"] { font-family: 'Noto Sans KR', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Black Han Sans"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Black Han Sans"] { font-family: 'Black Han Sans', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Do Hyeon"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Do Hyeon"] { font-family: 'Do Hyeon', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Jua"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Jua"] { font-family: 'Jua', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Gothic A1"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Gothic A1"] { font-family: 'Gothic A1', sans-serif !important; }
.note-editor .dropdown-menu .dropdown-item[data-value="Nanum Pen Script"],
.note-editor .dropdown-menu .note-fontname-item[data-value="Nanum Pen Script"] { font-family: 'Nanum Pen Script', cursive !important; }

/* Summernote 모달 */
.note-modal {
    z-index: 5000 !important;
}

.note-modal-backdrop {
    z-index: 4999 !important;
}

.note-modal .modal-content {
    background: #22272e !important;
    border: 1px solid #444c56 !important;
    border-radius: 8px !important;
}

.note-modal .modal-header {
    background: #2d333b !important;
    border-bottom: 1px solid #444c56 !important;
}

.note-modal .modal-title {
    color: #e6edf3 !important;
}

.note-modal .modal-body {
    background: #22272e !important;
}

.note-modal .modal-body label {
    color: #adbac7 !important;
}

.note-modal .form-control {
    background: #1c2128 !important;
    border: 1px solid #444c56 !important;
    color: #e6edf3 !important;
}

.note-modal .form-control:focus {
    border-color: #1f6feb !important;
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.3) !important;
}

.note-modal .modal-footer {
    background: #2d333b !important;
    border-top: 1px solid #444c56 !important;
}

.note-modal .close {
    color: #e6edf3 !important;
}

.note-modal .btn-primary {
    background: #1f6feb !important;
    border-color: #1f6feb !important;
}

/* 툴팁 숨김 */
.note-editor .note-tooltip {
    display: none !important;
}

/* 코드뷰 */
.note-editor .note-codable {
    background: #0d1117 !important;
    color: #c9d1d9 !important;
    font-family: 'Monaco', 'Consolas', monospace !important;
    font-size: 13px !important;
    padding: 15px !important;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .note-editor .note-toolbar {
        flex-wrap: wrap;
    }
}
