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

@layout-prefix-cls: ~'@{kd-prefix}-layout';

.@{layout-prefix-cls} {
  position: relative;
  display: flex;
  flex: auto;
  flex-direction: column;
  min-height: 0;
  background: @layout-body-background;

  &,
  * {
    box-sizing: border-box;
  }

  &-has-sider {
    flex-direction: row;

    > .@{layout-prefix-cls},
    > .@{layout-prefix-cls}-content {
      width: 0; 
    }
  }

  &-header,
  &-footer {
    flex: 0 0 auto;
  }

  &-header {
    height: @layout-header-height;
    padding: @layout-header-padding;
    color: @layout-header-color;
    line-height: @layout-header-height;
    background: @layout-header-background;
  }

  &-footer {
    padding: @layout-footer-padding;
    color: @color-text-primary;
    font-size: @font-size-middle;
    background: @layout-footer-background;
  }

  &-content {
    flex: auto;
    min-height: 0;
  }

  &-sider {
    position: relative;
    min-width: 0;
    background: @layout-sider-background;
    transition: all 0.2s;

    &-children {
      height: 100%;
      margin-top: -0.1px;
      padding-top: 0.1px;
    }

    &-has-trigger {
      padding-bottom: @layout-trigger-height;
    }

    &-right {
      order: 1;
    }

    &-trigger {
      position: absolute;
      bottom: 0;
      z-index: 1;
      padding: 0 16px;
      color: @layout-trigger-color;
      height: @layout-trigger-height;
      line-height: calc(@layout-trigger-height - 4px);
      font-size: 20px;
      background: @layout-trigger-background;
      cursor: pointer;
      transition: all 0.2s;
      border-top: 1px solid rgba(218,222,237,.1);
    }

    &-zero-width {
      > * {
        overflow: hidden;
      }

      &-trigger {
        position: absolute;
        top: @layout-header-height;
        right: calc(-1 * @layout-zero-trigger-width);
        z-index: 1;
        width: @layout-zero-trigger-width;
        height: @layout-zero-trigger-height;
        color: @layout-trigger-color;
        font-size: calc(@layout-zero-trigger-width / 2);
        line-height: @layout-zero-trigger-height;
        text-align: center;
        background: @layout-sider-background;
        border-radius: 0 @radius-border @radius-border 0;
        cursor: pointer;
        transition: background 0.3s ease;

        &::after {
          position: absolute;
          top: 0;
          right: 0;
          bottom: 0;
          left: 0;
          background: transparent;
          transition: all 0.3s;
          content: '';
        }

        &:hover::after {
          background: rgba(255, 255, 255, 0.1);
        }

        &-right {
          left: calc(-1 * @layout-zero-trigger-width);
          border-radius: @radius-border 0 0 @radius-border;
        }
      }
    }
  }
}

@import './light';