/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #f97316;
  --color-bg: #f7f7fb;
  --color-surface: #ffffff;
  --color-text: #1f2333;
  --color-text-light: #6b7280;
  --color-border: #e5e7eb;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 8px 24px rgba(31, 35, 51, 0.08);
  --shadow-hover: 0 12px 32px rgba(99, 102, 241, 0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
}

.brand i { color: var(--color-primary); }
.brand-accent { color: var(--color-secondary); }

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.main-nav a:hover { color: var(--color-primary); }

/* ===== Hero ===== */
.hero-section {
  background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 60%, #fff7ed 100%);
  padding: 80px 24px 70px;
  text-align: center;
}

.hero-inner { max-width: 760px; margin: 0 auto; }

.hero-section h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 18px;
}

.highlight { color: var(--color-primary); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: 32px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary);
  color: #fff;
  padding: 16px 36px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
  transition: transform 0.2s, background 0.2s;
}

.cta-button:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 36px;
  list-style: none;
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.hero-badges li { display: flex; align-items: center; gap: 8px; }
.hero-badges i { color: var(--color-primary); }

/* ===== Section common ===== */
.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 24px;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 40px;
}

/* ===== Tools Section (tabs) ===== */
.tools-section { background: var(--color-surface); }

.tool-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.tool-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  color: var(--color-text-light);
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.tool-tab-btn i { font-size: 0.95rem; }

.tool-tab-btn:hover { background: #e5e7eb; }

.tool-tab-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.tool-panel-desc {
  text-align: center;
  color: var(--color-text-light);
  margin-top: -20px;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* ===== Converter Section ===== */
.converter-section { background: var(--color-surface); }

.dropzone {
  border: 2.5px dashed #c7c9e6;
  border-radius: var(--radius-lg);
  background: #fafaff;
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}

.dropzone.dragover {
  border-color: var(--color-primary);
  background: #eef0ff;
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.dropzone-text { font-size: 1.05rem; margin-bottom: 6px; }
.dropzone-link { color: var(--color-primary); font-weight: 700; text-decoration: underline; }
.dropzone-hint { font-size: 0.85rem; color: var(--color-text-light); }

.dropzone-content.has-file .dropzone-icon { color: var(--color-secondary); }

/* File list panel (multi-PDF) */
.file-list-panel {
  margin-top: 24px;
  background: #fafaff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.file-list-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#file-list-count { color: var(--color-text-light); font-weight: 400; font-size: 0.9rem; }

.ghost-button-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.ghost-button-sm:hover { background: #eef0ff; }

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.file-list-item i.file-icon { color: var(--color-primary); font-size: 1.1rem; }

.file-list-item .file-item-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-item .file-item-size {
  font-size: 0.82rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

.file-list-item .file-item-status {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.file-item-status.status-waiting { color: var(--color-text-light); }
.file-item-status.status-converting { color: var(--color-secondary); }
.file-item-status.status-done { color: #16a34a; }
.file-item-status.status-error { color: #dc2626; }

.file-item-remove {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  transition: color 0.2s;
}
.file-item-remove:hover { color: #dc2626; }

/* Thumbnail grid panel (JPG->PDF, PDF merge&edit) */
.thumb-grid-panel {
  margin-top: 24px;
  background: #fafaff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.thumb-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.thumb-grid-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.thumb-grid-header h3 span { color: var(--color-text-light); font-weight: 400; font-size: 0.9rem; }

.thumb-grid-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ghost-button-sm.danger { color: #dc2626; border-color: #dc2626; }
.ghost-button-sm.danger:hover { background: #fef2f2; }

.thumb-grid-hint {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.thumb-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  padding-bottom: 8px;
  cursor: default;
  transition: box-shadow 0.15s;
}

.thumb-card.thumb-ghost {
  opacity: 0.4;
}

.thumb-order-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0 5px;
}

.thumb-kind-badge {
  position: absolute;
  top: 8px;
  left: 34px;
  background: rgba(31, 35, 51, 0.65);
  color: #fff;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.thumb-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #f3f4f6;
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.2s;
}

.thumb-drag-handle {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 35, 51, 0.55);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb-card:hover .thumb-drag-handle { opacity: 1; }
.thumb-drag-handle:active { cursor: grabbing; }

.thumb-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.thumb-remove-btn:hover { background: #b91c1c; }

.thumb-rotate-btn {
  position: absolute;
  bottom: 34px;
  right: 8px;
  background: rgba(31, 35, 51, 0.55);
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.thumb-rotate-btn:hover { background: var(--color-primary); }

.thumb-name {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-light);
  padding: 6px 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Options panel */
.options-panel {
  margin-top: 28px;
  background: #f9fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: end;
}

.option-item { display: flex; flex-direction: column; gap: 8px; }
.option-item label { font-size: 0.9rem; font-weight: 600; color: var(--color-text); }

.option-item input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.option-item select,
.option-item input[type="color"],
.option-item input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}
.option-item input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
.option-item input[type="text"] { height: 42px; }

.convert-button {
  grid-column: 1 / -1;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s;
}
.convert-button:hover { background: var(--color-primary-dark); }
.convert-button:disabled { background: #c7c9e6; cursor: not-allowed; }

/* Progress */
.progress-wrap { margin-top: 28px; }
.progress-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e9eaf5;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.25s ease;
}
.progress-text {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* Results */
.results-panel { margin-top: 32px; }
.results-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.results-header h3 {
  font-size: 1.2rem;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 8px;
}
#results-count { color: var(--color-text-light); font-weight: 400; font-size: 0.95rem; margin-left: 4px; }

.results-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.secondary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}
.secondary-button { background: var(--color-secondary); color: #fff; }
.secondary-button:hover { opacity: 0.9; }
.ghost-button { background: transparent; color: var(--color-text-light); border: 1px solid var(--color-border); }
.ghost-button:hover { background: #f3f4f6; }

.result-group { margin-bottom: 36px; }

.result-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.result-group-header i { color: var(--color-primary); flex-shrink: 0; }

.result-group-title {
  font-size: 1.02rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 160px;
}

.result-group-count {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-group-download {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.result-group-download:hover { background: #eef0ff; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.result-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}
.result-card:hover { transform: translateY(-3px); }

.result-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #f3f4f6;
  border-bottom: 1px solid var(--color-border);
}

.result-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-label { font-size: 0.85rem; font-weight: 600; color: var(--color-text); }

.result-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.result-download:hover { background: var(--color-primary-dark); }

/* ===== How it works ===== */
.how-it-works-section { background: #f7f7fb; }

.steps-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.steps-list li {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.steps-list h3 { font-size: 1.05rem; margin-bottom: 8px; }
.steps-list p { font-size: 0.9rem; color: var(--color-text-light); }

/* ===== FAQ ===== */
.faq-section { background: var(--color-surface); }

.faq-list { display: flex; flex-direction: column; gap: 14px; }

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  background: #fafaff;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 24px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p { margin-top: 12px; color: var(--color-text-light); font-size: 0.92rem; }

/* ===== Footer ===== */
.site-footer {
  background: #1f2333;
  color: #9aa0b8;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.85rem;
}

.footer-inner { max-width: 900px; margin: 0 auto; }

.footer-desc { color: #cbd0e0; margin-bottom: 16px; }

.footer-copyright {
  font-size: 0.8rem;
  color: #9aa0b8;
  padding-top: 16px;
  border-top: 1px solid rgba(203, 208, 224, 0.15);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .main-nav { display: none; }
  .hero-section h1 { font-size: 2rem; }
  .section-inner { padding: 50px 20px; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .tool-tab-btn { flex: 1 1 auto; justify-content: center; }
  .result-group-download { margin-left: 0; }
}
