$grw-sidebar-content-header-height: 58px;
$grw-sidebar-content-footer-height: 50px;
$grw-pagetree-item-padding-left: 10px;

.grw-pagetree {
  min-height: calc(100vh - ($grw-navbar-height + $grw-navbar-border-width + $grw-sidebar-content-header-height + $grw-sidebar-content-footer-height));

  .btn-page-item-control {
    .icon-plus::before {
      font-size: 18px;
    }
  }

  .list-group-item {
    .grw-visible-on-hover {
      display: none;
    }

    &:hover {
      .grw-visible-on-hover {
        display: block;
      }

      .grw-count-badge {
        display: none;
      }
    }

    .grw-pagetree-triangle-btn {
      background-color: transparent;
      transition: all 0.2s ease-out;
      transform: rotate(0deg);

      &.grw-pagetree-open {
        transform: rotate(90deg);
      }
    }

    .grw-pagetree-title-anchor {
      width: 100%;
      overflow: hidden;
      text-decoration: none;
    }

    .grw-pagetree-count-wrapper {
      display: inline-block;

      &:hover {
        display: none;
      }
    }
  }

  .grw-pagetree-item-container {
    .grw-triangle-container {
      min-width: 35px;
      height: 40px;
    }
  }

  // To realize a hierarchical structure, set multiplied padding-left to each pagetree-item
  > .grw-pagetree-item-container {
    > .list-group-item {
      padding-left: 0;
    }
    > .grw-pagetree-item-children {
      > .grw-pagetree-item-container {
        > .list-group-item {
          padding-left: $grw-pagetree-item-padding-left;
        }
        > .grw-pagetree-item-children {
          > .grw-pagetree-item-container {
            > .list-group-item {
              padding-left: $grw-pagetree-item-padding-left * 2;
            }
            > .grw-pagetree-item-children {
              > .grw-pagetree-item-container {
                > .list-group-item {
                  padding-left: $grw-pagetree-item-padding-left * 3;
                }
                > .grw-pagetree-item-children {
                  > .grw-pagetree-item-container {
                    > .list-group-item {
                      padding-left: $grw-pagetree-item-padding-left * 4;
                    }
                    > .grw-pagetree-item-children {
                      > .grw-pagetree-item-container {
                        > .list-group-item {
                          padding-left: $grw-pagetree-item-padding-left * 5;
                        }
                        > .grw-pagetree-item-children {
                          > .grw-pagetree-item-container {
                            > .list-group-item {
                              padding-left: $grw-pagetree-item-padding-left * 6;
                            }
                            > .grw-pagetree-item-children {
                              > .grw-pagetree-item-container {
                                > .list-group-item {
                                  padding-left: $grw-pagetree-item-padding-left * 7;
                                }
                                > .grw-pagetree-item-children {
                                  > .grw-pagetree-item-container {
                                    > .list-group-item {
                                      padding-left: $grw-pagetree-item-padding-left * 8;
                                    }
                                    > .grw-pagetree-item-children {
                                      > .grw-pagetree-item-container {
                                        > .list-group-item {
                                          padding-left: $grw-pagetree-item-padding-left * 9;
                                        }
                                        .grw-pagetree-item-children {
                                          > .grw-pagetree-item-container {
                                            > .list-group-item {
                                              padding-left: $grw-pagetree-item-padding-left * 10;
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
