@import 'src/styles/variables';

@keyframes highlight {
  0% {
    opacity: 0.75;
  }
  25% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.75;
  }
  75% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.wrap {
  @include outer_shadow;

  background: $content_bg_light;
  min-height: $comment_height;
  display: flex;
  position: relative;
  min-width: 0;
  border-radius: $radius;

  &.is_empty {
    opacity: 0.5;
  }

  &.is_same {
    margin: 0 !important;
    border-radius: 0;
  }

  &.is_new::after {
    content: ' ';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    animation: highlight 1s 0.5s forwards;
    border-radius: $radius;
    pointer-events: none;
    touch-action: none;
  }

  @include tablet {
    flex-direction: column;
  }
}

.text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;

  @include tablet {
    :global(.comment-author) {
      display: none !important;
    }
  }
}

.thumb {
  flex: 0 0 $comment_height;
  border-radius: $panel_radius 0 0 $panel_radius;
  background-color: $content_bg;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  @include tablet {
    flex-direction: row;
    flex: 0 0 40px;
    padding: 8px;
    box-shadow: inset rgba(255, 255, 255, 0.05) 1px 1px,
      inset rgba(0, 0, 0, 0.1) -1px -1px;
    border-radius: $panel_radius $panel_radius 0 0;
  }
}

div.thumb_image {
  height: $comment_height;
  background: $gray_90 no-repeat 50% 50%;
  border-radius: $panel_radius 0 0 $panel_radius;
  background-size: cover;
  flex: 0 0 $comment_height;
  will-change: transform;
  cursor: default;

  @include tablet {
    height: 32px;
    width: 32px;
    flex: 0 0 32px;
    border-radius: $panel_radius;
  }
}

.pointer {
  cursor: pointer;
}

.thumb_user {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 0 $gap;
  font: $font_14_medium;

  @include tablet {
    display: flex;
  }
}
