/* ── Toolbar ── */
.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

/* ── Drop zone ── */
.pdf-drop-zone {
  border: 2px dashed #888;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 24px;
  text-align: center;
  background: #a2a2a2;
  transition: border-color 0.2s, background 0.2s;
  min-height: 200px;
  margin-bottom: 20px;
}

.pdf-drop-zone.compact {
  min-height: 80px;
  padding: 16px 24px;
}

.pdf-drop-zone.drag-over {
  border-color: red;
  background: #b5b5b5;
}

.pdf-drop-zone svg {
  width: 48px;
  height: 48px;
  color: #555;
}
.pdf-drop-zone.compact svg {
  width: 28px;
  height: 28px;
}

.pdf-drop-zone p {
  margin: 0;
  color: #333;
}

.pdf-drop-zone .hint {
  font-size: 0.85em;
  color: #555;
}

.pdf-drop-zone .or {
  font-size: 0.85em;
  color: #555;
}

/* ── Settings ── */
.pdf-settings {
  background: #a2a2a2;
  border: 1px solid #888;
  border-radius: 5px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.pdf-settings label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1em;
  cursor: pointer;
  user-select: none;
}

.pdf-settings input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.pdf-setting-desc {
  font-size: 0.85em;
  color: #555;
  margin: 4px 0 0 26px;
}

/* ── File list (locked / file-level view) ── */
.pdf-file-list {
  margin-bottom: 20px;
}

.pdf-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #a2a2a2;
  border: 1px solid #888;
  border-radius: 5px;
  padding: 10px 14px;
  margin-bottom: 4px;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
  user-select: none;
}

.pdf-file-item:hover {
  border-color: red;
}

.pdf-file-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.pdf-file-item.drag-over-item {
  border-color: red;
  background: #b5b5b5;
}

.pdf-drag-handle {
  color: #555;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.pdf-drag-handle svg {
  width: 16px;
  height: 16px;
}

.pdf-file-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 64px;
  border: 1px solid #888;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdf-thumb-loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 10px;
  background: #ccc;
}

.pdf-file-details {
  flex: 1;
  min-width: 0;
}

.pdf-file-name {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-file-meta {
  font-size: 0.85em;
  color: #555;
  margin-top: 2px;
}

.pdf-file-remove {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

.pdf-file-remove:hover {
  color: #cc0000;
  background: rgba(200, 0, 0, 0.1);
}

.pdf-file-remove svg {
  width: 16px;
  height: 16px;
}

/* ── Page-level grid (unlocked) ── */
.pdf-page-list {
  margin-bottom: 20px;
}

.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.pdf-page-card {
  background: #a2a2a2;
  border: 1px solid #888;
  border-radius: 5px;
  padding: 8px;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s, transform 0.15s;
}

.pdf-page-card:hover {
  border-color: red;
}

.pdf-page-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.pdf-page-card.drag-over-card {
  border-color: red;
  background: #b5b5b5;
}

.pdf-page-card-thumb {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  border: 1px solid #888;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-page-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdf-page-card-label {
  font-size: 0.8em;
  color: #333;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.pdf-page-card-label strong {
  font-weight: bold;
}

/* ── Progress ── */
.pdf-progress {
  margin-bottom: 20px;
}

.pdf-progress-track {
  width: 100%;
  height: 6px;
  background: #888;
  border-radius: 3px;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  background: red;
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

.pdf-progress-text {
  font-size: 0.85em;
  color: #555;
  margin-top: 8px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .pdf-file-item { padding: 8px 10px; gap: 8px; }
  .pdf-file-thumb { width: 36px; height: 48px; }
  .pdf-page-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
  .pdf-page-card { padding: 6px; }
}
