/* ============================================================================
   Infinity PDF Studio - PDF Merge, Split & Page Combiner Visual Canvas Styles
   Enterprise Document Workbench: Merge Multiple Files, Delete Pages, Split Chapters
   ============================================================================ */

.combiner-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  user-select: none;
}

.combiner-card {
  width: 95vw;
  max-width: 1240px;
  height: 90vh;
  max-height: 860px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: combinerPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes combinerPop {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.combiner-header {
  padding: 12px 20px;
  background: linear-gradient(90deg, #be123c, #e11d48);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.combiner-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}

.combiner-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.combiner-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Workbench Top Toolbar */
.combiner-toolbar {
  padding: 10px 20px;
  background: var(--bg-surface-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.combiner-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combiner-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combiner-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-main, #1e293b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.combiner-btn:hover:not(:disabled) {
  background: var(--bg-surface-secondary, #f1f5f9);
  border-color: #94a3b8;
}

.combiner-btn-primary {
  background: #e11d48;
  color: #ffffff;
  border-color: #be123c;
}

.combiner-btn-primary:hover:not(:disabled) {
  background: #be123c;
  color: #ffffff;
}

.combiner-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.combiner-badge {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Main Grid Canvas (Visual Combiner) */
.combiner-canvas {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-canvas, #f1f5f9);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: max-content;
  gap: 18px;
  align-content: start;
}

/* Empty State Dropzone */
.combiner-dropzone {
  grid-column: 1 / -1;
  height: 380px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: var(--bg-surface, #ffffff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.combiner-dropzone:hover,
.combiner-dropzone.dragover {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.03);
  color: #e11d48;
}

.combiner-dropzone i {
  font-size: 3rem;
  color: #e11d48;
}

.combiner-dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
}

/* Individual Page Card in Grid */
.combiner-page-card {
  position: relative;
  background: var(--bg-surface, #ffffff);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.combiner-page-card:hover {
  border-color: #e11d48;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.combiner-page-card.selected {
  border-color: #e11d48;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.02);
}

.combiner-page-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.combiner-page-thumb-wrap {
  width: 100%;
  height: 200px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.combiner-page-thumb-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.combiner-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.combiner-page-num {
  font-weight: 700;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 4px;
}

.combiner-file-tag {
  font-size: 0.65rem;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted, #64748b);
  background: var(--bg-surface-secondary, #f1f5f9);
  padding: 1px 5px;
  border-radius: 4px;
}

.combiner-page-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.combiner-card-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.combiner-card-btn:hover {
  background: var(--bg-surface-secondary, #f1f5f9);
  color: #e11d48;
}

/* Chapter Splitter Divider Marker */
.combiner-chapter-marker {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

/* Bottom Actions & Mode Bar */
.combiner-footer {
  padding: 12px 20px;
  background: var(--bg-surface, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.combiner-footer-left {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 12px;
}

.combiner-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
