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

body {
  font-family: 'SF Pro Display', system-ui, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #888;
  margin-top: 0.25rem;
}

.status-bar {
  background: #1a1a1a;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-family: 'SF Mono', monospace;
  font-size: 0.9rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.editor-section { grid-row: span 2; }
.output-section { }
.preview-section { }

.editor-section, .output-section, .preview-section {
  background: #1a1a1a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #252525;
  border-bottom: 1px solid #333;
  font-weight: 500;
}

.panel-header button {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.panel-header button:hover:not(:disabled) {
  background: #5a6fd6;
  transform: translateY(-1px);
}

.panel-header button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#editor {
  flex: 1;
  width: 100%;
  background: #1a1a1a;
  color: #e0e0e0;
  border: none;
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: none;
  outline: none;
}

#terminal {
  flex: 1;
  padding: 1rem;
  font-family: 'SF Mono', monospace;
  font-size: 0.85rem;
  overflow-y: auto;
  background: #0d0d0d;
}

#terminal .log { color: #888; }
#terminal .info { color: #4fc3f7; }
#terminal .error { color: #ef5350; }
#terminal .success { color: #66bb6a; }

#preview {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

#previewUrl {
  font-size: 0.75rem;
  color: #888;
  font-family: monospace;
}

footer {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.85rem;
}

footer a {
  color: #667eea;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .editor-section { grid-row: span 1; min-height: 300px; }
  .output-section { min-height: 150px; }
  .preview-section { min-height: 300px; }
}