/* Original contents is available on https://github.com/syumai/go-playground-custom */

/***
 * yjs collaborative editing
 * based on https://github.com/yjs/y-codemirror/blob/v3.0.1/demo/index.html
 */

 .remote-caret {
  position: relative;
  border-left: 2px solid black;
  margin-left: -1px;
  margin-right: -1px;
  box-sizing: border-box;
}
.remote-caret > div {
  white-space: nowrap;
  position: absolute;
  top: -1.05em;
  left: -2px;
  font-size: .8em;
  background-color: rgb(250, 129, 0);
  font-family: Menlo, monospace;
  font-style: normal;
  font-weight: normal;
  line-height: normal;
  user-select: none;
  color: white;
  padding-left: 3px;
  padding-right: 3px;
  z-index: 3;
  transition: opacity .3s ease-in-out;
}
.remote-caret.hide-name > div {
  transition-delay: .7s;
  opacity: 0;
}
.remote-caret:hover > div {
  opacity: 1;
  transition-delay: 0s;
}

/***
 * CodeMirror customization
 */

.CodeMirror {
  border: 0.0625rem solid #c0c2c3;
  background-color: #f8f8f8;
  font-size: 11pt;
  font-family: Menlo, monospace;
  flex: 1 1 0;
  min-height: 100px;
  height: auto;
  width: 100%;
  box-sizing: border-box;
}

.CodeMirror-gutters {
  background: inherit;
}

span.other-client {
  height: 11pt !important;
  margin: inherit !important;
  display: inherit !important;
}

/***
 * Application configs
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

header,
main,
footer {
  width: 100%;
}

header {
  height: 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background-color: #ff8d11;
  color: #fff;
}

a:hover {
  opacity: 0.8;
}

@media screen and (max-width: 740px) {
  header {
    height: 70px;
  }

  header .header-content {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  header .button-container {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: 12px;
  }
}

header .title {
  margin-left: 16px;
  font-size: 1.5rem;
  font-weight: bold;
}

header .header-content {
  display: flex;
  align-items: center;
  margin-right: 16px;
}

header .button-container {
  margin-left: 16px;
  display: flex;
  align-items: center;
}

#jsCopyRunBtn {
  margin-right: 9px;
  min-width: 162px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  white-space: nowrap;
}

#jsCopyRunBtn .copy-run-default,
#jsCopyRunBtn .copy-run-feedback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hidden {
  display: none !important;
}

header a {
  color: #fff;
}

select {
  margin-right: 9px;
  border-radius: 0.1875rem;
}

button {
  padding: 3px 8px;
  margin-right: 9px;
  border-radius: 0.1875rem;
  box-shadow: 0 2px 5px rgb(0 0 0 / 20%);
  box-sizing: border-box;
  border: none;
  background-color: #f7f9fa;
  color: #f27b10;
  font: bold 0.875rem Roboto, sans-serif;
}

button.primary {
  padding: 3px 8px;
  border: 0.0625rem solid #ff8d11;
  background-color: #fff;
}

button.primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

button kbd {
  font-size: 0.7em;
  opacity: 0.5;
  font-family: inherit;
  font-weight: normal;
}

header .link-to-github {
  margin-left: 9px;
}

main {
  width: 100%;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  --result-height: 300px;
}

@media screen and (max-width: 740px) {
  main {
    height: calc(100vh - 70px);
  }
}

.code-body {
  display: none;
}

.resizer {
  position: relative;
  z-index: 4;
  flex: 0 0 3px;
  height: 3px;
  width: 100%;
  cursor: row-resize;
  background-color: #e0e0e0;
  touch-action: none;
  user-select: none;
}

.resizer::after {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  right: 0;
}

.resizer:hover,
.resizer.dragging {
  background-color: #ff8d11;
}

.result,
.options {
  flex: 0 0 var(--result-height);
  height: var(--result-height);
  box-sizing: border-box;
  width: 100%;
  padding: 8px;
  overflow: auto;
}

.result.hidden,
.options.hidden {
  display: none;
}

.result {
  font-size: 0.9rem;
  white-space: pre;
  font-family: Menlo, monospace;
}

.result .line {
  width: 100%;
}

.result .line.stdout {
  color: #000;
}

.result .line.stderr {
  color: #c33;
}

.result .line.system {
  color: #999;
}

.options {
  background-color: #f0f0f0;
}

.options button {
  color: #000;
}
