// Layout
$layout-body-background: #f0f2f5;
$layout-header-background: #001529;
$layout-footer-background: $layout-header-background;
$layout-sider-background: $layout-header-background;
$layout-header-height: 64px;
// $layout-header-padding: 0 50px;
// $layout-footer-padding: 24px 50px;
$layout-trigger-height: 48px;
$layout-trigger-background: #002140;
$layout-trigger-color: #fff;
$layout-zero-trigger-width: 36px;
$layout-zero-trigger-height: 42px;

$text-color: #fff;
$text-color2: #000;
$font-size-base: 14px;
$border-radius-base: 4px;

.smx-layout {
  display: flex;
  flex: auto;
  flex-direction: column;
  /* fix firefox can't set height smaller than content on flex item */
  min-height: 0;
  background: $layout-body-background;
  overflow: auto;

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

  &-has-sider {
    flex-direction: row;
    > .smx-layout,
    > .smx-layout-content {
      overflow-x: hidden;
    }
  }

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

  &-header {
    height: $layout-header-height;
    // padding: $layout-header-padding;
    line-height: $layout-header-height;
    background: $layout-header-background;
    color: $text-color;
  }

  &-footer {
    // padding: $layout-footer-padding;
    color: $text-color;
    font-size: $font-size-base;
    background: $layout-footer-background;
  }

  &-content {
    flex: auto;
    min-height: 0;
    color: $text-color2;
    overflow: auto;
    padding-bottom: 20px;
  }

  &-sider {
    position: relative;
    min-width: 0;
    background: $layout-sider-background;
    transition: all 0.5s;
    color: $text-color;
    overflow-y: hidden;

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

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

    &-right {
      order: 1;
    }

    &-trigger {
      position: fixed;
      bottom: 0;
      z-index: 1;
      height: $layout-trigger-height;
      color: $layout-trigger-color;
      line-height: $layout-trigger-height;
      text-align: center;
      background: $layout-trigger-background;
      cursor: pointer;
      transition: all 0.2s;
    }

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

      &-trigger {
        position: absolute;
        top: $layout-header-height;
        right: -$layout-zero-trigger-width;
        width: $layout-zero-trigger-width;
        height: $layout-zero-trigger-height;
        color: $layout-trigger-color;
        font-size: $layout-zero-trigger-width / 2;
        line-height: $layout-zero-trigger-height;
        text-align: center;
        background: $layout-sider-background;
        border-radius: 0 $border-radius-base $border-radius-base 0;
        cursor: pointer;
        transition: background 0.3s ease;

        &:hover {
          background: tint($layout-sider-background, 10%);
        }

        &-right {
          left: -$layout-zero-trigger-width;
        }
      }
    }
  }
}