@import "./../styles/index.scss";

.nav-item{
  align-items: center;
  cursor: pointer;
  display: flex;
  height: 40px;
  position: relative;
  width: 100%;

  .nav-item-icon{
    background-color: transparent;
    font-family: none;
    font-size: 16px;
    height: 18px;
    margin: 0 10px 0 32px;
    width: 15px;

    i{
      background-color: transparent;
    }
  }

  span{
    font-weight: 300;
    margin-left: 15px;
  }

  a {
    text-decoration: none;
    display: flex;
  }

  .nav-item-badge{
    margin-left: 5px;
    
    .badge{
      background-color: #65bdff;
      border-radius: 13px;
      color: white;
      font-size: 11px;
      font-weight: 500;
      height: 17px;
      line-height: 17px;
      margin: 0;
      min-width: 24px;
      padding: 0 2px;
      text-align: center;
      width: auto;
    }
  }
}

.nav-item-selected{
  span{
    font-weight: 600;
  }
}

/* COLLAPSE
   ----------------------------- */
@mixin collapse-nav-item-icon{
  font-size: 18px;
  margin: 0 auto;
  width: auto;
}

@mixin collapse-nav-item-a{
  margin: 0 auto;
}

@mixin collapse-nav-item-badge {
  margin: 0;
  position: absolute;
  right: 8px;
  top: 5px;
}

@mixin collapse-nav-item-badge-mini {
  right: 28px;
  top: 10px;
}

@mixin collapse-badge {
  border: 1px solid white;
  border-radius: 6px;
  font-size: 0;
  height: 7px;
  min-width: 0px;
  width: 3px;
}

.sidebar-app-collapse .nav-item{
    &:nth-child(n+2){
      .badge{
        @include collapse-badge;
      }

      .nav-item-badge{
        @include collapse-nav-item-badge-mini;
      }
    }

    a{
      @include collapse-nav-item-a;
    }

    .nav-item-icon{
      @include collapse-nav-item-icon;
    }

    .nav-item-badge{
      @include collapse-nav-item-badge;
      
    }
}

@media screen and (max-width: $_MAX_WIDTH_SCREEN) {
  .nav-item{

    &:nth-child(n+2){
      .badge{
        @include collapse-badge;
      }

      .nav-item-badge{
        @include collapse-nav-item-badge-mini;
      }
    }

    a{
      @include collapse-nav-item-a;
    }
    
    .nav-item-icon{
      @include collapse-nav-item-icon;
    }

    .nav-item-badge{
      @include collapse-nav-item-badge;
    }
  }
}

/* THEME
   ----------------------------- */
@mixin themable($_THEME, $_BACKGROUND_COLOR_NAVITEM_SELECTED, $_BACKGROUND_COLOR_NAVITEM_HOVER, $_COLOR_TEXT_NAVITEM_SELECTED, $_COLOR_TEXT_NAVITEM, $_COLOR_ICON_NAVITEM, $_COLOR_ICON_NAVITEM_SELECTED){
  [data-theme^=#{$_THEME}],
  [data-theme] [data-theme^=#{$_THEME}] {
    .nav-item{
      &.nav-item-selected{
        background-color: $_BACKGROUND_COLOR_NAVITEM_SELECTED;
  
        .nav-item-icon{
          color: $_COLOR_ICON_NAVITEM_SELECTED;
        }
  
        >span {
          color: $_COLOR_TEXT_NAVITEM_SELECTED;
        }

        a {
          span{
            color: $_COLOR_TEXT_NAVITEM_SELECTED;
          }
        } 
      }
      
      &:hover{
        background-color: $_BACKGROUND_COLOR_NAVITEM_HOVER;
      }

      .nav-item-icon{
        color: $_COLOR_ICON_NAVITEM;
      }

      >span{
        color: $_COLOR_TEXT_NAVITEM;
      }

      a {
        span{
          color: $_COLOR_TEXT_NAVITEM;
        }
      }
    }
  }
}

@include themable($_THEME_LIGHT, $_BACKGROUND_COLOR_NAVITEM_SELECTED_LIGHT, $_BACKGROUND_COLOR_NAVITEM_HOVER_LIGHT, $_COLOR_TEXT_NAVITEM_SELECTED_LIGHT, $_COLOR_TEXT_NAVITEM_LIGHT, $_COLOR_ICON_NAVITEM_LIGHT, $_COLOR_ICON_NAVITEM_SELECTED_LIGHT);
@include themable($_THEME_DARK, $_BACKGROUND_COLOR_NAVITEM_SELECTED_DARK, $_BACKGROUND_COLOR_NAVITEM_HOVER_DARK, $_COLOR_TEXT_NAVITEM_SELECTED_DARK, $_COLOR_TEXT_NAVITEM_DARK, $_COLOR_ICON_NAVITEM_DARK, $_COLOR_ICON_NAVITEM_SELECTED_DARK);