// colors
$primaryColor: #1565c0; // Primary Color
$primaryColorLight: #5e92f3; // Light
$primaryColorDark: #003c8f; // Dark
$secondaryColor: #ffee58; // Secondary Color
$secondaryColorLight: #ffff8b; // Light
$secondaryColorDark: #c9bc1f; // Dark
$grayColor: #f5f5f6; // Gray

html, body {
  min-height: 100%;
  background: $grayColor;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
* {
  box-sizing: border-box;
}
h1, h2, h3, h4, h5, h6 {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
}

// mixin

// Basic Setup

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
  &.c-wp { // without padding
    padding: 0;
  }
  @media screen and (min-width: 992px) {
    width: 975px;
  }
  @media screen and (min-width: 1200px) {
    width: 1100px;
  }
  @media screen and (min-width: 1400px) {
    width: 1200px;
  }
}

.float-left {
  float: left;
}
.float-right {
  float: right;
}

// Webfont

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: local('Material Icons'),
    local('MaterialIcons-Regular'),
    url(../fonts/MaterialIcons-Regular.woff2) format('woff2'),
    url(../fonts/MaterialIcons-Regular.woff) format('woff'),
    url(../fonts/MaterialIcons-Regular.ttf) format('truetype');
}

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

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: 'liga';
}

// Main components

#root {
  header.g {
    background: $primaryColor;
    color: #fff;
    .logo {
      margin: 19px 0;
      width: 77px;
      height: 22px;
      background: url(../img/Hybond.svg) rgba(0, 0, 0, 0) no-repeat;
      background-size: 77px 22px;
      display: inline-block;
    }
    .top-row {
      height: 60px;
      padding: 0 15px;
      @media screen and (min-width: 992px) {
        padding: 0 45px;
      }
      .top-add {
        height: 60px;
      }
      .float-right > div {
        display: -webkit-flex;
        display: -ms-flex;
        display: flex;
        align-items: center;
        .avatar {
          background: #fff;
          color: $primaryColor;
          cursor: pointer;
        }
      }
    }
    .banner {
      text-align: center;
      h1 {
        font-size: 4em;
        font-weight: normal;
        font-style: italic;
        @media screen and (max-width: 425px) {
          font-size: 3.5em;
        }
        br {
          display: none;
          @media screen and (max-width: 425px) {
            display: block;
          }
        }
      }
      .description {
        font-size: 130%;
        font-weight: 300;
        br {
          display: none;
          @media screen and (min-width: 768px) and (max-width: 992px) {
            display: block;
          }
        }
      }
    }
    .error {
      width: 95%;
      max-width: 620px;
      margin: 0 auto;
      margin-top: -40px;
      transform: translateY(40px);
      padding: 10px;
      box-sizing: border-box;
      background: #20252d;
      border-radius: 5px;
      box-shadow: 0 6px 25px rgba(#000, .5);
      font-size: 80%;
      line-height: 1.3;
      .error-top-bar {
        position: relative;
        .error-btns {
          position: absolute;
          left: 0;
        }
        button {
          border-radius: 100%;
          border: 1px solid rgba(#000, .3);
          width: 14px;
          height: 14px;
          outline: none;
          margin-right: 7px;
          cursor: default;
          &.error-close-btn {
            background: #ec6a5f;
            &:active {
              background: #b1534b;
            }
          }
          &.error-fake-btn-y {
            background: #f5bf4f;
            &:active {
              background: #ad8a40;
            }
          }
          &.error-fake-btn-g {
            background: #62c655;
            &:active {
              background: #427e3b;
            }
          }
        }
        p {
          text-align: center;
          cursor: default;
          line-height: 1.5;
        }
      }
      .error-ascii-art {
        font-family: 'Courier New', 'Courier', 'mono';
        line-height: .63;
        font-size: 60%;
        overflow: hidden;
        color: #39598c;
        text-align: center;
        @media screen and (max-width: 768px) {
          display: none;
        }
      }
      p {
        margin: 0;
      }
      .error-alert {
        color: #f49c4e;
      }
      .error-comment-out {
        color: #39598c;
      }
      .error-input {
        color: #fff;
        opacity: .8;
        &::after {
          content: '';
          display: inline-block;
          margin-bottom: -4px;
          width: .4em;
          height: 1em;
          background: rgba(#fff, .3);
        }
      }
    }
  }
  main {
    padding: 30px 0;
    padding-bottom: 50px;
    min-height: 400px;
    border-radius: 2px;
    @media screen and (max-width: 768px) {
      border-radius: 0;
      box-shadow: none;
    }
    .container {
      padding: 0 15px;
    }
    // Basic elements
    h1.big {
      font-size: 3em;
      text-align: center;
      font-weight: bold;
    }
    h1 {
      font-size: 2.6em;
    }
    // Other elements
    .proj-description {
      text-align: center;
      margin-top: -1.3em;
      margin-bottom: 2.8em;
      font-weight: bold;
      a {
        font-weight: normal;
        text-decoration: none;
        color: $primaryColor;
        &:hover {
          border-bottom: 2px solid $primaryColor;
        }
      }
    }
  }
  footer.g {
    padding: 30px 23px;
    padding-bottom: 60px;
    line-height: 1.5;
    font-size: 14px;
    color: #888;
    a {
      text-decoration: none;
      color: #333;
    }
    .footer-links {
      a {
        @media screen and (min-width: 768px) {
          margin: 0 .5em;
          &:first-child {
            margin-left: 0;
          }
        }
      }
    }
  }
}

// Flow chart

$chartColor: #232c38;

.flow-chart {
  height: 270px;
  width: 100%;
  background: $chartColor;
  color: #fff;
  overflow: auto;
  margin-bottom: 40px;
  &::after {
    content: '';
    width: 100%;
    height: 4px;
    position: absolute;
    left: 0;
    top: 40px;
    background: url(../img/dots.svg) $primaryColor;
    background-size: 9px 4px;
  }
  section {
    width: auto;
    padding: 0 70px;
    padding-top: 120px;
    height: 100%;
    display: inline-block;
    column-width:160px;
    column-gap: 10px;
    position: relative;
    @media screen and (min-width: 768px) {
      &:first-child {
        &::before {
          content: '';
          display: block;
          position: absolute;
          left: 0;
          top: 0;
          width: 60px;
          height: 100%;
          background: none;
          background: linear-gradient(right , rgba($chartColor, 0) , $chartColor 100%);
          background: -webkit-linear-gradient(right , rgba($chartColor, 0) , $chartColor 100%);
          background: -moz-linear-gradient(right , rgba($chartColor, 0) , $chartColor 100%);
        }
      }
      &:last-child {
        &::before {
          content: '';
          display: block;
          position: absolute;
          right: 0;
          top: 0;
          width: 60px;
          height: 100%;
          background: none;
          background: linear-gradient(left , rgba($chartColor, 0) , $chartColor 100%);
          background: -webkit-linear-gradient(left , rgba($chartColor, 0) , $chartColor 100%);
          background: -moz-linear-gradient(left , rgba($chartColor, 0) , $chartColor 100%);
        }
      }
    }
    button {
      text-align: left;
      width: 160px;
      height: 40px;
      border-radius: 20px;
      background: rgba(#000, .15);
      margin-bottom: 10px;
      border: none;
      padding-left: 40px;
      padding-right: 15px;
      outline: none;
      position: relative;
      transition: all .3s;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: rgba(#fff, .8);
      font-weight: bold;
      &:hover {
        background: rgba(#000, .3);
        color: #fff;
      }
      .flow-chart-color {
        position: absolute;
        left: 14px;
        top: 20px;
        margin-top: -7px;
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-right: 8px;
        border-radius: 100%;
      }
    }
    .flow-chart-title {
      .flow-chart-dot {
        display: block;
        position: absolute;
        left: 50%;
        top: -25px;
        margin-left: -5px;
        width: 10px;
        height: 10px;
        border-radius: 100%;
        background: $primaryColor;
        box-shadow: 0 0 0 5px rgba(245, 245, 246, 0.12);
      }
      font-size: 1.2em;
      color: #a3b1c3;
      position: absolute;
      top: 61px;
      left: 70px;
      height: 35px;
      line-height: 30px;
      padding: 0 .7em;
    }
  }
}

// Flow chart End.

// Introduction

.introduction {
  .part-name {
    font-size: 1.7em;
  }
  .proj-name {
    font-weight: bold;
    margin-top: .3em;
    margin-bottom: 0;
  }
  .description {
    margin-top: 0;
    font-size: 120%;
    color: #7e7e7e;
    margin-bottom: 1.5em;
  }
  .introduction-dot {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 100%;
  }
  a {
    text-decoration: none;
    color: $primaryColor;
    &:hover {
      border-bottom: 2px solid $primaryColor;
    }
  }
  code {
    border: 1px solid #efefef;
    background: #fafafa;
    padding: 2.5em 1.7em 1em;
    font-size: 13px;
    position: relative;
    border-radius: 2px;
    &::after {
      content: 'code';
      position: absolute;
      left: 1.7em;
      top: .5em;
      color: #858585;
      font-size: 80%;
    }
  }
  .details {
    width: 100%;
    @media screen and (min-width: 992px) {
      width: 35%;
    }
    float: left;
    h2 {
      padding-top: .2em;
      padding-bottom: .3em;
    }
    ul {
      margin: 0;
      padding: 0;
      display: table;
      line-height: 2;
      li {
        list-style: none;
        display: table-row;
        &.devide {
          label {
            padding-bottom: .5em;
          }
        }
        label {
          display: table-cell;
          padding-right: 15px;
          color: #7e7e7e;
        }
        span {
          display: table-cell;
          a {
            text-decoration: none;
            color: $primaryColor;
            &:hover {
              border-bottom: 2px solid $primaryColor;
            }
          }
        }
        .details-tooltip-pin {
          position: relative;
        }
        &:hover {
          .details-tooltip {
            visibility: visible;
            opacity: 1;
          }
        }
        .details-tooltip {
          z-index: 10;
          width: 330px;
          height: 40px;
          visibility: hidden;
          opacity: 0;
          transition: opacity .3s .3s;
          position: absolute;
          left: 100%;
          padding-left: 10px;
          top: -4px;
          background: #fff;
          overflow: hidden;
          input {
            width: 320px;
            height: 40px;
            padding: 0 10px;
            outline: none;
            border: 1px solid #dfdfdf;
            display: inline-block;
            background: #fff;
            border-radius: 2px;
            &::selection, &-moz-::selection {
              background: rgba(#000, .05);
            }
          }
          button {
            position: absolute;
            z-index: 4;
            top: 0;
            right: 0;
            width: 95px;
            padding-left: 15px;
            height: 40px; // to fix the 1px bug
            border: 1px solid #dfdfdf;
            border-left: none;
            background: #fff;
            background: linear-gradient(left , rgba(#fff, .0) , #fff 16%);
            background: -webkit-linear-gradient(left , rgba(#fff, .0) , #fff 16%);
            background: -moz-linear-gradient(left , rgba(#fff, .0) , #fff 16%);
            color: $primaryColor;
            display: inline-block;
            outline: none;
            border-radius: 0 2px 2px 0;
          }
          .link-return {
            position: absolute;
            right: 0;
            top: 0;
            width: 320px;
            height: 40px;
            z-index: 10;
            background: rgba(#fff, .9);
            visibility: hidden;
            text-align: center;
            line-height: 40px;
            border-radius: 2px;
            @keyframes inAndOutFade{
              0% {opacity:0;
              visibility: hidden;}
              20% {opacity:1;
              visibility: visible;}
              80% {opacity:1;
              visibility: visible;}
              100% {opacity:0;
              visibility: hidden;}
            }
            &.details-tooltip-success {
              $color: #43a047;
              color: $color;
              border: 1px solid $color;
              animation:inAndOutFade 2s .2s ease both;
            }
            &.details-tooltip-error {
              $color: #d93737;
              color: $color;
              border: 1px solid $color;
              animation:inAndOutFade 2s .2s ease both;
            }
          }
        }
      }
    }
  }
  .install {
    width: 100%;
    @media screen and (min-width: 992px) {
      width: 65%;
    }
    float: right;
    h2 {
      padding-top: .2em;
      padding-bottom: .3em;
    }
  }
  .docs {
    width: 100%;
    @media screen and (min-width: 992px) {
      width: 35%;
      padding-top: .4em;
    }
    float: left;
    h2 {
      padding-top: .2em;
      padding-bottom: .3em;
    }
    ul {
      padding: 0;
      margin: 0;
      @media screen and (max-width: 768px) {
        column-width: 300px;
      }
      li {
        list-style: none;
        line-height: 1.8;
        padding-bottom: .2em;
      }
    }
  }
}

// Manage

.manage {
  @media screen and (max-width: 768px) {
    &.container {
      padding: 0 !important;
    }
  }
  a {
    text-decoration: none;
    color: $primaryColor;
    border-bottom: 2px solid rgba(#000, 0);
    &:hover {
      border-bottom-color: $primaryColor;
    }
  }
  .manage-list {
    padding: 0;
    margin-bottom: 2.5em;
    @media screen and (max-width: 768px) {
      margin: 0;
    }
    box-shadow: 0 3px 2px rgba(#000, .1);
    border-radius: 2px;
    li {
      display: block;
      list-style: none;
      background: #fff;
      margin-bottom: 0;
      padding: 1em 1.5em;
      border-bottom: 1px solid #ddd;
      position: relative;
      @media screen and (max-width: 768px) {
        margin: 0;
        border: none;
        border-bottom: 1px solid #dddddd;
        border-radius: 0;
        box-shadow: 0;
        &:first-child {
          border-top: 1px solid #dddddd;
        }
      }
      &:first-child {
        border-radius: 2px 2px 0 0;
      }
      &:last-child {
        border-radius: 0 0 2px 2px;
        margin-bottom: 0;
        border-bottom: none;
      }
      a {
        display: inline-block;
        font-size: 120%;
      }
      .description {
        display: block;
      }
      .manage-list-left {
        float: left;
        @media screen and (min-width: 768px) {
          max-width: 722px;
        }
      }
      .manage-list-right {
        float: right;
        @media screen and (max-width: 768px) {
          display: none;
        }
      }
    }
  }
  .manage-page {
    display: -webkit-flex;
    display: -ms-flex;
    display: flex;
    justify-content: center;
    .stepper {
      box-shadow: 0 3px 2px rgba(#000, .1);
      @media screen and (max-width: 768px) {
        width: 100%;
        border-top: 1px solid #ddd;
      }
    }
    button {
      &:first-child {
        margin-right: 10px;
      }
      &:last-child {
        margin-left: 10px;
      }
    }
  }
}

// Guide

.guide {
  margin-bottom: -50px;
  .guide-control {
    margin-top: -40px;
    &.fixed {
      position: fixed;
      overflow: hidden;
      padding-bottom: 8px;
      top: 0;
      width: 100%;
      margin-top: 0;
      z-index: 500;
      .guide-filter {
        border-bottom: none;
        box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
      }
    }
    .guide-search {
      height: 54px;
      position: relative;
      background: #181c21;
      .container {
        position: relative;
        height: 54px;
      }
      input {
        position: relative;
        z-index: 10;
        width: 100%;
        height: 100%;
        border: none;
        outline: none;
        background: none;
        color: #fff;
        padding: 0 15px 0 45px;
        font-size: 18px;
      }
      label {
        z-index: 5;
        position: absolute;
        top: 0;
        left: 15px;
        color: #fff;
        font-size: 21px;
        text-align: center;
        width: 45px;
        height: 54px;
        line-height: 60px;
        opacity: .7;
      }
    }
    .guide-filter {
      height: 54px;
      overflow-x: scroll;
      overflow-y: hidden;
      border-bottom: 1px solid #ececec;
      background: #fff;
      button {
        height: 54px;
      }
    }
  }
  .fixed + .guide-sections {
    padding-top: 68px !important;
  }
  .guide-sections {
    h2, h3 {
      padding: 0 16px;
    }
    h2 {
      opacity: .7;
    }
    h3 {
      opacity: .4;
    }
    section {
      &:first-child {
        padding-top: 20px;
      }
      &:last-child {
        padding-bottom: 30px;
      }
    }
    .guide-form {
      text-align: center;
      .guide-stepper {
        display: -webkit-flex;
        display: -ms-flex;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 20px;
        margin-bottom: 10px;
        .guide-avatar {
          margin-right: 10px;
          background: $primaryColor;
        }
      }
      .guide-btn {
        width: 100%;
        display: inline-block;
        padding: 30px;
        color: #fff;
        background: #2b2b2b;
        background-position: right bottom;
        background-repeat: no-repeat;
        background-size: 180px;
        transition: background .3s;
        p {
          margin: 0;
          text-align: left;
          line-height: 1.2;
          font-weight: lighter;
          &.big {
            font-size: 300%;
          }
        }
        &#guide-btn-ss {
          margin-bottom: 10px;
          background-image: url(../img/snapshot.svg);
        }
        &#guide-btn-np {
          background-image: url(../img/normal_project.svg);
        }
        &.active {
          background-color: $primaryColor;
          background-size: 200px;
        }
        @media screen and (min-width: 768px) {
          width: 300px;
          &#guide-btn-ss {
            margin-right: 20px;
          }
        }
      }
      .hidden {
        display: none;
        visibility: hidden;
      }
      .guide-input {
        display: -webkit-flex;
        display: -ms-flex;
        display: flex;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        @media screen and (min-width: 768px) {
          width: 300px;
        }
      }
    }
    .guide-page {
      h3 {
        display: none;
      }
      .guide-hot, .guide-all {
        //column-gap: 25px;
        //column-width: 275px;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-pack: start;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -webkit-box-align: stretch;
        -webkit-align-items: stretch;
        align-items: stretch;
      }
      .guide-card {
        width: 33.33333%;
        position: relative;
        @media screen and (max-width: 992px) {
          width: 50%;
        }
        @media screen and (max-width: 625px) {
          width: 100%;
        }
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        flex-direction: column;
        .guide-wrap {
          z-index: 10;
          -webkit-box-flex: 1;
          -webkit-flex: 1;
          flex: 1;
          position: relative;
          display: block;
          margin: 0 10px;
          border-radius: 2px;
          box-shadow: 0 3px 2px rgba(#000, .2);
          background: #fff;
          margin-bottom: 20px;
          padding: 16px;
          padding-bottom: 50px;
          transition: box-shadow .3s, transform .4s, z-index .4s, box-shadow .2s;
          transform: perspective(999px);
          transform-origin: top;
          &:hover {
            box-shadow: 0 7px 12px rgba(#000, .3);
          }
          > span {
            font-size: 80%;
            padding: 5px 0 15px 10px;
            display: block;
            opacity: .8;
          }
          .tag {
            height: 46px;
            border-radius: 23px;
            background-color: $primaryColor;
            background-image: linear-gradient(left , rgba(#000, .0) 15%, rgba(#000, .3) 100%);
            background-image: -webkit-linear-gradient(left , rgba(#000, .0) 15%, rgba(#000, .3) 100%);
            background-image: -moz-linear-gradient(left , rgba(#000, .0) 15%, rgba(#000, .3) 100%);
            color: #fff;
            line-height: 46px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding-left: 46px;
            position: relative;
            font-weight: bold;
            .tag-dot {
              width: 20px;
              height: 20px;
              border-radius: 100%;
              position: absolute;
              border: 2px solid rgba(#fff, .5);
              top: 50%;
              left: 15px;
              margin-top: -10px;
            }
          }
          .description {
            line-height: 1.4;
            padding: 0 10px;
          }
          footer {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 46px;
            border-top: 1px solid #ececec;
            padding: 8px 15px;
            button {
              border: none;
              outline: none;
              &.more {
                height: 30px;
                font-size: 90%;
                min-height: 30px;
                padding: 0 16px;
              }
            }
            .check {
              float: right;
              margin-top: -9px;
            }
          }
        }
      }
    }
  }
  #bottom-bar {
    position: fixed;
    top: 100%;
    margin-top: -60px;
    width: 100%;
    height: 100%;
    z-index: 600;
    background: #fff;
    box-shadow: 0 -4px 5px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px 0 rgba(0, 0, 0, 0.08), 0 -2px 4px -1px rgba(0, 0, 0, 0.15);
    transition: top .7s, margin-top .7s;
    background: #fff;
    .top.container {
      display: -webkit-flex;
      display: -ms-flex;
      display: flex;
      height: 60px;
      align-items: center;
    }
    p.header {
      flex: 1;
    }
    &.unfolded {
      top: 0;
      margin-top: 0;
      overflow: auto;
    }
    .introduction {
      margin-top: 30px;
      margin-bottom: 30px;
    }
  }
}
