/* pdf_to_img_web/style.css 를 계승 + 파일 목록·비교 팝업 추가 */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eef1f5;
  font-family: "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
  font-size: 14px;
  color: #222;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 40px 12px; }

/* 기능/사용 방법/FAQ 공용 카드 */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  margin-bottom: 16px;
}

/* 드래그 중 화면 전체 강조 — 창 아무 곳에나 드롭 가능함을 표시 */
body.drop-active::after {
  content: "";
  position: fixed;
  inset: 0;
  border: 4px dashed #0066cc;
  background: rgba(0, 102, 204, 0.07);
  pointer-events: none;
  z-index: 90; /* 비교 팝업(100)보다는 아래 */
}

h1 { font-size: 20px; margin: 0 0 4px; }

.privacy-note { margin: 0 0 18px; color: #667; font-size: 12.5px; }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.row-label { width: 100px; flex-shrink: 0; font-weight: 600; }

input[type="text"], select {
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

input[type="text"]:disabled { background: #f0f0f0; color: #999; }

input[type="range"] { flex: 1; max-width: 260px; }
input[type="range"]:disabled { opacity: 0.4; }

input.quality-value {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-weight: 600;
  color: #2e7d32;
  font-family: inherit;
  font-size: 14px;
}
input.quality-value:disabled { background: #f0f0f0; color: #999; }

.sub-note { color: #667; font-size: 12.5px; }

.hint { margin: 2px 0 12px; color: #0066cc; font-size: 12.5px; font-weight: 600; }

button {
  padding: 6px 14px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #f7f7f7;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #ececec; }
button:disabled { opacity: 0.5; cursor: default; }

button.primary {
  background: #4caf50;
  border-color: #43a047;
  color: #fff;
  font-weight: 600;
  padding: 8px 22px;
}

button.primary:hover:not(:disabled) { background: #43a047; }

.btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 4px;
  flex-wrap: wrap;
}

/* ---------- 진행 상태 ---------- */
.status-area { margin-top: 18px; text-align: center; }

#statusText {
  margin: 8px 0 0;
  font-weight: 600;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
}
.status-wait { color: #1565c0; }
.status-run { color: #2e7d32; }
.notice-success { color: #1b5e20; background: #e8f5e9; border-color: #a5d6a7; }
.notice-error { color: #b71c1c; background: #fdecea; border-color: #ef9a9a; }
.notice-warn { color: #7a4f01; background: #fff4e5; border-color: #ffcc80; }

.progress-track {
  height: 8px;
  background: #e3e6ea;
  border-radius: 4px;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0;
  background: #4caf50;
  transition: width 0.15s;
}

/* ---------- 파일 목록 ---------- */
#fileListWrap { overflow-x: auto; } /* 좁은 화면에서 표가 카드 밖으로 넘치지 않게 */

.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}

.file-table th, .file-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e6e9ee;
  text-align: left;
  white-space: nowrap;
}

.file-table th { color: #556; background: #f5f7fa; }

.col-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-name a { color: #0066cc; }

.rate-saved { color: #2e7d32; font-weight: 600; }
.rate-keep { color: #7a4f01; font-weight: 600; }
.st-done { color: #2e7d32; }
.st-error { color: #b71c1c; }

.del-btn { padding: 1px 7px; font-size: 12px; }

/* 압축 중 행에 표시되는 작은 회전 스피너 */
.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid #c8e6c9;
  border-top-color: #2e7d32;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.summary { margin: 8px 0 0; font-weight: 600; color: #333; text-align: right; }

.compare-hint { margin: 4px 0 0; color: #667; font-size: 12px; text-align: right; }

footer {
  margin-top: 28px;
  text-align: center;
  color: #667;
  font-size: 11.5px;
}

footer a { color: inherit; }

/* ---------- 사용법 / FAQ ---------- */
.guide {
  font-size: 13px;
  line-height: 1.7;
  color: #444;
}

.guide h2 { font-size: 15px; margin: 0 0 8px; color: #222; }
.guide ol { margin: 0; padding-left: 20px; }
.guide dl { margin: 0; }
.guide dt { font-weight: 600; margin-top: 8px; }
.guide dd { margin: 2px 0 0 0; color: #555; }

/* ---------- 비교 팝업 ---------- */
#compareOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.compare-box {
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px 18px;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  gap: 12px;
}

.compare-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 이미지 크기에 맞춰 줄어들도록 fit-content — 클립 경계선·슬라이더가 이미지 폭과 일치 */
.compare-stage {
  position: relative;
  overflow: hidden;
  background:
    repeating-conic-gradient(#e8e8e8 0% 25%, #fff 0% 50%) 0 0 / 20px 20px; /* 투명 배경 체커 */
  border: 1px solid #dde;
  border-radius: 6px;
  min-height: 120px;
  max-height: calc(100vh - 240px);
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-stage img {
  display: block;
  max-width: min(822px, calc(100vw - 70px)); /* compare-box 안쪽 폭 한도 */
  max-height: calc(100vh - 240px);
  object-fit: contain;
}

#compareSlider { display: block; margin: 0 auto; max-width: 100%; }

.compare-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #0066cc;
  pointer-events: none;
}

.compare-tag {
  position: absolute;
  top: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.tag-left { left: 8px; }
.tag-right { right: 8px; }

.compare-info { margin: 0; text-align: center; color: #444; font-size: 13px; }
