/* Navbar */

.navbar {
  font-family: $type1-regular;
  background: $white;
  -webkit-box-shadow: 0px 8px 74px -21px rgba(0, 0, 0, 0.15);
  -moz-box-shadow: 0px 8px 74px -21px rgba(0, 0, 0, 0.15);
  box-shadow: 0px 8px 74px -21px rgba(0, 0, 0, 0.15);
  transition:background $action-transition-duration $action-transition-timing-function;
  -webkit-transition:background $action-transition-duration $action-transition-timing-function;
  -moz-transition:background $action-transition-duration $action-transition-timing-function;
  -ms-transition:background $action-transition-duration $action-transition-timing-function;
  .navbar-brand-wrapper {
    transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
    -webkit-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
    -moz-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
    -ms-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
    background: $white;
    @extend .border-right;
    .sidebar-light & {
      background: $sidebar-light-bg;
    }
    width: $sidebar-width-lg;
    height: $navbar-height;

    .navbar-brand {
      color: lighten(color(gray-dark), 20%);
      font-size: 1.5rem;
      line-height: 48px;
      margin-right: 0;
      padding: .25rem 0;
      width: 100%;
      @include display-flex(inline-flex);

      &:active,
      &:focus,
      &:hover {
        color: lighten(color(gray-dark), 10%);
      }

      img {
        width: calc(#{$sidebar-width-lg} - 120px );
        max-width: 100%;
        height: 28px;
        margin: auto auto auto $sidebar-menu-padding-x-left;
        vertical-align: middle;
      }
    }

    .brand-logo-mini {
      display: none;
      img {
        width: calc(#{$sidebar-width-icon} - 50px );
        max-width: 100%;
        height: 28px;
        margin: auto;
      }
    }
  }

  .navbar-menu-wrapper {
    transition: width $action-transition-duration $action-transition-timing-function;
    -webkit-transition: width $action-transition-duration $action-transition-timing-function;
    -moz-transition: width $action-transition-duration $action-transition-timing-function;
    -ms-transition: width $action-transition-duration $action-transition-timing-function;
    color: $navbar-light-color;
    padding-left: 15px;
    padding-right: 15px;
    width: calc(100% - #{$sidebar-width-lg});
    height: $navbar-height;
    @media (max-width: 991px) {
      width: auto;
    }

    .navbar-toggler {
      border: 0;
      color: inherit;
      height: $navbar-height;
      @include border-radius(0px);
      padding-left: 5px;
      padding-right: 20px;
      &:not(.navbar-toggler-right) {
        @media (max-width: 991px) {
          display: none;
        }
      }
      &.navbar-toggler-right{
        @media (max-width:991px){
          padding-left: 15px;
          padding-right: 11px;
          border-right: none;
        }
      }
    }

    .search-field {
      background: #f3f3f3;
      @include border-radius(5px);
      margin-top: 10px;
      margin-bottom: 10px;
      input{
        font-size: $default-font-size;
        @include input-placeholder{
          font-size: inherit;
        }
      }
      .dropdown-toggle{
        color: #d1d5d6;
        i{
          margin-right: 0;
          font-size: 17px;
        }
      }
      .search-button{
        position: relative;
        padding-left: 23px;
        &:before{
          content: "";
          display: block;
          position: absolute;
          left: 10px;
          top: 50%;
          @include transform(translateY(-50%));
          height: 15px;
          width: $border-width;
          background: #d1d5d6;
        }
        i{
          font-size: 17px;
          margin-right: 0;
        }
      }
      .rtl & {
        @extend .ml-0;
        @extend .mr-4;
        .search-button {
          padding-left: 10px;
          padding-right: 23px;
          &:before{
            left: unset;
            right: 10px;
          }
        }
      }
    }

    .navbar-nav {
      flex-direction: row;
      align-items: center;

      .nav-item {
        border-right: 1px solid $border-color;
        &:last-child{
          border-right: none;
        }
        .nav-link {
          color: inherit;
          font-size: $navbar-font-size;
          margin-left: 1rem;
          margin-right: 1rem;
          height: $navbar-height;
          @include display-flex;
          @include align-items(center);
          @media (max-width: 767px) {
            margin-left: .8rem;
            margin-right: .8rem;
          }
          i {
            font-size: $navbar-icon-font-size;
          }
          &.nav-profile {
            img {
              width: 32px;
              height: 32px;
              border-radius: 100%;
              margin-right: 1rem;
            }
          }
        }
        &.dropdown {
          .count-indicator {
            position: relative;

            .count {
              position: absolute;
              top: 25%;
              right: 0;
              width: 5px;
              height: 5px;
              background-image: linear-gradient(300deg, #ff5858, #f09819);
              border-radius: 100%;
            }
            &:after {
              display: none;
            }
          }
          .navbar-dropdown {
            font-size: 0.9rem;
            margin-top: 0;
            position: absolute;
            top: 48px;
            right: 0;
            left: auto;
            @media (max-width: 991px) {
              right: -85px;
            }
            padding: 0;

            .dropdown-item {
              @extend .d-flex;
              @extend .align-items-center;
              border-bottom: 1px solid lighten(color(gray-light),30%);
              margin-bottom: 0;
              padding: 11px 13px;

              i {
                font-size: 17px;
              }

              .ellipsis {
                max-width: 200px;
                overflow: hidden;
                text-overflow: ellipsis;
              }
              .rtl & {
                i{
                  @extend .mr-0;
                  margin-left: 10px;
                }
              }
            }

            .dropdown-divider {
              margin: 0;
            }
          }
        }
        &.nav-settings{
          padding-left: 20px;
          padding-right: 5px;
          .nav-link{
            margin-right: 0;
            margin-left: 0;
          }
        }
      }
      &.navbar-nav-right {
        @media (min-width: 992px) {
          margin-left: auto;
          .rtl & {
            margin-left: 0;
            margin-right: auto;
          }
        }
      }
    }
    .dropdown-menu {
      @extend .dropdownAnimation;
      border: none;
      @include border-radius(5px);
      -webkit-box-shadow: 0px 3px 21px 0px rgba(0, 0, 0, 0.2);
      -moz-box-shadow: 0px 3px 21px 0px rgba(0, 0, 0, 0.2);
      box-shadow: 0px 3px 21px 0px rgba(0, 0, 0, 0.2);
    }
  }
}
@media (max-width:991px) {
  .navbar {
    flex-direction: row;

    .navbar-brand-wrapper {
      width: 75px;

      .brand-logo {
        display: none;
      }

      .brand-logo-mini {
        display: inline-block;
      }
    }
  }

  .navbar-collapse {
    display: flex;
    margin-top: 0.5rem;
  }
}

@media (max-width:480px) {
  .navbar {
    .navbar-brand-wrapper {
      width: 55px;
      border-right: none !important;
      .brand-logo-mini{
        padding-top: 0px;
      }
    }
  }
}
