// Copyright (c) 2020-2021 Drew Lemmy
// This file is part of TenebraWeb 2 under AGPL-3.0.
// Full details: https://github.com/tmpim/TenebraWeb2/blob/master/LICENSE.txt
@import (reference) "../../App.less";

.site-sidebar {
  background: @kw-sidebar-bg;
  border-right: 1px solid @kw-border-color-darker;

  width: @kw-sidebar-width;

  position: fixed;
  top: @layout-header-height;
  bottom: 0;

  // Above the mobile collapse backdrop, below the modals
  z-index: 910;

  transition: left @kw-sidebar-collapse-duration ease;
  left: 0;

  &.collapsed {
    left: -@kw-sidebar-width;
  }

  .site-sidebar-header {
    padding: 0.5rem 1rem;

    background: @kw-sidebar-header-bg;
    border-bottom: 1px solid @kw-border-color-darker;

    line-height: 1.25;

    user-select: none;

    h5 {
      margin-bottom: 0;

      font-size: @font-size-sm;
      font-weight: bolder;

      color: @text-color-secondary;
    }

    &.site-sidebar-update {
      padding: 1rem;

      background: @primary-color;
      color: @kw-darkest;

      h5 {
        color: @kw-darkest;
        margin-bottom: @padding-xs;
      }
    }

    &.site-sidebar-total-balance {
      .anticon svg {
        width: 14px;
        height: 14px;

        position: relative;
        bottom: 0.15em;

        color: @text-color-secondary;
      }

      .tenebra-value {
        font-size: 20px;
      }
    }
  }

  .ant-layout-sider-children {
    display: flex;
    flex-direction: column;

    & > .ant-menu {
      overflow-y: auto;
      height: 100%;
    }
  }

  .ant-menu-item-group .ant-menu-item-group-title {
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;

    color: @kw-text-secondary;

    // margin: 1rem 0 0 0;
    margin: 0;
    padding: 1rem 1rem 0.5rem 1rem;

    border-top: 1px solid @kw-border-color-division;

    user-select: none;
  }

  .ant-menu-item {
    margin-top: 0;
    margin-bottom: 0 !important;
    padding: 0;

    line-height: @kw-sidebar-item-height;
    height: @kw-sidebar-item-height;
    vertical-align: middle;

    user-select: none;

    .anticon {
      line-height: @kw-sidebar-item-height;
      vertical-align: middle;

      font-size: 18px;
    }

    .conditional-link-disabled {
      color: @text-color;
    }
  }

  .site-sidebar-footer {
    user-select: none;

    padding: 0.5rem;

    text-align: center;
    font-size: 75%;

    color: @text-color-secondary;

    .conditional-link-disabled, a {
      color: @text-color;
    }

    .site-sidebar-footer-version {
      margin: @padding-xs -0.5rem 0 -0.5rem;
      padding-top: @padding-xs;

      border-top: 1px solid @kw-border-color-division;

      font-size: 90%;
      font-weight: 500;
      line-height: 1;
    }
  }
}

.site-sidebar-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  transition: opacity @kw-sidebar-collapse-duration ease;

  background: @kw-sidebar-backdrop-bg;
  opacity: 1;

  pointer-events: all;
  cursor: pointer;

  // Below the sidebar and modals
  z-index: 900;

  &.collapsed {
    pointer-events: none;
    opacity: 0;
  }
}
