/* Ensure elements with [hidden] attribute are not displayed */
[hidden] {
  display: none !important;
}

/* Global Styles */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #f0f4ff, #d9e4ff);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Container */
.container {
  width: 90%;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

/* Drop Area */
.drop-area {
  border: 2px dashed #aaa;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 20px;
  background-color: #fafafa;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.drop-area:hover {
  background-color: #f0f0f0;
}
.file-label {
  color: #0645AD;
  text-decoration: underline;
  cursor: pointer;
}
#imageUpload {
  display: none;
}

/* Process Buttons */
.process-buttons {
  margin-bottom: 20px;
}
.process-buttons button {
  padding: 10px 20px;
  margin: 10px 5px;
  border: none;
  border-radius: 4px;
  background-color: #4CAF50;
  color: #fff;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}
.process-buttons button:disabled {
  background-color: #9E9E9E;
  cursor: not-allowed;
}
.process-buttons button:hover:not(:disabled) {
  background-color: #45a049;
}

/* New Batch Button */
#newBatchBtn {
  padding: 10px 20px;
  margin: 10px 5px;
  border: none;
  border-radius: 4px;
  background-color: #4CAF50;
  color: #fff;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}
#newBatchBtn:disabled {
  background-color: #9E9E9E;
  cursor: not-allowed;
}
#newBatchBtn:hover:not(:disabled) {
  background-color: #45a049;
}

/* Thumbnails */
.thumbnails {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.thumbnail {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 24px;
  color: white;
  -webkit-text-stroke: 1px black;
  padding: 2px;
}
.delete-btn:hover {
  background: transparent !important;
  outline: none;
}

/* Processing Indicator */
.processing-indicator {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.processing-indicator p {
  margin-top: 10px;
  font-size: 16px;
  color: #333;
}
.spinner {
  margin: 20px auto;
  width: 50px;
  height: 50px;
  border: 6px solid #eee;
  border-top: 6px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Download Link */
.download-link {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #2196F3;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  width: fit-content;
}

/* About Section */
#aboutSection {
  margin: 20px 0;
  background: #f7f7f7;
  padding: 15px;
  border-radius: 4px;
  text-align: center;  /* Center the content */
}
#aboutSection summary {
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  text-align: center;
}
#aboutSection p {
  font-size: 0.95em;
  margin: 10px 0;
  text-align: center;
}

/* Footer */
footer {
  margin: 20px 0;
  text-align: center;
  color: #666;
  font-size: 0.8em;
}
footer a {
  color: #2c3e50;
  text-decoration: underline;
}

/* Responsive Styles for Mobile Screens */

/* For screens up to 768px */
@media (max-width: 768px) {
  .container {
    width: 95%;
    margin: 20px auto;
    padding: 15px;
  }
  .drop-area {
    padding: 20px;
    font-size: 14px;
  }
  .thumbnail {
    width: 90px;
    height: 90px;
  }
  .process-buttons button, #newBatchBtn {
    padding: 8px 16px;
    font-size: 0.9em;
  }
  .processing-indicator p {
    font-size: 14px;
  }
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
  .download-link {
    padding: 8px 16px;
    font-size: 0.9em;
  }
  #aboutSection summary, #aboutSection p {
    font-size: 0.9em;
  }
}

/* For screens up to 480px */
@media (max-width: 480px) {
  .drop-area {
    padding: 15px;
    font-size: 12px;
  }
  .thumbnail {
    width: 70px;
    height: 70px;
  }
  .process-buttons button, #newBatchBtn {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  .processing-indicator p {
    font-size: 12px;
  }
  .spinner {
    width: 35px;
    height: 35px;
    border-width: 3px;
  }
  .download-link {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  #aboutSection summary, #aboutSection p {
    font-size: 0.8em;
  }
}

/* For very small screens, up to 320px */
@media (max-width: 320px) {
  .container {
    width: 100%;
    margin: 10px;
    padding: 10px;
    box-sizing: border-box;
  }
  .drop-area {
    padding: 10px;
    font-size: 10px;
  }
  .thumbnail {
    width: 60px;
    height: 60px;
  }
  .process-buttons button, #newBatchBtn {
    padding: 5px 10px;
    font-size: 0.7em;
  }
  .processing-indicator p {
    font-size: 10px;
  }
  .spinner {
    width: 30px;
    height: 30px;
    border-width: 2px;
  }
  .download-link {
    padding: 5px 10px;
    font-size: 0.7em;
  }
  #aboutSection summary, #aboutSection p {
    font-size: 0.7em;
  }
}
