@import '../../styles/common.module.scss';

.modalWrapper {
  z-index: 1102;
}

.FileManager {
  width: 810px;
  height: 660px;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 6px;
  position: relative;

  @mixin headerPart {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .header {
    @include paper;
    @include headerPart;
    padding: 5px;
    justify-content: space-between;
  }

  .headerLeft {
    @include headerPart;
  }

  .headerRight {
    @include headerPart;
  }

  .action {
    margin-right: 5px;
  }

  .listContainer,
  .list {
    width: 100%;
    height: 100%;
    min-height: 100px;
  }

  .listContainer {
    padding-bottom: 12px;
    padding: 20px;
  }

  .content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    max-height: 100%;
    overflow: auto;
    @include styledScrollBar;
  }

  .item {
    display: flex;
    position: relative;
    align-items: center;
    flex-direction: column;
    width: 100px;
    height: auto;
    margin: 4px;
    transition: 0.2s;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    white-space: normal;
    word-break: break-all;
    border: 3px solid transparent;

    &:hover {
      background-color: #eee;

      .zoomItemBtn {
        opacity: 0.5;
      }
    }
  }

  .itemIcon {
    margin-bottom: 5px;
    width: 60px;
    height: 60px;
  }

  .itemImageContainer {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .itemTextContainer {
    position: relative;
  }

  .itemText {
    text-align: initial;
    width: 100%;
    font-size: 14px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  // .selectedItem .itemText {
  //   -webkit-line-clamp: initial;
  //   position: absolute;
  // }

  .itemImage {
    max-height: 60px;
    max-width: 60px;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
  }

  .zoomItemBtn {
    position: absolute;
    top: calc(50% - 41px);
    left: calc(50% - 15px);
    opacity: 0;
    transition: 0.2s;
    background: #fff;
  }

  .item .zoomItemBtn:hover {
    opacity: 1;
    background: #fff;
  }

  .photoPreviewCloseBtn {
    position: absolute;
    background: #333;
    top: 10px;
    right: 10px;
  }

  .photoPreviewCloseIcon {
    color: #cdcdcd;
    width: 20px;
    height: 20px;
  }

  .zoomItemBtn {
    display: none;
  }

  .selectedItem {
    border: 3px solid #919191;

    .zoomItemBtn {
      display: block;
    }
  }

  .selectBtn {
    margin-right: 10px;
  }

  .preloader > div {
    box-shadow: 0 0 25px 2px rgba(91, 0, 82, 0.7);
    background: linear-gradient(144deg, #28006f 0%, #600155 100%);
    border-radius: 100%;
    transition: 0.3s;
  }
}

.itemTextTooltip,
.itemTextTooltip:hover {
  color: #fff;
}

.photoPreviewContainer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.8);
}

.photoPreview {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
}

.createFolderWindow {
  position: absolute;
  top: 50px;
  display: flex;
  align-items: center;
  z-index: 22;
  background-color: #fff;
  box-shadow: 0 0 25px 2px rgba(0, 0, 0, 0.2);
  border-radius: 7px;
  padding: 5px 10px;
}

.breadcrumbs {
  padding: 10px 15px 0 15px;
}

.pathChunk {
  cursor: pointer;
  font-size: 14px;
}

.dragAreaHighlight {
  display: none;
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 15px;
  right: 15px;
  border: 3px dashed #666;
}

.dragOverList {
  position: relative;
  .dragAreaHighlight {
    display: block;
  }
}

:global(.modeDark) {
  .FileManager,
  .FileManager .header,
  .createFolderWindow {
    background-color: #333;

    * {
      color: #eee;
    }
  }

  .item:hover {
    background-color: #555;
  }

  .zoomItemBtn {
    background-color: #333;
  }

  .item .zoomItemBtn:hover {
    background-color: #333;
  }

  .FileManager .selectedItem {
    border: 2px solid #ccc;
  }
}
