/* Combined and refined styles for threaded comments */
#commentSection {
    /* background-color: #ffffff00; */
    /* border-radius: 0.5rem; */
    /* box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.05); */
    /* padding: 1rem; */
    /* margin-top: 1.5rem; */
    /* margin-bottom: 1.5rem; */
}

#commentInput {
    border-color: #e2e8f0;
    transition: border-color 0.2s;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    resize: vertical;
    min-height: 100px;
    box-shadow: 0px 0px 1px 1px rgb(12 140 233 / 48%);
}

#commentInput:focus {
    border-color: #4299e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

#allCommentsSection, #activeThreadSection {
    background-color: #ffffffc9;
    border-radius: 1rem;
    /* box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); */
    /* padding: 1.5rem; */
    margin-top: 0rem;
    margin-bottom: 1.5rem;
    border: none;
}
/* Ensure proper spacing between threads */
#threadList > div:not(:last-child) {
    margin-bottom: 0rem;
}

#threadList .thread-item {
    background-color: transparent;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

#threadList .thread-item:hover {
    transform: translateY(-2px);
}

#threadList .thread-item.active-thread {
}

.thread-item-content {
    display: grid;
    grid-template-columns: 12fr 2fr;
    /* justify-content: space-between; */
}



.thread-item-avatar{
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
    display: flex;
}

.message-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    /* margin-right: 1rem; */
    object-fit: cover;
    display: flex;
}

.thread-item-details, .message-details {
    flex-grow: 1;
}

.thread-item-header{
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* justify-content: space-between; */
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.message-header {
    display: none;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.thread-message-text-time-div{
    display: grid;
    gap: 3px;
    /* flex-direction: row; */
    /* align-content: space-around; */
    /* align-items: center; */
    /* justify-content: space-between; */
}
.thread-item-name, .message-name {
    font-weight: 600;
    color: #1f2937;
}

.thread-item-time, .message-time {
    font-size: 0.875rem;
    display: flex;
    gap: 5px;
    color: #6b7280;
    align-self: center;
    justify-self: flex-end;
}

.thread-item-message, .message-text {
    color: #4b5563;
    word-wrap: break-word;
    word-break: break-word;
}

.thread-item-message{
    align-self: center;
    justify-self: flex-start;
    word-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 30vw; /* Adjust this value as needed */
    display: flex;
    gap: 5px;
}
#activeThreadMessages .message {
    /* background-color: #f3f4f6; */
    border-radius: 9px;
    /* padding: 1rem; */
    margin-bottom: 1rem;
    max-width: 85%;
    /* border: 1px solid #e2e8f0; */
    flex-direction: row;
    gap: 4px;
    /* padding-bottom: 12px; */
    display: flex;
    /* align-items: center; */
    /* justify-content: flex-end; */
}

#activeThreadMessages .message-content.author {
    margin-left: auto;
    background-color: #E4EEF9;
    /* border-color: #4fd1c5; */
    border-radius: 9px;
    justify-content: flex-end;
}

#activeThreadMessages .message.author {
    margin-left: auto;
    /* border-color: #4fd1c5; */
    border-radius: 9px;
    justify-content: flex-end;
}

.message-content {
    display: flex;
    align-items: flex-start;
    /* justify-self: flex-end; */
    /* justify-items: flex-end; */
    /* background-color: #E4EEF9; */
    border-radius: 9px;
    padding: 0.5rem;
    /* padding-top: 0rem; */
    border: 1px solid #E4EEF9;
}

.message-content.author {
    display: flex;
    align-items: flex-start;
    /* justify-self: flex-end; */
    /* justify-items: flex-end; */
    /* background-color: #E4EEF9; */
    border-radius: 9px;
    padding: 0.5rem;
    padding-bottom: 0.2rem;
}

/* Utility classes */
.hidden {
    display: none;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.font-semibold {
    font-weight: 600;
}

.text-lg {
    font-size: 1.125rem;
}

/* Adjust overall spacing */
#commentSection, #allCommentsSection, #activeThreadSection {
    margin-top: 1rem;
    margin-bottom: 1rem;
    /* border: none; */
    margin: 1rem;
}

#activeThreadSection {
    box-shadow: 0px 0px 1px 1px rgb(12 140 233 / 48%);
}



/* Make thread items more compact */
#threadList .thread-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Add scrollable area for thread messages */
#activeThreadMessages {
    max-height: 400px;
    min-height: 300px;
    overflow-y: auto;
    /* padding: 0.5rem; */
    padding-left: 0rem;
    padding-top: 1rem;
    border-top: 2px solid rgb(12 143 233 / 15%);
    border-bottom: 2px solid rgb(12 143 233 / 15%);
    background: white;
    padding: 0rem 0.3rem 0.75rem 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Style for inline reply section */
#replySection {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0rem 0.3rem 0.75rem 0.75rem;
    /* background: white; */
}

#replyInput {
    flex-grow: 1;
    margin-right: 0.5rem;
    padding: 0.5rem;
    border: 1px solid rgb(12 143 233 / 15%);
    border-radius: 18px;
    background: white;
}

#replyBtn {
    padding: 0.5rem 1rem;
    background-color: #0a66c3;
    color: white;
    border-radius: 22px;
    border: 1.5px solid #0a66c3;
    font-weight: 600;
}

/* Reduce spacing between messages */
#activeThreadMessages > div:not(:last-child) {
    /* margin-bottom: 0.5rem; */
}

/* Make messages more compact */
#activeThreadMessages .message {
    /* padding: 0.75rem; */
}

/* Your existing CSS here... */

@media only screen and (max-width: 500px){
    .thread-rating-approval, .thread-item-content{
        display: flex;
        gap: 1rem;
        align-content: space-between;
        flex-wrap: wrap;
        flex-direction: column;
    }

    .thread-item-content{
        display: grid;
        grid-template-columns: 12fr 4fr;
        gap: 0.5rem;
    }

    .thread-item-time{
        /* display: none; */
    }
}

/* Media query for screens smaller than 600px (typically mobile devices) */
@media only screen and (max-width: 600px) {
    #commentSection, #allCommentsSection, #activeThreadSection {
        /* padding: 0.5rem; */
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
        margin: 0rem;
    }

    #commentSection{
        /* margin: 0rem; */
    }

    #commentInput {
        min-height: 50px;
    }

    #threadList .thread-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    #activeThreadMessages {
        max-height: 200px;
    }

    #replySection {
        flex-direction: column;
        font-size: 0.875rem;
        align-items: stretch;
        display: flex;
    }

    #replyInput {
        /* margin-right: 0; */
        /* margin-bottom: 0.5rem; */
        border-radius: 18px;
        margin-right: 0rem;
    }

    .thread-item-avatar, .message-avatar {
        width: 1.5rem;
        height: 1.5rem;
    }

    .thread-item-details, .message-details {
        flex-grow: 1;
    }

    .thread-item-header, .message-header {
        /* flex-direction: column; */
        align-items: flex-start;
    }

    .thread-item-name, .message-name {
        font-size: 0.875rem;
    }

    .thread-item-time, .message-time {
        font-size: 0.65rem;
        /* align-self: center; */
        /* align-content: center; */
        text-align: center;
    }

    .thread-item-message, .message-text {
        font-size: 0.875rem;
        word-wrap: break-word;
        word-break: break-word;
        padding-right: 5px;
    }

    #activeThreadMessages .message {
        /* padding: 0.5rem; */
        margin-bottom: 0.5rem;
    }

    #replyBtn {
        /* padding: 0.5rem; */
        margin: 0.5rem;
        font-size: 0.75rem;
    }
}

#activeThreadSection {
    max-height: 0;
    overflow: hidden;
    /* overflow-x: clip; */
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
    pointer-events: none;
    margin-top: 0rem;
    /* padding-top: 0rem; */
    /* padding: 0rem 0.3rem 0.75rem 0.75rem; */
    /* border-top: 1px solid blue; */
    /* background: white; */
    margin-right: 0.5rem;
    margin-left: 0.5rem;
}

#activeThreadSection.active {
    opacity: 1;
    pointer-events: auto;
}

.sectionTitleBottom{
    width: fit-content;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: #f9fcff;
    border: 1px solid #0A66C3;
    color: #0A66C3;
    font-size: 1rem;
    }

#sharedSummaryContent{
    border-bottom: 0.5px solid #e5e7eb;
    padding: 0.5rem;
    padding-bottom: 2rem;
}
  
  .message.unread {
    background-color: #e6f7ff;
  }

  .unread-indicator {
    background-color: #ff4d4f;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 0.75em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* margin-left: 5px; */
    padding: 0;
  }
  
  .thread-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
  }
  
  .thread-item-name-wrapper {
    display: flex;
    align-items: center;
  }
  
  .thread-item-name {
    margin-right: 5px;
    align-self: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 30vw; /* Adjust this value as needed */
  }

  #activeThreadMessages .message {
    display: flex;
    margin-bottom: 1rem;
    max-width: 85%;
  }
  
  #activeThreadMessages .message.current-user {
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 0.5rem;
  }
  
  #activeThreadMessages .message.other-user {
    justify-content: flex-start;
    margin-right: auto;
  }
  
  .message-content {
    display: flex;
    flex-direction: column;
    border-radius: 9px;
    padding: 0.5rem;
    max-width: 70%;
  }
  
  .current-user .message-content {
    background-color: #E4EEF9;
    margin-left: 0.5rem;
  }
  
  .other-user .message-content {
    background-color: #f0f0f0;
    margin-right: 0.5rem;
  }
  
    .read-status {
        width: 15px;
        height: 15px;
        margin-top: 2px;
        transform: rotate(10deg);
    }

    .read-status.seen {
        width: 15px;
        height: 15px;
    }

  .repeating-div {
    position: relative;
    text-align: left;
    align-items: center;
    margin-bottom: 10px;
    border-radius: 28px;
    padding: 5px 10px;
    box-sizing: border-box;
    border: solid 1px transparent;
    background-image: linear-gradient(white, white), linear-gradient(90deg, rgba(255, 255, 255, 1) 15%, rgba(10, 102, 195, 1));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    z-index: 0;
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
    gap: 10px;
    overflow: hidden;
    transition: background 0.3s ease;
}

.repeating-div::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    z-index: -1;
    background: linear-gradient(150deg, rgb(10 120 195 / 10%), rgb(10 120 195 / 1%));
    border-radius: 29px;
}

.repeating-div:hover {
    background: linear-gradient(109deg, rgba(10, 102, 195, 0.30) 40.85%, rgba(10, 102, 195, 0.10) 104.17%);
}

.stakeholder-approval-span{
    padding: 0.4rem 0.5rem;
    align-content: center;
}

.stakeholder-rating{
    background: #80808054;
    padding: 0.05rem 0.5rem;
    border-radius: 1rem 1rem 1rem 1rem;
    margin-left: -5px;
}

.star-rating {
  display: flex;
  gap: 2px;
}

.thread-rating-approval {
    position: relative;
    border: none;
    padding-top: 1rem;
    margin-top: 1.25rem;
    justify-content: space-between;
    display: flex;
    flex-direction: row-reverse;
}

.thread-rating-approval::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 15%, rgba(10, 102, 195, 1));
    z-index: 1;
}

.thread-time-unread{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding-top: 0.15rem;
}

.thread-info{
    /* align-items: flex-start; */
    /* align-self: flex-start; */
    /* justify-self: flex-start; */
    display: grid;
    /* width: 100%; */
}

.thread-rating-approval-items{
    justify-self: center;
    justify-content: space-between;
    /* gap: 50px; */
}

.stakeholder-approval{
    align-content: space-between;
}

/*#feedbackHeading {
    position: relative;
    border: none;
    padding-top: 1rem;
    padding-bottom: 1rem;
    justify-content: flex-start;
    display: flex;
    flex-direction: row;
}

#feedbackHeading::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(190deg, rgba(255, 255, 255, 1) 15%, rgba(10, 102, 195, 1));
    z-index: 1;
}*/

.sectionHeading {
    /* text-decoration: underline; */
    text-underline-offset: 10px; /* Adjust the value as needed */
    margin-bottom: 0px;
    text-decoration-thickness: 2px; /* Adjust the value as needed */
    text-decoration-color: #0a66c3; /* Adjust the color as needed */
    color: #0a66c3;
    font-size: 1.2rem;
    margin-left: 20px;
    display: contents;
}

#feedbackHeading{
    margin: 1rem;
    padding-top: 1rem;
    /* padding-bottom: 1rem; */
    display: contents;
}

#commentSection{
    margin: 15px 5px;
}