/* General Styles */
body {
  font-family: sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 20px;
  background-color: #f4f7f6;
}

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

header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

header h1 {
  color: #2c3e50;
  margin-bottom: 5px;
}

header p {
  color: #7f8c8d;
  font-size: 1em;
}

h2 {
  color: #34495e;
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

h3 {
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
}

h4 {
    color: #555;
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Removed .setup-section styles */

/* Content Area */
.content {
  margin-top: 20px;
}

/* Backend Status */
.backend-status {
    margin: 15px 0; /* Add some spacing */
}

/* Status Message Styling (used by backend status and processing status) */
.status-message {
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
}

.status-message.hidden {
  display: none;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}


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

.file-upload {
  margin-bottom: 15px;
}

.file-upload input[type="file"] {
  display: none; /* Hide default input */
}

.file-upload label {
  display: inline-block;
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

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

.images-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.image-preview-item {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.image-preview-item img {
  display: block;
  width: 100%;
  height: 100px; /* Fixed height for consistency */
  object-fit: cover; /* Crop images nicely */
}

.image-preview-item .remove-button {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: rgba(255, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.image-preview-item .remove-button:hover {
  background-color: rgba(255, 0, 0, 1);
}

/* Options Section */
.options-section {
  margin-bottom: 30px;
}

.option {
  margin-bottom: 20px;
}

.option label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.checkbox-group label {
  display: flex; /* Use flex for alignment */
  align-items: center; /* Vertically align checkbox and text */
  font-weight: normal;
  color: #333;
  cursor: pointer;
  margin-bottom: 0; /* Remove bottom margin from label itself */
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px; /* Space between checkbox and text */
}


#resolution {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 150px;
}

/* Process Button */
#process-button {
  display: block; /* Make it block level */
  width: 100%;   /* Make it full width */
  padding: 12px 20px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
  margin-top: 20px;
}

#process-button:hover:not(:disabled) {
  background-color: #27ae60;
}

#process-button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.7;
}


/* Status Container */
.status-container {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.status-container p {
  margin: 0 0 10px 0;
  font-weight: bold;
  text-align: center;
}

.progress-container {
  background-color: #e9ecef;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: #3498db;
  border-radius: 4px;
  transition: width 0.4s ease;
}


/* Results Section */
.results-section {
  margin-top: 30px;
  border-top: 2px solid #3498db;
  padding-top: 20px;
}

.results-container {
  margin-bottom: 20px;
}

.result-group {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #ccc;
}
.result-group:last-child {
    border-bottom: none;
}

.result-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.result-item {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  background-color: #fff;
}

.result-item img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
  border: 1px solid #eee;
}

.result-item a {
  display: inline-block;
  margin-top: 5px;
  font-size: 13px;
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s;
}

.result-item a:hover {
  color: #2980b9;
  text-decoration: underline;
}

.result-item.error-item {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.result-item .error-message {
    color: #721c24;
    font-size: 13px;
}


/* Action Buttons (Download Zip, Restart) */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.action-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  flex-grow: 1; /* Allow buttons to grow */
}

/* Specific button styling - can use classes or IDs */
#download-zip-button {
  background-color: #17a2b8; /* Teal */
  color: white;
}
#download-zip-button:hover {
  background-color: #138496;
}
#download-zip-button:disabled {
  background-color: #bdc3c7;
   cursor: not-allowed;
   opacity: 0.7;
}


#restart-button {
  background-color: #6c757d; /* Grey */
  color: white;
}
#restart-button:hover {
  background-color: #5a6268;
}

/* Removed shutdown button */


/* Utility Classes */
.hidden {
  display: none !important; /* Use important to override other display properties if needed */
}

/* --- Potentially Unused Modal Styles (kept from original) --- */
/* Secondary Button (used in Modal) */
.secondary-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}
.secondary-button:hover {
  background-color: #5a6268;
}
/* Primary Button (used in Modal) */
.primary-button {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  width: 48%; /* Example width from original */
}
.primary-button:hover {
  background-color: #218838;
}
/* Share Link Modal */
.modal-dialog {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5); display: flex;
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
  background-color: white; padding: 30px; border-radius: 8px;
  max-width: 600px; width: 90%;
}
.modal-content h3 { margin-bottom: 15px; color: #2c3e50; }
.share-link-container { display: flex; margin: 20px 0; }
.share-link-container input {
  flex: 1; padding: 10px; border: 1px solid #ddd;
  border-radius: 4px 0 0 4px; font-size: 14px;
}
.share-link-container button {
  padding: 10px 15px; background-color: #3498db; color: white;
  border: none; border-radius: 0 4px 4px 0; cursor: pointer;
  transition: background-color 0.3s; width: auto;
}
.share-link-container button:hover { background-color: #2980b9; }
.share-description { color: #666; font-size: 14px; margin-bottom: 20px; }
.modal-buttons { display: flex; justify-content: space-between; margin-top: 20px; }
.modal-close-button {
  background-color: #6c757d; color: white; border: none;
  padding: 10px 20px; border-radius: 4px; cursor: pointer;
  font-size: 16px; transition: background-color 0.3s; width: 48%;
}
.modal-close-button:hover { background-color: #5a6268; }
/* --- End Modal Styles --- */


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

  h1 { font-size: 1.8em; }
  h2 { font-size: 1.4em; }

  .images-preview {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
  }
  .image-preview-item img {
      height: 80px;
  }

  .checkbox-group {
      grid-template-columns: 1fr; /* Stack checkboxes vertically */
      gap: 5px;
  }

  .result-items {
      grid-template-columns: 1fr; /* Stack results vertically */
      gap: 15px;
  }

  .action-buttons {
      flex-direction: column; /* Stack action buttons */
      gap: 10px;
  }
  .action-buttons button {
      width: 100%; /* Make action buttons full width */
  }

  /* Modal adjustments from original */
  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .modal-close-button,
  .primary-button {
    width: 100%;
  }
  /* Removed media query section for .input-group */
}