@import '../../styles/main.scss';

$trigger-height: 50px;

.Sidebar {
  position: sticky;
  top: $navbar-height;
  z-index: 1;
  flex-shrink: 0;
  transition: top $duration ease 0s;

  &--onTop {
    top: 0;
  }

  &__wrapper {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    max-height: 0;
    overflow: auto;
    transition: max-height $duration;

    &--open {
      max-height: 500px;
    }
  }

  &__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    height: $trigger-height;
    font-size: 24px;
    cursor: pointer;
    background-color: $c_catskill_white;
    transition: transform $duration ease 0s;

    &--active {
      color: $c_white;
      background-color: $c_silver;
    }
  }

  &__trigger-icon {
    width: 35px;
    margin-right: 20px;
  }

  &__container {
    width: 100%;
    padding: calc(30px + #{$trigger-height}) 30px 30px;
    background-color: $c_catskill_white;
    transform: translateY(-100%);
    transition: transform $duration ease 0s;

    &--open {
      transform: translateY(0);
    }
  }

  &__group {
    &:not(:last-child) {
      margin-bottom: 30px;
    }
  }

  &__heading {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }

  &__state-icon {
    width: 32px;
    margin-right: 10px;
  }

  &__title {
    font-size: 16px;
    font-weight: 600;
  }

  &__link {
    display: block;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 20px;
    color: $c_black;
    text-align: left;

    &:hover {
      font-weight: 600;
      cursor: pointer;
    }

    &--active {
      color: $c_blue-ribbon;
    }
  }

  @media #{$screen-sm} {
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100vh;
    max-width: 230px;
    overflow: auto;
    background-color: $c_catskill_white;

    &__wrapper {
      height: auto;
      max-height: none;
    }

    &__trigger {
      display: none;
    }

    &__container {
      position: relative;
      z-index: 0;
      display: block;
      padding-top: calc(#{$navbar-height} + 20px);
      transform: translateY(0);
    }

    &__group {
      &:not(:last-child) {
        margin-bottom: 40px;
      }
    }

    &__link {
      font-size: 14px;

      &--active {
        padding-left: 6px;
        font-weight: 700;
        color: $c_black;

        &:hover {
          font-weight: 700;
          cursor: pointer;
        }
      }
    }
  }

  @media #{$screen-md} {
    max-width: 270px;

    &__container {
      padding-left: 0;
    }

    &__heading {
      margin-bottom: 32px;
    }

    &__title {
      font-size: 20px;
    }

    &__link {
      margin-bottom: 24px;
      font-size: 16px;
    }
  }
}
