/**
 * SMARTDOCIFY - DOCUMENT SCANNER STYLESHEET (style.css)
 * 100% Client-Side In-Browser Document Scanner
 * Responsive, Mobile-First, Touch-Friendly Design System
 */

/* ==========================================================================
   1. GLOBAL CONTAINER & PRIVACY CALLOUT
   ========================================================================== */
.scanner-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.scanner-header-block {
  margin-bottom: 1.75rem;
}

.scanner-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-pill.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-pill.badge-privacy {
  background-color: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.scanner-heading {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.scanner-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.6;
  margin: 0;
}

/* Privacy Alert Box */
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  color: #065f46;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.privacy-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-emerald);
}

.privacy-banner strong {
  font-weight: 700;
  color: #047857;
}

/* Status / Alert Callout */
.scanner-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  max-width: 420px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-main);
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.scanner-toast.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.scanner-toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.scanner-toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.scanner-toast.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.scanner-toast.toast-info {
  border-left: 4px solid var(--primary);
}

/* ==========================================================================
   2. INITIAL INPUT HUB & DROPZONE
   ========================================================================== */
.input-hub-section {
  margin-bottom: 3rem;
}

.input-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.input-method-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.input-method-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.input-method-card.primary-method {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-surface) 100%);
}

.input-method-card.primary-method:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.method-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
}

.input-method-card:hover .method-icon-circle {
  transform: scale(1.08);
  background-color: var(--primary);
  color: #ffffff;
}

.method-icon-circle svg {
  width: 28px;
  height: 28px;
}

.method-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.method-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 1rem 0;
}

.method-badge {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.5rem;
  margin-top: auto;
}

/* Drag & Drop Area */
.scanner-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.75rem 1.5rem;
  text-align: center;
  background-color: var(--bg-surface-alt);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.scanner-dropzone:hover,
.scanner-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.dropzone-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.dropzone-types {
  font-size: 0.775rem;
  color: var(--text-subtle);
  margin: 0;
  letter-spacing: 0.02em;
}

.browse-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ==========================================================================
   3. SCANNER WORKSPACE & RESULT SCREEN
   ========================================================================== */
.scanner-workspace {
  display: none; /* Shown dynamically when pages > 0 */
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 3.5rem;
}

.workspace-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.workspace-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workspace-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.pages-counter-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.workspace-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Multi-Page Thumbnails Bar */
.pages-manager-strip {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.5rem;
}

.strip-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thumbnails-scroll-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.thumbnails-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.thumbnails-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 9999px;
}

.page-thumbnail-card {
  width: 100px;
  height: 142px;
  flex-shrink: 0;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.page-thumbnail-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.page-thumbnail-card.active-page {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.page-thumbnail-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}

.thumbnail-preview-img {
  width: 100%;
  height: 108px;
  object-fit: contain;
  background-color: #0b0f19;
  display: block;
}

.thumbnail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.4rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.thumbnail-actions-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 5;
}

.page-thumbnail-card:hover .thumbnail-actions-overlay,
.page-thumbnail-card.active-page .thumbnail-actions-overlay {
  opacity: 1;
}

.mini-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background-color: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  padding: 0;
}

.mini-action-btn:hover {
  background-color: var(--primary);
}

.mini-action-btn.del-btn:hover {
  background-color: var(--accent-rose);
}

.mini-action-btn svg {
  width: 12px;
  height: 12px;
}

/* Add Page Card */
.add-page-card {
  width: 100px;
  height: 142px;
  flex-shrink: 0;
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-page-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.add-page-card svg {
  width: 24px;
  height: 24px;
}

/* ==========================================================================
   4. MAIN DOCUMENT PREVIEW VIEWPORT
   ========================================================================== */
.document-viewport-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.viewport-canvas-container {
  width: 100%;
  max-width: 960px;
  min-height: 480px;
  max-height: 720px;
  background: #1e293b;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 1rem;
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

#scanned-preview-canvas {
  max-width: 100%;
  max-height: 680px;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  display: block;
  transition: transform 0.2s ease-out;
}

/* Toolbars */
.tools-control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.tool-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tool-btn svg {
  width: 16px;
  height: 16px;
}

/* Quick Filter Selector */
.filter-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-pill {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-pill.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Primary Export & Action Bar */
.workspace-actions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left-actions,
.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Button Variants */
.btn-scanner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
}

.btn-scanner-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-scanner-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-scanner-success {
  background-color: var(--accent-emerald);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-scanner-success:hover {
  background-color: #059669;
}

.btn-scanner-secondary {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-scanner-secondary:hover {
  background-color: var(--bg-surface-alt);
  border-color: var(--border-strong);
}

.btn-scanner-danger {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--accent-rose);
}

.btn-scanner-danger:hover {
  background-color: var(--accent-rose-light);
  border-color: var(--accent-rose);
}

.btn-scanner svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   5. CAMERA SCANNER MODAL (FULLSCREEN / RESPONSIVE)
   ========================================================================== */
.camera-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  flex-direction: column;
  overflow: hidden;
}

.camera-modal-overlay.active {
  display: flex;
}

.camera-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  z-index: 20;
}

.camera-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.camera-controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.camera-icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.camera-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.camera-icon-btn.torch-active {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #0f172a;
}

.camera-viewport-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
}

#camera-video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Document Framing Guide Overlay */
.camera-frame-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  max-width: 520px;
  height: 70%;
  max-height: 720px;
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-frame-corners {
  position: absolute;
  width: 100%;
  height: 100%;
}

.corner-line {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--primary);
  border-style: solid;
}

.corner-line.top-left { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
.corner-line.top-right { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
.corner-line.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
.corner-line.bottom-right { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }

.frame-instruction {
  background-color: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.camera-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1.5rem 2rem;
  background-color: rgba(15, 23, 42, 0.85);
  z-index: 20;
}

.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 4px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all 0.15s ease-out;
}

.shutter-btn:hover {
  transform: scale(1.06);
  background-color: var(--primary-light);
}

.shutter-btn:active {
  transform: scale(0.94);
}

.shutter-btn svg {
  width: 32px;
  height: 32px;
}

/* ==========================================================================
   6. INTERACTIVE 4-CORNER CROP MODAL
   ========================================================================== */
.crop-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  flex-direction: column;
}

.crop-modal-overlay.active {
  display: flex;
}

.crop-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  z-index: 10;
}

.crop-viewport-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #090d16;
  touch-action: none;
}

#crop-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  user-select: none;
}

/* Magnifier Loupe */
.crop-magnifier-loupe {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  background-color: #000000;
  display: none;
  pointer-events: none;
  z-index: 50;
}

.crop-magnifier-loupe canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crop-magnifier-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crop-magnifier-crosshair::before,
.crop-magnifier-crosshair::after {
  content: '';
  position: absolute;
  background: var(--primary);
}

.crop-magnifier-crosshair::before {
  top: 0; left: 7px; width: 2px; height: 16px;
}
.crop-magnifier-crosshair::after {
  top: 7px; left: 0; width: 16px; height: 2px;
}

.crop-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  gap: 0.75rem;
  flex-wrap: wrap;
  z-index: 10;
}

/* ==========================================================================
   7. ADJUSTMENTS PANEL / DRAWER MODAL
   ========================================================================== */
.adjust-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.adjust-modal-overlay.active {
  display: flex;
}

.adjust-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
}

.adjust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.adjust-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.adjust-sliders-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.adjust-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.slider-val-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  min-width: 38px;
  text-align: center;
}

.adjust-range-input {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--border-strong);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.adjust-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s;
}

.adjust-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.adjust-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ==========================================================================
   8. PRINTER / SCANNER DIALOG MODAL
   ========================================================================== */
.scanner-dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.scanner-dialog-overlay.active {
  display: flex;
}

.scanner-dialog-card {
  width: 100%;
  max-width: 520px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  text-align: center;
}

.scanner-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.scanner-dialog-icon svg {
  width: 32px;
  height: 32px;
}

.scanner-dialog-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.65rem 0;
}

.scanner-dialog-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1.5rem 0;
}

.scanner-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   9. CONFIRMATION DIALOG MODAL
   ========================================================================== */
.confirm-dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.confirm-dialog-overlay.active {
  display: flex;
}

.confirm-dialog-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
  text-align: center;
}

.confirm-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--accent-rose-light);
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
}

.confirm-icon-box svg {
  width: 26px;
  height: 26px;
}

.confirm-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
}

.confirm-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.confirm-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* ==========================================================================
   10. PDF OPTIONS MODAL
   ========================================================================== */
.pdf-options-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.pdf-options-overlay.active {
  display: flex;
}

.pdf-options-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
}

.pdf-options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.pdf-options-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.pdf-form-group {
  margin-bottom: 1.25rem;
}

.pdf-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.pdf-select-input,
.pdf-text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  box-sizing: border-box;
}

.pdf-select-input:focus,
.pdf-text-input:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   11. DARK MODE OVERRIDES
   ========================================================================== */
[data-theme="dark"] .scanner-workspace {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .privacy-banner {
  background-color: rgba(6, 95, 70, 0.25);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

[data-theme="dark"] .privacy-banner strong {
  color: #6ee7b7;
}

[data-theme="dark"] .input-method-card.primary-method {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.15) 0%, var(--bg-surface) 100%);
}

[data-theme="dark"] .page-thumbnail-card {
  background-color: var(--bg-surface);
}

[data-theme="dark"] .thumbnail-footer {
  background-color: var(--bg-surface);
}

[data-theme="dark"] .adjust-card,
[data-theme="dark"] .scanner-dialog-card,
[data-theme="dark"] .confirm-dialog-card,
[data-theme="dark"] .pdf-options-card {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}

/* ==========================================================================
   12. RESPONSIVE DESIGN (MOBILE-FIRST BREAKPOINTS)
   ========================================================================== */
@media (max-width: 900px) {
  .input-methods-grid {
    grid-template-columns: 1fr;
  }

  .scanner-heading {
    font-size: 1.85rem;
  }

  .viewport-canvas-container {
    min-height: 340px;
    max-height: 480px;
  }
}

@media (max-width: 640px) {
  .workspace-top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace-actions-footer {
    flex-direction: column;
    width: 100%;
  }

  .footer-left-actions,
  .footer-right-actions {
    width: 100%;
    justify-content: stretch;
  }

  .footer-left-actions .btn-scanner,
  .footer-right-actions .btn-scanner {
    flex: 1;
    min-width: 120px;
  }

  .tools-control-bar {
    justify-content: space-between;
  }

  .tool-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
  }

  .camera-top-toolbar {
    padding: 0.75rem 1rem;
  }

  .camera-bottom-toolbar {
    padding: 1.25rem 1rem;
  }

  .shutter-btn {
    width: 64px;
    height: 64px;
  }

  .crop-bottom-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .crop-bottom-toolbar > div {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
}
