@import '../../style/themes/index';
@import '../../style/mixins/index';

@m-sidebar-menu-prefix-cls: m-sidebar-menu;

.@{m-sidebar-menu-prefix-cls} {
  display: flex;
  height: @sidebar-menu-height-base;
  font-size: @font-size-sm;
  background: @sidebar-menu-background;

  &-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: @sidebar-menu-height-base;

    &-icon-close {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 999;
      padding-right: 0;
      cursor: pointer;
    }

    &-body {
      position: relative;
      flex: 1;
      width: @sidebar-menu-body-width;
      height: @sidebar-menu-height-base;
      overflow: hidden;
    }
  }

  &-tabset {
    height: @sidebar-menu-height-base;
  }

  .ant-tabs {
    .ant-tabs-nav {
      min-width: auto;
    }

    .ant-tabs-content {
      height: @sidebar-menu-height-base;

      .ant-tabs-tabpane-active {
        position: relative;
        height: @sidebar-menu-height-base;
      }

      .ant-tabs-tabpane {
        padding-left: 0;
      }
    }

    .ant-tabs-tab-active {
      color: inherit;
      background: #e8e8e8;
    }

    .ant-tabs-nav-list {
      .ant-tabs-tab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        padding: 0;
        margin: 12px 4px;
        border-radius: 2px;

        &:hover {
          color: inherit;
          background: #e8e8e8;
        }

        &.ant-tabs-tab-active {
          .ant-tabs-tab-btn {
            color: inherit;
          }
        }

        .anticon {
          margin-right: 0;
          font-size: 16px;
        }

        .ant-tabs-ink-bar {
          display: none !important; // hack tabs style
        }
      }
    }

    .ant-tabs-ink-bar {
      display: none !important; // hack tabs style
    }
  }

  .tabset-hide {
    .ant-tabs-nav {
      border-color: transparent;
    }

    .ant-tabs-tab-active {
      background: transparent;
    }
  }

  // m-sidebar-menu-header
  &-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: @sidebar-menu-header-height;
    padding-left: @padding-sm;
    margin-bottom: @margin-md;
    border-bottom: @sidebar-menu-header-borderBottom;
    &-plus {
      margin-right: @margin-md + 4px;
      cursor: pointer;
    }
    &-minus {
      margin-right: @sidebar-menu-header-minus-marginRight;
      cursor: pointer;
    }
  }

  // m-sidebar-menu-detail-info
  &-detail-info {
    &-container {
      padding: @sidebar-menu-detail-info-container-padding;
    }

    &-block {
      display: flex;
      align-items: baseline;
      padding-bottom: @sidebar-menu-detail-info-block-paddingBottom;
      font-weight: @sidebar-menu-detail-info-block-fontWeight;
    }

    &-keyName {
      display: flex;
      align-items: center;
      width: @sidebar-menu-detail-info-keyName-width;
      padding-right: @sidebar-menu-detail-info-keyName-paddingRight;
      color: @sidebar-menu-detail-info-keyName-color;
    }

    &-keyValue {
      flex: 1;
      color: @sidebar-menu-detail-info-keyValue-color;
    }
  }

  //m-sidebar-menu-search
  &-search {
    display: flex;
    flex-direction: column;
    height: @sidebar-menu-height-base;
    &-container {
      height: calc(100% - 36px);
      padding-left: @sidebar-menu-search-container-paddingLeft;
      overflow-x: hidden;
      overflow-y: auto;
    }

    &-checkbox {
      padding: @sidebar-menu-search-checkbox-padding;
      font-size: 12px;

      .ant-checkbox + span {
        align-self: self-start;
        padding-top: 2px;
      }
    }

    &-input {
      width: calc(100% - 24px);

      .ant-input {
        font-size: 12px;
      }
    }

    &-result {
      padding: @sidebar-menu-search-result-padding;
    }

    &-list {
      flex: 1;
      overflow: auto;
      .ant-empty {
        padding-top: 40px;
        font-size: 12px;
      }
    }

    &-tree-item {
      width: @sidebar-menu-search-tree-item-width;
      padding: @sidebar-menu-search-tree-item-padding;
      cursor: pointer;
    }

    &-hightlight-word {
      color: @sidebar-menu-search-hightlight-word-color;

      &:hover {
        text-decoration: underline;
      }
    }

    &-tree-title {
      display: flex;
      justify-content: space-between;
      font-weight: 400;
      color: @sidebar-menu-search-tree-title-color;

      &-left {
        width: calc(100% - 30px);

        .anticon {
          padding-right: 6px;
        }
      }
    }

    &-tree-leaf {
      padding-left: @sidebar-menu-search-tree-leaf-paddingLeft;

      &:hover {
        background: #e8e8e8;
      }
    }

    &-loading {
      width: 100%;
      padding-top: @sidebar-menu-search-loading-paddingTop;
      text-align: center;
    }
  }

  //m-sidebar-menu-shortcut
  &-shortcut {
    &-container {
      padding: @sidebar-menu-shortcut-container-padding;
    }

    &-title {
      padding: @sidebar-menu-shortcut-title-padding;
      font-size: @sidebar-menu-shortcut-title-fontsize;
      font-weight: @sidebar-menu-shortcut-title-font-weight;
      line-height: @sidebar-menu-shortcut-title-lineheight;
      box-shadow: @sidebar-menu-shortcut-boxshadow;
    }

    &-block {
      display: flex;
      justify-content: space-between;
      padding: @sidebar-menu-shortcut-block-padding;
      font-size: @sidebar-menu-shortcut-block-fontsize;
      line-height: @sidebar-menu-shortcut-block-lineheight;
      box-shadow: @sidebar-menu-shortcut-boxshadow;

      &-shortcut {
        color: @sidebar-menu-shortcut-block-shortcut-color;
      }
    }
  }
}
