@use 'sass:map';
@use '@tutorbook/styles/config';
@use '@tutorbook/styles/typography';
@use '@tutorbook/styles/loader';

$height: 125px;
$margin: 20px;

.listItem {
  height: $height;
  position: relative;
  border: 1px solid map.get(config.$colors, 'accents-2');
  border-top: none;
  cursor: pointer;

  &.disabled {
    cursor: not-allowed;
  }

  &:first-child {
    border-top: 1px solid map.get(config.$colors, 'accents-2');
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  &:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }
}

.img {
  display: inline-block;
  position: absolute;
  left: $margin;
  top: $margin;
  width: $height - 2 * $margin;
  height: $height - 2 * $margin;
}

.name {
  @include typography.typography('body1');
  overflow: hidden;
  text-overflow: ellipsis;
  color: map.get(config.$colors, 'foreground');
  display: inline-block;
  position: absolute;
  left: $height;
  top: $margin;
  width: calc(100% - #{$height + $margin});
  height: 24px;
}

.bio {
  @include typography.typography('body2');
  overflow: hidden;
  text-overflow: ellipsis;
  color: map.get(config.$colors, 'accents-5');
  display: inline-block;
  position: absolute;
  left: $height;
  top: $margin + 24px;
  width: calc(100% - #{$height + $margin});
  height: $height - (2 * $margin + 24px);

  &.loading {
    top: $margin * 2 + 24px;
    height: $height - (3 * $margin + 24px);
  }
}

.loading {
  @include loader.loading();
  border-radius: 4px;
}
