/* Thread Header */

@-webkit-keyframes loadingshimmer {
  0% {
    background-position: -700px 0;
  }

  100% {
    background-position: 700px 0;
  }
}

@keyframes loadingshimmer {
  0% {
    background-position: -700px 0;
  }

  100% {
    background-position: 700px 0;
  }
}

.cp-thread-header--loading .cp-ticket-loadable-text {
  position: relative;
}

.cp-thread-header--loading .cp-ticket-loadable-text:after {
  -webkit-animation: loadingshimmer 1s linear 0s infinite forwards;
  animation: loadingshimmer 1s linear 0s infinite forwards;
  background: linear-gradient(to right, #eaf0f6, #dfe3eb 20%, #eaf0f6 40%);
  background-color: #eaf0f6;
  background-size: 1200px;
  content: ' ';
  height: 0.75em;
  left: 0;
  max-width: 200px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

.cp-ticket-thread__header-wrapper {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.cp-ticket-thread__header {
  margin-bottom: 12px;
}

.cp-ticket-thread__header h1 {
  font-size: 32px;
  font-weight: 300;
  margin-bottom: 8px;
}

.cp-ticket-thread__id {
  display: inline-block;
  min-width: 75px;
}

.cp-ticket-thread__status-wrapper {
  margin-left: 24px;
}

.cp-ticket-thread__status {
  background-color: #9b9b9b;
  border-radius: 2.5px;
  color: #fff;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 65px;
  padding: 5px 10px;
  text-align: center;
  text-transform: uppercase;
}

.cp-ticket-thread__status.open {
  background-color: #00bda5;
}

.cp-ticket-thread__status.closed {
  background-color: #9b9b9b;
}

.cp-ticket-thread__status.error {
  background-color: #f55;
}

.cp-ticket-icon {
  font-size: 20px;
  vertical-align: text-top;
}

/* Error messages */

.cp-error-message {
  color: #666d77;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0.5rem 0 0;
  text-align: center;
  width: 100%;
}

/* Threaded responses */

.cp-ticket-thread__messages {
  align-items: center;
  border-radius: 3px;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  padding: 20px 20px 0;
}

.cp-ticket-thread__show-more {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  text-align: center;
}

.cp-show-more-messages-button {
  background-color: #99acc2;
  border-radius: 16px;
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  position: absolute;
  transition: all 0.15s ease-out;
  z-index: 1;
}

.cp-show-more-messages-button:hover {
  background-color: #a7b8cc;
  color: #fff;
  text-decoration: none;
}

.cp-show-more-messages-button:active {
  background-color: #8fa2b8;
  color: #fff;
}

.cp-ticket-thread__show-more.hidden {
  display: none;
  margin-bottom: 0;
}

.cp-ticket-thread__response button[type='submit'] {
  display: flex;
  justify-content: center;
  min-width: 175px;
}

.cp-list-items {
  width: 100%;
}

.cp-list-item {
  display: block;
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.cp-list-item:last-child {
  border-bottom: none;
}

.cp-list-item-metadata {
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding-bottom: 12px;
  width: 100%;
}

.cp-list-item-sender-wrapper {
  align-items: center;
  display: inline-flex;
  flex-direction: row;
}

.cp-list-item-sender-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 0;
}

.cp-list-item-avatar {
  -webkit-animation: loadingshimmer 1s linear 0s infinite forwards;
  animation: loadingshimmer 1s linear 0s infinite forwards;
  background: linear-gradient(to right, #eaf0f6, #dfe3eb 20%, #eaf0f6 40%);
  background-color: #eaf0f6;
  background-size: 1200px;
  border-radius: 50%;
  color: #fff;
  height: 32px;
  line-height: 32px;
  margin-right: 8px;
  overflow: hidden;
  text-align: center;
  width: 32px;
}

.cp-list-item-avatar > img {
  height: 100%;
}

.cp-list-item-metadata p {
  font-size: 16px;
  margin: 0;
}

.cp-list-item-message-content img {
  max-height: 200px;
}

.cp-list-item-message-content__text {
  white-space: pre-line;
}

.cp-list-item-message-content__text--rich-text {
  white-space: normal;
}

.cp-list-item-message-content__attachments {
  margin-top: 8px;
}

.cp-ticket-thread__textarea-wrapper {
  border: 1px solid #d1d6dc;
  border-bottom: none;
  display: flex;
}

.cp-list-item-message-expandable-content-wrapper {
  padding-left: 40px;
}

.cp-ticket-thread__textarea-wrapper > textarea {
  border: none;
  margin-top: 0;
}

.cp-reply-to-wrapper {
  align-content: flex-start;
  align-items: flex-start;
  border: 1px solid #d1d6dc;
  border-bottom: none;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  margin-top: 12px;
  padding: 16px 12px 8px 16px;
}

.cp-reply-to {
  background-color: white;
  display: block;
  transition: height 150ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.cp-reply-to--hidden {
  display: none;
  margin-bottom: 0;
}

.cp-reply-to-label {
  align-items: baseline;
  flex-shrink: 0;
  font-size: 14px;
  margin-right: 8px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.cp-reply-to-email-list {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: normal;
  gap: 5px;
  justify-content: flex-start;
}

.cp-reply-to-email-recipient {
  background-color: rgba(248, 250, 252, 1);
  border: 1px solid #d1d6dc;
  flex-wrap: nowrap;
  max-width: 100%;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.cp-reply-to-name-text {
  font-weight: bold;
}

.cp-emails-list__show-more a {
  color: #0091ae;
  font-size: 14px;
  margin-left: 5px;
}

.cp-reply-to-email-caret {
  color: #0091ae;
  margin-left: auto;
  transition: all 150ms ease-out 0s;
}

.cp-reply-to-email-caret svg {
  fill: #0091ae;
}

.cp-file-attach-submit-wrapper {
  align-items: center;
  border: 1px solid #d1d6dc;
  border-radius: 3px;
  border-top: 0 !important;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  display: flex;
  justify-content: space-between;
  padding-left: 8px;
  padding-right: 12px;
}

.cp-file-attach-wrapper {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: flex-start;
  margin-bottom: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.cp-file-attach-preview-wrapper {
  width: 100%;
}

.cp-file-attach-wrapper > * {
  margin-right: 12px;
}

.cp-file-attach-input-label {
  align-items: center;
  display: flex;
  flex-direction: row;
  margin: 1px;
}

.cp-file-attach-text {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.cp-file-attach-input p {
  font-size: 14px;
  margin-bottom: 0;
  margin-right: 8px;
}

.cp-file-attach-input small {
  font-size: 14px;
  font-weight: 100;
  margin-bottom: 0;
}

.cp-attach-button {
  font-size: 16px;
  height: 32px;
  margin-right: 5px;
  padding: 8px;
  width: 32px;
}

#cp-send-button {
  font-size: 14px;
  height: 28px;
  min-width: 0;
}

.cp-list-item-message-expandable-content {
  overflow-y: hidden;
  position: relative;
  transition: height 150ms ease-out;
}

.cp-expand-uninitialized {
  max-height: 300px;
}

.cp-expand-closed:after {
  background-image: linear-gradient(rgba(255, 255, 255, 0), currentcolor);
  background-size: 100% 32px;
  bottom: 0;
  content: '';
  height: 32px;
  left: 0;
  opacity: 1;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.cp-expand-open {
  height: auto;
}

.cp-expand-closed {
  height: 300px;
}

.cp-list-item-message-expand-button {
  display: inline-block;
  margin-top: 0.875rem;
}

/* Response form */
.cp-ticket-thread__response.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.cp-ticket-thread__response.disabled #response {
  opacity: 0.6;
  pointer-events: none;
}

.cp-ticket-thread__response.disabled .cp-file-attach-wrapper,
.cp-ticket-thread__response.disabled .cp-file-attach-input-label {
  cursor: not-allowed;
  pointer-events: none;
}

.cp-file-preview {
  border-radius: 3px;
  display: inline-flex;
  flex-direction: row;
  font-size: 14px;
  margin: 0 8px 8px 0;
  padding: 12px 32px 12px 12px;
  position: relative;
  width: 95%;
  max-width: 325px;
}

.cp-file-preview p {
  font-size: 14px;
  margin-bottom: 0;
}

.cp-preview-wrapper {
  align-items: center;
  display: flex;
  flex-basis: auto;
  flex-shrink: 0;
  font-size: 24px;
  justify-content: center;
  margin-right: 12px;
  max-height: 52px;
  overflow-x: hidden;
  overflow-y: hidden;
  position: relative;
  width: 52px;
}

.cp-file-preview-preview {
  height: 32px;
  width: 48px;
}

.cp-file-preview .cp-preview-remove-button {
  font-size: 8px;
  height: 12px;
  min-width: 12px;
  position: absolute;
  right: 8px;
  top: 8px;
}

.cp-file-metadata {
  flex-basis: 0;
  flex-grow: 1;
  flex-shrink: 0;
  font-size: 14px;
  overflow: hidden;
}

.cp-file-metadata > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media all and (-ms-high-contrast: none) {
  .cp-file-metadata {
    flex-basis: auto;
    max-width: calc(100% - 52px);
    padding-right: 12px;
  }
}

.cp-drop-zone--hover {
  border: 1px solid #00c6ab !important;
  margin: 0;
  /* stylelint-disable-next-line declaration-no-important */
}

.cp-drop-zone--active {
  border: 1px solid #ccc;
  margin: 0;
}
