/* ── Drop zone ── */
.drop-zone {
  min-height: 220px;
  border: 2px dashed #CBD5E1;
  background: var(--surface);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  margin-bottom: 24px;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  border-style: solid;
  background: #FEF2F2;
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: #CBD5E1;
  transition: color 0.2s;
}
.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon { color: var(--primary); }
.drop-zone-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.drop-zone-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.drop-zone-formats {
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  padding: 4px 10px;
}

/* ── File card ── */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.file-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-card-icon.red   { background: #FEE2E2; color: var(--primary); }
.file-card-icon.blue  { background: #DBEAFE; color: var(--secondary); }
.file-card-icon.green { background: #D1FAE5; color: var(--success); }

.file-card-info { flex: 1; min-width: 0; }
.file-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.file-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-file-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
  flex-shrink: 0;
}

/* ── Options panel ── */
.options-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}
.options-panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 16px;
}
.option-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.option-group:last-child { margin-bottom: 0; }
.option-label { font-size: 0.875rem; font-weight: 500; color: var(--text); }

.option-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.option-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.option-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}

.option-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.option-select:focus { border-color: var(--primary); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.radio-btn:hover   { border-color: var(--primary); color: var(--primary); }
.radio-btn.active  { background: var(--primary); border-color: var(--primary); color: #fff; }

.slider-row { display: flex; align-items: center; gap: 12px; }
.range-slider { flex: 1; accent-color: var(--primary); height: 6px; cursor: pointer; }
.slider-value { font-size: 0.875rem; font-weight: 600; color: var(--text); min-width: 42px; text-align: right; }

/* ── Progress ── */
.progress-wrap { text-align: center; padding: 40px 24px; }
.progress-bar-track {
  background: var(--border);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary), #ff6b6b);
  height: 100%;
  border-radius: 100px;
  transition: width 0.35s ease;
  width: 0%;
}
.progress-bar-fill.animated { animation: progressPulse 1.4s ease-in-out infinite; }
@keyframes progressPulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

.progress-status { font-size: 0.9375rem; color: var(--muted); margin-bottom: 8px; }
.progress-warning { font-size: 0.8125rem; color: var(--muted); }

/* ── Download ready ── */
.download-ready { text-align: center; padding: 32px 24px; }
.success-icon {
  width: 64px;
  height: 64px;
  background: #D1FAE5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: popIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
.success-icon svg { color: var(--success); }
.download-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.download-meta  { font-size: 0.9375rem; color: var(--muted); margin-bottom: 24px; }
.download-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.download-actions .btn-lg { max-width: 320px; }

/* ── File list (merge/jpg-to-pdf) ── */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  cursor: grab;
  transition: all 0.15s;
}
.file-list-item:active { cursor: grabbing; }
.file-list-item.sortable-ghost   { opacity: 0.4; background: var(--primary-light); }
.file-list-item.sortable-chosen  { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: var(--primary); }

.drag-handle { color: var(--muted); cursor: grab; flex-shrink: 0; user-select: none; font-size: 1.1rem; line-height: 1; }
.file-list-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #FEE2E2;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-list-info { flex: 1; min-width: 0; }
.file-list-name {
  font-size: 0.875rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.file-list-meta { display: flex; gap: 6px; align-items: center; }
.remove-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.remove-btn:hover { background: #FEE2E2; color: var(--primary); }

/* ── Thumbnail grid (split PDF, pdf-to-jpg output) ── */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.thumbnail-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  overflow: hidden;
  transition: border-color 0.15s;
  cursor: pointer;
  position: relative;
  background: var(--surface);
}
.thumbnail-item:hover { border-color: #94A3B8; }
.thumbnail-item.selected { border-color: var(--primary); }
.thumbnail-item.selected .thumb-overlay { display: flex; }
.thumb-canvas { width: 100%; display: block; }
.thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(230,57,70,0.12);
  display: none;
  align-items: flex-start; justify-content: flex-end;
  padding: 6px;
}
.thumb-check {
  width: 24px; height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.thumb-footer {
  padding: 6px 8px;
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px;
}
.thumb-page { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.thumb-dl-btn { font-size: 0.7rem; padding: 3px 8px; }

/* ── Image thumbnail grid (jpg-to-pdf input) ── */
.image-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.image-thumb-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  transition: border-color 0.15s;
}
.image-thumb-item:hover { border-color: var(--primary); }
.image-thumb-item.sortable-ghost  { opacity: 0.4; }
.image-thumb-item.sortable-chosen { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: var(--primary); }
.image-thumb-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.image-thumb-footer {
  padding: 6px 8px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.image-thumb-name { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-thumb-remove {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  font-size: 1rem; line-height: 1; flex-shrink: 0; font-family: inherit;
}
.image-thumb-remove:hover { background: #FEE2E2; color: var(--primary); }
.drag-handle-badge {
  position: absolute; top: 5px; left: 5px;
  background: rgba(255,255,255,0.88);
  border-radius: 4px; padding: 2px 5px;
  font-size: 0.7rem; color: var(--muted); cursor: grab; line-height: 1;
  user-select: none;
}

/* ── Compression level cards ── */
.compression-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.compression-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}
.compression-card:hover   { border-color: var(--primary); }
.compression-card.selected { border-color: var(--primary); background: var(--primary-light); }
.compression-icon  { font-size: 1.75rem; display: block; margin-bottom: 8px; }
.compression-label { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.compression-desc  { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }

/* ── Split tool tabs ── */
.split-tabs {
  display: flex;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  overflow: hidden;
}
.split-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: var(--bg);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  border-right: 1px solid var(--border);
  text-align: center;
}
.split-tab:last-child { border-right: none; }
.split-tab:hover { background: var(--surface); color: var(--text); }
.split-tab.active { background: var(--primary); color: #fff; }

/* ── Selection toolbar ── */
.selection-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
}
.toolbar-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
}
.toolbar-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.toolbar-range {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 0.8125rem;
  width: 160px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.toolbar-range:focus { border-color: var(--primary); }
.toolbar-count { margin-left: auto; font-size: 0.8125rem; font-weight: 600; color: var(--text); }

/* ── PDF to Text textarea ── */
.text-stats-bar {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-input) var(--radius-input) 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.stat-item { font-weight: 500; }
.stat-item span { color: var(--text); font-weight: 600; }
.output-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  outline: none;
  display: block;
}
.output-textarea:focus { border-color: var(--border); }
.text-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-input) var(--radius-input);
  flex-wrap: wrap;
}

/* ── Print instructions (Word to PDF) ── */
.print-instructions {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
}
.print-instructions h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1E40AF;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.print-steps { display: flex; flex-direction: column; gap: 10px; list-style: none; counter-reset: ps; }
.print-step  { display: flex; gap: 12px; font-size: 0.9375rem; color: #1E40AF; counter-increment: ps; }
.print-step::before {
  content: counter(ps);
  width: 22px; height: 22px;
  background: #2563EB; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}

/* ── Add more button ── */
.add-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-input);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 16px;
}
.add-more-btn:hover { background: var(--primary-light); border-color: var(--primary); }

/* ── Summary bar ── */
.summary-bar {
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.summary-bar strong { color: var(--text); }

/* ── Tool wrapper ── */
.tool-wrapper { padding-bottom: 48px; }

/* ── Large file warning ── */
.large-file-note {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* ── Output size comparison ── */
.size-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.size-original { color: var(--muted); text-decoration: line-through; }
.size-arrow    { color: var(--muted); }
.size-new      { font-weight: 700; color: var(--success); font-size: 1.125rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .thumbnail-grid     { grid-template-columns: repeat(2, 1fr); }
  .image-thumb-grid   { grid-template-columns: repeat(2, 1fr); }
  .compression-levels { grid-template-columns: 1fr; }
  .split-tabs         { flex-direction: column; }
  .split-tab          { border-right: none; border-bottom: 1px solid var(--border); }
  .split-tab:last-child { border-bottom: none; }
  .selection-toolbar  { gap: 6px; }
}
@media (max-width: 480px) {
  .thumbnail-grid   { grid-template-columns: repeat(2, 1fr); }
  .image-thumb-grid { grid-template-columns: repeat(2, 1fr); }
  .file-list-item   { flex-wrap: wrap; }
  .toolbar-range    { width: 120px; }
}
