@import 'common/angular/common.mixin';

.header {
  user-select: none;

  position: sticky;

  overflow: hidden;
  display: flex;

  padding-left: 10px;

  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-888);

  &:first-child:not(.checkbox) {
    padding-left: 30px;
  }

  .order {
    cursor: pointer;
    visibility: hidden;
  }

  &:hover .order {
    visibility: visible;
  }

  &.checkbox {
    margin-left: 0;
    padding-left: 10px;
  }

  .title-wrapper {
    display: flex;
    align-items: center;
    padding-right: 15px;

    .icon-sort {
      display: flex;
    }
  }

  .tools-wrapper {
    display: flex;
  }

  .draggable-line {
    cursor: col-resize;

    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;

    display: flex;

    width: 5px;
    height: 100%;

    background-color: transparent;

    &:hover {
      background-color: var(--color-gray-eee);
    }

    &.active {
      background-color: transparent;
    }
  }

  .grad {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;

    width: 16px;
    height: 100%;

    background: linear-gradient(to right, hsl(0deg 0% 100% / 0%), var(--color-gray-fff) 70%, var(--color-gray-fff));
  }
}

.cdk-drag-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
  align-items: center;

  box-sizing: border-box;

  background-color: var(--color-gray-fff);
  border-radius: 4px;
  box-shadow: var(--tui-shadow);
}

.row {
  @include extlist-row;

  display: grid;

  box-sizing: border-box;

  text-overflow: ellipsis;

  border-bottom-color: var(--color-gray-eee);
  border-bottom-style: solid;

  .actions,
  .actions-dots-button {
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    visibility: hidden;
  }

  .actions-dots-button {
    justify-content: flex-end;
  }

  &:hover .actions,
  &:hover .actions-dots-button {
    visibility: visible;
  }

  .visible {
    visibility: visible;
  }

  &.selected {
    background-color: var(--app-bg-color-l3);
  }

  .progress-wrapper {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;

    padding: 0 5px;

    .progress-widget {
      flex: 8;
    }

    .percentage {
      flex: 2;
    }
  }
}

.empty-drag-placeholder {
  height: 50px;
}

.table__titles {
  display: grid;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-gray-eee);
}

.table__titles,
.table__rows {
  width: fit-content;
  min-width: 100%;
}

.extlist__col {
  @include extlist-column;
}

.row__dd-handle {
  position: relative;
  right: 0;
  margin-right: 5px;
}

// Возможно нужно вынести в отдельный виджет
.columns-setting {
  display: flex;
  flex-direction: column;

  width: 275px;
  max-width: 19vw;
  height: 350px;
  max-height: 48vh;
  padding: 15px;

  background-color: var(--color-gray-fff);
  border-radius: 4px;
  box-shadow: 0 3px 15px rgb(0 0 0 / 25.1%);

  .columns-setting__title {
    border-bottom: 1px solid var(--color-gray-eee);

    h3 {
      margin-top: 0;
    }
  }

  .columns-setting__column-list {
    overflow: hidden;
    flex-grow: 1;
    margin: 15px 0;

    .column-list__container {
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      max-height: 100%;
    }
  }

  .columns-setting__actions {
    display: flex;
    justify-content: flex-end;

    button {
      padding: 0 15px !important;
    }
  }
}

.table__col--hidden {
  display: none;
}

.checklist-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist-button,
.settings-button {
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;

  &:hover {
    opacity: 0.8;
  }
}

.prior-wrap {
  display: inline-block;
  width: 14px;
  height: 14px;
}

.table__count.head {
  min-height: 18.2px;
}

.table__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .table__count {
    color: var(--color-gray-888);
  }
}

.prio-trigger {
  cursor: pointer;
  display: flex;
  padding-left: 10px;
  visibility: hidden;
}

.table__paginator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 10px;

  .page-number {
    cursor: pointer;
    padding: 2px 5px;

    &.selected {
      font-weight: 600;
      color: var(--color-href);
    }
  }

  &-first-icon,
  &-last-icon,
  &-prev-icon,
  &-next-icon {
    padding: 2px 5px;

    app-cmf-doodle-icon {
      display: flex;
    }
  }
}

.content-height {
  .extlist__col {
    height: fit-content;

    .cmf-row-wrap {
      position: static;
      align-items: start;
    }
  }
}

.subinfo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-task {
  height: 50px;
}

.recently-modified {
  font-weight: bold;
}

.cursor-line {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;

  display: block;

  width: 2px;
  height: 100%;

  background-color: var(--accent-color-bg);

  &.active {
    will-change: left;
    display: block;
  }
}

.table__content {
  overflow-x: hidden;
  min-width: 100%;
}

.fake-scroller-wrapper {
    overflow-x: auto;
    position: sticky;
    bottom: 0;
}

.fake-scroller {
    background-color: transparent;
    height: 1px;
}

.fake-scroller-wrapper {
  overflow-x: auto;
  position: sticky;
  bottom: 0;
}

.fake-scroller {
  background-color: transparent;
  height: 1px;
}
