/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../variables';
@import '../blueprint-overrides/common/colors';

// This file contains various overrides for the Ace editor.
// Ideally they should be incorporated into a theme

.ace-solarized-dark {
  background-color: rgba($dark-gray1, 0.5);

  // START: Custom code styles
  .ace_variable.ace_column {
    color: #2ceefb;
  }

  .ace_comment.ace_issue {
    color: #cb3116;
    text-decoration: underline;
    text-decoration-style: wavy;
  }

  .ace_storage.ace_type {
    color: #27c923;
  }
  // END: Custom code styles

  &.no-background {
    background-color: transparent;
  }

  &.placeholder-padding {
    .ace_placeholder {
      // This padding is needed because there is a bug in this current version of ACE Editor where the padding set in
      // code is not being applied to the placeholder element
      margin-top: 10px;
    }
  }

  .ace_gutter {
    background: $gray5;
    color: $gray1;

    .#{$bp-ns}-dark & {
      background: $dark-gray4;
      color: $gray5;
    }
  }

  .ace_gutter-active-line {
    background-color: rgba($gray1, 0.6);
  }

  &:not(.ace_autocomplete) .ace_text-layer {
    filter: brightness(1.5) saturate(0.9);
  }

  &.ace_editor.ace_dark.ace_autocomplete {
    background: $dark-gray4;
    border: none;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(15, 19, 32, 0.45);

    .ace_text-layer {
      filter: brightness(1.1);
    }
  }
}

.ace_tooltip {
  padding: 10px;
  color: #c1ccd5;
  width: 500px;
  display: block;
  height: auto;
  white-space: initial;
  background: $gray2;
  border: none;
  border-radius: 2px;
  box-shadow: 0 5px 15px rgba(15, 19, 32, 0.45);

  .#{$bp-ns}-dark & {
    background: $dark-gray4;
  }

  & > * {
    filter: brightness(1.1);
  }

  .doc-name {
    font-size: 18px;
    border-bottom: 2px solid rgba(193, 204, 213, 0.5);
    padding-bottom: 4px;
    color: #93ca12;
  }

  .doc-syntax {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .doc-name,
  .doc-syntax {
    font-family: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace;
  }
}
