@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --accent: #7fff6e;
  --accent-dim: #3d6e38;
  --text: #e8e8e8;
  --text-dim: #666;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 80px;
}

header {
  width: 100%;
  max-width: 780px;
  margin-bottom: 48px;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

h1 {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

h1 span { color: var(--accent); }

.subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  width: 100%;
  max-width: 780px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.dropzone {
  border: 1px dashed var(--accent-dim);
  border-radius: 3px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(127, 255, 110, 0.04);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.6; }

.dropzone p {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.dropzone p strong { color: var(--accent); }

.or {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin: 16px 0;
  letter-spacing: 0.1em;
}

textarea {
  width: 100%;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 14px;
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus { border-color: var(--accent-dim); }
textarea::placeholder { color: #3a3a3a; }

/* Column table */
.col-table {
  width: 100%;
  border-collapse: collapse;
}

.col-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 0 0 10px 0;
  border-bottom: 1px solid var(--border);
}

.col-table th:not(:first-child) { padding-left: 12px; }
.col-table th.center { text-align: center; }

.col-table td {
  padding: 8px 0;
  border-bottom: 1px solid #1f1f1f;
  vertical-align: middle;
}

.col-table td:not(:first-child) { padding-left: 12px; }
.col-table tr:last-child td { border-bottom: none; }

/* Highlight the entire row whose radio is checked */
.col-table tr:has(input[type="radio"]:checked) td {
  background: rgba(127, 255, 110, 0.04);
}

/* Highlight just the filename cell */
.col-table tr:has(input[type="radio"]:checked) .radio-col {
  background: rgba(127, 255, 110, 0.10);
}

/* Dim the original column label on unchecked rows to draw eye to selected */
.col-table tr:not(:has(input[type="radio"]:checked)) .col-original {
  color: var(--accent-dim);
}

.col-original {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

select, input[type="text"] {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  appearance: none;
}

select:focus, input[type="text"]:focus { border-color: var(--accent-dim); }
select option { background: #1a1a1a; }

/* Type accent borders */
select.type-text    { border-left: 2px solid #5a8fff; }
select.type-number  { border-left: 2px solid #ffb347; }
select.type-date    { border-left: 2px solid #ff6eb4; }
select.type-boolean { border-left: 2px solid #c77dff; }
select.type-list    { border-left: 2px solid #47d7ff; }
select.type-link    { border-left: 2px solid var(--accent); }

/* Filename radio */
.radio-col { text-align: center; }

.radio-col input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #555;
  border-radius: 50%;
  background: #2a2a2a;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s;
}

.radio-col input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Preview */
.preview-box {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: #aaa;
  white-space: pre;
  overflow-x: auto;
}

.preview-box .prop-key      { color: #5a8fff; }
.preview-box .type-text     { color: var(--accent); }
.preview-box .type-number   { color: #ffb347; }
.preview-box .type-date     { color: #ff6eb4; }
.preview-box .type-boolean  { color: #c77dff; }
.preview-box .type-list     { color: #47d7ff; }
.preview-box .type-link     { color: var(--accent); }
.preview-box .yaml-fence    { color: var(--text-dim); }
.preview-box .filename-hint { color: #444; }

/* Status */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
  width: 100%;
  max-width: 780px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.status-dot.ready { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-dot.error { background: #ff6e6e; }

button#generate {
  width: 100%;
  max-width: 780px;
  padding: 16px;
  background: var(--accent);
  color: #0a1a08;
  border: none;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

button#generate:hover:not(:disabled) {
  background: #9fffa0;
  transform: translateY(-1px);
}

button#generate:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.divider {
  width: 100%;
  max-width: 780px;
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0 20px;
}

.hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 14px;
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

textarea::placeholder {
  color: #555;
}

#theme-toggle {
  color: #ccc;
}