@import "../../node_modules/material-design-lite/material.min";

$button-margin: 4px;
$site-container-width: 255px;
$footer-height: 50px;
$header-height: 100px;
$menu-color: #263238;
$menu-padding: 40px;
$menu-width: 220px;
$alias-dialog-width: 440px;

a {
  text-decoration: none;

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

%base-container {
  background-color: #e4eaec;
  border: 1px solid rgba(0, 0, 0, .2);
  display: inline-block;
  letter-spacing: 1px;
  font-weight: 500;
  margin: $button-margin;
  padding: 10px;
  width: $site-container-width;
}

.options-tab {
  padding: 0 15px;

  #hotkeys-table {
    margin-bottom: 30px;

    td {
      text-align: left;
    }
  }
}

.sitelist {
  margin-bottom: 320px;

  .sitelist-info {
    border-bottom: 3px solid $menu-color;
    display: flex;
    margin: 20px -5px 20px -15px;
    justify-content: space-around;

    .info-block {
      @extend %base-container;

      margin-bottom: 20px;

      p {
        text-align: left;
      }

      h4 {
        margin: 5px 0;
      }
    }
  }
}

.site-container {
  @extend %base-container;

  &.disabled {
    background-color: #9b2000;
    color: #fff;
  }

  h5 {
    margin-top: 8px;
    margin-bottom: 10px;
    text-align: center;
  }
}

.site-controls {
  margin-top: 10px;

  .site-settings-button {
    background-color: #d6dbdd !important;
    padding: 0 8px;

    i {
      font-size: 22px;
      margin-top: -2px;
    }
  }

  .site-alias-button {
    min-width: 80px;
  }

  .controls-group {
    float: left;
    margin-right: 20px;

    &:last-child {
      margin-right: 0;
    }

    .input-header {
      display: block;
      font-weight: 600;
      margin-bottom: 2px;
      margin-left: 1px;
    }
  }

  .site-priority-input {
    button {
      min-width: 60px;
      padding: 0;
    }

    .label {
      margin-left: 10px;
    }

    .mdl-menu,
    .mdl-menu__outline {
      min-width: 60px !important;
      width: 60px !important;

      .mdl-menu__item {
        height: 34px;
        line-height: 34px;
        text-align: center;
      }
    }
  }
}

.setting {
  font-size: 16px;

  input[type='checkbox'] {
    cursor: pointer;
    margin-right: 5px;
  }

  label {
    cursor: pointer;
    font-weight: 400;
  }
}

.main {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

#general {
  margin-bottom: 80px;
}

.main-container {
  display: flex;
  flex: 1;

  .content {
    background-color: #f1f4f5;
    flex: 1;
  }

  .menu {
    background-color: $menu-color;
    flex: 0 0 $menu-width;
    order: -1;
    width: $menu-width;

    ul {
      list-style: none;
      margin: 0;
      padding: $menu-padding 0 0 0;

      li {
        a {
          color: #a3afb7;
          display: block;
          font-size: 16px;
          font-weight: 500;
          line-height: 50px;
          padding: 0 10px 0 30px;

          &.selected {
            background-color: #242f35;
            border-bottom: 1px solid rgba(0, 0, 0, .06);
            border-top: 1px solid rgba(0, 0, 0, .06);
            color: #fff;
          }

          &:active,
          &:hover {
            color: rgba(255, 255, 255, .8);
            background-color: #76838f;
          }
        }

        .menu-arrow {
          display: inline-block;
          font-size: 24px;
          vertical-align: middle;

          &:before {
            content: "\232A";
          }
        }

        .menu-title {
          display: inline-block;
          width: calc(#{$menu-width} - 65px);
        }
      }
    }
  }
}

.header {
  background-color: #2880c7;
  box-shadow: 1px 0 3px 0 rgba(0, 0, 0, 0.8);
  color: #fff;
  display: block;
  height: $header-height;

  h1 {
    margin: 0;
    padding: 14px 30px;
  }
}

.footer {
  background-color: #e4eaec;
  height: $footer-height;
  margin-left: $menu-width;
  margin-top: -$footer-height;
  text-align: center;

  .footer-content {
    padding: 15px;

    a {
      letter-spacing: .4px;
      margin-right: 25px;
    }
  }
}

.site-enabled-icon {
  margin-left: 6px;
  margin-top: 2px;
}

.loader-container {
  background-color: #d9d9e0;
  display: inline-block;
  height: 100%;
  left: 0;
  opacity: .8;
  position: fixed;
  text-align: center;
  top: 0;
  width: 100%;
  z-index: 10;

  // TODO: clean this up
  .loader {
    left: calc(50% + 100px);
    margin: 0;
    top: calc(100vh / 2 - 1em);
  }
}

.alias-dialog {
  h3 {
    margin: 0 0 10px 0;
  }

  h5 {
    text-align: left;
  }

  .alias-input-container {
    margin-bottom: 15px;

    button {
      float: right;
      margin-top: 15px;
    }

    .mdl-textfield {
      width: 250px;
    }
  }

  .alias-container {
    margin-bottom: 10px;

    .label {
      font-size: 16px;
      line-height: 36px;
    }

    button {
      float: right;
    }
  }
}

// Include MDL dialog styles
// @see http://getmdl.io/components/index.html#dialog-section
.mdl-dialog {
  border: none;
  box-shadow: 0 9px 46px 8px rgba(0, 0, 0, 0.14), 0 11px 15px -7px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.2);
  width: $alias-dialog-width;
}

.mdl-dialog__title {
  padding: 24px 24px 0;
  margin: 0;
  font-size: 2.5rem;
}

.mdl-dialog__actions {
  padding: 8px 8px 8px 24px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: row-reverse;
  -ms-flex-direction: row-reverse;
  flex-direction: row-reverse;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.mdl-dialog__actions > * {
  margin-right: 8px;
  height: 36px;
}

.mdl-dialog__actions > *:first-child {
  margin-right: 0;
}

.mdl-dialog__actions--full-width {
  padding: 0 0 8px 0;
}

.mdl-dialog__actions--full-width > * {
  height: 48px;
  -webkit-flex: 0 0 100%;
  -ms-flex: 0 0 100%;
  flex: 0 0 100%;
  padding-right: 16px;
  margin-right: 0;
  text-align: right;
}

.mdl-dialog__content {
  padding: 20px 24px 24px 24px;
  color: rgba(0, 0, 0, 0.54);
}

// @see http://projects.lukehaas.me/css-loaders/
.loader {
  margin: 100px auto;
  font-size: 25px;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  position: relative;
  text-indent: -9999em;
  -webkit-animation: load5 1.1s infinite ease;
  animation: load5 1.1s infinite ease;
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
}
@-webkit-keyframes load5 {
  0%,
  100% {
    box-shadow: 0em -2.6em 0em 0em #ffffff, 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.5), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7);
  }
  12.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.7), 1.8em -1.8em 0 0em #ffffff, 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5);
  }
  25% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.5), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7), 2.5em 0em 0 0em #ffffff, 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  37.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5), 2.5em 0em 0 0em rgba(255, 255, 255, 0.7), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.5), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.7), 0em 2.5em 0 0em #ffffff, -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  62.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.5), 0em 2.5em 0 0em rgba(255, 255, 255, 0.7), -1.8em 1.8em 0 0em #ffffff, -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  75% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.5), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.7), -2.6em 0em 0 0em #ffffff, -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  87.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.5), -2.6em 0em 0 0em rgba(255, 255, 255, 0.7), -1.8em -1.8em 0 0em #ffffff;
  }
}
@keyframes load5 {
  0%,
  100% {
    box-shadow: 0em -2.6em 0em 0em #ffffff, 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.5), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7);
  }
  12.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.7), 1.8em -1.8em 0 0em #ffffff, 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5);
  }
  25% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.5), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7), 2.5em 0em 0 0em #ffffff, 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  37.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5), 2.5em 0em 0 0em rgba(255, 255, 255, 0.7), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.5), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.7), 0em 2.5em 0 0em #ffffff, -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  62.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.5), 0em 2.5em 0 0em rgba(255, 255, 255, 0.7), -1.8em 1.8em 0 0em #ffffff, -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  75% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.5), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.7), -2.6em 0em 0 0em #ffffff, -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
  }
  87.5% {
    box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.5), -2.6em 0em 0 0em rgba(255, 255, 255, 0.7), -1.8em -1.8em 0 0em #ffffff;
  }
}
