@import 'colors';

$appbar: 52px;
$aside: 270px;

$break-mobile-s: 320px;
$break-mobile-l: 425px;
$break-tablet: 768px;

@mixin placeholder {
  &::-webkit-input-placeholder {@content}
  &:-moz-placeholder           {@content}
  &::-moz-placeholder          {@content}
  &:-ms-input-placeholder      {@content}
}

@mixin placeholder-color($color) {
  &::-webkit-input-placeholder { /* WebKit browsers */
    color:    $color;
  }
  &:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color:    $color;
    opacity:  1;
  }
  &::-moz-placeholder { /* Mozilla Firefox 19+ */
    color:    $color;
    opacity:  1;
  }
  &:-ms-input-placeholder { /* Internet Explorer 10+ */
    color:    $color;
  }
}

@mixin prefixed($property, $value) {
  -webkit-#{$property}: #{$value};
  -moz-#{$property}: #{$value};
  -ms-#{$property}: #{$value};
  -o-#{$property}: #{$value};
  #{$property}: #{$value};
}


@mixin keyframes($name) {
  @-webkit-keyframes #{$name} {
    @content;
  }

  @-moz-keyframes #{$name} {
    @content;
  }

  @-ms-keyframes #{$name} {
    @content;
  }

  @-o-keyframes #{$name} {
    @content;
  }

  @keyframes #{$name} {
    @content;
  }
}


@mixin blur {
  -webkit-filter: blur(5px);
  -moz-filter: blur(5px);
  -o-filter: blur(5px);
  -ms-filter: blur(5px);
  filter: blur(5px);
}

@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin linear-gradient($fromColor, $toColor) {
  background-color: $toColor; /* Fallback Color */
  background-image: -webkit-gradient(linear, left top, left bottom, from($fromColor), to($toColor)); /* Saf4+, Chrome */
  background-image: -webkit-linear-gradient(top, $fromColor, $toColor); /* Chrome 10+, Saf5.1+, iOS 5+ */
  background-image:    -moz-linear-gradient(top, $fromColor, $toColor); /* FF3.6 */
  background-image:     -ms-linear-gradient(top, $fromColor, $toColor); /* IE10 */
  background-image:      -o-linear-gradient(top, $fromColor, $toColor); /* Opera 11.10+ */
  background-image:         linear-gradient(top, $fromColor, $toColor);
  filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#{$fromColor}', EndColorStr='#{$toColor}');
}

@mixin gradient-directional($start-color, $end-color, $deg) {
  background-repeat: repeat-x;
  background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+
  background-image: -o-linear-gradient($deg, $start-color, $end-color); // Opera 12
  background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
}

@function bezier($target, $duration: 0.28s) {
  @return $target $duration cubic-bezier(0.4, 0, 0.2, 1);
}

@mixin bezier($target) {
  transition: $target 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@mixin ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@mixin no-select {
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

@mixin sheet {
  background-color: $white;
  border-radius: 2px;
  @include bezier(box-shadow);
  color: $grey;
}

@mixin shadow-light {
  box-shadow: 0px 1px 4px $shadow;
}

@mixin shadow-medium {
  box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.23);
}

@mixin shadow-strong {
  box-shadow: 0px 1px 12px $strongShadow;
}

@mixin shadow-inset-light {
  box-shadow: inset 0px 1px 2px $shadow;
}

@mixin shadow-inset-medium {
  box-shadow: inset 0px 1px 8px rgba(0, 0, 0, 0.23);
}

@mixin panel {
  box-shadow: 0px 2px 2px $shadow;
  background-color: $white;
  color: $grey;
}


@mixin players-list {
  margin-bottom: 8px;

  li {
    line-height: 48px;

    .handle {
      color: $darkGrey;
      font-weight: bold;
      @include ellipsis;
    }
  }
}

@mixin rankings {
  li {
    display: flex;

    &.empty {
      height: 49px;
    }

    border-top: 1px solid transparent;

    & + li:not(.empty) {
      border-top: $border;
    }

    .rank {
      margin-right: 12px;
      font-weight: bold;
      font-family: $mono;
      color: $mediumGrey;
      text-align: center;
      width: 48px;
      background-color: $whiteSmoke;
      flex-shrink: 0;
    }

    .player-avatar {
      flex: 1;
      max-width: 162px;
    }

    .time {
      font-family: $mono;
      color: $grey;
      margin-left: 12px;
      padding-right: 12px;
      text-align: right;
      flex: 0.5;
      flex-shrink: 0;
    }
  }
}

$border: 1px solid #eee;

@mixin icon {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
}
