@import 'base';
@import 'markdownHighlighting';
@import 'material';
@import 'print';
@import 'bourbon';

body {
  background-color: $body-color;
  bottom: 0;
  font-weight: 300;
  left: 0;
  position: fixed;
  right: 0;
  tab-size: 4;
  text-rendering: auto;
  top: 0;
}

.font-loader {
  position: absolute;
  top: -100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

*::-webkit-scrollbar {
  -webkit-appearance: none;
}

/* stylelint-disable selector-pseudo-class-no-unknown */
*::-webkit-scrollbar:vertical {
  width: 7px;
}

*::-webkit-scrollbar:horizontal {
  height: 7px;
}
/* stylelint-enable selector-pseudo-class-no-unknown */

*::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

:focus {
  outline: none;
}

input:not([disabled]),
textarea:not([disabled]) {
  font-variant-ligatures: no-common-ligatures;
}

.panel {
  height: 100%;
  position: absolute;
  width: 100%;
}

.no-overflow {
  overflow: hidden;
}

.background {
  background-color: $background-color;
}

.postit {
  background-color: #fff8ba;
  font-size: 14px;
  overflow: hidden;
  padding: 15px 20px;
  z-index: 3;

  @include transform(rotate(-1deg));

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  blockquote,
  pre,
  ul,
  ol,
  dl {
    margin: 1em 0;
  }
}

.postit__close-btn {
  color: rgba(0, 0, 0, 0.5);
  font-size: 22px;
  height: 32px;
  padding: 0;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 32px;
}

.tip {
  color: rgba(0, 0, 0, 0.45);
  display: block;
  font-size: 14px;
  margin-left: 10px;
  margin-right: 10px;

  ul {
    margin: 0.5em 0;
  }
}

.warning {
  color: rgba(0, 0, 0, 0.67);
  padding: 10px 5px;
}

.prism--editor {
  border: 0;
  color: #000;
  padding: 0;
}

.navbar {
  background-color: #fff;
  color: rgba(0, 0, 0, 0.6);
  height: auto;
  z-index: 3;
}

.navbar__inner {
  position: relative;
}

.navbar__logo {
  background-image: url('assets/images/icon.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 28px 28px;
  height: 34px;
  width: 34px;
}

.navbar__item {
  display: inline-block;
  height: 30px;
  line-height: 30px;
  margin: 2px 1px;
  overflow: hidden;
  padding: 0 10px;
  position: relative;
  white-space: nowrap;

  > span {
    vertical-align: middle;
  }
}

.navbar__item--title {
  color: rgba(0, 0, 0, 0.75);
  font-size: 30px;
  height: 34px;
  letter-spacing: -0.03em;
  line-height: 34px;
  margin: 0;
  padding: 0 8px;
}

.navbar__item--icon {
  color: rgba(0, 0, 0, 0.54);
  font-size: 23px;
  padding: 0 4px;
}

.footer {
  height: 35px;
  min-height: 35px;
}

.footer__button {
  padding: 0.6em;
}

.footer__icon {
  color: rgba(0, 0, 0, 0.75);
  font-size: 1.55em;
  line-height: 0.65;
  padding: 0.4em 0;
  text-align: center;
  width: 1.45em;
}

.drop-zone {
  border: 3px dashed #aaa;
  border-radius: 8px;
  color: #aaa;
  padding: 32px;
  position: relative;
  text-align: center;
}

.drop-zone__input {
  cursor: pointer;
  display: block;
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.drop-zone__icon {
  font-size: 44px;
}

.rotate-90 {
  @include transform(rotate(90deg));

  &[class^='icon-'],
  &[class*=' icon-'] {
    display: inline-block;
    line-height: inherit;
  }
}

.rotate-180 {
  @include transform(rotate(180deg));

  &[class^='icon-'],
  &[class*=' icon-'] {
    display: inline-block;
    line-height: inherit;
  }
}

.rotate-270 {
  @include transform(rotate(270deg));

  &[class^='icon-'],
  &[class*=' icon-'] {
    display: inline-block;
    line-height: inherit;
  }
}

@mixin plastic-color($c, $i) {
  .plastic--#{$i} {
    $dark-c: darken($c, 30%);

    &.plastic--color {
      color: desaturate($c, 15%);

      &.md-button.md-focused,
      &.md-button:hover,
      > .md-button.md-focused,
      > .md-button:hover {
        background-color: mix(#fff, $dark-c, 96%);
      }
    }

    &.plastic--background {
      background-color: lighten($c, 10%);
    }

    // &.plastic--gradient {
    //   @include linear-gradient(to right, #555, mix(#606060, $dark-c, 75%));
    // }

    &.plastic--soft-background {
      background-color: mix($background-color, $dark-c, 94%);
    }

    &.plastic--toolbar {
      background-color: mix(#fff, darken($c, 50%), 75%);

      // md-input-container .md-input[disabled] {
      //   color: desaturate($c, 50%);
      // }
      // @include linear-gradient(to left, $background-color, mix(#fff, $dark-c, 94%));
    }

    &.plastic--border,
    &.folder-entry,
    &.tab-list__entry {
      border-color: lighten($c, 5%);
    }

    &.folder-entry,
    &.tab-list__entry {
      background-color: mix(#fafafa, $dark-c, 96%);

      &.md-button.md-focused,
      &.md-button:hover,
      > .md-button.md-focused,
      > .md-button:hover {
        background-color: mix(#fff, $dark-c, 92%);
      }

      &.md-whiteframe-1dp {
        box-shadow: 0 0 3px 0 transparentize($dark-c, 0.8), 0 0 1px 0 transparentize($dark-c, 0.86), 0 1px 1px -1px transparentize($dark-c, 0.88);
      }

      &.md-whiteframe-4dp {
        box-shadow: 0 1px 4px -1px transparentize($dark-c, 0.8), 0 3px 5px 0 transparentize($dark-c, 0.86), 0 0 10px 0 transparentize($dark-c, 0.88);
      }
    }
  }
}

@for $i from 1 through length($plastic-colors) {
  $c: nth($plastic-colors, $i);

  @include plastic-color($c, $i);
}

@include plastic-color(#737373, length($plastic-colors) + 1);
@include plastic-color(#aaa, length($plastic-colors) + 2);
