/**
 * ONE RESIZER — Tool 18: PDF Page Extractor Stylesheet
 * Interactive Page Grid with Thumbnails, Range Parser, Live Stage Preview,
 * Lossless Vector Page Copying, and Responsive 2-Column Studio.
 */

/* ========================================================
   CONTAINER & WORKSPACE VIEWS
   ======================================================== */
.pdfext-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pdfext-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdfext-view.hidden {
  display: none !important;
}

/* ========================================================
   UPLOAD HERO SCREEN
   ======================================================== */
.upload-hero-card {
  background: var(--bg-card);
  border: 2px dashed var(--primary-cyan);
  border-radius: var(--radius-xl);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.upload-hero-card:hover, .upload-hero-card.dragover {
  background: rgba(22, 135, 245, 0.08);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.upload-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(22, 135, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
}
.upload-icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  fill: none;
}

.upload-heading {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.upload-subheading {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.upload-btn-fake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-cyan);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 9px 22px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px var(--primary-glow);
  margin-bottom: 14px;
  transition: var(--transition);
}
.upload-btn-fake:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}
.upload-formats-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: var(--radius-full);
}

/* ========================================================
   WORKSPACE 2-COLUMN STUDIO LAYOUT
   ======================================================== */
.pdfext-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 950px) {
  .pdfext-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Page Selection & Thumbnails */
.pdfext-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* Mini File Bar */
.pdfext-file-mini-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.pdfext-mini-info {
  min-width: 0;
}
.pdfext-mini-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.pdfext-mini-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.pdfext-btn-change {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 750;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pdfext-btn-change:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Selection Toolbar */
.pdfext-select-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pdfext-btn-group {
  display: flex;
  gap: 6px;
}
.pdfext-btn-sm {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pdfext-btn-sm:hover {
  background: var(--primary-cyan);
  color: #fff;
  border-color: var(--primary-cyan);
}

/* Range Input */
.pdfext-range-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.pdfext-range-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
}
.pdfext-range-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
  outline: none;
}
.pdfext-range-input:focus {
  border-color: var(--primary-cyan);
}

/* Summary Badge */
.pdfext-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(22, 135, 245, 0.08);
  border: 1px solid rgba(22, 135, 245, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 16px;
}
.pdfext-summary-list {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thumbnails Grid */
.pdfext-grid-container {
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  margin-bottom: 18px;
}
.pdfext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
  padding: 10px;
}
.pdfext-thumb-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.pdfext-thumb-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 135, 245, 0.5);
}
.pdfext-thumb-card.selected {
  border-color: var(--primary-cyan);
  background: rgba(22, 135, 245, 0.06);
  box-shadow: 0 4px 12px rgba(22, 135, 245, 0.2);
}
.pdfext-thumb-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: block;
}
.pdfext-thumb-meta {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.pdfext-check-badge {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: var(--bg-card);
  transition: var(--transition);
}
.pdfext-thumb-card.selected .pdfext-check-badge {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
}

/* Action Button */
.pdfext-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: var(--transition);
}
.pdfext-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.pdfext-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress Bar */
.pdfext-progress-card {
  margin-top: 18px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: none;
}
.pdfext-progress-card.active {
  display: block;
}
.pdfext-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.pdfext-progress-track {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.pdfext-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), #10b981);
  transition: width 0.2s ease;
}

/* Results Card */
.pdfext-results-card {
  margin-top: 20px;
  padding: 22px;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-xl);
  display: none;
}
.pdfext-results-card.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
.pdfext-results-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  font-weight: 900;
  color: #10b981;
  margin-bottom: 14px;
}
.pdfext-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 600px) {
  .pdfext-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.pdfext-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}
.pdfext-metric-label {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.pdfext-metric-value {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-heading);
}

.pdfext-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: #10b981;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
  margin-bottom: 10px;
}
.pdfext-download-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}
.pdfext-btn-secondary {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 12px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pdfext-btn-secondary:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* ========================================================
   RIGHT COLUMN: LIVE STAGE PREVIEW (SELECTED PAGES)
   ======================================================== */
.pdfext-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdfext-preview-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pdfext-preview-title {
  font-size: 14px;
  font-weight: 850;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdfext-preview-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdfext-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}
.pdfext-nav-btn:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #fff;
  border-color: var(--primary-cyan);
}
.pdfext-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pdfext-nav-counter {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.pdfext-canvas-stage {
  width: 100%;
  max-width: 440px;
  min-height: 440px;
  background: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.08);
}
.pdfext-preview-canvas {
  max-width: 100%;
  max-height: 480px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  border-radius: 4px;
  background: #fff;
}
