// Composite Form
//================================================== //

.composite-form {
  height: 100%;
  margin-top: 0;

  > .scrollable-flex-content {
    border-top: 1px solid $panel-border-color;
    height: inherit;
    overflow-y: hidden;

    > .tab-panel-container {
      height: inherit;

      &.scrollable,
      &.scrollable-x,
      &.scrollable-y {
        height: 100%;
      }
    }

    > .tab-container {
      &.horizontal {
        padding: 0 0 0 20px;

        + .tab-panel-container {
          &.scrollable,
          &.scrollable-x,
          &.scrollable-y {
            height: calc(100% - 40px);
          }
        }
      }

      &.vertical {
        height: 100%;
        min-height: 0;
      }
    }
  }

  > .scrollable-flex-header {
    height: auto;
  }

  .tab-panel-container {
    background-color: $composite-tabs-panel-bg-color;
  }

  .tab-panel {
    margin: 20px 0;
    padding-top: 0;
  }

  //=================================================
  // Side-Summary Mode
  //=================================================

  &.on-side {
    flex-direction: row;

    > .scrollable-flex-header {
      width: 250px;
    }

    > .scrollable-flex-content {
      border-left: 1px solid $ids-color-palette-slate-30;
      border-top: 0;
      width: calc(100% - 250px);
    }
  }

  //=================================================
  // Responsive Mode (more columns)
  //=================================================
  &.is-in-responsive-mode {
    overflow: auto;

    > .scrollable-flex-content {
      flex-shrink: 0;

      > .tab-container {
        height: 40px;

        + .tab-panel-container {
          height: calc(100% - 41px);
        }
      }
    }

    // Revert the side-oriented version of the composite form back to its normal state
    // while in "responsive" mode.
    &.on-side {
      flex-direction: column;

      > .scrollable-flex-header,
      > .scrollable-flex-content {
        width: auto;
      }

      > .scrollable-flex-content {
        border-left: 0 !important;
        border-right: 0 !important;
        border-top: 1px solid $ids-color-palette-slate-30;
      }
    }
  }

  //==================================================
  // Explicitly NOT Responsive Mode
  //==================================================
  &:not(.is-in-responsive-mode) {
    &.on-side {
      .scrollable-flex-header {
        .one-third.column {
          float: none;
          width: auto;
        }
      }

      > .scrollable-flex-header {
        .expandable-expander {
          display: none;
        }
      }
    }
  }

  .expandable-pane {
    margin: 4px 28px;
  }

  .expandable-footer {
    margin-bottom: 12px !important;
    margin-left: 18px;
    margin-right: 18px;
    margin-top: 10px !important;
  }
}

html[dir='rtl'] {
  .composite-form {
    > .scrollable-flex-content {
      > .tab-container.horizontal {
        padding: 0 20px 0 0;
      }
    }

    &.on-side {
      > .scrollable-flex-content {
        border-left: 0;
        border-right: 1px solid $ids-color-palette-slate-30;
      }
    }
  }
}
