$background: #243949;
$white: #fffce1;
$yellow: #dab977;

@use 'sass:color';
@use '../src/scss/mixins' as *;
@use '../src/scss/core';
@use '../src/scss/toggle';
@use '../src/scss/theme-default' as theme-default;
@use '../src/scss/theme-carbon' as theme-carbon;

body.theme-default {
  @include theme-default.styles();
}
body.theme-carbon {
  @include theme-carbon.styles();
}

@mixin mi {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  text-indent: 0;
  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';
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-right: 15px;
  font-size: 19px;
  vertical-align: top;
  speak: never;
}

html, body, div, span, header, ul, li, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

html {
  height: 100%;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

em {
  font-style: italic;
}

strong {
  font-weight: 600;
}

ol, ul {
  list-style: none;
}

.cf {
  &::before,
  &::after {
    content: '';
    display: block;
    height: 0;
    overflow: hidden;
  }

  &::after {
    clear: both;
  }
}

#container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  background: linear-gradient(-134deg, #517FA4 0%, $background 100%);
  font-family: 'Raleway', sans-serif;
  text-align: center;
  color: $white;
}

.wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

#main-nav {
  display: none;
}

header {
  position: relative;
  padding: 50px 0 20px;

  h1 {
    font-size: 50px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 5px;
    padding-bottom: 8px;
  }

  h2 {
    max-width: 680px;
    margin: auto;
    font-size: 20px;
    font-weight: 200;
    line-height: 1.4;
    text-align: center;
    letter-spacing: 1px;
    padding-bottom: 30px;
  }

  .git {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    border-radius: 4px;
    padding: 4px 10px 4px 0;
    font-size: 15px;
    font-weight: 400;
    color: $white;
    background: #54b9cb;
    transition: background .15s ease-in-out;

    &:hover {
      background: #4CA8B9;

      svg {
        border-color: #54b9cb;
      }
    }

    svg {
      width: 15px;
      height: 15px;
      fill: $white;
      position: relative;
      top: 2px;
      padding: 0 10px;
      margin-right: 10px;
      border-right: 1px solid #4daabb;
      transition: border-color .15s ease-in-out;
    }
  }

  .ver {
    padding-top: 15px;
    font-weight: 200;
    color: $yellow;

    span {
      color: $white;
    }
  }

  .toggle {
    @include hc-hamburger('default', 35px, 26px, 4px, color.adjust($background, $lightness: -7%), .25s);
    position: relative;
    width: auto;
    top: auto;
    left: auto;
    float: left;
    display: block;
    cursor: pointer;
    box-sizing: content-box;
    font-size: 18px;
    padding-left: 55px;
    line-height: 22px;
    margin-top: 55px;
    color: #fff;
    text-align: left;
    text-decoration: none;

    &:hover {
      span {
        &,
        &::before,
        &::after {
          background: $yellow;
        }
      }
    }

    i {
      font-size: 10px;
      display: block;
      line-height: 10px;
      opacity: .7;
    }
  }
}

footer {
  padding-bottom: 40px;

  .swm {
    display: inline-block;
    padding: 0 15px;

    svg {
      display: block;
      width: auto;
      height: 17px;
      margin-top: 22px;

      path {
        transition: fill .1s ease;
      }

      .l-1 {
        fill: #4fb5e1;
      }
      .l-2 {
        fill: #f2c053;
      }
      .l-3 {
        fill: #a7ce38;
      }
    }

    &:not(:hover) {
      svg {
        .l-1 {
          fill: color.adjust($background, $lightness: 20%);
        }
        .l-2 {
          fill: color.adjust($background, $lightness: 50%);
        }
        .l-3 {
          fill: color.adjust($background, $lightness: 30%);
        }
      }
    }
  }
}

main {
  flex: 1 0 auto;
  padding-bottom: 30px;
  text-align: left;

  .content {
    border-top: 1px solid rgba(255, 255, 255, .1);
  }

  h4 {
    font-size: 15px;
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 20px 0;

    &:first-child {
      margin-top: 30px;
    }
  }

  .actions {
    margin: 0 -15px;
    text-align: center;

    div {
      padding: 0 15px 20px;
      box-sizing: border-box;
    }

    @media screen and (min-width: 800px) {

      &:not(.theme) {
        display: flex;
        flex-wrap: wrap;

        div {
          float: left;
          flex: 1 1 33.33%;
          max-width: 33.33%;
        }

        &.position {
          div {
            float: left;
            flex: 1 1 25%;
            max-width: 25%;
          }
        }
      }

      &.theme {

        &::after {
          content: '';
          display: table;
          clear: both;
        }

        div {
          float: left;
        }
      }
    }

    &.checkboxes {
      text-align: left;
      padding-top: 8px;

      label {
        font-size: 14px;
        text-transform: uppercase;
        cursor: pointer;

        input {
          display: none;

          &:checked {

            & ~ span {
              background: $yellow;

              &::before {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                margin-top: -1px;
                border: solid $background;
                border-width: 0 3px 3px 0;
                display: inline-block;
                padding: 5px 2px;
                transform: translate(-50%, -50%) rotate(45deg);
              }
            }
          }
        }

        span {
          display: inline-block;
          position: relative;
          top: -1px;
          width: 22px;
          height: 22px;
          background: $white;
          margin-right: 12px;
          vertical-align: top;
          transition: all .1s ease;
        }
      }
    }
  }

  .button {
    position: relative;
    display: block;
    padding: 18px 30px 16px;
    text-transform: uppercase;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1px;
    text-decoration: none;
    color: $background;
    cursor: pointer;
    background: $white;
    border-radius: 30px/80px;
    transition: all .1s ease;

    &:not(.active):hover {
      color: color.adjust($yellow, $lightness: -5%);
    }

    &.active {
      background: $yellow;
    }
  }

  .thumb {
    position: relative;
    display: block;
    width: 100px;
    height: 100px;
    border: 4px solid $white;
    border-radius: 5px;
    background-size: cover;

    &.active {
      border-color: $yellow;
    }
  }
}

.hc-offcanvas-nav {

  .nav-wrapper-0 > .nav-content {
    padding-bottom: 41px;
  }

  h2 {
    & ~ ul > li.search {
      .nav-custom-content {
        padding-top: 0;
      }
    }
  }

  &.rtl {

    .nav-item-link {
      &::before {
        margin-left: 15px;
        margin-right: 0 !important;
      }
    }

    .nav-item.collections > .nav-item-wrapper .nav-item-link span {
      float: left;
    }
  }

  li {

    .custom-message {
      font-size: 12px;

      a {
        color: #fff;
        font-size: 13px;

        &:hover {
          text-decoration: none;
        }
      }
    }

    &.add > .nav-item-wrapper a::before {
      @include mi;
      content: 'add';
    }

    &.new > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'fiber_new';
    }

    &.cryptocurrency > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'local_atm';
    }

    &.devices > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'devices';
    }

    &.mobile > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'phone_android';
    }

    &.television > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'desktop_windows';
    }

    &.camera > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'camera_alt';
    }

    &.magazines > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'import_contacts';
    }

    &.store > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'store';
    }

    &.collections > .nav-item-wrapper .nav-item-link {
      span {
        font-size: 70%;
        line-height: 15px;
        height: 15px;
        padding: 0 4px;
        float: right;
        background: #ff635a;
        border-radius: 2px;
        margin-top: 2px;
      }

      &::before {
        @include mi;
        content: 'collections';
      }
    }

    &.nolink > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'format_clear';
    }

    &.disabled > .nav-item-wrapper .nav-item-link::before {
      @include mi;
      content: 'block';
    }
  }

  &.nav-position-top,
  &.nav-position-bottom {

    ul.bottom-nav {
      position: relative;
      border-top: none;
    }

    .nav-wrapper-0 > .nav-content {
      padding-bottom: 0;
    }
  }

  ul.bottom-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    border-top: 1px solid rgba(#000, .15);

    li {
      flex: auto;

      a {
        padding: 10px;
        text-align: center;
        height: 100%;
        border-bottom: none;
      }

      svg {
        fill: #fff;
        display: inline-block;
        vertical-align: middle;
      }

      &.github {
        svg {
          width: 17px;
          height: 17px;
        }
      }

      &.ko-fi {
        svg {
          width: 21px;
          height: 21px;
        }
      }

      &.email {
        svg {
          width: 19px;
          height: 19px;
        }
      }
    }
  }
}

body.theme-default {
  .hc-offcanvas-nav {

    .second-nav {
      border-bottom: none !important;
    }
  }
}
