@charset "utf-8";

/* ==========================================
   웹진 에디터 CSS
   /usr/skin/board/photothumb_webzine/css/board.css
   ========================================== */

/* CSS Variables */
:root {
    --main-red: #e54837;
    --main-dark-gray: #1a1a1a;
    --main-gray: #6b7280;
    --main-light-gray: #9ca3af;
}

/* 레이아웃 */
#editor_wrap {
    display: flex;
    min-height: 100vh;
    background: #f5f6f8;
}

/* 사이드바 */
#sidebar {
    width: 240px;
    background: var(--main-dark-gray);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar_header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar_header h1 {
    font-size: 18px;
    font-weight: 700;
}

.sidebar_header .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--main-red);
    border-radius: 4px;
}

.sidebar_nav {
    flex: 1;
    padding: 16px 12px;
}

.nav_item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav_item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav_item.active {
    background: var(--main-red);
    color: #fff;
}

.sidebar_footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.back_link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.back_link:hover {
    color: #fff;
}

/* 메인 헤더 */
.main_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.main_header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--main-dark-gray);
}

.header_actions {
    display: flex;
    gap: 12px;
}

.header_actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn_preview {
    background: #fff;
    border: 1px solid var(--main-gray) !important;
    color: var(--main-dark-gray);
}

.btn_preview:hover {
    background: #f5f6f8;
}

.btn_save {
    background: var(--main-red);
    color: #fff;
}

.btn_save:hover {
    background: #c93d2e;
}

.btn_cancel {
    background: #fff;
    border: 1px solid #e9ebef !important;
    color: var(--main-gray);
}

/* 하단 버튼 영역 */
.footer_actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.footer_actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

/* 메인 영역 */
#editor_main {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    padding-right: 320px;
}

/* 섹션 공통 */
.editor_section {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section_title {
    font-size: 16px;
    font-weight: 700;
    color: var(--main-dark-gray);
    padding: 20px 24px;
    border-bottom: 1px solid #e9ebef;
    background: #fafbfc;
}

.section_content {
    padding: 24px;
}

/* 폼 요소 */
.form_row {
    display: flex;
    gap: 20px;
}

.form_row .form_group {
    flex: 1;
}

.form_group {
    margin-bottom: 20px;
}

.form_group:last-child {
    margin-bottom: 0;
}

.form_group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--main-dark-gray);
    margin-bottom: 8px;
}

.form_group input[type="text"],
.form_group select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    font-size: 14px;
    color: var(--main-dark-gray);
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form_group input[type="text"]:focus,
.form_group select:focus {
    outline: none;
    border-color: var(--main-red);
}

/* 컬러 피커 */
.color_picker_wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color_picker_wrap input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

/* 라벨 힌트 */
.label_hint {
    font-weight: 400;
    color: var(--main-light-gray);
    font-size: 12px;
}

/* 이미지 업로드 */
.image_upload_wrap {
    position: relative;
}

.image_upload_wrap input[type="file"] {
    display: none;
}

.image_upload_wrap .upload_label {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 180px;
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}

.upload_label:hover {
    border-color: var(--main-red);
    background: rgba(229, 72, 55, 0.03);
}

.upload_icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 10px;
    color: var(--main-gray);
}

.upload_info {
    text-align: center;
}

.upload_text {
    font-size: 14px;
    font-weight: 500;
    color: var(--main-dark-gray);
    margin-bottom: 4px;
}

.upload_text span {
    color: var(--main-red);
    text-decoration: underline;
}

.upload_hint {
    font-size: 12px;
    color: var(--main-light-gray);
}

.image_preview {
    display: none;
    margin-top: 12px;
}

.image_preview.has_image {
    display: block;
}

.image_preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}

.image_preview .remove_image {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--main-red);
    background: rgba(229, 72, 55, 0.08);
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

/* 에디터 툴바 */
.editor_toolbar {
    display: flex;
    gap: 32px;
    padding: 16px 20px;
    background: #fafbfc;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar_group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar_group > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--main-gray);
    white-space: nowrap;
    margin-bottom: 0;
}

.style_buttons,
.insert_buttons {
    display: flex;
    gap: 6px;
}

.style_btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--main-gray);
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.style_btn:hover {
    border-color: var(--main-dark-gray);
    color: var(--main-dark-gray);
}

.style_btn.active {
    background: var(--main-dark-gray);
    border-color: var(--main-dark-gray);
    color: #fff;
}

.insert_btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--main-gray);
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.insert_btn:hover {
    border-color: var(--main-red);
    color: var(--main-red);
}

/* 정렬 버튼 */
.align_buttons {
    display: flex;
    gap: 4px;
}

.align_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--main-gray);
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.align_btn:hover {
    border-color: var(--main-dark-gray);
    color: var(--main-dark-gray);
}

.align_btn.active {
    background: var(--main-dark-gray);
    border-color: var(--main-dark-gray);
    color: #fff;
}

/* 출처 입력 정렬 */
.source_input_wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.source_input_wrap input[type="text"] {
    flex: 1;
}

.source_align_buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.source_align_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--main-gray);
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.source_align_btn:hover {
    border-color: var(--main-dark-gray);
    color: var(--main-dark-gray);
}

.source_align_btn.active {
    background: var(--main-dark-gray);
    border-color: var(--main-dark-gray);
    color: #fff;
}

/* 에디터 본문 */
.editor_body {
    min-height: 500px;
    padding: 24px;
    border: 1px solid #e9ebef;
    border-radius: 8px;
    background: #fff;
}

.editor_placeholder {
    color: var(--main-light-gray);
    font-size: 16px;
    pointer-events: none;
}

/* 에디터 내 요소 */
.editor_body .editor_element {
    position: relative;
    margin-bottom: 80px;
    padding-left: 30px;
}

.editor_body .editor_element:hover .element_actions,
.editor_body .editor_element:hover .drag_handle {
    opacity: 1;
}

/* 드래그 핸들 */
.drag_handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 20px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--main-light-gray);
}

.drag_handle:hover {
    color: var(--main-gray);
}

.drag_handle:active {
    cursor: grabbing;
}

/* 드래그 중인 요소 */
.editor_element.dragging {
    opacity: 0.5;
    background: #f0f0f0;
    border-radius: 4px;
}

/* 드래그 플레이스홀더 */
.drag_placeholder {
    height: 4px;
    background: var(--main-red);
    border-radius: 2px;
    margin: 10px 0;
}

/* 드래그 오버 시 요소 표시 */
.editor_element.drag_over_element {
    border-top: 2px solid var(--main-red);
}

.element_actions {
    position: absolute;
    top: 0;
    right: -40px;
    opacity: 0;
    transition: opacity 0.2s;
}

.element_actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 4px;
    cursor: pointer;
    color: var(--main-gray);
}

.element_actions button:hover {
    border-color: var(--main-red);
    color: var(--main-red);
}

/* 텍스트 입력 */
.editor_body .text_input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.8;
    color: var(--main-dark-gray);
    background: transparent;
    font-family: inherit;
}

.editor_body .text_input[data-style="p"] {
    font-size: 16px;
    font-weight: 500;
}

.editor_body .text_input[data-style="subtitle"] {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.5;
}

.editor_body .text_input[data-style="title"] {
    font-size: 24px;
    font-weight: 800;
}

/* 제목 요소 */
.editor_body .title_element {
    padding-left: 20px;
    border-left: 4px solid var(--main-red);
}

/* 구분선 */
.editor_body .separator_element {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.editor_body .separator_element .separator {
    width: 60px;
    height: 2px;
    background: var(--main-dark-gray);
}

/* 이미지 요소 */
.editor_body .image_element {
    text-align: center;
}

.editor_body .image_element img {
    max-width: 100%;
    border-radius: 4px;
}

.editor_body .image_element .caption {
    margin-top: 12px;
    font-size: 14px;
    color: var(--main-gray);
}

/* In This Article 사이드바 */
#article_nav {
    position: fixed;
    top: 32px;
    right: 32px;
    width: 260px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#article_nav h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--main-dark-gray);
    margin-bottom: 14px;
}

#article_nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#article_nav ul li {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--main-gray);
    border-left: 2px solid #e9ebef;
    cursor: pointer;
    transition: all 0.2s;
}

#article_nav ul li.active {
    background: rgba(229, 72, 55, 0.05);
    border-left-color: var(--main-red);
    color: var(--main-dark-gray);
    font-weight: 600;
}

#article_nav ul li.empty_state {
    color: var(--main-light-gray);
    font-size: 12px;
    border-left: none;
    padding-left: 0;
    cursor: default;
}

/* 모달 */
.modal_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal_overlay.show {
    display: flex;
}

.modal_content {
    width: 480px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.modal_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ebef;
}

.modal_header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--main-dark-gray);
}

.modal_close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--main-gray);
    cursor: pointer;
    border: none;
    background: none;
}

.modal_body {
    padding: 24px;
}

.modal_footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #fafbfc;
    border-top: 1px solid #e9ebef;
}

.btn_confirm {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    background: var(--main-red);
    color: #fff;
    border: none;
}

/* 드래그앤드롭 스타일 */
.editor_body.drag_over {
    background-color: #e8f4f8;
    border: 2px dashed var(--main-red);
    border-radius: 8px;
}

.editor_body.drag_over::after {
    content: '이미지를 여기에 드롭하세요';
    display: block;
    text-align: center;
    padding: 40px;
    color: var(--main-red);
    font-size: 16px;
    font-weight: 600;
}

/* 이미지 캡션 입력 */
.image_caption_input {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--main-gray);
    border: 1px solid #e9ebef;
    border-radius: 4px;
    background: #fafbfc;
}

.image_caption_input:focus {
    outline: none;
    border-color: var(--main-red);
}

/* 플로팅 툴바 (1400px 이상에서만 표시) */
#floating_toolbar {
    display: none;
}

/* 반응형 */
@media screen and (max-width: 1400px) {
    #article_nav {
        display: none;
    }
    #editor_main {
        padding-right: 32px;
    }
}

@media screen and (min-width: 1401px) {
    #floating_toolbar {
        display: block;
        position: fixed;
        top: 280px; /* article_nav 아래에 위치 */
        right: 32px;
        width: 260px;
        background: #fff;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        z-index: 99;
    }

    .floating_section {
        margin-bottom: 20px;
    }

    .floating_section:last-child {
        margin-bottom: 0;
    }

    .floating_section h4 {
        font-size: 13px;
        font-weight: 600;
        color: var(--main-gray);
        margin-bottom: 12px;
    }

    .floating_buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .floating_btn {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 500;
        color: var(--main-gray);
        background: #fafbfc;
        border: 1px solid #e9ebef;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        text-align: left;
    }

    .floating_btn:hover {
        border-color: var(--main-dark-gray);
        color: var(--main-dark-gray);
        background: #fff;
    }

    .floating_btn.active {
        background: var(--main-dark-gray);
        border-color: var(--main-dark-gray);
        color: #fff;
    }

    .floating_btn svg {
        flex-shrink: 0;
    }
}

/* ==========================================
   전시정보 섹션 (write.jsp)
   ========================================== */
#exhibition_section .exhibition_preview {
    min-height: 80px;
    background: #fafbfc;
    border: 1px solid #e9ebef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

#exhibition_section .exhibition_preview .empty_state {
    color: var(--main-gray);
    font-size: 14px;
    text-align: center;
    margin: 0;
}

#exhibition_section .exhibition_preview_content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#exhibition_section .preview_text {
    flex: 1;
}

#exhibition_section .preview_label {
    display: block;
    font-size: 12px;
    color: var(--main-red);
    margin-bottom: 4px;
}

#exhibition_section .preview_title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--main-dark-gray);
    margin-bottom: 12px;
}

#exhibition_section .preview_items {
    list-style: none;
    padding: 0;
    margin: 0;
}

#exhibition_section .preview_items li {
    font-size: 13px;
    color: var(--main-gray);
    margin-bottom: 4px;
}

#exhibition_section .preview_items .key {
    font-weight: 500;
}

#exhibition_section .preview_image {
    flex: 0 0 100px;
}

#exhibition_section .preview_image img {
    max-width: 100px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.btn_add_exhibition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--main-gray);
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn_add_exhibition:hover {
    border-color: var(--main-dark-gray);
    color: var(--main-dark-gray);
}

/* 전시정보 모달 */
.modal_exhibition {
    max-width: 600px;
}

.modal_exhibition .modal_body {
    max-height: 70vh;
    overflow-y: auto;
}

.exhibition_items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.exhibition_item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.exhibition_item .item_key {
    flex: 0 0 120px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e9ebef;
    border-radius: 6px;
}

.exhibition_item .item_value {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e9ebef;
    border-radius: 6px;
}

.exhibition_item .btn_remove_item {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--main-gray);
    background: #fafbfc;
    border: 1px solid #e9ebef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.exhibition_item .btn_remove_item:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn_add_item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 13px;
    color: var(--main-gray);
    background: #fafbfc;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn_add_item:hover {
    border-color: var(--main-dark-gray);
    color: var(--main-dark-gray);
}

/* 버튼 래퍼 (항목 추가 + 링크 추가) */
.btn_add_wrap {
    display: flex;
    gap: 8px;
}

.btn_add_wrap .btn_add_item {
    flex: 1;
}

.btn_add_link {
    color: #2563eb;
}

.btn_add_link:hover {
    border-color: #2563eb;
    color: #1d4ed8;
}

/* 링크 항목 스타일 */
.exhibition_item.link_item {
    background: #f0f9ff;
    padding: 4px;
    border-radius: 6px;
}

.exhibition_item.link_item .link_icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.exhibition_item.link_item .item_link {
    border-color: #bfdbfe;
    background: #fff;
}

.btn_delete {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
    background: #fee2e2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: auto;
}

.btn_delete:hover {
    background: #fecaca;
}
