/* ================================= */
/* CSS for control sap.tnt/ToolPage  */
/* Base theme                        */
/* ================================= */

/* ==========================================================================
   Variables and mixins
   ========================================================================== */

@_sap_tnt_ToolPage_AsideWidth : 15rem;
@_sap_tnt_ToolPage_AsideWidthOnTablet : 3rem;
@_sap_tnt_ToolPage_HeaderHeight : 3rem;
@_sap_tnt_ToolPage_FooterHeight : 3rem;

@_sap_tnt_ToolPage_CompactAsideWidth : 15rem;
@_sap_tnt_ToolPage_CompactAsideWidthOnTablet : 3rem;
@_sap_tnt_ToolPage_CompactHeaderHeight : 3rem;
@_sap_tnt_ToolPage_CompactFooterHeight : 2rem;

@_sap_tnt_ToolPage_AnimationDuration : 0.3s;

.display-flex() {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

.flex-direction-column() {
  -webkit-box-direction: normal;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.flex-grow(@flex-grow) {
  -webkit-box-flex: @flex-grow;
  -webkit-flex-grow: @flex-grow;
  flex-grow: @flex-grow;
}

/* ==========================================================================
   Root element
   ========================================================================== */
.sapTntToolPage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  .display-flex();
  .flex-direction-column();

  box-sizing: border-box;
  overflow: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */
.sapTntToolPageHeader {
  height: @_sap_tnt_ToolPage_HeaderHeight;
}

/* ==========================================================================
   Content wrapper
   ========================================================================== */
.sapTntToolPageContentWrapper {
  .display-flex();
  .flex-grow(1);
  max-height: 100%;
  position: relative;
}

.sapTntToolPageWithHeader .sapTntToolPageContentWrapper {
  max-height: calc(~'100% - @{_sap_tnt_ToolPage_HeaderHeight}');
}

/* Aside container
   ========================================================================== */

.sapTntToolPageAside {
  .display-flex();
  .flex-direction-column();

  will-change: transform;
}

.sapTntToolPageAsideContent {
  .display-flex();
  .flex-direction-column();
  .flex-grow(1);
  height: 100%;
}

.sapTntToolPageAsideFooter {
  height: @_sap_tnt_ToolPage_FooterHeight;
  overflow: hidden;
}

html:not([data-sap-ui-animation='off']) .sapTntToolPageMain {
  -webkit-transition: padding-left @_sap_tnt_ToolPage_AnimationDuration, -webkit-transform @_sap_tnt_ToolPage_AnimationDuration; /* Safari */
  transition: padding-left @_sap_tnt_ToolPage_AnimationDuration, transform @_sap_tnt_ToolPage_AnimationDuration;
}

html:not([data-sap-ui-animation='off']) .sapTntToolPageAside {
  -webkit-transition: -webkit-transform @_sap_tnt_ToolPage_AnimationDuration; /* Safari */
  transition: transform @_sap_tnt_ToolPage_AnimationDuration;
}

.sap-desktop,
.sap-tablet {
  .sapTntToolPageAside {
    width: @_sap_tnt_ToolPage_AsideWidth;
    position: absolute;
    left: 0;
    bottom: 0;
    top: 0;
    z-index: 1;
  }

  .sapTntToolPageAside + .sapTntToolPageMain {
    padding-left: @_sap_tnt_ToolPage_AsideWidth;
  }
}

.sap-desktop,
.sap-tablet {
  .sapTntToolPageAsideCollapsed {
    & > .sapTntToolPageAside {
      width: @_sap_tnt_ToolPage_AsideWidthOnTablet;
    }

    & > .sapTntToolPageAside + .sapTntToolPageMain {
      padding-left: @_sap_tnt_ToolPage_AsideWidthOnTablet;
    }
  }
}

.sap-phone {
  .sapTntToolPageAside {
    width: @_sap_tnt_ToolPage_AsideWidth;
    position: absolute;
    left: 0;
    bottom: 0;
    top: 0;
    z-index: 1;
  }

  .sapTntToolPageMain {
    -webkit-transform: translateX(@_sap_tnt_ToolPage_AsideWidth);
    transform: translateX(@_sap_tnt_ToolPage_AsideWidth);
  }

  .sapTntToolPageAsideCollapsed {
    .sapTntToolPageAside {
      -webkit-transform: translateX(-@_sap_tnt_ToolPage_AsideWidth);
      transform: translateX(-@_sap_tnt_ToolPage_AsideWidth);
    }
    .sapTntToolPageMain {
      -webkit-transform: translateX(0);
      transform: translateX(0);
    }
  }
}

/* Main container
   ========================================================================== */

.sapTntToolPageMain {
  .display-flex();
  .flex-direction-column();
  .flex-grow(1);

  will-change: transform;
}

.sapTntToolPageMainContent {
  .flex-grow(1);

  position: relative;
}

.sapTntToolPageMainContentWrapper {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.sapTntToolPageMainFooter {
  height: @_sap_tnt_ToolPage_FooterHeight;
  overflow: hidden;
}

/* Compact size */
.sapUiSizeCompact {

  .sapTntToolPageHeader {
    height: @_sap_tnt_ToolPage_CompactHeaderHeight;
  }

  .sapTntToolPageAsideFooter {
    height: @_sap_tnt_ToolPage_CompactFooterHeight;
  }

  .sapTntToolPageMainFooter {
    height: @_sap_tnt_ToolPage_CompactFooterHeight;
  }
}

.sap-desktop .sapUiSizeCompact,
.sap-tablet .sapUiSizeCompact {
  .sapTntToolPageAside {
    width: @_sap_tnt_ToolPage_CompactAsideWidth;
  }

  .sapTntToolPageAside + .sapTntToolPageMain {
    padding-left: @_sap_tnt_ToolPage_CompactAsideWidth;
  }
}

.sap-desktop .sapUiSizeCompact,
.sap-tablet .sapUiSizeCompact {
  .sapTntToolPageAsideCollapsed {
    .sapTntToolPageAside {
      width: @_sap_tnt_ToolPage_CompactAsideWidthOnTablet;
    }

    .sapTntToolPageAside + .sapTntToolPageMain {
      padding-left: @_sap_tnt_ToolPage_CompactAsideWidthOnTablet;
    }
  }
}

.sap-phone .sapUiSizeCompact {

  .sapTntToolPageAside {
    width: @_sap_tnt_ToolPage_CompactAsideWidth;
  }

  .sapTntToolPageMain {
    -webkit-transform: translateX(@_sap_tnt_ToolPage_CompactAsideWidth);
    transform: translateX(@_sap_tnt_ToolPage_CompactAsideWidth);
  }

  .sapTntToolPageAsideCollapsed {
    .sapTntToolPageAside {
      -webkit-transform: translateX(-@_sap_tnt_ToolPage_CompactAsideWidth);
      transform: translateX(-@_sap_tnt_ToolPage_CompactAsideWidth);
    }
    .sapTntToolPageMain {
      -webkit-transform: translateX(0);
      transform: translateX(0);
    }
  }
}

/* ==========================================================================
   RTL
   ========================================================================== */

html[dir=rtl] {
  &.sap-phone {
    .sapTntToolPageMain {
      -webkit-transform: translateX(-@_sap_tnt_ToolPage_AsideWidth);
      transform: translateX(-@_sap_tnt_ToolPage_AsideWidth);
    }

    .sapTntToolPageAsideCollapsed {
      .sapTntToolPageAside {
        -webkit-transform: translateX(@_sap_tnt_ToolPage_AsideWidth);
        transform: translateX(@_sap_tnt_ToolPage_AsideWidth);
      }
      .sapTntToolPageMain {
        -webkit-transform: translateX(0);
        transform: translateX(0);
      }
    }
  }

  &.sap-phone .sapUiSizeCompact {
    .sapTntToolPageMain {
      -webkit-transform: translateX(-@_sap_tnt_ToolPage_CompactAsideWidth);
      transform: translateX(-@_sap_tnt_ToolPage_CompactAsideWidth);
    }

    .sapTntToolPageAsideCollapsed {
      .sapTntToolPageAside {
        -webkit-transform: translateX(@_sap_tnt_ToolPage_CompactAsideWidth);
        transform: translateX(@_sap_tnt_ToolPage_CompactAsideWidth);
      }
      .sapTntToolPageMain {
        -webkit-transform: translateX(0);
        transform: translateX(0);
      }
    }
  }
}