/* base styles for the Python sandbox UI */
:root {
  --bg: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0ea5e9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.actions button {
  appearance: none;
  border: 1px solid var(--line);
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.actions button:hover { background: #f3f4f6; }
.actions button:disabled { opacity: .5; cursor: not-allowed; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 45vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.panel-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--muted);
}

/* CodeMirror like StackOverflow */
.CodeMirror {
  height: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 16px;
  background:#fff;
}
.panel .CodeMirror{ padding: 0px; }
.CodeMirror-gutters{ background:#f8fafc; border-right:1px solid var(--line); }
.CodeMirror-linenumber{ color:#94a3b8; }

/* Output in right panel*/
.prose {
  margin: 0;
  padding: 12px;
  overflow: auto;
  height: 100%;
  background: #fff;
}
#output {
  white-space: break-spaces;
  word-break: break-word;
}

#output.prose pre {
  background: #f6f8fa;
  color: #1f2937;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
}
#output.prose pre code {
  background: transparent;
  font-size: 0.95rem;
  line-height: 1.6;
}

#output.prose :not(pre) > code {
  font-size: 0.95rem;
  background: #f1f5f9;
  color: #111827;
  padding: .15rem .35rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}

.footnote {
  padding: 10px 16px 20px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

/* right-toolbar 
font-family: Arial, Helvetica, sans-serif */
.toolbar-right .title { 
  display: block; ;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif
}
.toolbar {
  display:flex; 
  align-items:center; 
  justify-content:flex-end; 
  gap:8px;
  padding:10px 12px; 
  border-bottom:1px solid var(--line);
}
.toolbar-right {
  display:flex; 
  align-items:center; 
  justify-content:flex-start; 
  gap:16px;
  padding:10px 12px; 
  border-bottom:1px solid var(--line);
}

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

/* universal icon button (copy/trash) */
.icon-btn{
  appearance:none;
  border:1px solid var(--line);
  background:#f9fafb;
  border-radius:12px;
  cursor:pointer;
  transition:transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow:0 1px 0 rgba(0,0,0,.03);
  display:inline-flex; align-items:center; justify-content:center;
}
.icon-btn--round{ width:36px; height:36px; padding:0; }
.icon-btn:hover{ background:#f3f4f6 }
.icon-btn:active{ transform:translateY(1px) }
.icon-btn:focus-visible{ outline:2px solid #93c5fd; outline-offset:2px }
.icon-btn svg{ width:18px; height:18px; display:block; }

/* Run Btn */
.run-btn{
  appearance:none; border:1px solid transparent;
  background:#10b981; color:#fff; font-weight:500; font-size: medium;
  padding:6px 14px; border-radius:12px; cursor:pointer;
  transition:transform .06s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow:0 4px 12px rgba(16,185,129,.15);
  height: 36px;
}
.run-btn:hover{ filter:brightness(.96) }
.run-btn:active{ transform:translateY(1px) }
.run-btn:focus-visible{ outline:2px solid #34d399; outline-offset:2px }

/* red Stop */
.stop-btn{
  width:36px; height:36px; padding:0;
  border-radius:10px;
  border:1px solid #fca5a5;
  background:#ef4444;
  color:#fff;
  cursor:pointer;
  transition:transform .06s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow:0 4px 12px rgba(239,68,68,.18);
}
.stop-btn:disabled{ opacity:.55; cursor:not-allowed; filter:grayscale(.1); box-shadow:none; }
.stop-btn:hover:not(:disabled){ filter:brightness(.95) }
.stop-btn:active:not(:disabled){ transform:translateY(1px) }
.stop-btn svg{ width:18px; height:18px; }

