/**
 * Copyright 2016-present, Baifendian, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

@import '../variables.less';

@padding-left: 38px;
@border-color: #f0f0f0;

.bfd-nav {
  border-right: 1px solid #eaeaea;
  ul {
    margin: 0;
    padding: 0;
    background-color: #fff;
    list-style: none;
  }
}

.bfd-nav__item {
  > a {
    display: block;
    color: #333;
    text-decoration: none;
    position: relative;
    padding: 0px 15px;
    line-height: 34px;
    border-bottom: 1px solid @border-color;
    border-radius: 0;
    border-left: 5px solid #eaeaea;
    &:hover {
      background-color: #fafafa;
      border-left-color: @primary-color;
      color: #333;
      text-decoration: none;
    }
    &:focus {
      background-color: #fafafa;
      outline: none;
      text-decoration: none;
    }
  }
  > ul {
    display: none;
  }
  .bfd-nav__item {
    border-left: 0;
    border-right: 0;
    > a {
      padding-left: @padding-left;
    }
    .bfd-nav__item {
      > a {
        padding-left: @padding-left * 2;
      }
    }
  }
}

.bfd-nav__item-icon {
  margin-right: 10px;
  width: 1em;
  text-align: center;
}

.bfd-nav__item-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  margin-top: -6px;
  transition: transform .2s;
}

.bfd-nav__item--open {
  > ul {
    display: block;
  }
  .bfd-nav__item-toggle {
    transform: rotate(90deg);
  }
}

.bfd-nav__item--active {
  > a {
    color: #333;
    background-color: #f5f5f5;
    border-left-color: @primary-color-deep;
    &:hover,
    &:focus {
      color: #333;
      background-color: #f5f5f5;
    }
  }
}
