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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
}

.step.active {
  display: flex;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

p {
  color: #aaa;
  margin-bottom: 1rem;
  text-align: center;
}

/* Drop Zone */
#drop-zone {
  position: relative;
  width: 100%;
  max-width: 500px;
  border: 2px dashed #444;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 1rem;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: #6c63ff;
  background: rgba(108, 99, 255, 0.05);
}

#drop-zone svg {
  color: #555;
  margin-bottom: 1rem;
}

#drop-zone p {
  color: #bbb;
}

#drop-zone .formats {
  font-size: 0.8rem;
  color: #666;
}

#file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #888;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.loading {
  background: #f0ad4e;
  animation: pulse 1.5s infinite;
}

.dot.ready {
  background: #5cb85c;
  animation: none;
}

.dot.error {
  background: #d9534f;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Progress */
.progress-section {
  width: 100%;
  max-width: 400px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: #6c63ff;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

#bg-progress-text {
  font-size: 0.85rem;
  color: #888;
}

/* Crop */
#crop-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#crop-container {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  margin-bottom: 1rem;
}

#crop-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#crop-canvas:active {
  cursor: grabbing;
}

.crop-controls {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.crop-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
}

.crop-controls input[type="range"] {
  flex: 1;
  accent-color: #6c63ff;
  height: 4px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #5a52d5;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 24px;
  background: transparent;
  color: #888;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}

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

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #333;
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

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

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

/* Result */
#result-container {
  max-width: 500px;
  width: 100%;
  margin-bottom: 1.5rem;
}

#result-preview {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}
