/* ============================================================
   PDF Lab – global overrides
   Complements Tailwind CDN (darkMode: 'class')
   ============================================================ */

/* ---- Light-mode background fix ---- */
:root {
  --bg-light: #f8fafc;
  --bg-dark:  #09090b;
  --accent:   #7c3aed; /* violet-700 */
}

/* ---- Upload zone drag-over state ---- */
.upload-zone.drag-over {
  border-color: #7c3aed;
  background-color: rgba(124, 58, 237, 0.05);
}

/* ---- File item in list ---- */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
}

.dark .file-item {
  border-color: #3f3f46;
  background: #18181b;
}

/* ---- Thumbnail grid ---- */
.page-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}

.page-thumb:hover {
  transform: scale(1.03);
}

.page-thumb img {
  width: 100%;
  height: auto;
  display: block;
  background: #e4e4e7;
}

.page-thumb .thumb-placeholder {
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #71717a;
}

.dark .page-thumb .thumb-placeholder {
  background: #27272a;
  color: #a1a1aa;
}

.page-thumb .thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
  padding: 2px 0;
}

/* selected (delete/extract) */
.page-thumb.selected {
  border-color: #ef4444;
}

.page-thumb.selected-cyan {
  border-color: #06b6d4;
}

/* rotate overlay badge */
.page-thumb .rotate-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 4px;
}

/* ---- Progress bar ---- */
.upload-progress {
  height: 4px;
  border-radius: 2px;
  background: #e4e4e7;
  overflow: hidden;
  margin-top: 6px;
}

.upload-progress-bar {
  height: 100%;
  background: #7c3aed;
  transition: width 0.2s ease;
}

/* ---- Drag handle for merge reorder ---- */
.drag-handle {
  cursor: grab;
  color: #a1a1aa;
  padding: 0 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

.file-item.dragging {
  opacity: 0.5;
}

/* ---- Scrollbar (dark mode) ---- */
.dark ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dark ::-webkit-scrollbar-track {
  background: #18181b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}
