/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

$font-stack: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
$display-font: 'Open Sans';
$svg-font: 'Source Code Pro';
$primary-text: #19273C;
$secondary-text: #8C9696;
$first-highlight: #3F55AF;
$second-highlight: #5068C2;
$third-highlight: #F9F9F9;
$fourth-highlight: #F1F3F7;
$fifth-highlight: #B8C1C1;
$sixth-highlight: #2D3D7D;
$error-colour-1: #FF5C49;
$error-colour-2: #F7E6E6;
$success-colour: #40d5bb;
$keyline-highlight: #E3ECEC;
$white: #FDFDFD;
$black: #000000;
$callout: #FFD640;

.docs-container {
  display: grid;
  grid-template-columns: 25% 20% 20% 20% 15%;
  grid-template-rows: 20% 20% 20% 20% 20%;

  hr {
    display: none;
  }

  .page-sidebar-grid {
    grid-column-start: 1;
    grid-column-end: 2;
    justify-items: start;
    overflow-y: scroll;
    height: 100vh;
    background-color: $white;

    // Scrollbar overrides
    &::-webkit-scrollbar {
      display: none;
    }
    -ms-overflow-style: none;  // IE 10+

    .docs-pagenav-grid {
      padding-top: 5vh;

      .navbar-brand {
        padding-left: 2rem;
        text-decoration: none;
        color: $primary-text;
        font-size: 1rem;
        display: inline-block;
      }

      .top-nav-docs {
        padding-left: 2rem;
        padding-top: 0.5rem;
        a {
          text-decoration: none;
          color: $secondary-text;
          font-size: 0.9rem;
          padding-right: 1rem;

          &:hover {
            color: $first-highlight;
          }
        }
      }

      ul {
        list-style: none;
        padding-left: 2rem;
        li {
          a {
            font-size: 0.9rem;
            text-decoration: none;
            color: $primary-text;
          }
        }
      }
    }

    .docs-current-page-grid {
      p {
        font-weight: 300;
        font-size: 1.5rem;
        padding: 2rem;
        display: block;
      }
    }

    .context-nav {

      ul {
        padding-left: 0;
        margin: 0;

      li {
        list-style: none;
        position: relative;
        overflow: hidden;
        transition: 0.4s;
        background-color: $white;
        &.hide {
            height: 4rem !important;
            background-color: $white;
        }
        &:hover {
          &:after {
              content: " ";
              position: absolute;
              top: 0;
              right: 0px;
              bottom: 0;
              background-color: $first-highlight;
          }
        }
        &.active {
          height: auto !important;
          border-left-color: $first-highlight;
          &:after {
              content: " ";
              position: absolute;
              top: 0;
              right: 0px;
              bottom: 0;
              background-color: $first-highlight;
          }
        }
        &.activeBorder {
          border-right: 3px solid $first-highlight;
          transition: none;
        }
        a {
          padding-left: 2rem;
          padding-right: 1rem;
          display: block;
          padding-top: 0.5rem;
          padding-bottom: 0.5rem;
          &.active {
            color: $first-highlight;
          }
        }

        ul {
          list-style: none;
          padding-left: 0;
          margin: 0;
          margin-left: 0rem;
          margin-top: 1rem;
          padding-bottom: 2rem;
          &:hover {
            &:after {
                content: " ";
                position: absolute;
                top: 0;
                right: 0px;
                bottom: 0;
                background-color: $first-highlight;
            }
          }

          li {
            border-bottom: none;
            border-left: 3px solid $white;
            &:hover {
              border-left: 3px solid $first-highlight;
              border-right: none;
            }
          }
        }
      }

      .caret {
        float: right;
        width: 13px;
        height: 13px;
        padding: 10px;
        margin-top: -10px;
        &.hidden {
          visibility: hidden;
        }
      }

    }

      a {
        text-decoration: none;
        color: $primary-text;
        font-size: 0.9rem;
      }

      .docs-footer-grid {
        margin-top: 5rem;
        margin-bottom: 2rem;
        align-items: end;

        p {
          font-size: 0.8rem;
          color: grey;
          padding-left: 2rem;
        }

        ul {
          list-style: none;
          margin: 0;

          li {
            border-bottom: none;
            padding: 0;
            background-color: $white !important;

            &:hover {
              border-right: none;
            }

            a {
              font-size: 0.8rem;
              color: grey;
              margin: 0;
              padding-left: 2rem;
              padding-top: 0;
              padding-bottom: 0;

              &:hover {
                color: $first-highlight;
              }
            }
          }
        }
      }

    }
  }

  .page-content-grid {
    grid-column-start: 2;
    grid-column-end: 6;
    background-color: $third-highlight;
    overflow-y: scroll;
    height: 100vh;

    // ::-webkit-scrollbar {
    //   display: initial;
    // }

    .content-chunk {
      margin-left: 2rem;
      max-width: 750px;
      margin-top: 5vh;
      margin-bottom: 3rem;

      ul {
        font-size: 0.9rem;
      }

    }

  }

}

// Text styles

   .SiteWrapper {
    .content {
      .page-content-grid {
        .content-chunk {

          p {
            margin-top: 1.3rem;

            code {
              background-color: white;
              border: 1px solid $keyline-highlight;
              padding-top: 1px;
              padding-bottom: 2px;
              padding-left: 4px;
              color: $primary-text;
              border-radius:1px;
            }
          }

          h1 {
            font-weight: 300;
            font-size: 2em;
            margin-bottom: 3rem;
            padding-top: 5rem;

            &:first-of-type {
              padding-top: 0;
            }
          }

          h2 {
            margin-top: 2rem;
          }

          h3 {
            font-family: $font-stack;
            font-weight: 300;
            font-size: 1.2rem;
            line-height: 130%;
            color: $primary-text;
            margin-top: 2rem;
          }

          blockquote {
            background-color: white;
            padding: 1rem;
            padding-left: 2rem;
            margin-left: 0;
            margin-right: 0;
            border-left: 4px solid $first-highlight;
          }

          pre {
            background-color: #272B36;
            padding: 1rem;
            color: white;
            border-radius: 4px;
            padding-right: 4rem;

            code {
              padding-right: 35px;
            }
          }

          code {
            border-radius: 2px;
            padding-right: 5px;
            padding-top: 1px;
            padding-bottom: 1px;
            font-family: $svg-font;
            font-size: 0.8rem;
          }

          img {
            max-width: 100%;
            border: 1px solid $keyline-highlight;
          }

          ul {
            list-style: none;
            padding-left: 2em;
            text-indent: -1em;
            color: $primary-text;

            li:before {
              color: $primary-text;
              content: '- \0000a0';
              font-size: 1rem;
              font-weight: 600;
            }

            li {
              padding-bottom: 0.5rem;
              p {
                display: inline;
              }

            }
          }

          ol {
            border-left: 1px solid $keyline-highlight;
            font-family: $font-stack;
            font-size: 0.9rem;
            color: $primary-text;
            li {
                margin-top: 1.3rem;
            }
          }

        a {
          color: $first-highlight;
        }

        .support-button {
          position: relative;
          text-align: center;
          white-space: nowrap;
          vertical-align: middle;
          -ms-touch-action: manipulation;
          touch-action: manipulation;
          user-select: none;
          background-image: none;
          border: 1px solid transparent;
          border-radius: 5px;
          margin: 0;
          box-shadow: none;
          line-height: 40px;
          cursor: pointer;
          background-color: $white;
          width: auto;
          font-family: $font-stack;
          font-size: 0.9rem;
          font-weight: 400;
          transition: 0.4s cubic-bezier(0.075, 0.820, 0.165, 1.000);
          min-width: 140px;
          text-decoration: none;
          padding: 0.5rem;
          padding-left: 1.5rem;
          padding-right: 1.5rem;

          &.primary {
            background-color: $first-highlight;
            border-color: $first-highlight;
            color: $white;

            &:hover {
              background-color: $sixth-highlight;
            }
          }

        }

        // Table styling

        table {
          font-size: 0.8rem;
          display: block;
          background-color: white;
          padding: 1rem;

          td {
            border-bottom: 1px solid $keyline-highlight;
            padding-bottom: 1rem;
            padding-top: 1rem;
            padding-right: 1rem;
            padding: 1rem;
          }

          th {
            padding-bottom: 1rem;
            padding-top: 1rem;
            padding-right: 1rem;
            padding: 1rem;
            color: $secondary-text;
          }

          thead {
            font-weight: 600;
            padding-bottom: 1rem;
          }
          tbody {
            tr {
              transition: 0.4s cubic-bezier(0.075, 0.820, 0.165, 1.000);
              &:last-of-type {
                td {
                  border-bottom: none;
                }
                &:hover {
                  background-color: transparent;
                }

              }
              &:hover {
                background-color: $third-highlight;

              }
            }
          }
        }

        }
      }
    }
  }

  //media queries

  @media only screen and (max-width: 1440px) {
    .docs-container {
      grid-template-columns: 25% 25% 25% 25%;
    }
  }

  @media only screen and (max-width: 1024px) {
    .docs-container {
      grid-template-columns: 20% 20% 20% 20% 20%;

      .page-sidebar-grid {
        grid-column-start: 1;
        grid-column-end: 3;
      }

      .page-content-grid {
        grid-column-start: 3;
        grid-column-end: 6;
        .content-chunk {
          margin-left: 2rem;
          max-width: 550px;
        }
      }

    }
  }

  @media only screen and (max-width: 768px) {
    .docs-container {
      .page-content-grid {
        .content-chunk {
          max-width: 400px;
        }
      }
    }
  }

  @media only screen and (max-width: 599px) {
    .docs-container {
      .page-sidebar-grid {
        grid-column-start: 1;
        grid-column-end: 6;
        overflow-y: auto;

        // #off-canvas {
        //     position: fixed; /* or choose `absolute` depending on desired behavior*/
        //     top: 0;
        //     bottom: 0;
        //     width: 300px;
        //     left: -340px;
        //     transition: transform .3s ease-in-out;
        // }

      }

      .page-content-grid {
        grid-column-start: 1;
        grid-column-end: 6;
        padding-right: 2rem;
        overflow-y: auto;
        .content-chunk {
          max-width: 400px;
        }
      }
    }

    // .toggle {
    //   display: inline-block;
    //   }
    //
    //   #nav:target {
    //   transform: translateX(340px);
    // }

    }

// CSS Styles for Code highlighting
.highlight { border-radius: 4px; position: relative;}
.highlight .hll { background-color: #424242 }
// .highlight  { background: #000000; color: #eaeaea }
.highlight .c { color: #969896 } /* Comment */
.highlight .err { color: #d54e53 } /* Error */
.highlight .k { color: #c397d8 } /* Keyword */
.highlight .l { color: #e78c45 } /* Literal */
.highlight .n { color: #eaeaea } /* Name */
.highlight .o { color: #70c0b1 } /* Operator */
.highlight .p { color: #eaeaea } /* Punctuation */
.highlight .cm { color: #969896 } /* Comment.Multiline */
.highlight .cp { color: #969896 } /* Comment.Preproc */
.highlight .c1 { color: #969896 } /* Comment.Single */
.highlight .cs { color: #969896 } /* Comment.Special */
.highlight .gd { color: #d54e53 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gh { color: #eaeaea; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #b9ca4a } /* Generic.Inserted */
.highlight .gp { color: #969896; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #70c0b1; font-weight: bold } /* Generic.Subheading */
.highlight .kc { color: #c397d8 } /* Keyword.Constant */
.highlight .kd { color: #c397d8 } /* Keyword.Declaration */
.highlight .kn { color: #70c0b1 } /* Keyword.Namespace */
.highlight .kp { color: #c397d8 } /* Keyword.Pseudo */
.highlight .kr { color: #c397d8 } /* Keyword.Reserved */
.highlight .kt { color: #e7c547 } /* Keyword.Type */
.highlight .ld { color: #b9ca4a } /* Literal.Date */
.highlight .m { color: #e78c45 } /* Literal.Number */
.highlight .s { color: #b9ca4a } /* Literal.String */
.highlight .na { color: #7aa6da } /* Name.Attribute */
.highlight .nb { color: #eaeaea } /* Name.Builtin */
.highlight .nc { color: #e7c547 } /* Name.Class */
.highlight .no { color: #d54e53 } /* Name.Constant */
.highlight .nd { color: #70c0b1 } /* Name.Decorator */
.highlight .ni { color: #eaeaea } /* Name.Entity */
.highlight .ne { color: #d54e53 } /* Name.Exception */
.highlight .nf { color: #7aa6da } /* Name.Function */
.highlight .nl { color: #eaeaea } /* Name.Label */
.highlight .nn { color: #e7c547 } /* Name.Namespace */
.highlight .nx { color: #7aa6da } /* Name.Other */
.highlight .py { color: #eaeaea } /* Name.Property */
.highlight .nt { color: #70c0b1 } /* Name.Tag */
.highlight .nv { color: #d54e53 } /* Name.Variable */
.highlight .ow { color: #70c0b1 } /* Operator.Word */
.highlight .w { color: #eaeaea } /* Text.Whitespace */
.highlight .mf { color: #e78c45 } /* Literal.Number.Float */
.highlight .mh { color: #e78c45 } /* Literal.Number.Hex */
.highlight .mi { color: #e78c45 } /* Literal.Number.Integer */
.highlight .mo { color: #e78c45 } /* Literal.Number.Oct */
.highlight .sb { color: #b9ca4a } /* Literal.String.Backtick */
.highlight .sc { color: #eaeaea } /* Literal.String.Char */
.highlight .sd { color: #969896 } /* Literal.String.Doc */
.highlight .s2 { color: #899ff1 } /* Literal.String.Double */
.highlight .se { color: #e78c45 } /* Literal.String.Escape */
.highlight .sh { color: #b9ca4a } /* Literal.String.Heredoc */
.highlight .si { color: #e78c45 } /* Literal.String.Interpol */
.highlight .sx { color: #b9ca4a } /* Literal.String.Other */
.highlight .sr { color: #b9ca4a } /* Literal.String.Regex */
.highlight .s1 { color: #b9ca4a } /* Literal.String.Single */
.highlight .ss { color: #b9ca4a } /* Literal.String.Symbol */
.highlight .bp { color: #eaeaea } /* Name.Builtin.Pseudo */
.highlight .vc { color: #d54e53 } /* Name.Variable.Class */
.highlight .vg { color: #d54e53 } /* Name.Variable.Global */
.highlight .vi { color: #d54e53 } /* Name.Variable.Instance */
.highlight .il { color: #e78c45 } /* Literal.Number.Integer.Long */

// Copy to clipboard

.md-typeset div.highlight {
  position: relative;
  overflow: visible;
  padding: 0;
}
.md-typeset div.highlight pre {
  overflow-x: auto;
  display: block;
  padding: 1rem 1.2rem .8rem;
}

copy-button {
  background-color: #393F4F;
  padding: 0.5rem;
  max-width: 50px;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
  display: inline-block;
  position: absolute;
  top: 0px;
  right: 0px;
  padding-top: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 1rem;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  transition: 0.4s cubic-bezier(0.075, 0.820, 0.165, 1.000);
  line-height: 1rem;
  &:hover {
    background-color: #4B5368;
  }
}

// Search Bar

.search-form {
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 1rem;

  form {
    display: flex;
  }

  .search-box {
    overflow: hidden;
    max-width: 0;
    width: 250px;
    transition: max-width 0.5s ease-in-out;
    border: none;
    padding-top: 8px;
    padding-bottom: 8px;
    font-family: $font-stack;
    color: $primary-text;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 30px;
    border-bottom: 2px solid transparent;
    background-color: $white;

    &.opened {
      max-width: 70%;
      border-bottom: 2px solid $primary-text;
      padding-left: 0.8rem;
      background-color: $white;


      &:focus {
        outline: none;
        border-bottom: 2px solid $first-highlight;
        background-color: $third-highlight;
      }

      &:hover {
        background-color: $third-highlight;
      }
    }
  }

  .search-icon {
    padding-top: 10px;
    cursor: pointer;

    &.hide {
      display: none;
    }

    &:hover {
      fill: $first-highlight;
    }

  }

  .trigger {
    width: 18px;
  }

  .submit-input {
    padding-top: 8px;
    padding-bottom: 8px;
    border: none;
    background-color: transparent;
    width: 40px;
    background-image: url('../img/Search_Icon_1.svg');
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 0.3rem;

    &:focus {
      outline: none;
    }

    &:hover {
      background-color: $third-highlight;
    }

    &.hide {
      display: none;
    }
  }

}
