/*
 * This CSS provides a clean, modern, and user-friendly style for an Images to PDF conversion page.
 * All styles are scoped to the `.imagetopdf-body` class to prevent affecting the rest of the site.
 */

/* --- Tool Body Styles --- */
.imagetopdf-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
  margin: 0;
  padding: 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
  height: 100vh;
}

/* --- Main Container & Layout --- */
.imagetopdf-body .merge-container {

  width: 100%;
  max-width: 900px;
  padding: 2.5rem 3rem;
  text-align: center;
}

/* --- Header Section --- */
.imagetopdf-body .tool-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #5b21b6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.imagetopdf-body .tool-header h1 i {
  color: #5b21b6;
  font-size: 2.5rem;
}

.imagetopdf-body .tool-header p {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* --- Upload Section --- */
.imagetopdf-body .upload-section {
  border: 3px dashed #e5e7eb;
  border-radius: 1rem;
  padding: 3rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.imagetopdf-body .upload-section:hover,
.imagetopdf-body .upload-section.highlight {
  border-color: #5b21b6;
  background-color: #c4b5fd;
}

.imagetopdf-body .drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.imagetopdf-body .drop-content .bi-folder-plus {
  font-size: 4rem;
  color: #5b21b6;
  margin-bottom: 0.5rem;
}

.imagetopdf-body .drop-content p {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4c1d95;
  margin: 0;
}

.imagetopdf-body .drop-content span {
  font-size: 1rem;
  color: #6b7280;
  font-weight: 500;
}

/* --- Options & Preview Container --- */
.imagetopdf-body .options-and-preview {
  margin-bottom: 2rem;
}

.imagetopdf-body .options {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 2rem;
}

.imagetopdf-body .radio-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.imagetopdf-body .sortable-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  min-height: 100px;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
}

.imagetopdf-body .preview-item {
  position: relative;
  width: 120px;
  height: 160px;
  border: 2px solid #5b21b6;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.imagetopdf-body .preview-item:active {
  cursor: grabbing;
}

.imagetopdf-body .preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-in-out;
}

.imagetopdf-body .rotate-btn,
.imagetopdf-body .close-btn {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imagetopdf-body .rotate-btn {
  bottom: 5px;
  left: 5px;
}

.imagetopdf-body .close-btn {
  top: 5px;
  right: 5px;
}

/* --- Status Messages --- */
.imagetopdf-body .status-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.5rem;
}

.imagetopdf-body .status-message .spinner {
  border: 4px solid #e5e7eb;
  border-top: 4px solid #5b21b6;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.imagetopdf-body .status-message .success-icon {
  color: #10b981;
  font-size: 1.5rem;
}

.imagetopdf-body .status-message.error {
  color: #ef4444;
  font-weight: 600;
}

/* --- Action Buttons --- */
.imagetopdf-body .action-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.imagetopdf-body .btn {
  padding: 1rem 2rem;
  border-radius: 9999px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  justify-content: center;
  border: none;
}

.imagetopdf-body .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.imagetopdf-body .btn-convert {
  background-color: #5b21b6;
  color: #ffffff;
}

.imagetopdf-body .btn-convert:disabled {
  background-color: #e5e7eb;
  cursor: not-allowed;
  color: #6b7280;
}

.imagetopdf-body .btn-download {
  background-color: #10b981;
  color: #ffffff;
}

.imagetopdf-body .btn-download i,
.imagetopdf-body .btn-convert i {
  margin-left: 0.5rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .imagetopdf-body .merge-container {
    padding: 2rem 1.5rem;
  }
  
  .imagetopdf-body .tool-header h1 {
    font-size: 1.75rem;
  }
  
  .imagetopdf-body .tool-header p {
    font-size: 1rem;
  }
  
  .imagetopdf-body .options {
    flex-direction: column;
    gap: 1rem;
  }
}