/* This file is part of the BIMData Platform package.
(c) BIMData support@bimdata.io
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code. */
$width-tree: 272px;
$width-lg-tree: 300px;

.dms{
  position: relative;
  @include font-size(13px);
  .dms_title{
    padding: $grid-gutter-width;
    color: $color-primary;
    text-align: left;
  }
}

.dms-container{
  padding: 10px;
}
.dms__toolbox-selected{
  @include flexbox;
  .toolbox-selected__content{
    height: 32px;
    background-color: $color-white;
    box-shadow: $bd-box-shadow;
    text-align: left;
    @include flexbox;
    @include align-items(center);
    @include justify-content(center);
    @include font-size(11px);
    & > div{
      padding-left: $grid-gutter-width;
      padding-right: $grid-gutter-width;
      &:hover{
        cursor: pointer;
      }
    }
    .dms__delete-button{
      color: #DD0243;
    }
    .dms__move-button{
      color: #FF8B03;
      .container-button-move-top{
        height: 32px;
        display: inline-block;
        line-height: 32px;
      }
    }
    .dms__download-button{
      color: $color-primary;
    }
    .dms__selected-display{
      color: $color-primary;
      .item-counter{
        margin-left: $grid-gutter-width / 2;
        height: 15px;
        width: 15px;
        display: inline-block;
        color: $color-white;
        border-radius: 3px;
        background-color: $color-primary;
        line-height: 16px;
        text-align: center;
      }
    }
  }
}

.dms__toolbox{
  @include flexbox;
  .base-button-tool__container{
    position: relative;
  }
  .base-button-tool__container ~ .base-button-tool__container{
    margin-left: $grid-gutter-width / 2;
  }
  .dms__search{
    margin-left: $grid-gutter-width / 2;
    padding-left: $grid-gutter-width;
    position: relative;
    background-color: $color-white;
    box-shadow: $bd-box-shadow;
    @include flexbox;
  }
  input{
    width: 324px;
    height: 32px;
    min-width: 0;
    border: none;
    box-sizing: border-box;
    box-shadow: none;
  }
}

.dms__content{
  padding-top: $grid-gutter-width;
  height: 420px;
  position: relative;
  @include transition(.2s ease all);
  .dms__tree-view{
    width: $width-tree;
    height: calc(100% - #{$grid-gutter-width});
    position: absolute;
    left: -500px;
    overflow: auto;
    @include transition(.2s ease all);

    @include media-breakpoint-up(lg){
      width: $width-lg-tree;
    }
  }
  .dms__list-files{
    height: 100%;
    overflow: auto;
    @include transition(.2s ease all);
    .table-selected{
      width: 37px;
    }
    .table-name, .table-type, .table-date, .table-size{
      cursor: pointer;
    }
    .table-name{
      svg{
        margin: 0 8px 0 0;
      }
      span{
        display: flex;
        align-items: center;
        justify-content: flex-start;
      }
    }
  }

  &.shrinked{
    padding-left: $grid-gutter-width;
    width: calc(100% - #{$width-tree});
    transform: translateX($width-tree);

    @include media-breakpoint-up(lg){
      width: calc(100% - #{$width-lg-tree});
      @include transform(translateX($width-lg-tree));
    }
    .dms__tree-view{
      left: -$width-tree;
      @include media-breakpoint-up(lg){
        left: -$width-lg-tree;
      }
    }
  }

  .dms__tree-view{
    width: $width-tree;
    min-width: $width-tree;
    @include media-breakpoint-up(lg){
      width: $width-lg-tree;
      min-width: $width-lg-tree;
    }
  }

  .bd-table{
    width: 100%;
    min-width: 0;
    @include transition(.2s ease all);

    & > thead{
      & > tr{
        & > th{
          line-height: 1em;
          outline: none;
          &.sorting{
            &:before, &:after{
              display: none;
            }
          }
        }
      }
    }
    td{
      vertical-align: middle;
      line-height: 1em;
      word-break: break-all;
      @include font-size(13px);
      &:nth-child(even), &:nth-child(odd){
        background: none;
      }
    }

    .table-name{
      width: 47%;
      min-width: 47%;
      &__name{
        cursor: pointer;
        svg{
          min-width: 20px;
        }
      }
    }
    .table-type{
      width: 10%;
      min-width: 10%;
    }
    .table-creator{
      padding-bottom: 0;
      padding-top: 0;
      width: 9%;
      min-width: 9%;
    }
    .table-date{
      width: 14%;
      min-width: 14%;
    }
    .table-size{
      width: 9%;
      min-width: 9%;
    }
  }

  .base-button-option__menu{
    width: 157px;
    ul{
      li{
        padding: 6px 12px;
      }
    }

    &__remove{
      .delete__actions{
        .svg-icon{
          margin-right: 0;
        }
      }
    }
  }
  .base-checkbox{
    margin: 0;
    line-height: unset;
    span{
      &::before{
        margin: 0;
      }
    }
  }
}

.dms__tree-view{
  margin-right: $grid-gutter-width;
  .dms__tree-view-content{
    height: 100%;
    min-height: 100%;
    background-color: $color-white;
    box-shadow: $bd-box-shadow;
    overflow: auto;
    @include font-size(10px);
  }
  .dms__tree-view-header{
    padding: $grid-gutter-width / 2;
    @include flexbox;
    @include justify-content(flex-end);
    .svg-icon{
      cursor: pointer;
    }
  }
  ul{
    margin: 0;
    padding: 0;
  }
  .dms__tree-folder-list{
    list-style-type: none;
    text-align: left;
    li{
      position: relative;
      list-style-type: none;
      svg{
        color: $color-primary;
        @include transition(.15s linear all);
      }
      .dms__line-tree-view{
        padding-left: $grid-gutter-width * 1.5;
        padding-top: 5px;
        padding-bottom: 5px;
        @include transition(.15s linear all);
        &:hover{
          background-color: $gray3;
        }
      }
      .collapse-tree{
        overflow: hidden;
        will-change: height;
        @include transition(all 0.3s ease-in-out);
      }
      .dms__line-tree-view-content{
        position: relative;
        .folder-carret{
          width: 0px;
          height: 0px;
          position: absolute;
          top: 4px;
          left: -10px;
          content: '';
          display: inline-block;
          border-top: 4px solid transparent;
          border-bottom: 4px solid transparent;
          border-left: 4px solid grey;
          @include transition(transform 0.3s ease-in-out);
        }
        &__name{
          margin-left: 3px;
          width: 87%;
          display: inline-block;
          overflow: hidden;
          text-overflow: ellipsis;
          vertical-align: middle;
          white-space: nowrap;
        }
      }
      &:hover{
        cursor: pointer;
      }
    }
    li.is-current-folder > .dms__line-tree-view{
      background-color: $color-primary;
      color: $color-white;
      svg{
        color: $color-white;
      }
    }
    li.is-current-path > .dms__line-tree-view > .dms__line-tree-view-content{
      @include transition(.3s ease all);
    }
    .is-folder-opened > .dms__line-tree-view > .dms__line-tree-view-content .folder-carret{
      @include transform(rotate(90deg));
    }
  }
}

.new_folder_box{
  padding: 11px;
  position: absolute;
  top: 37px;
  left: 0;
  background-color: $color-white;
  color: $color-primary;
  box-shadow: $bd-box-shadow;
  text-align: left;
  z-index: 2;
  @include font-size(12px);
  @include transition(.15s ease all);
  &.rename{
    left: -120%;
    top: 60px;

    @include media-breakpoint-up(md){
      left: -110%;
    }
    @include media-breakpoint-up(xl){
      left: -100%;
    }
  }
  &__overlay{
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 1;
  }
  .base-input-text-material{
    margin: 0;
    padding: 16px 0;
    input{
      height: 22px;
      padding: 0;
      color: $color-text;
      @include font-size(12px);
    }
  }
  .new_folder_box__button-validation{
    flex: 1 auto;
    @include flexbox;
    @include align-items(center);
    @include justify-content(flex-end);
    span{
      padding-left: $grid-gutter-width;
      &:hover{
        color: darken($color-primary, 10);
        cursor: pointer;
      }
    }
  }
  &.show{
    opacity: 1;
  }
}
.dms__move-button{
  position: relative;
  .base-tree-select{
    position: absolute;
    top: 27px;
  }
}
