@import "tailwindcss";

header nav {
  width: 960px;
  margin: 0 auto;
}
header nav ol {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.codetje-logo {
  background-image: url(/logo.png);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 42px;
  height: 42px;
  z-index: 10000;
  background-size: contain;
  display: none;
}

header nav ol li {
  display: inline-block;
  padding: 12px;
}

main {
  width: 960px;
  margin: 0 auto;
}

aside {
  float: right;
}

.sign-up-overlay {
  position: relative;
  width: 100vw;
  height: 20vh;
  background-color: white;
  text-align: center;

  h2 {
    margin: 0;
  }

  &::before {
    box-shadow: 0 -100px 50px white;
    content: " ";
    height: 100%;
    position: absolute;
    left: -50%;
    top: 0;
    width: 200%;
    overflow: hidden;
    pointer-events: none;
  }

  button {
    min-width: 80px;
    max-width: 100px;
    background: inherit;
    border: 0;
    height: 28px;
    border: 1px solid black;
    border-radius: 2px;
    margin: 6px;
    color: black;
    cursor: pointer;
    transition: all 0.14s ease-out;
    &:hover {
      box-shadow: 2px 2px black;
      border: 1px solid black;
      border-radius: 2px;
      transform: translate(-2px, -2px);
    }
    &:active {
      transform: translate(0, 0);
      box-shadow: 0 0 black;
    }
  }

  .cache-notice {
    position: absolute;
    bottom: 6px;
    left: 6px;
    color: #888;
  }
}

.canvas {
  background: #fafafa;
  /* background-image: radial-gradient(#f0f0f0 2px, transparent 0);
  background-size: 10px 10px;
  background-position: -5px -5px; */
  height: 100%;
  cursor: grab;
}

.graph-vertex {
  cursor: default;
}

.runtime-toolbar {
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 20px;
  top: 20px;
  border: 1px solid black;
  border-radius: 2px;
}

.runtime-ide-canvas-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  min-height: 0;
  height: 100%;
}

.runtime-toolbar button {
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  border: 0;
  height: 48px;
  width: 48px;
  cursor: pointer;
}

.runtime-toolbar button.active {
  background: #eee;
}

.runtime-toolbar button svg {
  margin: 0 auto;
}

.runtime-toolbar button:active {
  background: #dedede;
}

.graph-node:active {
  cursor: grabbing;
}

.graph-vertex {
  background-color: #fff;
  border: var(--border-width) solid black;
  border-radius: 2px;
  transition: box-shadow 0.16s ease-out;
  position: relative;
}
.graph-vertex:hover {
  box-shadow: 4px 4px black;
}

.graph-vertex > form {
  display: flex;
  flex-direction: column;
}

.graph-vertex-heading {
  display: flex;
  height: 64px;
  padding: 0 12px;
  gap: 12px;
  border-bottom: var(--border-width) solid black;
  align-items: center;
  cursor: grab;
}

.graph-vertex-heading:active {
  cursor: grabbing;
}

.graph-vertex-heading .graph-vertex-menu {
  display: flex;
}

.graph-vertex-menu > a {
  color: black;
  background: none;
  border: none;
  cursor: pointer;
  margin: 6px;
}

.graph-vertex-code {
  margin-left: 1px;
  cursor: text;
}

.graph-edge-editor .graph-vertex {
  background: rgba(255, 255, 255, 1);
}
.graph-edge-editor .graph-vertex-code,
.graph-edge-editor .graph-vertex-footer {
  background: none;
  justify-content: right;
}

svg {
  overflow: auto;
}

.graph-vertex-add-edge-button {
  position: absolute;
  bottom: -10px;
  height: 20px;
  width: 20px;
  background: #000;
  border-radius: 20px;
  text-align: center;
  left: 50%;
  margin-left: -10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 20px;
  color: #fff;
  cursor: crosshair;
}

.graph-vertex-code {
  flex: 1;
  overflow: hidden;
}

.graph-vertex-profile-picture {
  width: 40px;
  height: 40px;
  background-color: #ddd;
  background-size: contain;
  border-radius: 50%;
  border: 1px solid black;
}

.container {
  max-width: 800px;
  padding-left: 0.5rem;
}

.run-dialog {
  position: fixed;
  width: 320px;
  height: 400px;
  background: white;
  top: 0;
  left: 0;
}

.graph-vertex-footer {
  position: relative;
  border-top: var(--border-width) solid black;
  border-radius: 0 0 12px 12px;
  display: flex;
  button {
    min-width: 80px;
    max-width: 100px;
    background: inherit;
    border: 0;
    height: 28px;
    margin: 6px;
    color: black;
    cursor: pointer;
    transition: all 0.14s ease-out;
    &:hover {
      box-shadow: 2px 2px black;
      border: 1px solid black;
      border-radius: 2px;
      transform: translate(-2px, -2px);
    }
    &:active {
      transform: translate(0, 0);
      box-shadow: 0 0 black;
    }
  }
  .vertex-inputs {
    overflow: hidden;
    flex: 1;
    padding: 4px 0;
    fieldset {
      display: inline;
      padding: 4px;
      border: 0;
    }
  }
}
.graph-vertex button.secondary {
  opacity: 0;
  visibility: hidden;
}

.graph-vertex .shouldSave button.secondary {
  visibility: visible;
  opacity: 1;
}

.graph-vertex-footer input {
  width: 100px;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  background: #efefef;
}

.graph-vertex-footer label {
  font-size: 11px;
  margin-left: 6px;
  color: #666;
}

html {
  font-family:
    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  font-size: 16px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Nimbus Mono PS", "Courier New", "Cutive Mono", monospace;
  margin-top: 0.5rem;
}

foreignobject {
  overflow: visible;
}

deltar-canvas {
  touch-action: none;
}

body {
  -webkit-font-smoothing: antialiased;
}
.runtime-ide {
  display: flex;
  height: 100vh;
}
.runtime-ide > .runtime-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.runtime-editor .runtime-editor-textarea {
  display: flex;
  height: 100%;
}

.runtime-editor .runtime-editor-toolbar {
  height: 40px;
}

.runtime-editor .cm-editor {
  min-width: 640px;
  max-width: 640px;
  background: white;
}

@media (max-width: 1280px) {
  .runtime-ide {
    flex-direction: column;
  }
  .runtime-editor {
    max-height: 320px;
    min-width: 0px;
    max-width: 100%;
  }
  .runtime-editor .runtime-editor-textarea {
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
    width: 100%;
    height: 320px;
  }
  .runtime-editor .cm-editor {
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

button svg {
  display: inline;
  vertical-align: middle;
}
/*
  7. Remove built-in form typography styles
*/
input,
button,
textarea,
select {
  font: inherit;
}
/*
  8. Avoid text overflows
*/
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
/*
  9. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

.cm-gutters {
  min-height: auto !important;
}
.cm-editor {
  font-size: 14px;
}
.cm-editor {
  max-height: calc(var(--vertex-height) - 104px);
  position: relative !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
}
.cm-editor .cm-scroller {
  display: flex !important;
  align-items: flex-start !important;
  font-family: monospace;
  line-height: 1.4;
  height: 100%;
  overflow: auto;
  position: relative;
  z-index: 0;
}
.cm-editor .cm-content[contenteditable="true"] {
  -webkit-user-modify: read-write-plaintext-only;
}
.cm-editor .cm-content {
  margin: 0;
  flex-grow: 2;
  flex-shrink: 0;
  display: block;
  white-space: pre;
  word-wrap: normal;
  box-sizing: border-box;
  min-height: 100%;
  padding: 4px 0;
  outline: none;
}
.cm-editor .cm-line {
  display: block;
  padding: 0 2px 0 6px;
}
.cm-editor .cm-gutters {
  flex-shrink: 0;
  display: flex;
  height: 100%;
  box-sizing: border-box;
  inset-inline-start: 0;
  z-index: 200;
}
.cm-editor .cm-gutters {
  background-color: #fff;
  color: #6c6c6c;
  border-right: 1px solid #ddd;
}
.cm-editor .cm-gutter {
  display: flex !important;
  flex-direction: column;
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: 100%;
  overflow: hidden;
}
.cm-editor .cm-gutterElement {
  box-sizing: border-box;
}
.cm-editor .cm-lineNumbers .cm-gutterElement {
  padding: 0 3px 0 5px;
  min-width: 20px;
  text-align: right;
  white-space: nowrap;
}
.cm-editor .cm-foldGutter span {
  padding: 0 1px;
  cursor: pointer;
}
.cm-editor.cm-focused {
  outline: 0;
}
.tok-keyword {
  color: #708;
}
.tok-punctuation {
  color: #333;
}
.tok-variableName {
  color: #333;
}
.tok-definition,
.tok-typeName {
  color: #00f;
}
.tok-operator {
  color: #708;
}
.tok-propertyName {
  color: #333;
}
.tok-string,
.tok-string2 {
  color: #a11;
}
.tok-comment {
  color: #940;
}
