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

:root {
  --primary: #9333ea;
  --primary-dark: #7e22ce;
  --accent: #c084fc;
  --bg: #faf5ff;
  --surface: #fff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

h1 {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

h2 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(147, 51, 234, 0.1);
  margin-bottom: 2rem;
}

.upload-area {
  border: 3px dashed var(--accent);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  background: var(--bg);
  transition: all 0.3s;
  cursor: pointer;
  margin-bottom: 2rem;
}

.upload-area:hover {
  border-color: var(--primary);
  background: #f3e8ff;
  transform: translateY(-2px);
}

.upload-area.dragover {
  border-color: var(--primary);
  background: #e9d5ff;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.preview-section {
  margin: 2rem 0;
  text-align: center;
}

.preview-section img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s;
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  width: 100%;
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(147, 51, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid var(--bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.result-item {
  text-align: center;
}

.result-item img {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.error-message {
  background: #fee;
  color: #ef4444;
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid #ef4444;
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .form-row,
  .results-grid {
    grid-template-columns: 1fr;
  }
}

