//CSS for ui-navbar-menu-old
.ui-menu {
  display: block;
  min-width: 4em;

  $base: unquote(".ui-menu");

  &__group {
    border: 0;
    flex: 0 0 auto;
    margin: 0 0 4px;
    padding: 0 0 4px;
    position: relative;

    &__container {
      > #{$base}__item {
        border: 0;
      }
    }

    &__label {
      font-size: 0.85em;
      padding: 10px;
      width: 100%;
    }

    &--collapsible &__label {
      width: calc(100% - 1em);
    }

    &--collapsible &__label::after {
      content: "\25BE";
      float: right;

      @at-root [dir="rtl"] & {
        float: left;
      }
    }

    &--collapsible[data-collapsed="true"] &__container {
      margin-top: 0.5em;
      max-height: 0;
      overflow: hidden;
    }

    &--collapsible[data-collapsed="true"] &__label::after {
      content: "\25B8";
    }

    &::after {
      content: "";
      @include position(absolute, null 0 0);
    }

    &:last-child::after {
      display: none;
    }
  }

  &__item {
    border-width: 1px 0;
    display: grid;
    flex: 0 0 auto;
    grid-template-areas: "link caret";
    grid-template-columns: 1fr auto;
    min-width: 4em;
    overflow: hidden;

    &__link {
      align-items: center;
      display: grid;
      grid-area: link;
      grid-template-areas: "icon label badge caret";
      grid-template-columns: auto 1fr auto auto;
      padding: 0.5rem 1rem;
      font-size: 1em;

      &:hover {
        .ui-icon {
          color: inherit;
        }
      }

      // &[data-open="true"],
      // &:active {
      //   transition: background-color 0.5s;
      // }

      &[data-disabled="true"] {
        pointer-events: none;
      }
    }

    .ui-badge {
      grid-area: badge;
      line-height: 1.2em;
    }

    &__label {
      grid-area: label;
      padding-left: 10px;
      @include ellipsis();
    }

    &__icon {
      grid-area: icon;
    }

    &__caret {
      grid-area: caret;

      &--split {
        padding: 0.35em 0.5em;

        .ui-icon {
          vertical-align: middle;
        }

        &[data-open="true"],
        &:active {
          transition: background-color 0.5s;
        }
      }

      @at-root [dir="rtl"] & {
        transform: scaleX(-1);
      }
    }
  }

  &__overflow {
    align-self: flex-end;
  }

  .ui-divider {
    display: block;
  }

  &__bar {
    align-content: space-between;
    display: grid;
    grid-template-columns: 1fr auto;
    position: relative;

    &::after {
      content: "";
      @include position(absolute, null 0 0);
    }

    &__wrapper {
      align-items: flex-end;
      flex-flow: row nowrap;
      overflow: hidden;
      @extend %ui-flex;

      .ui-divider {
        align-self: stretch;
        @extend %vr;
      }

      #{$base}__item {
        &__label {
          padding: 0.25em;
        }

        &__caret--split {
          padding: 0.25em 0.5em;
        }
      }

      #{$base}__group {
        align-items: stretch;
        margin: 0;
        padding: 0;

        &::after {
          display: none;
        }

        &__label {
          line-height: 1;
          pointer-events: none;

          .ui-icon {
            display: none;
          }
        }

        &__container {
          @extend %ui-flex;
          flex-flow: row nowrap;

          > .ui-divider {
            font-size: 0.8em;
            margin: -0.5em 0 0;
          }
        }
      }
    }
  }

  &.ui-contextmenu {
    min-width: 10em;
  }
}

//CSS for ui-navbar-menu
.condensed:not(.ui-navbar-menu-hover) {
  .navbar__btn {
    padding-left: 0.5em;
    margin-left: 0;
  }

  .navbar__menu__item {
    > div {
      width: max-content;
      padding: 0.5em;
    }

    &__content__title > ui-icon {
      margin-right: 0;
    }
  }
}

.navbar {
  a {
    display: block;
    text-decoration: none;
  }

  .navbar_arrow {
    font-size: 14px;
  }

  &__btn {
    margin-left: 12px;
    padding-top: 1em;

    &__burger {
      display: table;
      width: 1em;
      height: 1em;
      border-radius: 50%;
      padding: 12px;

      ui-icon {
        display: table-cell;
        vertical-align: middle;
      }

      &:hover,
      &.isSelected {
        transition: all 0.4s ease;
      }
    }
  }

  &__menu {
    &__item {
      margin-bottom: 10px;

      > div,
      > a {
        display: block;
        padding: 10px 12px;

        &:hover,
        &.isSelected {
          border-radius: 10px;
          font-weight: 600;
        }
      }

      &__content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 16px;

        &__title {
          font-size: 16px;
          display: flex;
          align-items: center;
          white-space: nowrap;

          ui-icon {
            margin-right: 15px;
            margin-top: 4px;
            margin-bottom: 4px;
          }
        }
      }
    }

    &__level2 {
      margin-left: 2em;

      &__item {
        &__content {
          font-size: 14px;
          display: flex;
          justify-content: space-between;
        }
      }

      > li {
        font-size: 14px;
        font-weight: 300;
      }
    }

    &__level3 {
      margin-left: 1em;
      list-style: none;

      > li {
        font-size: 12px;
      }
    }

    &__level2,
    &__level3 {
      margin-top: 10px;

      li {
        & a.isSelected {
          font-weight: 600;
        }

        & a > div {
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          color: white;
        }

        &.navbar__menu__with__child {
          margin-bottom: 10px;

          & a:hover {
            font-weight: 600;
          }
        }

        &.navbar__menu__no__child {
          &:hover {
            font-weight: bold;

            > a > div {
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
              color: white;
            }
          }
        }

        a {
          padding: 10px 12px;
          border-radius: 10px;
        }
      }
    }

    &__top,
    &__bottom {
      padding: 0 0.5em;
    }

    li > div {
      cursor: pointer;
    }
  }

  &__footer {
    margin-left: 12px;
    padding-bottom: 1em;
  }
}

.down {
  animation-name: down_arrow;
  animation-duration: 0.3s;
}

.up {
  animation-name: up_arrow;
  animation-duration: 0.3s;
}

@keyframes up_arrow {
  0% {
    transform: rotate(-180deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes down_arrow {
  0% {
    transform: rotate(-180deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.navbar__menu ul.navbar__menu__level2 {
  padding-left: 15px;
}

.animated_menu_level {
  animation-name: menu_appearance;
  animation-duration: 0.5s;
}

@keyframes menu_appearance {
  0% {
    opacity: 0;
    transform: translateY(-25px);
  }

  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}
