/* styles.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2933, #111827);
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.app {
  max-width: 1100px;
  width: 100%;
  margin: 24px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.header p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.95rem;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: flex-start;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.9rem;
}

.hint {
  font-size: 0.8rem;
  color: #9ca3af;
}

input[type="range"] {
  width: 100%;
}

select,
input[type="file"] {
  font: inherit;
}

select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
}

select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font: inherit;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
  user-select: none;
}

.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
}

.btn.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.sizes p {
  margin: 0;
  font-size: 0.9rem;
}

.preview {
  background: radial-gradient(circle at top left, #020617, #020617);
  border-radius: 14px;
  border: 1px solid #1f2937;
  padding: 14px 14px 16px;
}

.preview h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #e5e7eb;
}

.preview-box {
  position: relative;
  border-radius: 10px;
  border: 1px dashed #374151;
  background: #020617;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#previewImage {
  max-width: 100%;
  max-height: 100%;
  display: none;
  object-fit: contain;
}

#previewPlaceholder {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Vollbild Drag & Drop Overlay */

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(6px);
}

.drop-overlay.visible {
  display: flex;
}

.drop-content {
  border-radius: 18px;
  border: 2px dashed #4b5563;
  padding: 40px 60px;
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.drop-content h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.drop-content p {
  margin: 0;
  color: #9ca3af;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  border-radius: 24px;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

input:checked + .slider {
  background-color: #3b82f6;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Progressbar */
/* Progress Overlay */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.progress-box {
  background: #111827;
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #374151;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.progress-bar {
  width: 260px;
  height: 10px;
  background: #374151;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.2s ease;
}

/* Responsive */

@media (max-width: 800px) {
  .app {
    margin: 12px;
    padding: 18px 16px 20px;
  }

  .main {
    grid-template-columns: 1fr;
  }

  .preview {
    order: -1;
  }
}
