/* General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 15px;
}

.description {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
}

/* Upload Section */
.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 3px dashed #ddd;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #3498db;
  background-color: #ecf0f1;
}

.upload-area img {
  width: 80px;
  margin-bottom: 15px;
  opacity: 0.7;
}

.upload-btn {
  display: inline-block;
  background-color: #3498db;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  margin: 15px 0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.upload-btn:hover {
  background-color: #2980b9;
}

.file-name {
  margin-top: 10px;
  font-weight: bold;
  color: #2c3e50;
}

/* Preview Section */
.preview-section {
  margin-top: 30px;
}

.preview-section h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.preview-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.preview-page {
  text-align: center;
}

.page-label {
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c3e50;
}

.page-layout {
  display: flex;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.page-layout::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 1px;
  background-color: #ccc;
  z-index: 1;
}

.page {
  width: 150px;
  height: 212px; /* A4 aspect ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;
  background-color: white;
  font-size: 14px;
  color: #7f8c8d;
  position: relative;
}

/* Placeholder styling */
.placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
  color: #95a5a6;
  font-style: italic;
}

/* Buttons */
.buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.primary-btn,
.secondary-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.primary-btn {
  background-color: #2ecc71;
  color: white;
}

.primary-btn:hover {
  background-color: #27ae60;
}

.secondary-btn {
  background-color: #e74c3c;
  color: white;
}

.secondary-btn:hover {
  background-color: #c0392b;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
  display: none;
}

.spinner {
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 5px solid white;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Footer */
footer {
  text-align: center;
  margin-top: 30px;
  color: #7f8c8d;
  font-size: 14px;
}

footer .creator {
  margin-top: 5px;
  font-weight: 500;
}

footer .creator a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s;
}

footer .creator a:hover {
  color: #2980b9;
  text-decoration: underline;
}

footer .creator i {
  margin-left: 5px;
  color: #0077b5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .preview-container {
    flex-direction: column;
    align-items: center;
  }

  .page {
    width: 120px;
    height: 170px;
  }
}

/* File List */
.file-list {
  margin: 20px 0;
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
  margin-bottom: 8px;
  border-left: 3px solid #3498db;
}

.file-item-name {
  flex-grow: 1;
  margin-right: 10px;
}

.file-item-actions {
  display: flex;
  gap: 10px;
}

.file-item-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.3s;
}

.file-item-actions button:hover {
  color: #e74c3c;
}

.file-item-actions .process-btn {
  color: #3498db;
}

.file-item-actions .process-btn:hover {
  color: #2980b9;
}

/* Bulk Actions */
.bulk-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

/* Processed Files */
.processed-files {
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.processed-files h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.processed-files-list {
  margin-bottom: 20px;
}

.processed-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f0f7f4;
  border-radius: 5px;
  margin-bottom: 8px;
  border-left: 3px solid #2ecc71;
}

.processed-file-item-name {
  flex-grow: 1;
}

.download-btn {
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.download-btn:hover {
  background-color: #27ae60;
}
