/* Promeditor — 기본 스타일 */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    color: #1a1a1a;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* ── 레이아웃 ── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── 네비게이션 ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 24px;
}

.navbar-menu a {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.navbar-menu a:hover {
    color: #4f46e5;
}

/* ── 버튼 ── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.btn-primary {
    background: #4f46e5;
    color: #fff;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ── 홈 히어로 ── */
.hero {
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 32px;
}

.hero .btn {
    margin: 0 8px;
}

/* ── 카드 ── */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.15s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.card-description {
    font-size: 14px;
    color: #6b7280;
}

/* ── 폼 ── */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* ── 푸터 ── */
footer {
    margin-top: 80px;
    padding: 24px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #9ca3af;
}

/* ── 페이지 헤더 ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 32px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

/* ── 그리드 ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ── 유틸 ── */
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.text-muted { color: #9ca3af; font-size: 14px; }
.empty-state { text-align: center; padding: 80px 0; color: #9ca3af; }

/* ── 편집기 ── */
.editor-section {
    margin-top: 32px;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.block-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 80px;
}

.block-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.block-fixed { border-left: 4px solid #6b7280; }
.block-slot  { border-left: 4px solid #4f46e5; }

.block-handle {
    cursor: grab;
    color: #d1d5db;
    font-size: 18px;
    padding-top: 4px;
    user-select: none;
}

/* 드래그 앤 드롭 스타일 */
.block-item.dragging {
    opacity: 0.4;
    border-style: dashed;
}

.block-item.block-over {
    border-color: #4f46e5;
    background: #f0f0ff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.block-body {
    flex: 1;
}

.block-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
    margin-bottom: 10px;
}

.badge-slot {
    background: #ede9fe;
    color: #4f46e5;
}

.block-remove {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.block-remove:hover { color: #ef4444; }

.slot-row {
    display: flex;
    gap: 16px;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.option-row {
    display: flex;
    gap: 8px;
}

/* ── 미리보기 ── */
.preview-box {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 120px;
    color: #374151;
}

/* ── 사용 화면 레이아웃 ── */
.use-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.slot-form-section, .preview-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── 토스트 ── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 640px) {
    .use-layout { grid-template-columns: 1fr; }
    .slot-row   { flex-direction: column; }
}

/* ── 탭 ── */
.tab-bar {
    display: flex;
    gap: 4px;
    margin: 20px 0 16px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

/* ── 검색바 ── */
.search-bar {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ── 태그/배지 ── */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-category {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-tag {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── 즐겨찾기 버튼 ── */
.fav-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #f59e0b;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.fav-btn:hover { transform: scale(1.2); }

.fav-btn.inactive { color: #f59e0b; }

/* ── 히스토리 ── */
.history-section {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.history-item:hover { background: #f3f4f6; }

.history-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}
