@import './monokai';
@import 'components/atoms/_text.scss';

.CodeMirror {
  @include scrollbar;
}

.CodeMirror-cursor {
  border-left: 3px solid color('black');
  border-right: none;
  width: 3;
}

.CodeMirror-error-markers, .CodeMirror-linenumbers {
  background: color('charade');
}

.CodeMirror-error-markers {
  width: 8px;
}

.CodeMirror-linenumbers {
  padding-right: 4px;
}

.CodeMirror-linenumber {
  padding: 6px 6px 0 0;
  @include txt-mono;
  font-size: 9px;
  line-height: 1em;
}

.cm-s-monokai.CodeMirror {
  font-size: 14px;
  height: 100%;
  background: color('charade');
  pre {
    @include txt-mono;
    line-height: 1.25em;
    font-size: 1.25em;
  }
}

.CodeMirror-gutters {
  background: #fff;
  border: none;
}

.CodeMirror-hints {
  @include txt-mono;
  box-shadow: 0 0 5px 2px rgba(0,0,0,.1);

  /** Don't want scroll bars showing up on page */
  max-height: 60%;
  margin: 0;
  padding: 0;
}

.CodeMirror-hint {
  padding: 4px 8px;
}

li.CodeMirror-hint-active {
  background: color('blue-ribbon');
  color: white;
}

.Codemirror-sizer {
  margin: 0;
  padding: 4px;
}

.CodeMirror-gutters {
  background: none !important;
}

.cm-s-monokai .CodeMirror-activeline-background {
  background: var(--gradient-1);
}

.gutter-warning,
.gutter-error {
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  height: 12px;
  width: 12px;
  vertical-align: middle;
  position: relative;
  margin-left: -2px;
  margin-top: 4px;
}

.gutter-error {
  background-color: safeColor('dark-red');
}

.gutter-warning {
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  height: 12px;
  width: 12px;
  vertical-align: middle;
  position: relative;
  margin-left: 0px;
  margin-top: 4px;
}

.gutter-error > span, .gutter-warning > span {
  display: none;
}

.gutter-error:hover > span,
.gutter-warning:hover > span {
  @include txt;
  border-radius: 8px;
  display: block;
  background: #fff;
  color: color('black');
  z-index: 100;
  min-width: 400px;
  max-width: 100%;
  position: relative;
  left: 36px;
  top: 16px;
  padding: 8px;
  box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
  animation: fadein 0.25s ease-in-out forwards;
}

@media (max-width: 767px) {
  .CodeMirror {
    font-size: 16px;
    padding-bottom: 1rem;
  }
}
