@import "../../../../../styles/base/color.scss";
@import "../../../../../styles/base/typography.scss";

.pinned-panel {
  width: 641px;
  height: 100%;
  box-shadow: 0 0 var(--Sizes-S-04, 4px) 0 rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  background: $whiteColor;
  border-radius: 10px;
}

.pinned-panel-header {
  padding: 16px;
  border-bottom: 1px solid $accordionBgBackground;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: $semiBoldFontWeight;
  height: 64px;
}

.header-title {
  color: $darkColor;

  font-size: 16px;
  font-style: normal;
  font-weight: $ExtraFontWeight;
  line-height: 24px; /* 150% */
}
.close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: $secondaryColor;
  font-size: $normalFontSize;
  font-weight: 500;
}

.pinned-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pinned-title {
  margin-bottom: 16px;
  font-weight: $normalFontWeight;
  color: $mainFontColor;
  font-size: $normalFontSize;
  font-weight: 800;
  line-height: 21px;
}

.pinned-message {
  background: linear-gradient(
    92deg,
    $disabledSecondaryBg -0.92%,
    #f6f7fa 98.11%
  );
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.pinned-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: $successIconColor;
  color: $whiteColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.pinned-info {
  flex: 1;
}

.pinned-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: $normalFontSize;
}

.pinned-meta .user-title {
  color: $mainFontColor;

  /* Body/SmallBold */

  font-size: $smallFontSize;
  font-style: normal;
  font-weight: 700;
  line-height: 20px; /* 166.667% */
}
.pinned-meta span {
  font-size: $smallFontSize;
  color: $lightGrayColor;
}

.pinned-text {
  color: $mainFontColor;
  font-size: $smallFontSize;
  font-style: normal;
  font-weight: $BoldFontWeight;
  line-height: 20px; /* 166.667% */
  white-space: pre-wrap;
  word-break: break-word;

  // HTML content container
  .message-content-html {
    p {
      margin: 0 0 8px 0;
      color: $textButtonFontColor;
      font-size: $smallFontSize;
      font-weight: 500;
      line-height: 160%;
      letter-spacing: 0.14px;

      &:last-child {
        margin-bottom: 0;
      }
    }

    // Mention styling
    .mention {
      background-color: rgba($primaryColor, 0.1);
      border: 1px solid rgba($primaryColor, 0.3);
      border-radius: 4px;
      color: $primaryColor;
      font-weight: 600;
      padding: 0px 6px;
      text-decoration: none;
      display: inline-block;
      margin: 0px 2px;
      transition: all 0.2s ease;

      &:hover {
        background-color: rgba($primaryColor, 0.15);
        border-color: rgba($primaryColor, 0.5);
      }
    }

    // Text formatting styles
    strong {
      font-weight: 700;
      color: $textButtonFontColor;
    }

    em {
      font-style: italic;
      color: $textButtonFontColor;
    }

    u {
      text-decoration: underline;
      color: $textButtonFontColor;
    }

    s {
      text-decoration: line-through;
      color: $textButtonFontColor;
    }

    // Highlight styling
    mark {
      background-color: #fef3c7;
      border-radius: 4px;
      padding: 2px 4px;
      color: $textButtonFontColor;
    }

    // Link styling
    a {
      color: $primaryColor;
      text-decoration: underline;

      &:hover {
        color: darken($primaryColor, 10%);
      }
    }

    // List styling
    ul,
    ol {
      margin: 8px 0;
      padding-left: 20px;

      li {
        margin: 4px 0;
        color: $textButtonFontColor;
        font-size: $smallFontSize;
      }
    }

    // Heading styles
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin: 12px 0 8px 0;
      color: $textButtonFontColor;
      font-weight: 600;

      &:first-child {
        margin-top: 0;
      }
    }

    h1 {
      font-size: 18px;
    }
    h2 {
      font-size: 16px;
    }
    h3 {
      font-size: 15px;
    }
    h4 {
      font-size: 14px;
    }
    h5 {
      font-size: 13px;
    }
    h6 {
      font-size: 12px;
    }
  }
}

.user-titel {
  color: $mainFontColor !important;

  /* Body/SmallBold */
  font-size: $smallFontSize;
  font-style: normal;
  font-weight: $BoldFontWeight;
  line-height: 20px; /* 166.667% */
}
.time-stamp {
  color: $inputInfoColor;

  /* Body/SmallMedium */
  font-size: $smallFontSize;
  font-style: normal;
  font-weight: $normalFontWeight;
  line-height: 16px; /* 133.333% */
}
.pinned-time {
  color: $inputInfoColor !important;

  /* Body/SmallMedium */

  font-size: $smallFontSize;
  font-style: normal;
  font-weight: $normalFontWeight;
  line-height: 16px; /* 133.333% */
}

/* THREAD STYLES - new only */

.thread-message {
  display: flex;
  align-items: flex-start;
  margin: 16px 0;

  .thread-info {
    background: linear-gradient(
      92deg,
      #f8f9fb -0.92%,
      #f6f7fa 98.11%
    ); // light gray bg
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 80%;
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .thread-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;

    .user-title {
      color: $mainFontColor;
      /* Heading/MediumSemibold */
      font-size: $mediumFontSize;
      font-style: normal;
      font-weight: $semiBoldFontWeight;
      line-height: 24px; /* 150% */
    }
  }

  .thread-quote {
    color: $textButtonFontColor;
    font-size: $normalFontSize;
    font-style: normal;
    font-weight: 500;
    line-height: 160%; /* 22.4px */
    letter-spacing: 0.14px;
    background: $whiteColor;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;

    // HTML content styling for quotes
    .message-content-html {
      p {
        margin: 0 0 8px 0;
        color: $textButtonFontColor;
        font-size: $normalFontSize;
        font-weight: 500;
        line-height: 160%;

        &:last-child {
          margin-bottom: 0;
        }
      }

      .mention {
        background-color: rgba($primaryColor, 0.1);
        border: 1px solid rgba($primaryColor, 0.3);
        border-radius: 4px;
        color: $primaryColor;
        font-weight: 600;
        padding: 0px 6px;
        text-decoration: none;
        display: inline-block;
        margin: 0px 2px;
        transition: all 0.2s ease;

        &:hover {
          background-color: rgba($primaryColor, 0.15);
          border-color: rgba($primaryColor, 0.5);
        }
      }

      strong {
        font-weight: 700;
      }
      em {
        font-style: italic;
      }
      u {
        text-decoration: underline;
      }
      s {
        text-decoration: line-through;
      }

      mark {
        background-color: #fef3c7;
        border-radius: 4px;
        padding: 2px 4px;
      }

      a {
        color: $primaryColor;
        text-decoration: underline;
        &:hover {
          color: darken($primaryColor, 10%);
        }
      }
    }
  }

  .thread-text {
    color: $mainFontColor;
    margin-left: 8px;
    font-size: $normalFontSize;
    font-style: normal;
    font-weight: 500;
    line-height: 160%; /* 22.4px */
    letter-spacing: 0.14px;
    white-space: pre-wrap;
    word-break: break-word;

    // HTML content container
    .message-content-html {
      p {
        margin: 0 0 8px 0;
        color: $textButtonFontColor;
        font-size: $normalFontSize;
        font-weight: 500;
        line-height: 160%;
        letter-spacing: 0.14px;

        &:last-child {
          margin-bottom: 0;
        }
      }

      // Mention styling
      .mention {
        background-color: rgba($primaryColor, 0.1);
        border: 1px solid rgba($primaryColor, 0.3);
        border-radius: 4px;
        color: $primaryColor;
        font-weight: 600;
        padding: 0px 6px;
        text-decoration: none;
        display: inline-block;
        margin: 0px 2px;
        transition: all 0.2s ease;

        &:hover {
          background-color: rgba($primaryColor, 0.15);
          border-color: rgba($primaryColor, 0.5);
        }
      }

      // Text formatting styles
      strong {
        font-weight: 700;
        color: $textButtonFontColor;
      }

      em {
        font-style: italic;
        color: $textButtonFontColor;
      }

      u {
        text-decoration: underline;
        color: $textButtonFontColor;
      }

      s {
        text-decoration: line-through;
        color: $textButtonFontColor;
      }

      // Highlight styling
      mark {
        background-color: #fef3c7;
        border-radius: 4px;
        padding: 2px 4px;
        color: $textButtonFontColor;
      }

      // Link styling
      a {
        color: $primaryColor;
        text-decoration: underline;

        &:hover {
          color: darken($primaryColor, 10%);
        }
      }

      // List styling
      ul,
      ol {
        margin: 8px 0;
        padding-left: 20px;

        li {
          margin: 4px 0;
          color: $textButtonFontColor;
          font-size: $normalFontSize;
        }
      }

      // Heading styles
      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        margin: 12px 0 8px 0;
        color: $textButtonFontColor;
        font-weight: 600;

        &:first-child {
          margin-top: 0;
        }
      }

      h1 {
        font-size: 20px;
      }
      h2 {
        font-size: 18px;
      }
      h3 {
        font-size: 16px;
      }
      h4 {
        font-size: 15px;
      }
      h5 {
        font-size: 14px;
      }
      h6 {
        font-size: 13px;
      }
    }
  }

  .thread-time {
    color: $textButtonFontColor;
    text-align: right;
    font-size: $smallFontSize;
    font-style: normal;
    font-weight: 500;
    line-height: 160%; /* 19.2px */
    letter-spacing: 0.12px;
  }
}

.thread-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: $normalFontSize;
  outline: none;
  height: 56px;
  border-radius: 12px;

  &:focus {
    border-color: $primaryColor;
  }
}

.thread-input .send-btn {
  background: $primaryColor;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: $mediumFontSize;
}

.thread_title {
  color: $mainFontColor;
  font-size: $mediumFontSize;
  font-style: normal;
  font-weight: $semiBoldFontWeight;
  line-height: 24px; /* 150% */
}

.thread-quote-container {
  background: $whiteColor;
  padding: 8px;
}

.pinned-message,
.thread-message {
  .deleted-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: $lightGrayColor;
    font-size: 14px;
    margin-top: 4px;

    .delete-icon {
      font-size: 16px;
      color: $lightGrayColor;
    }

    .deleted-text {
      font-style: italic;
      font-size: $smallFontSize;
      font-weight: $normalFontWeight;
    }
  }
}
