*:not(dialog) {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

*::selection {
  background-color: paleturquoise;
}

a {
  color: inherit;
  text-decoration: none;
}

body,
html {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Roboto Mono', monospace;
  background-color: ghostwhite;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  width: 100%;
  flex-grow: 1;
  background-color: ghostwhite;
  padding: 20px;
  gap: 20px;
}

button {
  font-family: 'Poppins', sans-serif;
}

.form-container {
  height: 100%;
  min-width: 50%;
  display: flex;
  flex-direction: column;
}

form {
  width: 100%;
  flex-grow: 1;
}

.repl-controls {
  display: flex;
  align-items: center;
  /* border-bottom: 2px solid black; */
  justify-content: space-between;
  background-color: ghostwhite;
  gap: 5px;
  margin-bottom: 20px;
}
.repl-controls p {
  padding: 10px;
  flex-grow: 1;
  background-color: #2d2d2d20;
  border-radius: 5px;
  font-size: 16px;
  height: 44px;
  overflow: auto;
}

.repl-controls button {
  background-color: #2d2d2d;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  color: white;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.repl-controls button:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

form textarea, #output {
  width: 100%;
  resize: none;
  border: none;
  padding: 15px;
  height: 100%;
  font-size: 16px;
  border: none;
  outline: none;
}

.pre-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

#output {
  max-height: 80vh;
  max-width: 90vw;
  overflow: auto;
  box-shadow: 0 0 10px #2d2d2d20;
  border-radius: 10px;
  background-color: #2d2d2d;
  color: ghostwhite;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  word-wrap: break-word;
  word-break: break-all;
}

#system-output {
  word-wrap: break-word;
  word-break: break-all;
}

#output textarea {
  background-color: #2d2d2d;
  border: none;
  height: 100%;
  color: yellow;
  font-size: 16px;
  resize: none;
}

#output textarea:focus-visible {
  outline: transparent;
}

textarea:focus-visible {
  outline-color: transparent;
}

#prompt {
  font-family: 'Poppins', sans-serif;
  padding: 12px;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 16px;
}

#editor {
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px #2d2d2d30;
  max-height: 80vh;
}

#editor .CodeMirror {
  height: 100%;
  font-size: 16px;
  font-family: 'Roboto Mono';
}

.CodeMirror-scroll {
  max-height: 100%;
}

#editor textarea {
  height: 100%;
}

@media only screen and (max-width: 650px) {
  main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: 'input' 'output';
  }

  #filename {
    font-size: 16px;
  }

  .form-container {
    width: 100%;
    grid-area: 'input';
    max-height: 439px;
  }

  #editor {
    width: 100%;
    height: 100%;
  }

  .CodeMirror {
    height: 100%;
  }

  .codemirror-scroll {
    max-height: 390px;
  }

  #prompt {
    /* border-top: 2px solid black; */
    display: none;
  }

  .pre-container {
    max-height: 439px;
    border: none;
    grid-area: 'output';
  }

  .repl-controls {
    flex-direction: column;
  }

  .repl-controls .button-controls {
    width: 100%;
  }
  .repl-controls p {
    flex-grow: 1;
    width: 100%;
  }

  .repl-controls button {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


.snackbar {
  pointer-events: none;
  opacity: 0;
  background-color: rgb(172, 222, 172);
  color: #2d2d2d;
  font-family: Poppins;
  padding: 20px;
  position: absolute;
  top: 80px;
  right: 20px;
  border-radius: 5px;
  transition: opacity 0.3s;
  z-index: 999;
}

