/*
 * Copyright (c) 2023 Thomas Hansen - For license inquiries you can contact thomas@ainiro.io.
 */

@import "src/assets/styles/_variables/colors.scss";
@import "src/assets/styles/_variables/mixin.scss";

.panel-1 {
  flex: 1 1 auto;
  overflow: hidden;

  .mat-expansion-panel {
    max-height: 100%;
  }
}

.panel-2 {
  flex: 0 0 auto;

  .mat-expansion-panel {
    max-height: 22vh;
  }
}

.panel-3 {
  flex: 0 0 auto;

  .mat-expansion-panel {
    max-height: 15vh;
  }
}

.rename-box {
  position: absolute;
  left: 4px;
  width: 94%;
  z-index: 2;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 1;
}

::ng-deep #tree {
  .action-menu-general {
    .mat-icon-button {
      height: 25px;
      width: 25px;
      line-height: 25px;
      &:hover {
        background-color: transparentize($color: $ainiro_default, $amount: 0.5);;
      }

      mat-icon {
        width: 18px;
        height: 18px;
        font-size: 18px;
        line-height: 18px;
      }
    }
  }

  .mat-accordion {
    padding: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;

    .mat-expansion-panel-body {
      padding: 0;
    }

    .mat-expansion-panel-header {
      height: 25px;
      &:hover {
        background-color: $ainiro_default_grey5;
      }

      .mat-expansion-indicator {
        margin-top: -5px;
        margin-right: 5px;
      }

      &.mat-expanded {

        .mat-expansion-indicator {
          margin-top: 7px;
        }
      }
      .mat-expansion-panel-header-title {
        padding-left: 7px;
      }
    }

    .mat-expansion-panel {
      overflow: hidden;
      width: 100%;
    }

    .mat-expansion-panel-content {
      max-height: calc(100% - 25px);
      height: 100%;
      overflow: auto;
      @include scrollbar($ainiro_default_alt, $ainiro_default_grey4, 8px);
      @include scrollbar_horizontal($ainiro_default_alt, $ainiro_default_grey4, 7px);
    }
  }

  .mat-tree-node {
    min-height: unset;
    position: relative;
    overflow: visible;
    @include general_transition(0.3s);

    &.file-node {
      .file-button {
        margin-left: 20px !important;
        mat-icon {
          margin-right: 5px;
        }
      }
    }

    button {
      font-size: 12px;
      line-height: 21px;
      padding: 0 3px 0 0 !important;

      mat-icon {
        font-size: 22px;
        width: 22px;
        height: 22px;
        line-height: 22px;
      }
    }

    .show-on-hover {
      visibility: hidden;
      display: flex;
      align-items: center;

      .mat-icon-button {
        height: 25px;
        width: 25px;
        line-height: 25px;
        background-color: transparentize($color: $ainiro_default, $amount: 0.5);
      }

      mat-icon {
        font-size: 18px;
        line-height: 18px;
        width: 18px;
        height: 18px;
        margin-right: 0;
      }
    }

    &.active-folder,
    &.active-folder:hover {
      background-color: transparentize($color: $ainiro_default_grey4, $amount: 0.75);
    }

    &.active-file,
    &.active-file:hover {
      background-color: transparentize($color: $ainiro_default_grey4, $amount: 0.75);
    }

    &:hover {
      background-color: transparentize($color: $ainiro_default_grey5, $amount: 0.75);

      .show-on-hover {
        visibility: visible;
      }
    }
  }

  .open-files {
    button {
      font-size: 12px;
      line-height: 21px;
      padding-left: 5px;
    }

    button.mat-icon-button {
      height: unset;
    }

    @include general_transition(0.3s);

    &.active-file {
      background-color: transparentize($color: $ainiro_default_grey4, $amount: 0.9);
    }

    &:hover {
      background-color: transparentize($color: $ainiro_default_grey5, $amount: 0.75);
    }

    mat-icon {
      font-size: 20px;
      width: 20px;
      height: 20px;
      line-height: 20px;
    }
  }

  .toolbox {
    button {
      font-size: 12px;
      line-height: 21px;
      padding-left: 5px;
      mat-icon {
        font-size: 18px;
        margin-top: 0;
        height:20px;
      }
    }
  }
}
