:root {
  --bg-dark: #0a0a0c;
  --bg-card: #141418;
  --error-red: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning-amber: #f59e0b;
  --success-green: #10b981;
  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --border: #26262e;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

header {
  padding: 4rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.badge-error {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 4px 12px;
  background: var(--error-glow);
  border: 1px solid var(--error-red);
  color: var(--error-red);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

p.subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
}

main {
  display: grid;
  grid-template-columns: 350px 1fr;
  min-height: calc(100vh - 250px);
}

@media (max-width: 1024px) {
  main { grid-template-columns: 1fr; }
}

.sidebar {
  padding: 2rem;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}

.content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preset-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.preset-btn:hover {
  border-color: var(--error-red);
  background: rgba(239, 68, 68, 0.05);
}

.preset-btn.active {
  background: var(--error-red);
  color: white;
  border-color: var(--error-red);
  font-weight: 600;
}

.config-group {
  margin-bottom: 1.5rem;
}

.config-label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

select, input, textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  outline: none;
  font-size: 0.9rem;
}

textarea {
  font-family: var(--font-mono);
  resize: vertical;
  min-height: 100px;
}

.code-output {
  flex-grow: 1;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow: auto;
  position: relative;
}

.btn-copy {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.btn-copy:hover {
  background: rgba(255,255,255,0.2);
}

select:focus, input:focus, textarea:focus {
  border-color: var(--error-red);
  box-shadow: 0 0 0 2px var(--error-glow);
  background: rgba(255,255,255,0.02);
}

.code-output::before {
  content: 'TS';
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 10px;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.keyword { color: #c678dd; }
.type { color: #61afef; }
.string { color: #98c379; }
.comment { color: #5c6370; font-style: italic; }
.property { color: #e06c75; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#output-code {
  display: block;
  animation: slideIn 0.3s ease-out;
}

footer {
  text-align: center;
  padding: 4rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--success-green);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  display: none;
  z-index: 1000;
}
