/* Container styles */
.reorder-pdf-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.reorderPdfContainer {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

.title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1a202c;
}

/* Upload section styles */
.upload-section {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.uploadSection {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.file-input {
  padding: 1rem;
  border: 2px dashed #cbd5e0;
  border-radius: 0.5rem;
  width: 100%;
  max-width: 400px;
  transition: border-color 0.3s ease;
}

.fileInput {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.file-input:hover {
  border-color: #4a5568;
}

/* PDF workspace styles */
.pdf-workspace {
  background-color: #f7fafc;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdfWorkspace {
  margin-top: 1.5rem;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.pagesGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* PDF page styles */
.pdf-page {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.pdfPage {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
  position: relative;
  width: 220px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdf-page:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Page controls styles */
.page-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.pageControls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.pdf-page:hover .page-controls {
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  font-size: 1.25rem;
}

.controlBtn {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s;
}

.rotate-btn:hover {
  background-color: #ebf8ff;
  color: #3182ce;
  transform: rotate(45deg);
}

.rotateBtn {
  color: #007bff;
}

.delete-btn:hover {
  background-color: #fff5f5;
  color: #e53e3e;
  transform: scale(1.1);
}

.deleteBtn {
  color: #e74c3c;
}

.controlBtn:hover {
  background: #e0e0e0;
}

.drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 1.25rem;
  color: #718096;
}

.dragHandle {
  cursor: grab;
  font-size: 1.2rem;
  color: #888;
  margin-left: 0.3rem;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Action buttons styles */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.actionButtons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-btn {
  background-color: #3182ce;
  color: white;
}

.exportBtn {
  background: #007bff;
  color: #fff;
}

.export-btn:hover {
  background-color: #2c5282;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(49, 130, 206, 0.2);
}

.exportBtn:hover {
  background: #0056b3;
}

.reset-btn {
  background-color: #718096;
  color: white;
}

.resetBtn {
  background: #f0f0f0;
  color: #333;
}

.reset-btn:hover {
  background-color: #4a5568;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(113, 128, 150, 0.2);
}

.resetBtn:hover {
  background: #e0e0e0;
}

/* PDF preview styles */
.pdf-preview {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

.pdfPreview {
  margin-top: 2.2rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Loading and error states */
.loading {
  text-align: center;
  padding: 2rem;
  color: #4a5568;
}

.error {
  color: #e53e3e;
  text-align: center;
  padding: 1rem;
  background-color: #fff5f5;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }

  .pagesGrid {
    flex-direction: column;
  }

  .action-buttons {
    flex-direction: column;
  }

  .actionButtons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}