@import 'functions/rem';
@import 'mixins/list';
@import 'variables/colors';
@import 'variables/gutters';

.expanded-tree-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding-top: $digi--layout--gutter--m;

  &--is-root-node {
    position: static;
  }

  &__content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
  }

  &__filter {
    padding: 0 0.9375rem;
    margin-bottom: 1.25rem;
  }

  &__heading {
    font-size: 1rem;
    padding: 0 0.9375rem;
    display: block;
    font-weight: 600;

    ::ng-deep {
      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        max-width: 100%;
      }
    }
  }

  &__nodes {
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    @include msfa__reset-list;
    padding: 0.3125rem 0;
  }

  &__info {
    padding: 0.9375rem;
  }

  &__node {
    &--leaf {
      margin-top: $digi--layout--gutter--s;
      padding-left: $digi--layout--gutter;

      &:first-child {
        margin-top: 0;
      }
    }
  }

  &__child-node-expansion-btn {
    display: flex;
    padding: 0.3125rem 0.9375rem;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    position: relative;
    border-width: 0;
    background-color: transparent;
    align-items: center;
    font-size: var(--digi--typography--font-size--s);
    gap: var(--digi--layout--gutter--s);

    &:hover,
    &:focus {
      background-color: var(--digi--ui--color--background--secondary);
    }

    &--active {
      background-color: var(--digi--ui--color--primary);
      color: var(--digi--ui--color--background);

      &:hover,
      &:focus {
        background-color: lighten($digi--ui--color--primary, 10%);
      }
    }

    &__text {
      display: flex;
      align-items: center;
      text-align: left;
      position: relative;
      flex-grow: 1;
      padding-right: 1.2em;

      &--selected::after {
        content: '';
        width: 1em;
        height: 1em;
        border-radius: 100%;
        background-color: var(--digi--ui--color--success);
        position: absolute;
        right: 0;
      }
    }

    &__icon {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      width: 1em;
      max-height: 1em;
    }
  }

  &__child-node-checkbox {
    display: block;
    margin: 0.3125rem $digi--layout--gutter;

    &--toggle-all {
      margin: 1.25rem $digi--layout--gutter;
    }
  }

  &__child-node-expansion-panel {
    &--active {
      position: absolute;
      top: 0;
      left: 100%;
      border-left: 1px solid var(--digi--typography--color--text--disabled);
      height: 100%;
      width: 100%;
    }
  }
}
