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

:root {
  --bg: #0a0a08;
  --fg: #f0ece0;
  --card: #1a1a14;
  --primary: #d4a843;
  --primary-light: #e8c56d;
  --primary-fg: #0a0a08;
  --muted: #13130e;
  --muted-fg: #8b8778;
  --destructive: #ef4444;
  --success: #22c55e;
  --border: rgba(212, 168, 67, 0.12);
  --input: rgba(212, 168, 67, 0.2);
  --ring: #d4a843;
  --radius: 0.75rem;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(
    ellipse at 50% 0%,
    rgba(212, 168, 67, 0.06) 0%,
    transparent 60%
  );
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

@media (min-width: 640px) {
  .container {
    padding: 64px 48px 80px;
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--fg), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.header p {
  color: var(--muted-fg);
  font-size: 0.9rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(212, 168, 67, 0.25);
  border-radius: var(--radius);
  background: var(--card);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 24px rgba(212, 168, 67, 0.08);
  background: rgba(26, 26, 20, 0.95);
}

.upload-zone.drag-over {
  border-color: var(--primary-light);
  box-shadow: 0 0 32px rgba(212, 168, 67, 0.15);
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--primary);
  opacity: 0.7;
}

.upload-zone h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg);
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-bottom: 20px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--primary-fg);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212, 168, 67, 0.3);
  transition: box-shadow 0.2s, transform 0.15s;
}

.upload-btn:hover {
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

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

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

/* Status */
.status-bar {
  margin-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-fg);
  min-height: 24px;
  transition: color 0.2s;
}

.status-bar.done {
  color: var(--success);
  font-weight: 500;
}

/* Actions bar */
.actions-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 10px;
  background: transparent;
  color: var(--primary-light);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(212, 168, 67, 0.08);
}

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

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

/* Result card */
.result-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(26, 26, 20, 0.8);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  animation: fadeInUp 0.3s ease-out both;
}

.result-card:hover {
  border-color: rgba(212, 168, 67, 0.3);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.06);
  transform: translateY(-2px);
}

.result-card .card-preview {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(
      rgba(255, 255, 255, 0.04) 0% 25%,
      transparent 0% 50%
    )
    50% / 16px 16px;
  padding: 12px;
  overflow: hidden;
}

.result-card .card-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.result-card .card-body {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.result-card .card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.result-card .card-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary-light);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  transition: background-color 0.15s, border-color 0.15s;
}

.result-card .card-download:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--primary);
}

/* Progress bar */
.progress-track {
  width: 100%;
  max-width: 320px;
  height: 4px;
  background: var(--muted);
  border-radius: 2px;
  margin: 12px auto 0;
  overflow: hidden;
  display: none;
}

.progress-track.active {
  display: block;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
