/**
 * ONE RESIZER — Tool 09: PDF Splitter Stylesheet
 * Interactive Visual PDF Page Splitter & Extractor
 * Page Selection Grid, Range Parsing, Multi-Page ZIP / Single PDF Extraction,
 * Light & Dark theme compatible.
 */

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

.pdfs-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdfs-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);
}

/* ========================================================
   TOP FILE METADATA BAR
   ======================================================== */
.pdfs-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pdfs-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pdfs-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.pdfs-file-meta {
  min-width: 0;
}
.pdfs-file-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.pdfs-file-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pdfs-file-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 750;
  color: var(--text-heading);
}

.pdfs-change-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 750;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.pdfs-change-btn:hover {
  background: rgba(22, 135, 245, 0.1);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* ========================================================
   SPLIT MODE SELECTOR TABS
   ======================================================== */
.pdfs-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 22px;
}
@media (max-width: 650px) {
  .pdfs-mode-tabs {
    grid-template-columns: 1fr;
  }
}

.pdfs-mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  text-align: center;
}
.pdfs-mode-tab:hover {
  color: var(--text-heading);
  background: rgba(22, 135, 245, 0.05);
}
.pdfs-mode-tab.active {
  background: var(--bg-card);
  color: var(--primary-cyan);
  box-shadow: var(--shadow-sm);
}
.pdfs-tab-title {
  font-size: 13.5px;
  font-weight: 850;
  margin-bottom: 2px;
}
.pdfs-tab-desc {
  font-size: 11px;
  opacity: 0.8;
}

/* ========================================================
   MODE CONFIG PANELS
   ======================================================== */
.pdfs-mode-panel {
  display: none;
  margin-bottom: 22px;
}
.pdfs-mode-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Page Selection Toolbar */
.pdfs-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pdfs-selection-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-heading);
}
.pdfs-selection-actions {
  display: flex;
  gap: 8px;
}
.pdfs-btn-sm {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 750;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pdfs-btn-sm:hover {
  background: rgba(22, 135, 245, 0.1);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Page Thumbnails Grid */
.pdfs-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-sizing: border-box;
}
@media (max-width: 500px) {
  .pdfs-pages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pdfs-page-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pdfs-page-card:hover {
  border-color: rgba(22, 135, 245, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.pdfs-page-card.selected {
  border-color: var(--primary-cyan);
  background: rgba(22, 135, 245, 0.06);
  box-shadow: 0 0 0 2px rgba(22, 135, 245, 0.3);
}

.pdfs-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: var(--transition);
  z-index: 2;
}
.pdfs-page-card.selected .pdfs-card-check {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #fff;
}

.pdfs-canvas-box {
  width: 100%;
  height: 150px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 8px;
}
.pdfs-canvas-box canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pdfs-page-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
}

/* Range Input Box */
.pdfs-range-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.pdfs-range-label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
  display: block;
}
.pdfs-range-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-heading);
  background: var(--bg-subtle);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  box-sizing: border-box;
  transition: var(--transition);
}
.pdfs-range-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(22, 135, 245, 0.15);
}
.pdfs-range-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Split All Info Box */
.pdfs-split-all-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.pdfs-split-all-icon {
  font-size: 36px;
  margin-bottom: 10px;
}
.pdfs-split-all-heading {
  font-size: 16px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.pdfs-split-all-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ========================================================
   MAIN SPLIT ACTION BUTTON
   ======================================================== */
.pdfs-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);
}
.pdfs-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.pdfs-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================================
   PROGRESS BAR
   ======================================================== */
.pdfs-progress-card {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: none;
}
.pdfs-progress-card.active {
  display: block;
}

.pdfs-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.pdfs-progress-track {
  width: 100%;
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.pdfs-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), #10b981);
  border-radius: 6px;
  transition: width 0.2s ease;
}

/* ========================================================
   RESULTS CARD
   ======================================================== */
.pdfs-results-card {
  margin-top: 22px;
  padding: 24px;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-xl);
  display: none;
}
.pdfs-results-card.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.pdfs-results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 900;
  color: #10b981;
  margin-bottom: 16px;
}

.pdfs-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pdfs-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
}
.pdfs-metric-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.pdfs-metric-value {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-heading);
}

.pdfs-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: #10b981;
  color: #fff;
  font-size: 15.5px;
  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: 12px;
}
.pdfs-download-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Multi-file Results List (Split Every Page) */
.pdfs-split-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.pdfs-split-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  gap: 10px;
}
.pdfs-split-file-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdfs-split-file-size {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}
.pdfs-btn-download-single {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid #10b981;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.pdfs-btn-download-single:hover {
  background: #10b981;
  color: #fff;
}

.pdfs-secondary-actions {
  display: flex;
  gap: 10px;
}
.pdfs-btn-secondary {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pdfs-btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}
