@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --ink: #0f172a;
  --edge: #1e293b;
  --accent: #f15b2a;
  --accent-2: #ffb703;
  --surface: #f8fafc;
  --surface-strong: #ffffff;
  --muted: #e2e8f0;
  --muted-2: #cbd5e1;
  --glow: rgba(241, 91, 42, 0.18);
  --bg-gradient: radial-gradient(circle at 20% 20%, rgba(255, 183, 3, 0.18), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(241, 91, 42, 0.18), transparent 30%),
    linear-gradient(135deg, #ffffff, #f7f9fc);
}

body[data-theme="dark"] {
  --ink: #e2e8f0;
  --edge: #cbd5e1;
  --accent: #f472b6;
  --accent-2: #f97316;
  --surface: #0f172a;
  --surface-strong: #111827;
  --muted: #1f2937;
  --muted-2: #334155;
  --glow: rgba(244, 114, 182, 0.22);
  --bg-gradient: radial-gradient(circle at 20% 20%, rgba(244, 114, 182, 0.14), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(249, 115, 22, 0.16), transparent 30%),
    linear-gradient(135deg, #0b1220, #111827);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gradient);
  color: var(--ink);
  padding: 48px 16px 64px;
  transition: background 0.3s ease, color 0.2s ease;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface-strong);
  border: 1px solid var(--muted);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header {
  padding: 28px 32px 12px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(241, 91, 42, 0.1);
  color: var(--edge);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.title {
  margin: 14px 0 6px;
  font-size: 32px;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0;
  color: #4b5563;
  max-width: 820px;
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  padding: 0 32px 32px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.dropzone {
  border: 1.5px dashed var(--muted-2);
  border-radius: 14px;
  padding: 26px;
  background: var(--surface-strong);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(241, 91, 42, 0.08);
  transform: translateY(-2px);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(241, 91, 42, 0.05);
}

.dropzone h3 {
  margin: 10px 0 6px;
  letter-spacing: -0.2px;
}

.dropzone p {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.drop-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.file-list {
  margin-top: 16px;
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid var(--muted);
  padding-top: 12px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: var(--surface-strong);
  margin-bottom: 8px;
  gap: 10px;
  cursor: grab;
}

.file-row.dragging {
  opacity: 0.6;
  border-style: dashed;
}

.file-name {
  font-weight: 600;
  color: var(--edge);
}

.file-meta {
  color: #64748b;
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--glow);
  color: var(--edge);
  font-weight: 600;
  font-size: 12px;
}

.tag.warning {
  background: rgba(255, 183, 3, 0.18);
  color: #92400e;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 14px 35px rgba(241, 91, 42, 0.25);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.ghost-btn {
  border: 1px solid var(--muted);
  background: var(--surface-strong);
  color: var(--edge);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.list-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 6px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-btn {
  border: none;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.remove-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(153, 27, 27, 0.18);
}

.drag-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
}

.aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat {
  padding: 14px;
  background: var(--surface-strong);
  border-radius: 12px;
  border: 1px solid var(--muted);
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.status {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #0f172a;
  font-weight: 600;
}

.status.error {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #991b1b;
}

.helper {
  font-size: 14px;
  color: #475569;
  margin: 12px 0 0;
  line-height: 1.6;
}

.controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 0 32px 12px;
}

.lang-select {
  border: 1px solid var(--muted);
  background: var(--surface-strong);
  color: var(--edge);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  min-width: 180px;
}

.theme-toggle {
  border: 1px solid var(--muted);
  background: var(--surface-strong);
  color: var(--edge);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.render-sandbox {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 820px;
  background: white;
  padding: 16px;
  color: #111827;
}

.render-sandbox table {
  border-collapse: collapse;
  width: 100%;
}

.render-sandbox td,
.render-sandbox th {
  border: 1px solid #e5e7eb;
  padding: 8px;
}

body[data-theme="dark"] .shell {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

body[data-theme="dark"] .header .subtitle {
  color: #cbd5e1;
}

body[data-theme="dark"] .dropzone {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .dropzone.dragover {
  background: rgba(244, 114, 182, 0.08);
}

body[data-theme="dark"] .drop-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1220;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .file-row {
  border-color: var(--muted-2);
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .btn.secondary,
body[data-theme="dark"] .lang-select,
body[data-theme="dark"] .theme-toggle {
  border-color: var(--muted-2);
}

body[data-theme="dark"] .status {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

body[data-theme="dark"] .status.error {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecdd3;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    padding: 24px 12px 48px;
  }

  .header {
    padding: 20px 18px 8px;
  }

  .layout {
    padding: 0 18px 18px;
  }
}
