@import '../constants/dimensions';
@import '../constants/colors';

.graphql-editor {
  position: relative;
  display: grid;
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows:
    minmax(50%, 1fr) min-content min-content min-content minmax(0%, min-content)
    min-content;

  & > h2 {
    color: var(--hl);
    padding: @padding-xs @padding-sm;
    font-size: @font-size-md;
    border-top: 1px dashed var(--hl-sm);
  }

  .graphql-editor__schema-dropdown {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    margin: @padding-xs;
    opacity: @opacity-subtle;

    &:hover {
      opacity: 1;
    }
  }

  .graphql-editor__query,
  .graphql-editor__variables {
    height: 100%;
    max-height: 100%;
  }

  .graphql-editor__query .cm-attribute {
    color: var(--color-info);
  }

  .graphql-editor__query .cm-gql-disabled {
    opacity: 0.7;

    // Grayscale is really slow on high resolutions so disable it for now
    //filter: grayscale(0.8);
  }

  .graphql-editor__schema-notice {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .graphql-editor__operation-name {
    margin-left: auto;
    white-space: nowrap;
  }

  .graphql-editor__meta {
    color: var(--hl);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: @padding-xxs @padding-sm;
    flex-wrap: wrap;
  }

  .CodeMirror-jump-token {
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
  }
}

.CodeMirror-info {
  background: var(--color-bg);
  position: fixed;
  z-index: 100;
  padding: @padding-xs @padding-sm;
  border: 1px solid @border-color;
  color: var(--color-font);
  font-weight: 600;

  .info-description {
    font-weight: initial;
    padding-top: @padding-xs;

    // HACK: Cancel out padding on parent container
    margin-bottom: calc(@padding-sm * -1);

    & > * {
      margin: @padding-xs 0 @padding-sm 0;
    }
  }

  .type-name {
    color: var(--color-surprise);
  }

  .field-name {
    color: var(--color-success);
  }

  .enum-value {
    color: var(--color-info);
  }

  .arg-name {
    color: var(--color-surprise);
  }

  .directive-name {
    color: var(--color-warning);
  }
}
