/**
 * v7/post/create.css - 글 생성/수정 폼 스타일 + 파일 업로드 스타일
 *
 * v7 전용 CSS. Bootstrap 미사용.
 * create.php와 update.php에서 공통 사용.
 */

/* === 폼 페이지 === */
.post-form-page {
    max-width: 100%;
}

/* === 타이틀 + 편집기 전환 버튼 헤더 === */
.post-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--wa-color-neutral-800, #1e293b);
    padding-bottom: 0.5rem;
    margin: 0.5rem 0;
    gap: 0.5rem;
}

.post-form-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--wa-color-neutral-900, #0f172a);
}

/* === 편집기 전환 링크 === */
.editor-switch-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--wa-color-neutral-800, #1e293b);
    cursor: pointer;
    white-space: nowrap;
    background: var(--wa-color-neutral-100, #f1f5f9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.editor-switch-link:hover {
    color: var(--wa-color-brand-600, #2563eb);
}

.editor-switch-link i {
    margin-right: 0.15rem;
}

.post-form-loading {
    padding: 2rem;
    text-align: center;
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.85rem;
}

.post-form-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    font-size: 0.85rem;
}

/* === 폼 === */
.post-form {
    padding: 0.5rem 0;
}

.post-form-alert {
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.post-form-group {
    margin-bottom: 0.75rem;
}

.post-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wa-color-neutral-700, #334155);
    margin-bottom: 0.25rem;
}

.post-form-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    border: 1px solid var(--wa-color-neutral-300, #cbd5e1);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}

.post-form-input:focus {
    border-color: #7f1d1d;
    box-shadow: 0 0 0 2px rgba(127, 29, 29, 0.15);
}

.post-form-textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    border: 1px solid var(--wa-color-neutral-300, #cbd5e1);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
    resize: vertical;
    min-height: 200px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
}

.post-form-textarea:focus {
    border-color: #7f1d1d;
    box-shadow: 0 0 0 2px rgba(127, 29, 29, 0.15);
}

/* === 폼 액션 버튼 (wa-button) === */
.post-form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

/* 삭제 버튼을 오른쪽 끝으로 밀기 */
.post-form-actions wa-button[variant="danger"] {
    margin-left: auto;
}


/* === 파일 업로드 컴포넌트 === */
.v7-file-upload {
    width: 100%;
}

.file-drop-zone {
    border: 2px dashed var(--wa-color-neutral-80, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--wa-color-neutral-95, #f8fafc);
}

.file-drop-zone:hover {
    border-color: var(--wa-color-brand-70, #93c5fd);
    background: var(--wa-color-brand-95, #eff6ff);
}

.file-drop-zone.drag-over {
    border-color: var(--wa-color-brand-60, #60a5fa);
    background: var(--wa-color-brand-95, #eff6ff);
    border-style: solid;
}

.file-drop-icon {
    font-size: 1.5rem;
    color: var(--wa-color-neutral-60, #94a3b8);
    margin-bottom: 0.4rem;
    display: block;
}

.file-drop-zone:hover .file-drop-icon,
.file-drop-zone.drag-over .file-drop-icon {
    color: var(--wa-color-brand-60, #60a5fa);
}

.file-drop-text {
    font-size: 0.8rem;
    color: var(--wa-color-neutral-40, #475569);
    margin-bottom: 0.25rem;
}

.file-drop-hint {
    font-size: 0.7rem;
    color: var(--wa-color-neutral-50, #64748b);
}

.file-uploading-status {
    font-size: 0.85rem;
    color: #7f1d1d;
}

.file-upload-error {
    padding: 0.4rem 0.6rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.4rem;
}

/* === 파일 미리보기 === */
.file-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.file-preview-item {
    position: relative;
    display: inline-block;
}

.file-preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.file-preview-doc {
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 4px;
    background: var(--wa-color-neutral-50, #f8fafc);
}

.file-preview-doc i {
    font-size: 1.2rem;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.file-preview-name {
    font-size: 0.55rem;
    color: var(--wa-color-neutral-500, #64748b);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.file-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    line-height: 1;
    padding: 0;
}

.file-delete-btn:hover {
    background: #b91c1c;
}

/* === Quill 에디터 wrapper === */
.post-form-quill-wrapper {
    border-radius: 4px;
    overflow: hidden;
}

/* === 관리자 옵션 === */
.post-admin-options {
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0.75rem;
    background: #eff6ff;
}

.post-form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--wa-color-neutral-700, #334155);
    cursor: pointer;
}

.post-form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--wa-color-brand-600, #2563eb);
}

/* === 포인트 광고 === */
.post-adv-section {
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 6px;
    padding: 0.75rem;
    background: var(--wa-color-neutral-50, #f8fafc);
}

.post-adv-active {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    color: var(--wa-color-brand-600, #2563eb);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-adv-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.post-adv-select {
    max-width: 220px;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.5rem !important;
}

.post-adv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--wa-color-brand-600, #2563eb);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.post-adv-btn:hover {
    background: var(--wa-color-brand-700, #1d4ed8);
}

.post-adv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.post-adv-cost {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--wa-color-neutral-500, #64748b);
}

.post-adv-cost strong {
    color: var(--wa-color-brand-600, #2563eb);
}

/* === 반응형 textarea 높이 (v6 스타일 참고) === */
@media (max-width: 991px) {
    .post-form-textarea {
        min-height: 160px;
        max-height: 420px;
    }
}

@media (min-width: 992px) {
    .post-form-textarea {
        min-height: 320px;
        max-height: 760px;
    }
}
