@use "@angular/material" as mat;
@use "sass:math";
@import "./../../lib/scss/sc-variables";
@import "./../../lib/scss/sc-mixins";

$list-header-height: 96px;

sc-documents-manager {
  height: 100%;
}

.sc-card--doc-categories {
  height: calc(100% - 24px);

  .sc-card-content,
  .mat-tab-group,
  .mat-tab-body-wrapper,
  .mat-tab-body,
  .mat-tab-body-content {
    height: 100% !important;
  }
}

.fab-mr {
  margin-right: $grid-gap !important;
}

.text--truncate {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.l-doc-categories {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: $list-header-height minmax(0, 1fr) minmax(0, 2fr);
  height: 100%;

  &__list-header {
    grid-row: 1 / 2;
    padding: 0 $grid-gap;
    display: flex;
    align-items: center;
  }

  &__list {
    padding: 0;
    grid-row: 2 / 3;
    height: 100%;
    overflow-y: auto;

    .mat-list {
      &-item-content {
        padding-right: 8px !important;
      }
      
      &-text {
        flex-direction: row !important;
        gap: $grid-gap;
        padding-right: 0 !important;
      }
    }

    .list {
      &__text {
        flex: 1;
        min-width: 0;
      }

      &__action {
        flex: 0 0 auto;
      }
    }
  }

  &__doc {
    grid-row: 3 / 4;
    padding: 0;
    border-top: 1px solid;
    height: 100%;
    overflow: auto;
  }

  .items_loaded.repeater__content::after {
    height: 0;
  }

  @media screen and (min-width: 600px) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: $list-header-height minmax(0, 1fr);
    height: 100%;

    &__list-header {
      grid-row: 1 / 2;
    }

    &__list {
      padding: 0;
      grid-row: 2 / 3;
      overflow-y: auto;
    }

    &__doc {
      grid-row: 1 / 3;
      padding: 0;
      border-left: 1px solid;
      border-top: none;
    }
  }

  @media screen and (min-width: 1280px) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.loader-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.docs-card {
  .sc-card-content {
    overflow: hidden;
  }

  &__content-wrapper {
    position: relative;
    border: 0;
    padding-top: (math.div(297, 210) * 100%);
    // padding-top: 297 / 210 * 100%;
  }

  &__upload-indicator {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color $hover-transition-duration linear;

    svg {
      // width: 100%;
      // height: 100%;
      // max-width: 64px;
      // max-height: 64px;
      transition: fill $hover-transition-duration linear;
    }

    &:hover {
      transition: background-color $hover-transition-duration linear;

      svg {
        transition: fill $hover-transition-duration linear;
      }
    }
  }

  &__preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  &__preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
  }

  &__actions {
    position: absolute;
    top: 16px;
    right: 16px;
    width: calc(100% - 16px * 2);
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  &__footer {
    width: 100%;
    display: flex;
    align-items: center;

    &-title {
      flex: 1 1 calc(100% - 20px);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    &-icon {
      flex: 0 0 16px;
      margin-left: 4px;
    }
  }
}
