@import '_variables';

.dropdown-title,
.mobile-dropdown-title {
  color: inherit;
  line-height: inherit;
  font-weight: 500;
}

// less than 992px
@media (max-width: ($tablet - 0.02px)) {
  .dropdown-title {
    display: none;
  }

  .mobile-dropdown-title {
    display: block;
  }
}

span.arrow-down::after {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: middle;
  content: '';
  border-style: solid;
  border-width: 0.48rem 0.28rem 0 0.28rem;
  border-color: var(--text-secondary-color) transparent transparent transparent;
  margin-left: 0.3em;
}

span.arrow-right::after {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: middle;
  content: '';
  border-style: solid;
  border-width: 0.28rem 0 0.28rem 0.48rem;
  border-color: transparent transparent transparent var(--text-secondary-color);
  margin-left: 0.3em;
}

.dropdown-menu,
.mobile-dropdown-menu {
  list-style: none;
  min-width: 10rem;
  margin: 0;
  white-space: nowrap;
}

.dropdown-menu {
  padding: 0.5rem;
  border-radius: 0.25rem;
  position: absolute;
  top: 100%;
  right: 0;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  opacity: 0;
  transform: scale(0.8);
  visibility: hidden;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.51, 1.07, 1, 1);
  transition-duration: 0.2s;
}

.mobile-dropdown-menu {
  list-style: none;
  margin: 0;
  padding-left: 1.5rem;

  // less than 992px
  @media (max-width: ($tablet - 0.02px)) {
    & {
      padding-left: 1rem;
    }
  }
}

.dropdown-item {
  a,
  h4 {
    display: block !important;
    border-bottom: none !important;
    margin: 0.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
  }

  a {
    font-weight: 400;
    line-height: 1.5rem;

    &:hover {
      color: var(--theme-color);
      background-color: var(--deep-bg-color);
    }

    &.router-link-active:not(.external) {
      color: var(--theme-color);
      background-color: var(--deep-bg-color);
    }
  }

  h4 {
    font-weight: 500;
    color: var(--text-secondary-color);
  }
}

// 992px and up
@media (min-width: $tablet) {
  .dropdown-wrapper:hover .dropdown-menu {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
  }

  .mobile-dropdown-title {
    display: none;
  }
}
