/* C4 Interpreter — Catppuccin Mocha inspired IDE theme */
:root {
  --bg: #1e1e2e;
  --bg-dark: #181825;
  --bg-darker: #11111b;
  --border: #313244;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

#root {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#root > div { flex: 1; min-height: 0; }

/* Titlebar with subtle gradient depth */
.titlebar {
  background: linear-gradient(180deg, #232338 0%, #1e1e2e 100%);
}

/* Editor */
.editor-wrap {
  background: var(--bg);
  overflow: hidden;
}

.gutter {
  margin: 0;
  padding: 12px 8px 12px 12px;
  text-align: right;
  color: #45475a;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
  min-width: 44px;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre;
}

.code-area {
  background: var(--bg);
  color: #cdd6f4;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: #f5c2e7;
}

.code-area::selection { background: rgba(245,194,231,0.25); }

/* Console */
.console {
  background: var(--bg-darker);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #cdd6f4;
  min-height: 100%;
}

.console table td, .console table th { white-space: nowrap; }

/* Blinking cursor */
.cursor-blink {
  animation: blink 1.1s step-end infinite;
  color: #a6e3a1;
}
@keyframes blink { 50% { opacity: 0; } }

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,17,27,0.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  animation: fadein 0.15s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-dark);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  animation: slidein 0.2s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.4);
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer code {
  background: rgba(49,50,68,0.5);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #45475a; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #585b70; }

/* Responsive: stack editor / inspector on mobile */
@media (max-width: 1023px) {
  #root { height: auto; min-height: 100vh; }
  .editor-wrap { min-height: 320px; }
  .console { min-height: 300px; }
}