@use '../../../../styles/_globals.scss' as *;

.form-wrapper {
  // overflow:hidden here caused the browser's focus-scrolling to reset the
  // parent config-page scroll position when any form control received focus.
  overflow: visible;
  padding: var(--s2) var(--s2) var(--s) !important;

  config-form {
    display: block;
  }

  .section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s);
    margin-top: var(--s2);
  }

  &.keyboard {
    ::ng-deep formly-field > formly-group {
      box-sizing: border-box;
      padding: 0 var(--s);
      display: grid;
      grid: auto-flow / 1fr;
      gap: 0;

      @include mq(xs) {
        gap: 0 var(--s2);
        grid: auto-flow / 1fr 1fr;
      }
    }
  }
}

:host {
  position: relative;
  display: block;
}

$this-panel-padding-left-right: 12px;

:host ::ng-deep .collapsible-header {
  font-size: 16px;
  margin-top: 0;
  padding: 10px $this-panel-padding-left-right;
}

:host ::ng-deep .collapsible-panel {
  //border-top: 1px solid black;
  overflow: visible;

  > * {
    // for help icon positioning
    // does not work because of translate on the slide down ani element
    // position: static;

    // add a padding
    padding: 0 $this-panel-padding-left-right;
  }
}

:host ::ng-deep .help-btn {
  position: absolute;
  top: -40px;
  right: -2px;

  display: block;
  animation: var(--transition-duration-m) help-ico-animation var(--ani-standard-timing);
}

:host ::ng-deep .extra-margin-top {
  margin-top: var(--s4);
}

:host ::ng-deep .footer {
  margin: auto;
  margin-top: var(--s2);
  text-align: center;
}

@keyframes help-ico-animation {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}
