:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --error: #ef4444;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 12px;
}

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

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

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

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

section {
  margin-bottom: 2rem;
}

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

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--bg-card);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.drop-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.file-label {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}

.file-label:hover {
  color: var(--primary-dark);
}

/* Preview */
.preview-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  justify-content: center;
}

#canvas {
  max-width: 100%;
  border-radius: 8px;
}

.image-info {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Results */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.result-row {
  display: flex;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row .label {
  width: 120px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.result-row .value {
  flex: 1;
  font-weight: 500;
}

.result-row .value.success {
  color: var(--success);
}

.result-row .value.error {
  color: var(--error);
}

.result-row .value.time {
  color: var(--primary);
  font-family: ui-monospace, monospace;
}

.content-row {
  flex-direction: column;
  align-items: stretch;
}

.content-row .label {
  width: auto;
  margin-bottom: 0.5rem;
}

.content {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

/* Info Section */
.info-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.info-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.info-section ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.info-section li {
  color: var(--text);
}

.github-link a {
  color: var(--primary);
  text-decoration: none;
}

.github-link a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-muted);
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.75rem;
  }

  .drop-zone {
    padding: 2rem 1rem;
  }

  .result-row {
    flex-direction: column;
  }

  .result-row .label {
    width: auto;
    margin-bottom: 0.25rem;
  }
}