/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@import '../../../@theme/styles/themes';
@import '~@nebular/theme/styles/global/breakpoints';

@include nb-install-component() {
  $right-section-width: nb-theme(settings-col-width);
  $logo-fg: nb-theme(header-fg);
  $version-fg: nb-theme(color-primary);
  $primary: nb-theme(color-primary);
  $social-color: #a7b4cc;
  $social-hover: #eef3ff;
  $social-active: #d4dbf9;

  display: flex;
  flex: 1 0 auto;
  flex-direction: row;
  align-items: center;
  margin: 0;
  justify-content: space-between;

  .section {
    display: flex;

    &.left {
      display: flex;
      margin-top: 1.5rem;
      color: $social-color;
    }

    &.right {
      align-items: center;
    }
  }

  .stars {
    width: 95px;
    height: 20px;
    margin-right: 1.5rem;
    margin-top: 1.625rem;
  }

  .social-group {
    display: flex;
    align-items: center;
    margin-left: 2.25rem;

    i {
      width: 1.5rem;
      height: 1.5rem;
    }

    a {
      display: flex;
      align-items: center;
      color: $social-color;
      text-transform: none;
      text-decoration: none;
      margin-left: 1.75rem;
      margin-top: 0;

      &:first-child {
        margin-left: 0;

        i {
          line-height: inherit;
        }
      }

      i {
        fill: $social-color;
        line-height: 0.5;
      }

      &:hover {
        i {
          fill: $primary;
        }

        color: $primary;
      }
    }

    span {
      margin-left: 0.5rem;
    }
  }

  .btn-header {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
    color: $primary;
    background-color: transparent;
    font-weight: nb-theme(font-weight-bold);
    padding: 0.875rem;
    border: 1px solid nb-theme(color-gray-bg);
    border-radius: 0.25rem;
    cursor: pointer;
  }

  .btn-download {
    position: relative;

    .download-items-container {
      display: none;
    }

    span {
      padding: 0 0.75rem;
    }

    i {
      fill: $primary;
    }

    &:hover {
      color: nb-theme(color-white);
      box-shadow: none;
      background-color: $primary;

      i {
        fill: nb-theme(color-white);
      }

      .download-items-container {
        display: block;
        padding-top: 0.625rem;
        position: absolute;
        z-index: 1;
        top: 100%;
        left: 0;
      }

      ul {
        margin: 0;
        padding: 0.625rem 0;
        background-color: $primary;
        box-shadow: 0 6px 10px 0 rgba(51, 102, 255, 0.16);
        border-radius: 0.25rem;

        li {
          list-style: none;


          a {
            display: flex;
            align-items: center;
            text-decoration: none;
            text-transform: none;
            padding: 1rem;
            color: nb-theme(color-white);

            &:hover {
              background-color: #598bff;
            }

            &.active, &:active {
              background-color: #284de0;
            }
          }
        }
      }
    }
  }

  .desktop {
    display: inherit;
  }

  .mobile {
    display: none;
  }

  @include media-breakpoint-up(sm) {
    .logo {
      align-items: baseline;
      flex: 1 0 auto;
    }
  }

  @include media-breakpoint-down(xl) {
    margin: 0 1rem;
  }

  @include media-breakpoint-down(md) {
    .social-group {
      span {
        display: none;
      }
    }
  }

  @include media-breakpoint-down(sm) {
    .desktop {
      display: none;
    }

    .mobile {
      display: inherit;
    }

    .stars {
      margin-top: 0.875rem;
      margin-right: 0;
    }

    .section {
      margin-top: 1rem;

      &.left {
        margin-top: 0;

        a {
          display: none;
        }
      }

      &.right {
        .social-group {
          margin-right: 0;
          margin-left: 0;

          a {
            margin-left: 0;
            padding: 0.625rem;
          }

          i {
            width: 2rem;
            height: 2rem;
          }

          span {
            display: none;
          }

          .github, .behance {
            i {
              width: 1.75rem;
              height: 1.75rem;
            }
          }
        }
      }
    }

    .btn-header {
      margin-left: 0;
    }

    .btn-download {
      display: none;
    }
  }

  @media (min-width: 315px) and (max-width: 370px) {
    .section {
      &.right {
        .social-group {
          a {
            margin-left: 0.5rem;
            padding: 0.5rem;
          }
        }
      }
    }
  }
}
