@import 'syntax-variables';

atom-text-editor, :host {
  background-color: @syntax-background-color;
  color: @syntax-text-color;

  .invisible-character {
    color: @syntax-invisible-character-color;
  }

  .indent-guide {
    color: @syntax-indent-guide-color;
  }

  .wrap-guide {
    background-color: @syntax-wrap-guide-color;
  }

  .gutter {
    color: @syntax-gutter-text-color;
    background: @syntax-gutter-background-color;
  }

  .gutter .line-number.folded,
  .gutter .line-number:after,
  .fold-marker:after {
    color: #e87b00;
  }

  .invisible {
    color: #555;
  }

  .selection .region {
    background-color: #e1e1e1;
  }

  &.is-focused {
    .cursor {
      border-color: @syntax-cursor-color;
    }

    .selection .region {
      background-color: @syntax-selection-color;
    }

    .line-number.cursor-line-no-selection,
    .line.cursor-line {
      background-color: @syntax-gutter-background-color-selected;
    }
  }

  // Markdown
  .source.gfm {
    color: #444;
  }

  .gfm {
    .markup.heading {
      color: #111;
    }

    & .link {
      color: #888;
    }

    .variable.list {
      color: #888;
    }
  }

  .markdown {
    .paragraph {
      color: #444;
    }

    .heading {
      color: #111;
    }

    .link {
      color: #888;

      .string {
        color: #888;
      }
    }
  }
}

:host(.is-focused) {
  .cursor {
    border-color: @syntax-cursor-color;
  }

  .selection .region {
    background-color: @syntax-selection-color;
  }

  .line-number.cursor-line-no-selection,
  .line.cursor-line {
    background-color: @syntax-gutter-background-color-selected;
  }
}

.comment {
  color: #999988;
  font-style: italic;
}

.string {
  color: #D14;
}

// String interpolation in Ruby, CoffeeScript, and others
.string {
  .source,
  .meta.embedded.line {
    color: #5A5A5A;
  }

  .punctuation.section.embedded {
    color: #920B2D;

    .source {
      color: #920B2D;  // Required for the end of embedded strings in Ruby #716
    }
  }
}

.constant {
  &.numeric {
    color: #D14;
  }

  &.language {
    color: #606aa1;
  }

  &.character,
  &.other {
    color: #606aa1;
  }

  &.symbol {
    color: #990073;
  }

  &.numeric.line-number.find-in-files .match {
    color: rgba(143, 190, 0, 0.63);
  }
}

.variable {
  color: #008080;

  &.parameter {
    color: #606aa1;
  }
}

// Keywords
.keyword {
  color: #222;
  font-weight: bold;

  &.unit {
    color: #445588;
  }

  &.special-method {
    color: #0086B3;
  }
}

.storage {
  color: #222;

  &.type {
    color: #222;
  }
}

.entity {
  &.name.class {
    text-decoration: underline;
    color: #606aa1;
  }

  &.other.inherited-class {
    text-decoration: underline;
    color: #606aa1;
  }

  &.name.function {
    color: #900;
  }

  &.name.tag {
    color: #008080;
  }

  &.other.attribute-name {
    color: #458;
    font-weight: bold;
  }

  &.name.filename.find-in-files {
    color: #E6DB74;
  }
}

.support {
  &.constant,
  &.function,
  &.type {
    color: #458;
  }

  &.class {
    color: #008080;
  }
}

.invalid {
  color: #F8F8F0;
  background-color: #00A8C6;

  &.deprecated {
    color: #F8F8F0;
    background-color: #8FBE00;
  }
}


.meta {
  &.structure.dictionary.json > .string.quoted.double.json,
  &.structure.dictionary.json > .string.quoted.double.json .punctuation.string {
    color: #000080;
  }

  &.structure.dictionary.value.json > .string.quoted.double.json {
    color: #d14;
  }

  &.diff,
  &.diff.header {
    color: #75715E;
  }
}

// CSS Styles
.css {
  &.support.property-name {
    font-weight: bold;
    color: #333;
  }

  &.constant {
    color: #099;
  }
}

.bracket-matcher .region {
  background-color: #C9C9C9;
  opacity: .7;
  border-bottom: 0 none;
}
