/* Image to PDF Specific Styles */

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: start;
}

@media (max-width: 800px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-sidebar {
    order: -1; /* Show settings on top on mobile? Or bottom? Let's keep bottom usually, or top for easy access. */
  }
}

.toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.toolbar-actions {
  display: flex;
  gap: 10px;
}

/* Grid Layout */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  min-height: 200px;
  padding-bottom: 40px;
}

.img-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: grab;
  aspect-ratio: 1/1.3; /* Resemble a page */
  display: flex;
  flex-direction: column;
}

.img-card:active {
  cursor: grabbing;
}

.img-card.sortable-ghost {
  opacity: 0.4;
  background: #eef;
  border: 2px dashed #6a4cff;
}

.img-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.img-preview {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f7fb;
  padding: 8px;
  pointer-events: none; /* Let drag happen on card */
}

/* Page Number Badge */
.page-num {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  pointer-events: none;
}

/* Overlay Actions */
.card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.img-card:hover .card-actions,
.img-card:focus-within .card-actions {
  opacity: 1;
}

/* Mobile: always show actions */
@media (hover: none) {
  .card-actions { opacity: 1; }
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  color: #444;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
}
.action-btn:hover {
  background: #6a4cff;
  color: #fff;
}
.action-btn.delete:hover {
  background: #d14343;
  color: #fff;
}

/* Sidebar Specifics */
.opt-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.opt-btn:first-child { border-radius: 6px 0 0 6px; }
.opt-btn:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.opt-btn.active {
  background: #f0f0ff;
  color: #6a4cff;
  border-color: #6a4cff;
  z-index: 1;
}

.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.full-width { width: 100%; }

.mb-3 { margin-bottom: 1rem; }
