
@import 'colors';
@import 'mixins';
@import 'fonts';

h1 {
  font-family: $thin;
  color: $white;
  margin-top: 0;
  margin-bottom: 24px;
}

h2 {
  font-size: 24px;
  font-family: $thin;
  color: $whiteSeaBlue;
  margin-top: 0;
  margin-bottom: 16px;


  a {
    color: $light-medium;
    font-weight: bold;
    cursor: pointer;
    transition: bezier(color);

    &:hover, &:active {
      // color: $seaBlue;
      text-decoration: none;
      color: $light-hard;
    }
  }
}

h3 {
  font-size: 18px;
  font-family: $thin;
}

a {
  color: $seaBlue;
  cursor: pointer;

  &:hover, &:active {
    color: $seaBlue;
    text-decoration: none;
  }
}

p {
  margin: 0;

  & + p {
    margin-top: 16px;
  }
}

$header: 154px;

.hex-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  // height: $header;
  /* bottom: 0; */
  overflow: hidden;
}

header {
  color: white;
  background-color: $light;

  .container {
    padding: 36px 15px;
  }


  .action-title {

    &:hover {
      color: $mainBlue;

      i {
        opacity: 0.8;
      }
    }

    h1 {
      position: initial;
      display: inline-block;
      margin-left: 8px;
      vertical-align: top;
      line-height: 36px;
    }

    i {
      color: white;
      opacity: 0.6;
      font-size: 36px;
      width: 36px;
      text-align: center;
      vertical-align: top;
    }
  }

  &.with-tabs {
    .container {
      padding-bottom: 0;
    }

    .tabs-container {
      background-color: transparent;

      .tab {
        color: $whiteSeaBlue;
        transition: bezier(all);
        min-width: 160px;

        &:hover {
          background-color: transparent;
          color: $white;
          border-bottom-color: $orange;
        }

        &.active {
          border-bottom-color: $white;
        }
      }
    }
  }

}

section {
  @include shadow-inset-light;

  .container {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  &.white {
  }

  &.grey {
    background-color: $shadow;
  }
}

header + section.white:not(.inside), section.with-overlap {
  .container {
    padding-top: 0;
    position: relative;
  }
}

.is-overlap {
  margin-top: -24px;
}

.sheet {
  @include sheet;
}

hr {
  border-top: 2px solid $lightSeaBlue;
}

.align-center {
  text-align: center;
}

.btn-floating {
  display: block;
  height: 56px;
  width: 56px;
  transition: bezier(box-shadow), bezier(background-color);
  @include shadow-medium;
  position: relative;
  background-color: $lightGrey;
  border: none;
  border-radius: 28px;
  color: $white;
  font-size: 24px;
  cursor: pointer;
  text-align: center;

  i {
    line-height: 56px;
  }

  &:hover {
    color: $white;
  }

  &:active {
    @include shadow-strong;
  }

  @mixin btn-theme($color) {
    background-color: $color;
    &:hover {
      background-color: $color;
    }
    &:active {
      background-color: darken($color, 8%);
    }
  }

  &.btn-condensed {
    height: 40px;
    width: 40px;
    @include shadow-light;

    i {
      line-height: 40px;
    }

    &:active {
      @include shadow-medium;
    }
  }

  &.btn-white {
    background-color: white;
    color: $mediumGrey;
  }

  &.btn-primary {
    @include btn-theme($mainBlue);
  }

  &.btn-positive {
    @include btn-theme($green);
  }

  &.btn-warn {
    @include btn-theme($orange);
  }
}

.btn-flat, .btn-raised {
  display: inline-block;
  line-height: 36px;
  min-width: 64px;
  padding: 0 8px;
  color: $seaBlue;
  text-transform: uppercase;
  text-align: center;
  font-weight: bold;
  transition: bezier(background-color), bezier(color);
  border: none;
  background-color: transparent;
  cursor: pointer;

  &:hover {
    background-color: $whiteSeaBlue;
  }

  &:active {
    outline: none;
  }

  &[disabled] {
    color: $mediumGrey;

    &:hover {
      background-color: inherit !important;
    }
  }

  &.condensed {
    line-height: 32px;
  }

  & + .btn-flat,
  & + .btn-raised {
    margin-left: 12px;
  }

  i {
    vertical-align: top;
    margin-top: 4px;
    margin-right: 4px;
  }
}

.btn-flat {
  &.btn-danger {
    color: $red;

    &:hover {
      background-color: lighten($red, 52%);
    }
  }

  &.btn-transparent {
    background-color: transparent;
    color: white;

    &:hover {
      background-color: $light;
    }
  }
}


.btn-raised {
  @include bezier(background-color);
  border-radius: 2px;

  &.btn-primary {
    background-color: $mainBlue;
    color: $white;
  }

  &.btn-danger {
    background-color: $red;
    color: $white;
  }

  &.btn-positive {
    background-color: $green;
    color: $white;
  }

  &.btn-white {
    background-color: $white;
    color: $seaBlue;

    &:active {
      background-color: $lightGrey;
    }

  }

  & + .btn-flat {
    margin-left: 12px;
  }

  &.btn-raised {
    @include shadow-light;

    &:hover {
      @include shadow-medium;
    }
  }
}

.tabs-container {
  background-color: #EEE;
  
  .tabs-content {
    display: flex;

    .tab {
      flex: 1;
      line-height: 46px;
      padding: 0 12px;
      text-align: center;
      text-transform: uppercase;
      cursor: pointer;
      font-weight: bold;
      color: $grey;
      border-bottom: 2px solid transparent;

      &.tab-selected {
        color: $darkGrey;
        border-color: $mainBlue;
      }

      &:hover {
        background-color: #F3F3F3;
      }

      &:active, &:focus {
        text-decoration: none;
      }
    }
  }
}

aside {
  h3 {
    margin: 0;
    margin-bottom: 16px;
    font-weight: bold;
    font-family: $regular;
    font-size: 16px;
    color: $darkGrey;
  }

}


.alert {
  border-radius: 0;
  border-width: 3px;
}

.alert-danger {
  a {
    color: $red;
  }
}

.alert-warning {
  background-color: $lighterOrange;
  border-color: $lightOrange;
  color: $darkOrange;
}

.form-group {
  position: relative;
  padding-top: 16px;
  margin-bottom: 24px;

  .form-control {
    /* margin: 8px 16px; */
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #ddd;
    display: block;
    padding: 4px 0 5px 0;
    box-shadow: none;
    background-color: transparent;
    font-size: 15px;

    &:focus {
      outline: none;
      box-shadow: none;
      border-width: 2px;
      padding-bottom: 4px;
      border-color: $mainBlue;
    }
  }

  .form-control:focus ~ label,
  .form-control.filled ~ label,
  .inline-fields ~ label {
    font-size: 13px;
    top: 0;
  }

  label {
    display: block;
    position: absolute;
    top: 20px;
    transition: bezier(all);
    font-size: 15px;
  }

  .inline-fields {
    display: flex;
    flex-direction: row;

    .form-control + .form-control {
      margin-left: 16px;
    }
  }

  .feedback {
    min-height: 24px;
    line-height: 24px;
    font-size: 14px;
  }

  &.with-error {
    transition: bezier(all);

    label {
      color: $red;
    }

    .form-control {
      border-color: $red;
    }

    .feedback {
      color: $red;
    }
  }
}

.form-row {
  display: flex;
  flex-direction: row;
  margin: 16px 0 8px 0;

  .form-group + .form-group {
    margin-left: 16px;
  }
}

.form-inline {
  .form-group + .btn,
  .btn + .btn {
    margin-left: 8px;
  }
}

.form-error-global {
  color: $orange;
  padding: 10px 0;
}

.label {
  font-family: $thin;
  text-transform: uppercase;
  padding: 0 5px;
  line-height: 1.4;
  border-radius: 2px;

  &.label-default {
    background-color: $lightSeaBlue;
    color: $white;
  }
}

.form-actions {
  margin-top: 30px;
}

.uppercase {
  text-transform: uppercase;
}

.player-avatar {
  display: flex;
  align-items: center;

  .avatar {
    vertical-align: none;
    border-radius: 16px;
    margin-right: 8px;
  }

  .handle {
    flex: 1;
    font-weight: bold;
  }
}


.list-players {
  @include players-list;
}


.list-rankings {
  @include players-list;
  @include rankings;
}


.material-icons {
  @include icon;
}

.loading-block {
  height: 160px;
  margin-top: 80px;
  width: 24px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes pulse {	
  50% { 
    background: $white;
  } 
}

.loading-pulse {
  $base-line-height: 24px;
  $off-white: rgba($white, 0.2);
  $spin-duration: 1s;
  $pulse-duration: 750ms;

  position: relative;
  width: ($base-line-height / 4);
  height: $base-line-height;
  background: $off-white;
  animation: pulse $pulse-duration infinite;
  animation-delay: ($pulse-duration / 3);
  &:before, &:after {
    content: '';
    position: absolute;
    display: block;
    height: ($base-line-height / 1.5);
    width: ($base-line-height / 4);
    background: $off-white;
    top: 50%;
    transform: translateY(-50%);
    animation: pulse $pulse-duration infinite;
  }
  &:before {
    left: -($base-line-height / 2);
  }
  &:after {
    left: ($base-line-height / 2);
    animation-delay: ($pulse-duration / 1.5);
  }
}
