@import './themes/default.less';

/* 侧栏 */
.guns-admin-sidebar {
  flex-shrink: 0;
  width: @sidebar-width;
  min-height: calc(100vh - @header-height);
  z-index: calc(@layout-z-index + 3);
  background: @sidebar-light-background;
  box-shadow: @sidebar-light-shadow;
  transition: @sidebar-transition;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;

  & > .guns-admin-sidebar-menus {
    flex: auto;
    overflow-x: hidden;
    overflow-y: auto;

    & > .ant-menu {
      border: none;
      background: none;
      transition: none;

      .ant-menu-item,
      .ant-menu-submenu-title {
        width: 100%;
      }

      .ant-menu-item-icon {
        font-size: 24px;
      }

      .ant-menu-submenu .ant-menu-sub {
        transition: none;
      }
    }
  }

  & > .guns-admin-sidebar-tool-item {
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    .guns-admin-sidebar-tool-item-icon {
      font-size: 20px !important;
      color: #000;
    }
  }

  & + .guns-admin-body {
    width: calc(100% - @sidebar-width);
    transition: width @sidebar-transition-anim;
  }
}
.guns-admin-collapse .ant-menu-item-icon {
  font-size: @menu-icon-size-lg !important;
}

/* 双侧栏一级 */
.guns-admin-sidebar-nav {
  flex-shrink: 0;
  width: @sidebar-nav-width;
  min-height: calc(100vh - @header-height);
  box-shadow: -1px 0 0 @border-color-split inset;
  transition:
    width @sidebar-transition-anim,
    left @sidebar-transition-anim,
    padding @sidebar-transition-anim,
    box-shadow @sidebar-transition-anim;
  z-index: calc(@layout-z-index + 3);
  background: @component-background;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;

  & > .guns-admin-sidebar-nav-menu {
    flex: auto;
    position: relative;
    box-sizing: border-box;
    padding: @sidebar-nav-padding;
    transition: padding @sidebar-transition-anim;
    overflow-x: hidden;
    overflow-y: auto;

    & > .ant-menu {
      border: none;
      background: none;
      width: auto;

      & > .ant-menu-item,
      & > .ant-menu-submenu {
        color: #03112b;
        margin: @sidebar-nav-item-margin;
        border-radius: 8px !important;
      }

      & > .ant-menu-item {
        transition:
          color 0.3s @ease-in-out,
          background-color 0.3s @ease-in-out,
          margin 0.3s @ease-in-out;
      }

      & > .ant-menu-submenu {
        transition: margin 0.3s @ease-in-out;
      }

      & > .ant-menu-submenu > .ant-menu-submenu-title {
        margin: 0;
      }

      & > .ant-menu-item,
      & > .ant-menu-submenu > .ant-menu-submenu-title {
        width: 100%;
        height: auto;
        line-height: 0;
        display: block;
        text-align: center;
        border-radius: 8px;
        padding: @sidebar-nav-item-padding !important;
        transition:
          color 0.3s @ease-in-out,
          background-color 0.3s @ease-in-out,
          padding 0.3s @ease-in-out;

        & > .ant-menu-item-icon {
          line-height: 22px;
          margin: 0;
          // line-height: 0;
          font-size: @sidebar-nav-icon-font-size;
          transition: font-size 0.3s @ease-in-out;
        }

        & > .ant-menu-title-content {
          margin: 0;
          opacity: 1;
          display: block;
          transition: none;
        }

        & > .ant-menu-title-content > span {
          width: auto;
          height: auto;
          display: block;
          line-height: 1;
          font-size: @sidebar-nav-font-size;
          max-height: @sidebar-nav-font-size;
          margin: @sidebar-nav-item-title-margin;
          transition:
            transform 0.3s @ease-in-out,
            max-height 0.3s @ease-in-out,
            margin 0.3s @ease-in-out,
            visibility 0.3s @ease-in-out;
          overflow: hidden;
          white-space: nowrap;
          word-break: break-all;
          text-overflow: ellipsis;
          visibility: visible;
          transform: scale(1);
          max-width: none;
          opacity: 1;
        }

        &:after {
          display: none;
        }
      }

      & > .ant-menu-item:not(.ant-menu-item-selected):hover {
        background: @header-tool-hover-bg;
      }

      & > .ant-menu-submenu:not(.ant-menu-submenu-selected) {
        & > .ant-menu-submenu-title:not(:active):hover {
          background: @header-tool-hover-bg;
        }
      }

      & > .ant-menu-submenu.ant-menu-submenu-selected {
        & > .ant-menu-submenu-title {
          background: @item-active-bg;
        }
      }
    }
  }

  .guns-admin-sidebar-nav-tool-item {
    height: 40px;
    line-height: 40px;
    text-align: center;
    // color: @text-color;
    color: #03112b !important;
    font-size: @font-size-lg;
    transition:
      color 0.3s @ease-in-out,
      background-color 0.3s @ease-in-out,
      padding 0.3s @ease-in-out;
    cursor: pointer;

    &:hover {
      color: @primary-color;
    }
  }
}

.guns-admin-sidebar-nav-menu-pop > .ant-menu {
  margin-left: @sidebar-nav-pop-menu-margin;
}

/* 侧栏双菜单 */
.guns-admin-side-mix {
  --sidebar-background: #eff1f7;
  --header-light-background: #eff1f7;
  @sidebar-width: 275px;
  .guns-admin-header {
    box-shadow: none;
  }
  .guns-admin-logo {
    width: @sidebar-nav-width;
    box-shadow: none !important;

    & > span {
      display: none;
    }
  }

  &:not(.guns-admin-collapse) .guns-admin-logo {
    box-shadow: -1px 0 0 @border-color-split inset;
  }

  .guns-admin-sidebar-nav {
    --component-background: #eff1f7;
  }

  .guns-admin-sidebar-nav + .guns-admin-sidebar {
    border-radius: 20px 0 0 0;
    background: @component-background;
    box-shadow: none;
    width: calc(@sidebar-width - @sidebar-collapse-width);
    z-index: calc(@layout-z-index + 1);

    .guns-admin-sidebar-menus {
      border-right: 1px solid #E7EBF1;
    }
  }

  .guns-admin-body {
    width: calc(100% - @sidebar-nav-width);

    .guns-admin-content {
      height: calc(100vh - 52px - 16px);
      padding: 0 16px 16px 0;
      box-sizing: border-box;
    }

    .guns-admin-content-view {
      background-color: #eff1f7;
      border-radius: 0 20px 20px 0;
      // clip-path: inset(0 round 0 20px 20px 0);
    }
  }

  .guns-admin-sidebar + .guns-admin-body {
    width: calc(100% - @sidebar-width + @sidebar-collapse-width - @sidebar-nav-width);
  }

  .guns-admin-sidebar {
    --component-background: #eff1f7;
    padding-bottom: 16px;
    box-sizing: border-box;
    box-shadow: none;

    .guns-admin-sidebar-menus {
      padding: 12px 16px;
      background-color: #fff;
      border-radius: 20px 0 0 20px;
    }
    .ant-menu-item {
      border-radius: 4px;
    }

    .ant-menu-item-selected {
      color: #0f56d7;
      background-color: #cfddf759;
    }
    .ant-menu-item::after {
      border-right: 0 !important;
    }
  }

  .guns-admin-sidebar-nav-menu > .ant-menu > .ant-menu-submenu.ant-menu-submenu-selected > .ant-menu-submenu-title {
    border-radius: 4px;
    background-color: #cfddf759;
    color: #0f56d7;
  }
}

.guns-admin-side-mix.guns-admin-collapse {
  .guns-admin-content-view {
    border-radius: 20px;
      // clip-path: inset(0 round 20px);
  }
}
