/* ===== REORDER TOOL STYLES ===== */
.tool-header {
  text-align: center;
  padding: 3rem 2rem 1rem;
  background: var(--accent);
  background-size: cover;
}

.tool-title {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.tool-subtitle {
  font-size: 1.1rem;
  color: var(--secondary-light);
  max-width: 700px;
  margin: 0 auto;
}

.tool-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.tool-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 1.5rem;
}

.upload-area {
  padding: 3rem 2rem;
  text-align: center;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  margin: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.upload-area.highlight {
  border-color: var(--primary);
  background-color: rgba(225, 29, 72, 0.05);
}

.upload-icon {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

.upload-text h3 {
  font-size: 1.4rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.upload-text p {
  color: var(--secondary-light);
  margin-bottom: 1.5rem;
}

.upload-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.file-info-container {
  padding: 0 1.5rem;
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-details i {
  font-size: 2rem;
  color: var(--primary);
}

.file-name {
  font-weight: 600;
  color: var(--secondary);
}

.file-size {
  font-size: 0.9rem;
  color: var(--secondary-light);
}

.remove-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn:hover {
  background: #e9ecef;
  color: var(--primary);
}

.pages-container {
  padding: 0 1.5rem 2rem;
}

.pages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.pages-header h3 {
  color: var(--secondary);
  font-size: 1.3rem;
}

.rotation-tips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #e7f5ff;
  color: #228be6;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
}

.pages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.page-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  cursor: move;
}

.page-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.page-preview {
  height: 140px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.page-preview i {
  font-size: 2.5rem;
  color: #adb5bd;
}

.page-number {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(33, 37, 41, 0.7);
  color: white;
  text-align: center;
  padding: 0.3rem;
  font-size: 0.85rem;
}

.rotation-controls {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem;
  background: #f8f9fa;
}

.rotate-btn {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotate-btn:hover {
  background: #e9ecef;
  color: var(--primary);
}

.reorder-actions {
  text-align: center;
}

.process-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem 2.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.process-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(225, 29, 72, 0.3);
}

.process-btn:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-message {
  background: #fff3f3;
  color: #e03131;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  margin: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid #ffc9c9;
}

/* Responsive */
@media (max-width: 768px) {
  .tool-title {
    font-size: 2rem;
  }
  
  .pages-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 576px) {
  .tool-header {
    padding: 2rem 1rem 1rem;
  }
  
  .upload-area {
    padding: 2rem 1rem;
    margin: 1rem;
  }
  
  .pages-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .upload-area {
    margin: 1rem auto;
    padding: 2rem 0.5rem;
    max-width: 95vw;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .file-info-container {
    margin: 1rem auto;
    width: 100%;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .file-info-card {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 1rem auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .file-info {
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .upload-area, .file-info-container, .file-info-card {
    max-width: 99vw;
    padding: 1rem 0.2rem;
  }
}

/* Rotation indicator */
.rotation-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  background: tomato;
  /* background: rgba(225, 29, 72, 0.9); */
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: bold;
  display: none;
}

/* Visual feedback for rotations */
.page-item.rotated {
  animation: rotateHighlight 0.5s ease;
}

@keyframes rotateHighlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 5px 15px rgba(225, 29, 72, 0.3); }
  100% { transform: scale(1); }
}

/* Visual feedback for resets */
.page-item.reset {
  animation: resetHighlight 0.5s ease;
}

@keyframes resetHighlight {
  0% { background-color: #f8f9fa; }
  50% { background-color: #ebfbee; }
  100% { background-color: #fff; }
}

/* Reset all button */
.reset-all-btn {
  background: #495057;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.reset-all-btn:hover {
  background: #343a40;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reset-all-btn:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Visual feedback for reordering */
.page-item.reordered {
  animation: reorderHighlight 1s ease;
}

@keyframes reorderHighlight {
  0% { background-color: #f8f9fa; }
  50% { background-color: #e7f5ff; }
  100% { background-color: #fff; }
}

/* Reset all animation */
.pages-list.reset-all {
  animation: resetAllHighlight 1s ease;
}

@keyframes resetAllHighlight {
  0% { background-color: #f8f9fa; }
  50% { background-color: #ebfbee; }
  100% { background-color: #fff; }
}

/* Rotation controls */
.rotation-controls {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.reset-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #6c757d;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-btn:hover {
  background: #e9ecef;
  color: #e63946;
  border-color: #ced4da;
}