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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #222;
  --border: #333;
  --border-accent: #555;
  --text: #e5e5e5;
  --text-muted: #888;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --success: #4ade80;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px;
}

header {
  text-align: center;
  padding: 48px 0 24px;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 64px;
}

/* Dropzone */
#dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

#dropzone:hover,
#dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.04);
}

#dropzone.dragover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.08);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon {
  color: var(--text-muted);
}

.dropzone-text {
  font-size: 16px;
  font-weight: 500;
}

.dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* Actions bar */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 0;
}

.actions.hidden {
  display: none;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.file-count {
  color: var(--text-muted);
  font-size: 14px;
  margin-left: auto;
}

/* Results grid */
.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.result-card {
  display: grid;
  grid-template-columns: 80px 1fr 80px auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-info {
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-dims {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-dims .arrow {
  color: var(--success);
  margin: 0 6px;
}

.preview-after {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview-after img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 600px) {
  .result-card {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }

  .preview,
  .preview-after {
    width: 60px;
    height: 60px;
  }

  .preview-after {
    display: none;
  }
}
