@import 'assets/scss/colors.scss';
@import 'assets/scss/fonts.scss';

.clickableListItem {
  padding: 0px 8px;

  > a {
    text-decoration: none;
  }
}

.containerListItem {
  padding: 16px 8px 0 16px;
  display: flex;
  flex-direction: row;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 400ms, border 400ms;
}

.containerListItem.unread {
  &:before {
    content: '•';
    color: var(--color-airy-blue);
    padding-top: 3px;
    margin-left: -20px;
    margin-right: 11px;
  }
}

.containerListItemActive {
  @extend .containerListItem;
  padding: 16px 8px 16px 16px;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--color-airy-logo-blue);
  border-radius: 8px;
  background-color: var(--color-background-blue);
  .contactDetails {
    padding-bottom: 0;
  }
}

.profileImage {
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: 16px;
  border-radius: 50%;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.contactDetails {
  width: 100%;
  border-bottom: 1px solid transparent;
  overflow: hidden;
  padding-bottom: 16px;
}

.topRow {
  display: flex;
  flex-direction: row;

  justify-content: space-between;
  align-items: center;
}

.profileName {
  color: var(--color-text-contrast);
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profileName.unread {
  color: var(--color-airy-blue);
  font-weight: 700;
}

@keyframes flipAnimation {
  0% {
    opacity: 1;
    transform: rotateX(90deg);
  }
  50% {
    opacity: 0.5;
    transform: rotateX(0deg);
  }
  100% {
    opacity: 1;
  }
}

.closedStateButton {
  width: 24px;
  height: 24px;
  background: none;
  padding: 0px;
  animation-name: flipAnimation;
  animation-duration: 1500ms;
  animation-fill-mode: forwards;

  svg {
    margin-top: 1px;
    path {
      fill: var(--color-soft-green);
    }
  }

  button {
    cursor: pointer;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    padding: 0px;
    outline: none;

    &:hover {
      svg {
        margin-top: 1px;
        path {
          fill: var(--color-soft-green);
        }
      }
    }
  }
}

.openStateButton {
  width: 20px;
  height: 20px;
  background: none;
  border: 1px solid var(--color-red-alert);
  margin: 2px 2px 0 0;
  border-radius: 50%;
  animation-name: flipAnimation;
  animation-duration: 1500ms;
  animation-fill-mode: forwards;

  button {
    cursor: pointer;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    outline: none;
  }
}

.contactLastMessage {
  @include font-base;
  color: var(--color-text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  margin-bottom: 8px;
  max-height: 24px;
  svg {
    margin: 4px 0;
    height: 16px;
    width: 16px;
    path {
      fill: var(--color-text-gray);
    }
  }
}

.contactLastMessage.unread {
  @include font-base;
  font-weight: 700;
  color: var(--color-text-contrast);
}

.bottomRow {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.contactLastMessageDate {
  @include font-s;
  color: var(--color-text-gray);
  text-align: right;
  white-space: nowrap;
}

.conversationIcon svg {
  width: 12px;
  height: 12px;

  path {
    fill: var(--color-text-gray);
  }
}

.source {
  @include font-s;
  color: var(--color-text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  margin-right: 4px;
  svg {
    path {
      fill: var(--color-dark-elements-gray);
    }
  }
  div {
    margin-right: 3px;
  }
}

.statusIcon {
  height: 24px;
}

.doneIcon {
  svg {
    width: 24px;
    height: 24px;
    path {
      fill: var(--color-soft-green);
    }
  }
}

.openIcon {
  width: 20px;
  height: 20px;
  background: none;
  border: 1px solid #bf1a2f;
  border-radius: 50%;
  margin: 2px 2px 0 0;
}

.openDoneToggle {
  border: none;
  background-color: rgba(0, 0, 0, 0);
  cursor: pointer;
}

.attachmentIcons {
  svg {
    height: 18px;
    width: 18px;
    path {
      fill: var(--color-text-gray);
    }
  }
}
