@font-face {
  font-family: 'Roboto Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/roboto-mono:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Roboto Mono Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 700;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/roboto-mono:vf@latest/latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --monospace: "Roboto Mono Variable", "SF Mono", Menlo, Consolas, 'Courier New', Courier, monospace;
}

body {
  font-size: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

h2 {
  margin: 0;
  font-size: 1.5rem;
}

h3 {
  margin: 0;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  padding: 1rem;
  gap: 1rem;
}

#syntax-diagrams {
  box-sizing: border-box;
  padding: 1rem;
  border-top: 1px solid #000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#syntax-diagrams main {
  padding: 1rem;
  /* min-height: 0;
  flex: 1; */
  /* overflow: auto; */
  border: 1px solid #000;
}

#input, #output {
  flex: 1;
  flex-shrink: 0;
}

#input {
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
}

#input .toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f0f0f0;
  border-bottom: 1px solid #000;
}

#editor {
  padding: 0.5rem;
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  font-family: var(--monospace);
  font-size: 0.875rem;
}

#editor:focus {
  outline: none;
}

.select {
  line-height: 1.5;
  background: #ffffff;
  border: 1px solid #000;
  box-shadow: rgb(187, 187, 187) 2px 2px 0px 0px;
}

.select:focus {
  outline: none;
  box-shadow: rgb(187, 187, 187) 2px 2px 0px 0px, 0 0 0 .1rem rgba(52, 130, 255, 0.84);
}

.button {
  line-height: 1.5;
  background: rgb(153, 197, 255);
  border: 1px solid #000;
  box-shadow: rgb(187, 187, 187) 2px 2px 0px 0px;
}

.button:focus {
  box-shadow: rgb(187, 187, 187) 2px 2px 0px 0px, 0 0 0 .1rem rgba(0, 0, 0, .2);
}

collapsible-tree {
  font-family: var(--monospace);
}

details {
  margin-left: 1em;
  cursor: pointer;
}

summary {
  outline: none;
  list-style: none;
}

details>summary::-webkit-details-marker {
  display: none;
}

details:not([open]):not([leaf])>summary::after {
  font-weight: bold;
  content: " ...";
}

collapsible-tree details {
  position: relative;
}

collapsible-tree details>.rule {
  position: absolute;
  top: 1rem;
  left: 1px;
  bottom: 0;
  border-left: 1px dashed rgba(0, 0, 0, .2);
}

collapsible-tree>details {
  margin-left: 0;
}

/* Hide the radio buttons */
.tabs input[type="radio"] {
  display: none;
}

/* Basic styling for tab labels (can be made more "style-less" by removing borders, padding) */
.tabs > label {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 0.5rem;
  border: 1px solid #000;
  /* Minimalist border */
  cursor: pointer;
  /* To make borders overlap slightly */
  background: #f0f0f0;
  /* Light gray background for non-active tabs */
}

/* Hide all tab content by default */
.tab-content {
  margin-top: 0.5rem;
  display: none;
  border: 1px solid #000;
  padding: 10px;
  height: calc(100% - 2.25rem);
  overflow: auto;
  /* Align with the bottom border of the labels */
}

/* Show the content of the checked tab and style the active tab label */
.tabs input[type="radio"]:checked+label {
  background: #fff;
  outline: 1px solid #000;
  /* White background for active tab */
  /* border-bottom: none; */
  /* Makes it look like the content is part of the tab */
}

.tabs input[type="radio"] + label {
  margin-right: 0.25rem;
}


/*
When radio button with id="tab1" is checked, the element with id="content1" that
is a sibling of it (~) will be displayed.
*/
#radio-typer:checked ~ #tab-typer,
#radio-parser:checked ~ #tab-parser,
#radio-elaborator:checked ~ #tab-elaborator,
#radio-resolver:checked ~ #tab-resolver,
#radio-lowering:checked ~ #tab-lowering,
#radio-code-generation:checked ~ #tab-code-generation {
  display: block;
}

/* Optional: Basic layout for the labels to appear in a row */
.tabs {
  overflow: hidden;
  /* Clear floats or prevent margin collapse, depending on label styling */
}

.tab-content pre {
  margin: 0;
}

.tab-content h3 {
  margin-bottom: 0.5rem;
}

pre > code {
  font-family: var(--monospace);
}

pre > code.traces {
  font-size: 0.875rem;
}

header.tree-display, header.traces {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.tree-display > div.hint {
  font-size: 0.75rem;
  opacity: 0.5;
  font-weight: bold;
}

label[for="show-traces"] {
  font-size: 0.875rem;
}

.compile-time-report {
  font-size: 0.875rem;
  margin-left: auto;
  align-self: center;
}
