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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
}

.subtitle {
  color: #888;
  margin-top: 0.4rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #444;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #6c9;
  background: rgba(102, 204, 153, 0.05);
}

.drop-zone-content svg {
  color: #666;
  margin-bottom: 1rem;
}

.drop-zone-content p {
  font-size: 1.1rem;
  color: #ccc;
}

.hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
}

/* Loading */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #6c9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-section {
  text-align: center;
  padding: 3rem 0;
}

/* Previews */
.previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .previews {
    grid-template-columns: 1fr;
  }
}

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

.preview-card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #aaa;
  margin-bottom: 0.75rem;
}

.preview-box {
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-bottom: 0.75rem;
}

.preview-box img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.dark-bg {
  background: #222;
  /* checkerboard behind image for transparency visibility */
  background-image:
    linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.light-bg {
  background: #e0e0e0;
  background-image:
    linear-gradient(45deg, #d0d0d0 25%, transparent 25%),
    linear-gradient(-45deg, #d0d0d0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d0d0d0 75%),
    linear-gradient(-45deg, transparent 75%, #d0d0d0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  color: #fff;
  background: #333;
}

.btn:hover {
  background: #444;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #2a7a4a;
}

.btn-primary:hover {
  background: #35955b;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
}

.btn-secondary:hover {
  border-color: #666;
  color: #ccc;
}

.actions {
  text-align: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Error */
.error-text {
  color: #e66;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
}

#error-section {
  text-align: center;
  padding: 2rem 0;
}

/* Utility */
.hidden {
  display: none !important;
}
