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

.sidebar-app{
  display: inline-table;
  height: 100%;

  header{
    align-items: center;
    background-color: #373a45;
    cursor: pointer;
    display: flex;
    height: $_HEIGHT_HEADER;
    margin: 0;
    padding: 0;
    position: relative;
    width: auto;
  }
}

.header-icon{
  align-items: center;
  background-color: transparent;
  background-image: url(../#{$_PATH_TO_IMAGES}/header-icon.svg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100%;
  height: 46px;
  margin: 0 auto;
  width: 135px;
}

.navigation-partial-mail{
  display: flex;
  height: calc(100% - 60px);
  flex-direction: column;
  overflow-y: auto;
  width: 100%;
  user-select: none;

  nav {
    &.nav-main{
      background-color: transparent;

      ul{
        li{
          &:last-child {
            &:hover{
              background-color: transparent;
            }
          }

          span{
            background-color: transparent;
            font-family: NunitoSans;
          }
        }
      }
    }

    &.nav-footer{
      background-color: transparent;
      display: flex;
      flex-direction: column;
      flex-grow: 1;
      justify-content: flex-end;
      min-height: 185px;

      li.nav-item{
        span{
          width: auto;
        }
      }

      li.join-plus {
        span, i {
          color: #e3a344;
        }
      }

      .icon-crown {
        background-image: url(../#{$_PATH_TO_IMAGES}/crown.svg);
        background-size: 100% auto;
        height: 18px;
        width: 18px;
      }
    }

    hr{
      border: 0;
      border-top: solid 1px;
      display: block;
      margin: 0 30px 10px;
      width: calc(100% - 60px);
    }

    ul{
      background-color: transparent;
      list-style: none;
      margin: 0;
      padding: 0;

      li {
        background-color: transparent;
        display: flex;
        margin: 0;
        padding: 0;
        text-align: center;

        &.nav-item-more{
          height: auto;
          flex-direction: column;
        
          hr{
            margin: 10px 0;
          }
        
          .nav-item-container{
            background-color: transparent;
            align-items: center;
            display: flex;
            height: 40px;
            width: 100%;
          }
        
          ul{
            overflow: auto;
            width: 100%;
          }
        
          &.nav-item-more-selected{
            .nav-item-container{
              span{
                font-weight: 600;
              }
            }
          }
        }

        span {
          display: block;
          font-family: NunitoSans;
          font-size: 13px;
          text-align: left;
          text-decoration: none;
          width: calc(100% - 116px);
        }
      }
    }
  }
}

.nav-item-free{
  background-color: transparent;
  text-align: center;
  width: 100%;
}

#button-compose{
  margin: 15px 0;
  width: 141px;

  i{
    background-color: transparent;
    left: -8px;
    margin-right: 10px;
  }
}


.nav-item-collapse{
  height: 75px;
}

.nav-item-option{
  background-color: transparent;
  height: 18px;
  position: relative;

  i{
    background-color: transparent;
    font-size: 22px;
    line-height: 18px;
  }
}

.sidebar-app-expand .sidebar-app{
  width: 210px;
}

/* COLLAPSE
   ----------------------------- */
@mixin collapse-sidebar-app{
  width: 79px;
}

@mixin collapse-header{
  background-color: #373a45;

  .header-icon{
    background-image: url(../#{$_PATH_TO_IMAGES}/header-icon-mini.svg);
    background-size: 100% auto;
    width: 42px;
  }
}

@mixin collapse-button-compose{
  border-radius: 50%;
  height: 39px;
  width: 39px;
  padding: 0;

  i{
    font-size: 19px;
    left: 1px;
    margin: 0;
    top: 0px;
  }

  span{
    display: none;
  }
}

@mixin collapse-nav{
  &.nav-main ul li{
    &:last-child{
      display: none;
    }
  }

  ul li > span, ul li a > span{
    display: none
  }
}

.sidebar-app-collapse .sidebar-app{
  @include collapse-sidebar-app;

  header{
    @include collapse-header;
  }

  #button-compose{
    @include collapse-button-compose;
  }

  nav{
    @include collapse-nav;
  }
}

@media screen and (max-width: $_MAX_WIDTH_SCREEN) {
  .sidebar-app-expand .sidebar-app{
    @include collapse-sidebar-app;

    header{
      @include collapse-header;
    }

    #button-compose{
      @include collapse-button-compose;
    }

    nav{
      @include collapse-nav;
    }
  }
}

/* THEME
   ----------------------------- */
@mixin themable($_THEME, $_BACKGROUND_COLOR_SIDEBAR, $_COLOR_TEXT_NAVITEM_SELECTED, $_BORDER_COLOR_NAV, $_COLOR_TEXT_NAVITEM, $_COLOR_ICON_NAVITEM, $_COLOR_ICON_NAVITEM_SELECTED){
  [data-theme^=#{$_THEME}],
  [data-theme] [data-theme^=#{$_THEME}] {
    .navigation-partial-mail{
      background-color: $_BACKGROUND_COLOR_SIDEBAR;

      nav{
        hr{
          border-top-color: $_BORDER_COLOR_NAV;
        }
      }

      .nav-item-more{
        &.nav-item-more-selected{
          .nav-item-container{
            .nav-item-icon{
              i{
                color: $_COLOR_ICON_NAVITEM_SELECTED;
              }
            }

            >span{
              color: $_COLOR_TEXT_NAVITEM_SELECTED;
            }

            .nav-item-option{
              i{
                color: $_COLOR_ICON_NAVITEM_SELECTED;
              }
            }
          }
        }

        .nav-item-container{
          >span{
            color: $_COLOR_TEXT_NAVITEM;
          }
        }
      }
    }

    .nav-item-option{
      i{
        color: $_COLOR_ICON_NAVITEM;
      }
    }
  }
}

@include themable($_THEME_LIGHT, $_BACKGROUND_COLOR_SIDEBAR_LIGHT, $_COLOR_TEXT_NAVITEM_SELECTED_LIGHT, $_BORDER_COLOR_NAV_LIGHT, $_COLOR_TEXT_NAVITEM_LIGHT, $_COLOR_ICON_NAVITEM_LIGHT, $_COLOR_ICON_NAVITEM_SELECTED_LIGHT);
@include themable($_THEME_DARK, $_BACKGROUND_COLOR_SIDEBAR_DARK, $_COLOR_TEXT_NAVITEM_SELECTED_DARK, $_BORDER_COLOR_NAV_DARK, $_COLOR_TEXT_NAVITEM_DARK, $_COLOR_ICON_NAVITEM_DARK, $_COLOR_ICON_NAVITEM_SELECTED_DARK);