@import "../../../../scss/variables";

material-navbar {
  display: block;
  color: $site-text-color-100;
  box-shadow: $box-shadow-3;
  position: relative;
  z-index: 2;
  height: $material-navbar-height;

  &:not(.transparent) {
    background-color: $site-primary-color-200;
  }

  .navbar-container {
    display: flex;
    align-items: center;
    padding: 0 15px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
  }

  .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 55%;
    width: auto;

    .logo {
      display: block;
      max-height: 100%;
      max-width: 100%;
      width: auto;
      min-width: 120px;
    }
  }

  .text-logo {
    font-size: 2.2rem;
    color: $site-text-color-100;
  }

  .toggle-sidebar-button {
    display: block;
    margin: 0 10px;
  }

  custom-menu {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-grow: 0;

    @media only screen and (max-width: $navbar-breakpoint) {
      display: none;
    }

    .nav-item {
      white-space: nowrap;
      display: block;
      color: inherit;
      text-decoration: none;
      padding: 5px 15px;
      border-radius: 5px;
      line-height: 22px;
      height: auto;

      &:hover {
        text-decoration: underline;
      }

      &.router-link-active, &.active {
        color: $site-text-color-100;
        background-color: $site-primary-color-100;
      }
    }
  }

  &.mobile-search-active {
    .nav-searchbar {
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      max-height: 100%;
      max-width: 100%;
      z-index: 2;

      .mat-icon {
        display: none;
      }

      input {
        border-radius: 0;
        background-color: $site-bg-color-100;
        color: $site-text-color-400;
      }
    }

    .mobile-search-toggle {
      color: $site-text-color-400;
      left: 35px;
    }

    .search-button {
      display: none;
    }
  }

  .mobile-search-toggle {
    position: relative;
    z-index: 3;
    margin-right: 10px;
  }

  .nav-searchbar {
    height: 65%;
    max-height: 48px;
    max-width: 650px;

    // separate logo and search bar
    margin-left: 30px;

    // needed to separate search bar and user avatar
    // on small screens, if there's no menu items
    margin-right: 30px;

    input, form {
      height: 100%;
    }

    input {
      background-color: $site-primary-color-100;
      transition: background-color 0.1s ease-in-out;
      outline: none;

      &:active, &:focus {
        background-color: $site-bg-color-100;
        color: $site-text-color-400;

        & + .mat-icon-button {
          color: $site-text-color-400;
        }
      }
    }

    @media only screen and (max-width: $navbar-breakpoint) {
      display: none;
    }
  }

  .right-side-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-left: 30px;
  }
}