/* ═══════════════════════════════════════════════
   이력서/자소서 자동 생성기 v2 — 스타일시트
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&display=swap');

/* ── CSS Variables ── */
/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111127;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(124, 58, 237, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-purple: #7c3aed;
    --accent-purple-light: #a78bfa;
    --accent-blue: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #3b82f6);
    --accent-gradient-hover: linear-gradient(135deg, #8b5cf6, #60a5fa);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Mode (여성 상담사 선호 Soft Lavender Light Theme) ── */
[data-theme="light"] {
    --bg-primary: #f3f0fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f2fe;
    --bg-input: #f8f6ff;
    --border: #e2d8f6;
    --border-focus: #7c3aed;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-purple: #7c3aed;
    --accent-purple-light: #6366f1;
    --accent-blue: #6366f1;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #6366f1);
    --accent-gradient-hover: linear-gradient(135deg, #6d28d9, #4f46e5);
    --shadow-sm: 0 4px 16px rgba(124, 58, 237, 0.08);
    --shadow-md: 0 8px 24px rgba(124, 58, 237, 0.12);
    --shadow-lg: 0 12px 36px rgba(124, 58, 237, 0.15);
}

/* ── 테마 토글 버튼 ── */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-purple);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}

.app-container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ═══════════ HEADER ═══════════ */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 28px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo {
    width: 44px; height: 44px; background: var(--accent-gradient);
    border-radius: var(--radius-md); display: flex; align-items: center;
    justify-content: center; font-size: 22px;
    box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
.header-title h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.header-title p { font-size: 0.8rem; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 16px; }

.model-selector {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px 12px;
}
.model-selector label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.model-selector select {
    background: transparent; border: none; color: var(--text-primary);
    font-family: inherit; font-size: 0.8rem; cursor: pointer; outline: none; min-width: 100px;
}

/* ── Select / Option 다크모드 수정 ── */
select { background: var(--bg-input); color: var(--text-primary); }
select option { background: var(--bg-secondary); color: var(--text-primary); }

.status-indicator {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 500; border: 1px solid var(--border);
}
.status-indicator.connected { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--success); }
.status-indicator.disconnected { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--error); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-indicator.connected .status-dot { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
    0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* ═══════════ USER MODE SWITCHER BAR ═══════════ */
.user-mode-bar {
    margin-bottom: 16px;
}
.mode-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}
.mode-label-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.mode-toggle-group {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.mode-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.mode-toggle-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.mode-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}
.mode-toggle-btn.active .mode-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ═══════════ TAB BAR ═══════════ */
.tab-bar {
    display: flex; gap: 4px; padding: 5px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px;
}
.tab-btn {
    flex: 1; padding: 14px 20px; border: none; background: transparent;
    color: var(--text-secondary); font-family: inherit; font-size: 0.9rem;
    font-weight: 500; cursor: pointer; border-radius: var(--radius-md);
    transition: var(--transition); display: flex; align-items: center;
    justify-content: center; gap: 8px;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.tab-btn.active {
    background: var(--accent-gradient); color: #fff; font-weight: 600;
    box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
.tab-btn .tab-icon { font-size: 1.1rem; }

.tab-content { display: none; animation: fadeSlideUp 0.4s ease; }
.tab-content.active { display: block; }
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════ 프리셋 바 ═══════════ */
.preset-section { margin-bottom: 16px; }
.preset-bar {
    display: flex; gap: 8px; padding: 5px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.preset-btn {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border: 1px solid transparent;
    background: transparent; border-radius: var(--radius-md);
    color: var(--text-secondary); cursor: pointer;
    font-family: inherit; transition: var(--transition); text-align: left;
}
.preset-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.preset-btn.active {
    background: rgba(124,58,237,0.12); border-color: var(--accent-purple);
    color: var(--text-primary);
}
.preset-icon { font-size: 1.2rem; }
.preset-info { display: flex; flex-direction: column; }
.preset-name { font-size: 0.88rem; font-weight: 600; }
.preset-desc { font-size: 0.7rem; color: var(--text-muted); }
.preset-btn.active .preset-desc { color: var(--text-secondary); }

/* ═══════════ 문항 체크박스 바 ═══════════ */
.question-select-bar {
    display: flex; gap: 6px; margin-bottom: 16px;
    padding: 8px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.question-check {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition); flex: 1;
    min-width: 130px; justify-content: center;
}
.question-check:hover { background: var(--bg-card-hover); }
.question-check label {
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer; color: var(--text-secondary);
    white-space: nowrap; user-select: none;
}
.question-check input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px; border: 2px solid var(--border);
    border-radius: 4px; cursor: pointer; position: relative;
    transition: var(--transition); flex-shrink: 0;
}
.question-check input[type="checkbox"]:checked {
    background: var(--accent-purple); border-color: var(--accent-purple);
}
.question-check input[type="checkbox"]:checked::after {
    content: '✓'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); color: #fff;
    font-size: 12px; font-weight: 700;
}
.question-check.checked label { color: var(--text-primary); }

/* ═══════════ 문항 탭 ═══════════ */
.question-tabs {
    display: flex; gap: 4px; margin-bottom: 16px;
    overflow-x: auto; padding-bottom: 4px;
}
.q-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 18px; border: 1px solid var(--border);
    background: var(--bg-card); border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    font-family: inherit; font-size: 0.82rem; font-weight: 500;
    white-space: nowrap; transition: var(--transition);
    position: relative;
}
.q-tab:hover { border-color: rgba(124,58,237,0.3); color: var(--text-primary); }
.q-tab.active {
    background: rgba(124,58,237,0.12); border-color: var(--accent-purple);
    color: var(--text-primary); font-weight: 600;
}
.q-tab .q-tab-badge {
    font-size: 0.65rem; padding: 2px 6px;
    border-radius: 8px; font-weight: 600;
}
.q-tab .q-tab-badge.done { background: rgba(16,185,129,0.15); color: var(--success); }
.q-tab .q-tab-badge.pending { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ═══════════ 입력 패널 ═══════════ */
.input-panel {
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 28px; box-shadow: var(--shadow-sm);
}
.panel-header { margin-bottom: 24px; }
.panel-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.panel-header p { font-size: 0.82rem; color: var(--text-muted); }

.field-group { margin-bottom: 20px; }
.field-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.field-group input,
.field-group textarea,
.field-group select {
    width: 100%; padding: 12px 16px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: 0.88rem; line-height: 1.6;
    transition: var(--transition); outline: none;
}
.field-group input:focus,
.field-group textarea:focus {
    border-color: var(--border-focus); background: rgba(124,58,237,0.05);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.field-group textarea { min-height: 80px; resize: vertical; }
.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--text-muted); font-size: 0.82rem; }

.field-group input.input-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
.input-error-msg {
    font-size: 0.78rem;
    color: #f87171;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* ═══════════ 버튼 ═══════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.btn-primary {
    background: var(--accent-gradient); color: #fff;
    box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
.btn-primary:hover { background: var(--accent-gradient-hover); box-shadow: 0 6px 20px rgba(124,58,237,0.4); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.15); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent-purple); color: var(--accent-purple); background: rgba(124,58,237,0.05); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-group { display: flex; gap: 10px; margin-top: 24px; }
.btn-full { width: 100%; }

/* ═══════════ 전체 결과 영역 ═══════════ */
.all-results {
    margin-top: 20px; background: var(--bg-card);
    backdrop-filter: blur(20px); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.all-results-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.all-results-header h3 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.result-actions { display: flex; gap: 8px; }

.result-item { border-bottom: 1px solid var(--border); }
.result-item:last-child { border-bottom: none; }

.result-item-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; cursor: pointer; transition: var(--transition);
}
.result-item-header:hover { background: var(--bg-card-hover); }
.result-item-title { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.result-item-meta { display: flex; align-items: center; gap: 10px; }
.result-item-count { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.result-item-badge {
    font-size: 0.7rem; padding: 3px 8px; border-radius: 8px; font-weight: 600;
}
.result-item-badge.done { background: rgba(16,185,129,0.12); color: var(--success); }
.result-item-badge.pending { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.result-item-badge.generating { background: rgba(124,58,237,0.12); color: var(--accent-purple); }

.result-item-body {
    padding: 0 24px 16px; font-size: 0.9rem; line-height: 1.9;
    white-space: pre-wrap; word-break: keep-all;
}
.result-item-body.collapsed { display: none; }
.result-item-body .empty-text { color: var(--text-muted); font-style: italic; font-size: 0.82rem; }

.result-item-actions {
    padding: 0 24px 12px; display: flex; gap: 8px;
}
.result-item-actions.collapsed { display: none; }

/* ═══════════ 목표 글자수 선택 바 ═══════════ */
.length-select-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.length-bar-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.length-options {
    display: flex;
    gap: 6px;
}
.length-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.length-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.length-btn.active {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

/* ═══════════ 휴먼터치 수동 편집 ═══════════ */
.result-edit-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.result-edit-textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--accent-purple);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.9;
    outline: none;
    resize: vertical;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.edit-hint-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.edit-live-count {
    color: var(--accent-purple-light);
    font-weight: 700;
}

/* ═══════════ 이력서 TAB ═══════════ */
.resume-container {
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 32px; box-shadow: var(--shadow-sm);
}
.resume-section {
    margin-bottom: 32px; padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.resume-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; color: var(--text-primary);
}
.section-title .section-icon {
    width: 32px; height: 32px; display: flex; align-items: center;
    justify-content: center; background: var(--accent-gradient);
    border-radius: var(--radius-sm); font-size: 0.9rem;
}

/* ── Toggle Switch ── */
.toggle-switch {
    display: inline-flex; align-items: center; gap: 10px;
    margin-left: auto; cursor: pointer;
}
.toggle-switch .toggle-label {
    font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
}
.toggle-switch .toggle-label.on { color: var(--success); }
.toggle-track {
    width: 44px; height: 24px; background: rgba(255,255,255,0.1);
    border-radius: 12px; position: relative; cursor: pointer;
    transition: background 0.3s;
}
.toggle-track.active { background: var(--success); }
.toggle-track::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; background: #fff;
    border-radius: 50%; transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-track.active::after { transform: translateX(20px); }

.intro-content { transition: var(--transition); overflow: hidden; }
.intro-content.hidden { max-height: 0; opacity: 0; margin-top: 0; padding: 0; pointer-events: none; }

/* ── Form Grid ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .full-width { grid-column: 1 / -1; }

/* ── Dynamic Rows ── */
.dynamic-rows { display: flex; flex-direction: column; gap: 12px; }
.dynamic-row {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 16px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    animation: fadeSlideUp 0.3s ease;
}
.dynamic-row .row-fields { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dynamic-row .row-fields.career-fields { grid-template-columns: 1fr 1fr 1fr; }
.dynamic-row .row-fields .full-width { grid-column: 1 / -1; }
.btn-remove-row {
    width: 32px; height: 32px; flex-shrink: 0; margin-top: 24px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius-sm); color: var(--error); cursor: pointer;
    font-size: 1rem; transition: var(--transition); border: none;
}
.btn-remove-row:hover { background: rgba(239,68,68,0.2); }
.btn-add-row {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px; border: 1px dashed var(--border);
    border-radius: var(--radius-md); background: transparent;
    color: var(--text-muted); cursor: pointer; font-family: inherit;
    font-size: 0.82rem; transition: var(--transition); width: 100%; margin-top: 8px;
}
.btn-add-row:hover { border-color: var(--accent-purple); color: var(--accent-purple); background: rgba(124,58,237,0.05); }

.resume-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }

/* ═══════════ LOADING ═══════════ */
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-purple); animation: bounce 1.4s infinite both; }
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%,80%,100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.streaming-cursor::after { content: '▌'; color: var(--accent-purple); animation: blink 0.8s infinite; }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* ═══════════ MODAL ═══════════ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: #fff; color: #1a1a2e; width: 100%; max-width: 800px;
    max-height: 90vh; overflow-y: auto; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; background: #fff; z-index: 10;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; color: #1a1a2e; }
.modal-close {
    width: 36px; height: 36px; border: none; background: #f1f5f9;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; transition: var(--transition);
}
.modal-close:hover { background: #e2e8f0; color: #1a1a2e; }
.modal-body { padding: 32px; }
.modal-footer {
    padding: 16px 24px; border-top: 1px solid #e2e8f0;
    display: flex; gap: 12px; justify-content: center;
    position: sticky; bottom: 0; background: #fff;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-footer .btn { color: #fff; }
.modal-footer .btn-secondary { color: #1a1a2e; }

/* ── Resume Print ── */
.resume-print { font-family: 'Noto Sans KR', sans-serif; color: #1a1a2e; font-size: 13px; line-height: 1.6; }
.resume-print h1 {
    text-align: center; font-size: 22px; font-weight: 900;
    margin-bottom: 24px; letter-spacing: 8px;
    border-bottom: 3px double #1a1a2e; padding-bottom: 12px;
}
.resume-print .print-section { margin-bottom: 20px; }
.resume-print .print-section-title {
    font-size: 14px; font-weight: 700; padding: 6px 12px;
    background: #f1f5f9; border-left: 4px solid #7c3aed; margin-bottom: 12px;
}
.resume-print table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.resume-print table th, .resume-print table td {
    border: 1px solid #cbd5e1; padding: 8px 12px; text-align: left; font-size: 13px;
}
.resume-print table th { background: #f8fafc; font-weight: 600; width: 100px; text-align: center; color: #475569; }
.resume-print .print-intro { padding: 12px; border: 1px solid #cbd5e1; line-height: 1.8; white-space: pre-wrap; }

/* ═══════════ TOAST ═══════════ */
.toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 0.85rem; font-weight: 500;
    box-shadow: var(--shadow-md); z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
    .preset-bar { flex-wrap: wrap; }
    .preset-btn { flex: 1 1 45%; }
    .question-select-bar { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .app-container { padding: 12px; }
    .header { flex-direction: column; gap: 12px; padding: 16px; }
    .header-right { width: 100%; justify-content: space-between; }
    .tab-btn { padding: 10px 12px; font-size: 0.82rem; }
    .input-panel { padding: 20px; }
    .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
    .dynamic-row .row-fields, .dynamic-row .row-fields.career-fields { grid-template-columns: 1fr; }
    .resume-actions { flex-direction: column; }
    .btn-group { flex-direction: column; }
    .preset-btn { flex: 1 1 100%; }
    .question-check { flex: 1 1 45%; min-width: 110px; }
}

/* ═══════════ 사진 업로드 카드 UI/UX ═══════════ */
.personal-info-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.personal-info-fields {
    flex: 1;
}

.personal-info-photo {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.photo-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.photo-hint-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-purple-light, #a78bfa);
    background: rgba(124, 58, 237, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.photo-drop-zone {
    width: 100%;
    aspect-ratio: 3/4;
    max-height: 250px;
    border: 2px dashed rgba(124, 58, 237, 0.35);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
}

.photo-drop-zone:hover,
.photo-drop-zone.drag-over {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    text-align: center;
}

.photo-upload-icon { font-size: 2.2rem; opacity: 0.8; }
.photo-upload-text { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.photo-upload-hint { font-size: 0.72rem; color: var(--text-muted); }

.photo-previews {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.photo-preview-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.preview-img {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-arrow { color: var(--accent-purple-light, #a78bfa); font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.preview-wait { font-size: 0.72rem; color: var(--text-muted); }

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.photo-select-wrapper {
    width: 100%;
}

.photo-gender-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.photo-gender-select:hover,
.photo-gender-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.photo-btn-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-process-photo {
    flex: 1;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-process-photo:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-delete-photo {
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete-photo:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.photo-status {
    margin-top: 4px; font-size: 0.78rem; color: var(--text-secondary);
    text-align: center; padding: 8px 12px; border-radius: var(--radius-sm);
    background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.2);
}
.photo-status.success { background: rgba(16,185,129,0.12); color: var(--success); border-color: rgba(16,185,129,0.3); }
.photo-status.error { background: rgba(239,68,68,0.12); color: var(--error); border-color: rgba(239,68,68,0.3); }

.photo-features-list {
    margin-top: 12px;
    padding: 12px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-md);
}
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.feature-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.feature-col-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.feature-col.highlight .feature-col-title {
    color: var(--accent-purple-light);
}
.feature-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.feature-col ul li {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.feature-col.highlight ul li {
    color: var(--text-secondary);
}
}
.bg-color-selector {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}
.bg-color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.bg-color-btn:hover {
    transform: scale(1.15);
}
.bg-color-btn.active {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}

/* ── 이력서 인쇄 — 사진 셀 ── */
.resume-print .photo-cell {
    width: 120px; text-align: center;
    vertical-align: middle; padding: 8px;
}
.resume-print .photo-cell img {
    width: 105px; height: 140px;
    object-fit: cover; border: 1px solid #cbd5e1;
}

@media (max-width: 640px) {
    .personal-info-layout { flex-direction: column; }
    .personal-info-photo { width: 100%; max-width: 200px; margin: 0 auto; }
}

/* ═══════════ PRINT (이력서 인쇄/PDF 저장 전용) ═══════════ */
@media print {
    /* 웹 UI 요소 전체 숨김 */
    body * {
        visibility: hidden !important;
    }

    /* 미리보기 모달 및 내부 이력서 양식만 보임 설정 */
    #previewModal,
    #previewModal *,
    #previewBody,
    #previewBody * {
        visibility: visible !important;
    }

    #previewModal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        z-index: 999999 !important;
    }

    #previewModal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        border-radius: 0 !important;
    }

    #previewModal .modal-header,
    #previewModal .modal-footer,
    #previewModal .modal-close {
        display: none !important;
    }

    .resume-print {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #1e293b !important;
        font-size: 13px !important;
        box-shadow: none !important;
        border: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .resume-print h1 {
        color: #0f172a !important;
        margin-bottom: 20px !important;
        font-size: 24px !important;
    }

    .resume-print .print-section {
        margin-bottom: 20px !important;
        page-break-inside: avoid !important;
    }

    .resume-print .print-section-title {
        color: #1e293b !important;
        background: #f8fafc !important;
        border-left: 4px solid #6366f1 !important;
        font-weight: 700 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .resume-print table {
        width: 100% !important;
        border-collapse: collapse !important;
        background: #ffffff !important;
    }

    .resume-print th {
        background: #f1f5f9 !important;
        color: #334155 !important;
        border: 1px solid #cbd5e1 !important;
        font-weight: 600 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .resume-print td {
        border: 1px solid #cbd5e1 !important;
        color: #1e293b !important;
        background: #ffffff !important;
    }

    .resume-print .photo-cell img {
        border: 1px solid #cbd5e1 !important;
        object-fit: cover !important;
    }

    @page {
        size: A4 portrait;
        margin: 12mm 15mm 12mm 15mm;
    }
}
