/* PDF 페이지 번호 전용 스타일 */

nav { max-width: 800px; }
main { max-width: 800px; }

/* 드롭존 */
.dropzone {
  display: block;
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 2.2rem 1rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 14px;
  text-align: center;
  transition: all 0.15s;
}
.dropzone:hover,
.dropzone:focus,
.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.04);
  outline: none;
}
.dropzone[hidden] { display: none; }

.dropzone-content svg {
  color: var(--text-sub);
  margin-bottom: 0.85rem;
}
.dropzone-content p {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.dropzone-content .hint {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.file-info[hidden] { display: none; }

.file-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-pages {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--primary);
  padding: 0.2rem 0.55rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 999px;
  flex-shrink: 0;
}

.btn-remove {
  width: 28px;
  height: 28px;
  font-size: 1rem;
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* 설정 */
.config {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.config[hidden] { display: none; }

.cfg-group {
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cfg-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 0.55rem;
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.fmt-chip {
  padding: 0.4rem 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.fmt-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.fmt-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.format-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.format-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.cfg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.cfg-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cfg-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
}

.cfg-row input[type="number"],
.cfg-row select {
  padding: 0.4rem 0.55rem;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
  width: 100%;
}
.cfg-row input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.cfg-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  min-width: 0;
}

.num {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
  text-align: right;
}

.hint-inline {
  font-size: 0.7rem;
  color: var(--text-sub);
  white-space: nowrap;
}

/* 미리보기 */
.preview-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.preview-stage {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.preview-page {
  position: relative;
  width: 240px;
  height: 340px;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-line {
  height: 6px;
  background: #e8e8e8;
  border-radius: 2px;
}
.preview-line.short {
  width: 65%;
}

.preview-num {
  position: absolute;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Hiragino Sans", system-ui, sans-serif;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.preview-num[data-pos="bottom-center"] {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}
.preview-num[data-pos="bottom-left"] {
  bottom: 14px;
  left: 24px;
}
.preview-num[data-pos="bottom-right"] {
  bottom: 14px;
  right: 24px;
}
.preview-num[data-pos="top-center"] {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}
.preview-num[data-pos="top-left"] {
  top: 14px;
  left: 24px;
}
.preview-num[data-pos="top-right"] {
  top: 14px;
  right: 24px;
}

/* 액션 */
.actions {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.actions[hidden] { display: none; }

.btn-primary {
  flex: 1;
  padding: 0.7rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 48px;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 진행률 */
.progress-wrap {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.progress-wrap[hidden] { display: none; }

.progress-status {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.25s ease-out;
}

.error {
  margin-bottom: 1rem;
  padding: 0.75rem 0.95rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.85rem;
}
.error[hidden] { display: none; }

@media (max-width: 600px) {
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-row { grid-template-columns: 90px 1fr auto; }
  .preview-page { width: 200px; height: 280px; padding: 18px; }
}
