$navHeight: 4.5rem;
$mobileBreakPoint: 600px;
$menuBreakPoint: 800px;

.app {
  display: flex;

  &__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
  }

  &__name {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: $colorWhite;
    font-size: 1.5rem;

    &::after {
      content: '2.0 alpha';
      display: block;
      margin-left: 0.5rem;
      font-size: 0.7rem;
      letter-spacing: 0.05rem;
      text-transform: uppercase;
      border-radius: 5px;
      border: 1px solid $colorWhite;
      padding: 0 0.4em;
    }
  }

  &__github {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
  }

  ::v-deep .algolia-autocomplete {
    display: block;
    width: 100%;
  }

  &__search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 3rem;
    overflow: hidden;
    background-color: transparent;
    border: 1px solid rgba($colorWhite, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;

    &::after {
      content: 'Search';
      color: rgba($colorWhite, 0.5);
    }
  }

  &__search-docsearch {
    ::v-deep > button {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      opacity: 0;
    }
  }

  &__sidebar {
    display: none;

    @media (min-width: $menuBreakPoint) {
      display: block;
      width: 20rem;
      flex: 0 0 auto;
      position: sticky;
      top: 0;
      align-self: flex-start;
      padding: 2rem;
      height: 100vh;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      border-right: 1px solid rgba($colorWhite, 0.1);
    }
  }

  &__content {
    flex: 1 1 auto;
    min-width: 0;
  }

  &__top-bar {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    position: sticky;
    z-index: 2;
    top: 0;
    backdrop-filter: blur(10px);
    max-height: 100vh;

    @media (min-width: $menuBreakPoint) {
      padding: 1.5rem 0;
    }

    &::after {
      content: '';
      z-index: -1;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: $colorBlack;
      opacity: 0.8;
      transform: translate3d(0,0,0);
      pointer-events: none;
    }
  }

  &__top-bar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
  }

  &__menu-icon,
  &__close-icon {
    display: flex;
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: $colorText;
    margin-left: 1rem;
    transition: color 0.2s $ease;

    &:hover {
      color: $colorWhite;
    }

    @media (min-width: $menuBreakPoint) {
      display: none;
    }
  }

  &__inner {
    margin: 0 auto;
    max-width: 50rem;
    padding: 0 1rem;

    @media (min-width: $mobileBreakPoint) {
      padding: 0 2rem;
    }
  }

  &__link-group {
    margin-bottom: 1rem;

    @media (min-width: $mobileBreakPoint) {
      margin-bottom: 2rem;
    }
  }

  &__link-group-title {
    font-weight: 700;
    letter-spacing: 0.025rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba($colorWhite, 0.3);
    margin-bottom: 0.5rem;
  }

  &__link-list {
    list-style: none;
  }

  &__link-list &__link-list {
    display: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
  }

  &__mobile-nav &__link-list &__link-list {
    display: block;
  }

  .app__link--active + &__link-list {
    display: block;
  }

  &__link {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.85rem;
    margin-left: -0.5rem;
    white-space: nowrap;

    &:hover {
      color: $colorWhite;
    }

    &--exact {
      color: $colorWhite;
      background-color: rgba($colorWhite, 0.05);
    }

    &--draft {
      color: rgba($colorWhite, 0.4);

      &::after {
        content: 'draft';
        font-family: 'JetBrainsMono', monospace;
        text-transform: uppercase;
        color: $colorGrey;
        background-color: rgba($colorGrey, 0.1);
        padding: 0 0.5em;
        border-radius: 5px;
      }
    }

    &--pro {
      &::after {
        content: 'PRO';
        font-family: 'JetBrainsMono', monospace;
        text-transform: uppercase;
        color: $colorOrange;
        background-color: rgba($colorOrange, 0.1);
        padding: 0 0.5em;
        border-radius: 5px;
      }
    }

    &--new {
      &::after {
        content: 'NEW';
        font-family: 'JetBrainsMono', monospace;
        text-transform: uppercase;
        color: $colorGreen;
        background-color: rgba($colorGreen, 0.1);
        padding: 0 0.5em;
        border-radius: 5px;
      }
    }

    &--with-children::after {
      content: '↓';
      color: rgba($colorWhite, 0.2);
    }
  }

  &__mobile-nav &__link--with-children::after {
    display: none;
  }

  &__main {
    padding: 1rem 0;

    @media (min-width: $mobileBreakPoint) {
      padding: 2rem 0;
    }
  }

  &__page-navigation {
    border-top: 1px solid rgba($colorWhite, 0.1);
  }

  &__page-footer {
    font-size: 0.85rem;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid rgba($colorWhite, 0.1);

    a {
      text-decoration: underline;
    }
  }

  &__mobile-nav {
    padding: 1rem;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    @media (min-width: $mobileBreakPoint) {
      padding: 2rem;
    }
  }
}
