// Main Container
.CommentContainer {
  background-color: #FFFFFF;
  border-radius: 16px;
  width: 700px;
  height: 530px;
  padding: 20px 24px;
  box-shadow: 0px 2px 3px #00000040;
  display: flex;
  flex-direction: column;
  font-family: Helvetica !important;
  margin-top: 60px;

  // Wrapper divs for ngIf sections
  >div:not(.CommentHeader):not(.CommentFooterFooter) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  // Embedded permanently inside a tab (Team Space/Meeting discussion) instead of a floating
  // panel — fill the host container rather than a fixed floating-panel size/position.
  &.inline {
    width: 100%;
    height: 100%;
    margin-top: 0;
    border-radius: 8px;
    box-shadow: none;
  }
}

// Header Section
.CommentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.CommentTitleContainer {
  .ProjectTitle {
    font-family: Helvetica !important;
    font-weight: 700;
    font-style: Bold;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0%;
    color: #834DD0;
    display: block;
  }

  .ProjectTitlecode {
    font-family: Helvetica !important;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0%;
    color: #834DD0;
  }

  .ProjectSubtitle {
    font-size: 12px;
    color: #834DD0;
    display: block;
  }
}

.HeaderActions {
  display: flex;
  gap: 8px;
}

.header-icon {
  border: none;
  background: transparent;
  color: #6B6B6B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.headerer-icon {
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  width: 48px;
  height: 28px;
  gap: 2px;
  opacity: 1;
  border-radius: 8px;
  border: 1px solid #834DD0;
  display: flex;
  justify-content: center;
  align-items: center;
}

// Body Section
.CommentBody {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  margin-bottom: 12px;

  textarea {
    width: 100%;
    flex: 1;
    min-height: 100px;
    resize: none;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 14px;
    font-size: 14px;
    outline: none;
  }
}

// Reply Sections
.reply-container {
  padding: 10px;
  border-radius: 8px;
}

.parent-comment-section {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #FFFFFF;
  border-radius: 4px;
}

.comment-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #834DD0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.username {
  font-weight: bold;
  font-size: 16px;
  color: #834DD0;
}

.timestamp {
  font-size: 14px;
  color: #666;
  margin-left: auto;
}

.timestamp-auto {
  font-size: 14px;
  color: #666;
  margin-left: auto;
}

.timestamp-right {
  font-size: 14px;
  color: #999;
  margin-left: auto;
}

.comment-text-box {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  max-width: 691px;
  min-height: 58px;
  gap: 10px;
  opacity: 1;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  padding: 8px 6px;
  background-color: #F3EDFA;
  margin-left: 50px;
  word-wrap: break-word;
}

.comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  // margin-left: 50px;
  margin-top: 8px;
}

.comment-actions-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 40px;
  margin-top: 8px;
}

.left-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.right-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.reply-icon {
  color: #834DD0;
  font-size: 20px;
  cursor: pointer;
}

.action-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;

  mat-icon {
    font-size: 20px;
  }

  &.edit-btn mat-icon {
    color: #834DD0;
  }

  &.delete-btn mat-icon {
    color: #E53935;
  }
}

.mark-resolved {
  color: #00A67E;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

// Child Comments Section
.child-comments-container {
  margin-left: 26px;
}

.child-comment {
  margin-bottom: 10px;
  background-color: #FFFFFF;
  border-radius: 4px;
}

.child-comment-text {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  margin-left: 36px;
  background-color: #F3EDFA;
  max-width: 691px;
  min-height: 58px;
  gap: 10px;
  opacity: 1;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  padding: 8px 6px;
  word-wrap: break-word;
}

// Reply To Section (simplified)
.reply-to-section {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-left: 3px solid #834DD0;
  border-radius: 4px;
  flex-shrink: 0;
}

.reply-to-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.reply-to-label {
  font-size: 14px;
  color: #666;
}

.reply-to-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-to-text {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

// Mark Resolved Checkbox
.MarkResolved {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  flex-shrink: 0;
}

// Footer Section
.CommentFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  flex-shrink: 0;
}

// Main Footer with Add Button - ALWAYS at bottom
.CommentFooterFooter {
  height: 80px;
  opacity: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: auto;
}

.add-button-wrapper {
  width: 64px;
  height: 64px;
  opacity: 1;
  background-color: #834DD0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.addbutton {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;

  mat-icon {
    font-size: 40px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

// Icon buttons
.IconBar {
  display: flex;
  align-items: center;
  width: 164px;
  height: 32px;
  opacity: 1;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}

.Infoicon {
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photocamera,
.camera,
.attachfile,
.mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photocamera {
  background-color: #9A6CE0;
  color: #FFFFFF;
}

.camera {
  background-color: #FF4F7B;
  color: #FFFFFF;
}

.attachfile {
  background-color: #E153BD;
  color: #FFFFFF;
}

.mic {
  background-color: #FFD23F;
  color: #FFFFFF;
}

// Send button
.send-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background-color: #834DD0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

// Comment text display
.commenttext {
  width: auto;
  max-width: 720px;
  min-height: 58px;
  opacity: 1;
  gap: 10px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 8px 6px;
  background-color: #F3EDFA;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: block;
}

// Display Comments Section
.comments-display-section {
  .parent-comment-wrapper {
    margin-bottom: 15px;
  }

  .comment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
  }

  .user-reply-section {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .reply-with-count {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .reply-count {
    color: #834DD0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
  }
}

// Replies thread section
.replies-thread {
  margin-left: 30px;
  margin-top: 10px;
  padding-left: 15px;
  border-left: 3px solid #834DD0;
}

.reply-item {
  margin-bottom: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 5px;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.reply-username {
  color: #834DD0;
  font-weight: bold;
  font-size: 16px;
}

.reply-text {
  color: #333;
  font-size: 14px;
}

// Username styles
.username-display {
  color: #1A1A1ADE;
  font-weight: bold;
  font-size: 16px;
}

.user-avatar-large {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #834DD0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}

// Edit mode styles
.edit-mode {
  margin: 10px 0;

  .edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;

    &:focus {
      outline: none;
      border-color: #6200ea;
    }
  }

  .edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;

    button {
      padding: 8px 16px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.3s;

      &.save-btn {
        background-color: #6200ea;
        color: white;

        &:hover {
          background-color: #5300d1;
        }
      }

      &.cancel-btn {
        background-color: #f5f5f5;
        color: #333;

        &:hover {
          background-color: #e0e0e0;
        }
      }
    }
  }
}

// ── Resolved badge ─────────────────────────────────────────────────────────
.resolved-badge {
  display: inline-flex;
  align-items: center;
  color: #00A67E;

  mat-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }
}

// ── Reactions bar ──────────────────────────────────────────────────────────
.reactions-bar {
  display: flex;
  gap: 6px;
  // margin-left: 50px;
  margin-top: 4px;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #F3EDFA;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 2px 8px;
  cursor: pointer;
  color: #6B6B6B;
  font-size: 12px;

  mat-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }

  &.active {
    border-color: #834DD0;
    color: #834DD0;
    background: #E9DBFA;
  }

  &:hover {
    background: #E9DBFA;
  }
}

// ── @mention picker ────────────────────────────────────────────────────────
.compose-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.mention-picker {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0px 2px 6px #00000020;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;

  &:hover {
    background: #F3EDFA;
  }
}

.mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #834DD0;
  color: white;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mention-name {
  font-size: 13px;
  color: #333;
}

.mention-empty {
  padding: 8px 10px;
  color: #999;
  font-size: 12px;
}

.mention-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F3EDFA;
  color: #834DD0;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;

  mat-icon {
    font-size: 14px;
    width: 14px;
    height: 14px;
    cursor: pointer;
  }
}

// ── Attachment panel (features/gbattachment embed) ─────────────────────────
.attachment-panel {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
  flex-shrink: 0;
}

.attachfile.active {
  outline: 2px solid #834DD0;
  outline-offset: 1px;
}

// ── Nested replies (recursive tree) ─────────────────────────────────────────
.nested-replies {
  margin-left: 24px;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid #E9DBFA;
}

