/* =========================================================
   pdf.css  –  PDF Tools 페이지 전용 스타일
   공통 스타일(레이아웃, 헤더, 광고슬롯, 카드 껍데기 등)은 common.css 참조
   ========================================================= */

:root {
    --primary:       #667eea;
    --primary-dark:  #5a6fd6;
    --primary-light: #eef0fd;
    --success:       #059669;
    --danger:        #dc2626;
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
}

/* ── 헤더 특정 포인트 (common.css의 .tool-header 확장) ── */
.tool-header h1 span {
    color: var(--primary);
}

/* ── 탭 메뉴 ────────────────────────────────────────────── */
.tabs {
    display: flex; gap: 4px; background: var(--gray-100);
    border-radius: var(--radius); padding: 4px; margin-bottom: 24px; overflow-x: auto;
}
.tab-btn {
    flex: 1; min-width: 110px; padding: 10px 14px; border: none; background: transparent;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
    color: var(--gray-600); transition: all 0.15s; white-space: nowrap;
    display: flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
}
.tab-btn:hover { color: var(--primary); background: white; }
.tab-btn.active { background: white; color: var(--primary); font-weight: 700; box-shadow: 0 1px 6px rgba(0,0,0,0.1); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── 카드 내부 요소 ──────────────────────────────────────── */
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.card-desc { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }

/* ── 파일 업로드 영역 ────────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 36px 24px;
    text-align: center; cursor: pointer; transition: all 0.2s; position: relative; background: var(--gray-50);
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.upload-icon { font-size: 38px; margin-bottom: 10px; display: block; }
.upload-label { font-size: 15px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.upload-hint  { font-size: 13px; color: var(--gray-400); }

.upload-area.has-file { border-color: var(--success); background: #f0fdf4; }
.file-name { font-size: 13px; color: var(--success); font-weight: 600; margin-top: 8px; display: none; }
.upload-area.has-file .file-name { display: block; }

/* ── 옵션 (입력창, 셀렉트) ──────────────────────────────── */
.options { margin: 18px 0; }
.option-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.option-row label { font-size: 14px; font-weight: 500; color: var(--gray-700); min-width: 100px; }
.option-row select, .option-row input[type="text"] {
    padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
    font-size: 14px; color: var(--gray-900); background: white; outline: none;
    transition: border-color 0.15s; flex: 1; font-family: inherit;
}
.option-row select:focus, .option-row input[type="text"]:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ── 버튼 (PDF 전용 사이즈/스타일) ───────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; justify-content: center; margin-top: 18px; }

/* ── 로딩 스피너 및 HTMX ─────────────────────────────────── */
.htmx-indicator { display: none; align-items: center; gap: 8px; color: var(--primary); font-size: 14px; margin-top: 14px; }
.htmx-request .htmx-indicator { display: flex; }
.manual-loading { display: none; align-items: center; gap: 8px; color: var(--primary); font-size: 14px; margin-top: 14px; }
.manual-loading.show { display: flex; }

.spinner {
    width: 18px; height: 18px; border: 2px solid var(--gray-200);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 결과 영역 및 정보 테이블 ────────────────────────────── */
.result-area { margin-top: 20px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table tr { border-bottom: 1px solid var(--gray-100); }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: 10px 12px; }
.info-table td:first-child { color: var(--gray-500); font-weight: 500; width: 140px; }
.info-table td:last-child  { color: var(--gray-900); font-weight: 600; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-top: 10px; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: var(--danger);  border: 1px solid #fecaca; }

/* ── 파일 리스트 (병합 기능용) ───────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px;
    font-size: 13px; color: var(--gray-700);
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--gray-400); flex-shrink: 0; }
.file-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.file-item-btn {
    width: 26px; height: 26px; border: 1px solid var(--gray-200); border-radius: 6px;
    background: white; cursor: pointer; font-size: 12px; display: flex;
    align-items: center; justify-content: center; color: var(--gray-600); transition: all 0.15s; padding: 0;
}
.file-item-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.file-item-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.file-item-btn.remove:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }

.merge-file-count { font-size: 13px; color: var(--gray-500); margin-top: 8px; }

/* ── 기타 유틸 (페이지 분리 예시) ───────────────────────── */
.range-examples {
    background: var(--primary-light); border-radius: 8px; padding: 10px 14px;
    margin-top: 8px; font-size: 13px; color: #4338ca; line-height: 1.7;
}
.range-examples code { background: white; padding: 1px 6px; border-radius: 4px; }

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .tab-btn { font-size: 12px; min-width: 80px; padding: 8px 10px; }
}