/**
 * ONE RESIZER — Tool 08: Merge PDF Stylesheet
 * Interactive Multi-PDF Combiner, Drag & Drop Reordering, Page Previews,
 * Progress Animation, and Responsive Studio Layout.
 */

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

.pdfm-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdfm-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 TOP SUMMARY BAR
   ======================================================== */
.pdfm-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pdfm-summary-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pdfm-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
}

.pdfm-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdfm-btn-add {
  background: rgba(22, 135, 245, 0.1);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.pdfm-btn-add:hover {
  background: var(--primary-cyan);
  color: #fff;
}

.pdfm-btn-clear {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 750;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.pdfm-btn-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* ========================================================
   FILE LIST / REORDER GRID
   ======================================================== */
.pdfm-files-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.pdfm-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  user-select: none;
}
.pdfm-file-item:hover {
  border-color: rgba(22, 135, 245, 0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.pdfm-file-item.dragging {
  opacity: 0.5;
  border-color: var(--primary-cyan);
  background: rgba(22, 135, 245, 0.05);
}

.pdfm-file-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pdfm-drag-handle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: grab;
  font-size: 18px;
  flex-shrink: 0;
}
.pdfm-drag-handle:active {
  cursor: grabbing;
}

.pdfm-file-index-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
  color: var(--text-heading);
  flex-shrink: 0;
}

.pdfm-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12.5px;
  flex-shrink: 0;
}

.pdfm-file-details {
  min-width: 0;
}
.pdfm-file-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}
@media (max-width: 600px) {
  .pdfm-file-title {
    max-width: 180px;
  }
}

.pdfm-file-subtext {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pdfm-badge-sub {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.pdfm-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pdfm-order-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}
.pdfm-order-btn:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #fff;
  border-color: var(--primary-cyan);
}
.pdfm-order-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pdfm-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
.pdfm-remove-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* ========================================================
   MAIN MERGE ACTION CARD
   ======================================================== */
.pdfm-action-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.pdfm-merge-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);
}
.pdfm-merge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.pdfm-merge-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

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

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

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

.pdfm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 550px) {
  .pdfm-metrics-grid {
    grid-template-columns: 1fr;
  }
}

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

.pdfm-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;
}
.pdfm-download-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.pdfm-secondary-actions {
  display: flex;
  gap: 10px;
}
.pdfm-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);
}
.pdfm-btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}
