.comment-section {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--cmBorderColor);
    /* overflow: hidden; */
    margin: 1rem auto;
}

.comment-section *:not(i) {
    font-family: Sarabun, sans-serif !important;
}

.comment-section>.list-comment-section>.comment-main>.cm-profile,
.comment-section>.my-comment-section>.cm-profile {
    flex: 0 0 50px !important;
    width: 50px !important;
    height: 50px !important;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--cmProfileBorderColor);
    margin: 0 !important;
}

.comment-section>.list-comment-section>.comment-main:first-child {
    border-radius: 10px 10px 0 0;
}

.comment-section>.list-comment-section>.comment-main:last-child {
    border-radius: 0 0 10px 10px;
}

.comment-section .list-comment-section .cm-profile {
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 30px !important;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--cmProfileBorderColor);
    margin: 0 !important;
}


.comment-section>.my-comment-section,
.comment-section .comment-main {
    display: flex;
    width: 100%;
    padding: 1.25rem 1.25rem 0 1.25rem;
    column-gap: 1rem;
    position: relative;
}

.comment-section>.list-comment-section>.comment-main:has(.comment-main)>.cm-line,
.comment-section>.list-comment-section>.comment-main:has(.my-reply-section)>.cm-line {

    position: absolute;
    height: calc(100% - 1.25rem - 50px);
    left: calc(1.25rem + 25px);
    top: calc(1.25rem + 50px);
    border-left: 2px solid var(--cmBorderColor);
}


.list-comment-section>.comment-main .comment-main:has(.comment-main)>.cm-line,
.list-comment-section>.comment-main .comment-main:has(.my-reply-section)>.cm-line {
    position: absolute;
    height: calc(100% - 30px - 1.25rem);
    left: calc(1.25rem + 15px - 20px);
    top: calc(1.25rem + 30px);
    border-left: 2px solid var(--cmBorderColor);
}

.comment-section>.list-comment-section>.comment-main:not(:has(.comment-main))>.cm-line {
    position: absolute;
}

.list-comment-section>.comment-main .comment-main:not(:has(.comment-main))>.cm-line {
    position: absolute;
}

.comment-section>.my-comment-section,
.comment-section>.list-comment-section>.comment-main {
    padding-bottom: 1.25rem;
}


.comment-section .comment-main .button-group {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    color: var(--cmSecondaryColor);
    column-gap: 16px;
}

.comment-section .comment-main .cm-button-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--cmSecondaryColor);
    column-gap: 16px;
}


.comment-section .comment-main .cm-button-group .cm-first>span {
    color: var(--cmSecondaryColor);
}

.list-comment-section .my-reply-section {
    position: relative;
    display: flex;
    width: 100%;
    column-gap: 1rem;
    margin-top: 1.25rem;
}


.comment-section .comment-main:hover {
    background-color: #fff;
}

.list-comment-section .my-reply-section {
    margin-left: -20px;
    width: calc(100% + 20px);
    padding: 1.2rem 0;
}

.comment-section>.list-comment-section>.comment-main>.cm-content>.my-reply-section {
    margin-left: -30px;
    width: calc(100% + 30px);
}

.comment-section>.my-comment-section .button,
.list-comment-section .my-reply-section .button,
.list-comment-section .my-edit-section .button,
.cm-mobile-section .my-reply-section .button,
.cm-mobile-section .my-edit-section .button {
    cursor: pointer;
    background-color: var(--cmPrimaryColor);
    color: #fff;
    padding: 0.5rem 1rem;
    outline: 0;
    border: 0;
    border-radius: 10px;
    transition: background-color 0.5s;
}

.list-comment-section .my-reply-section .button-no-bg,
.list-comment-section .my-edit-section .button-no-bg,
.cm-mobile-section .my-reply-section .button-no-bg,
.cm-mobile-section .my-edit-section .button-no-bg {
    cursor: pointer;
    background-color: transparent;
    color: var(--cmSecondaryColor);
    padding: 0.5rem 1rem;
    outline: 0;
    border: 0;
    border-radius: 10px;
    transition: color 0.5s;
}

.list-comment-section .my-reply-section .button-no-bg:hover,
.list-comment-section .my-edit-section .button-no-bg:hover,
.cm-mobile-section .my-reply-section .button-no-bg:hover,
.cm-mobile-section .my-edit-section .button-no-bg:hover {
    color: var(--cmPrimaryColor);
    font-weight: bold;
}

.comment-section>.my-comment-section .button:disabled,
.list-comment-section .my-reply-section .button:disabled,
.list-comment-section .my-edit-section .button:disabled,
.cm-mobile-section .my-reply-section .button:disabled,
.cm-mobile-section .my-edit-section .button:disabled {
    background-color: var(--cmPrimaryDisabledColor);
}

.comment-section>.my-comment-section>div,
.comment-section .comment-main>div,
.list-comment-section .my-reply-section>div,
.list-comment-section .my-edit-section,
.cm-mobile-section .my-reply-section>div,
.cm-mobile-section .my-edit-section {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    width: 100%;
}

.list-comment-section .my-reply-section .button-group,
.list-comment-section .my-edit-section .button-group,
.cm-mobile-section .my-reply-section .button-group,
.cm-mobile-section .my-edit-section .button-group {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    column-gap: 1rem;
}



.comment-section .comment-main .cm-button-group span:hover {
    cursor: pointer;
}

.comment-section>.my-comment-section textarea,
.list-comment-section .my-reply-section textarea {
    width: 100%;
    display: block;
    border: 1px solid var(--cmBorderColor);
    border-radius: 10px;
    padding: 0.5rem;
}

/* 
.comment-section>.my-comment-section textarea:focus {
    outline: 2px solid var(--cmProfileBorderColor);
} */


.comment-section .no-comment {
    text-align: center;
    padding: 1.25rem;
    color: var(--cmPrimaryColor);
}


.comment-section>section:not(:last-child) {
    border-bottom: 1px solid var(--cmBorderColor);
}

.cm-time {
    color: var(--cmSecondaryColor) !important;
    font-size: 14px !important;
}

.cm-edited {
    color: var(--cmSecondaryColor) !important;
}

.cm-time-wrapper {
    color: var(--cmSecondaryColor) !important;
}

.cm-replies {
    color: var(--cmPrimaryColor) !important;
    font-size: 14px !important;
    cursor: pointer;
}

.cm-replies:hover {
    color: var(--cmPrimaryColor);
    text-decoration: underline;
}

.cm-hide-replies {
    color: var(--cmSecondaryColor) !important;
    font-size: 14px !important;
    cursor: pointer;
}

.cm-hide-replies:hover {
    color: var(--cmSecondaryColor);
    text-decoration: underline;
}

.cm-display-name {
    font-weight: bold !important;
    font-size: 18px !important;
    white-space: normal !important;
    padding-right: 5px;
}

.cm-header {
    display: flex;
    flex-direction: column;
}

.cm-head-inside {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 16px;
    position: relative;
}

.just-added {
    opacity: 0;
    animation: comment-fadein 1s forwards;
}

.comment-section>.list-comment-section>.comment-main:has(.comment-main)>.cm-content>.comment-main {
    padding-right: 0;
    padding-left: 0;
    margin-left: -30px;
    width: calc(100% + 30px);
}

.comment-main .comment-main {
    padding-right: 0;
    padding-left: 0;
    margin-left: -20px;
    width: calc(100% + 20px);
}

.comment-section [data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    opacity: 0;

    transition: all 0.15s ease;
    padding: 10px;
    color: #fff;
    border-radius: 10px;
    pointer-events: none;
    max-width: 350px;
    min-width: 50px;
    white-space: normal;
    text-align: center;
}

.comment-section [data-tooltip]:hover::before {
    /* needed - do not touch */
    opacity: 1;
    z-index: 1031;

    /* customizable */
    background: var(--cmTooltipBgColor);
    margin-top: -50px;
    margin-left: -20px;
}

.cm-detail {
    word-break: break-all;
}

.cm-detail * {
    font-size: 16px !important;
    padding-bottom: 0;
    margin-bottom: 0;
}

.cm-detail blockquote {
    letter-spacing: .25px;
    font-size: 16px !important;
    padding: 20px;
    position: relative;
    background-color: #f4f4f4;
}

/* .cm-detail blockquote p {
    margin-bottom: 30px !important;
} */

.cm-detail blockquote::before {
    content: "";
    color: var(--cmPrimaryColor);
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: var(--cmPrimaryColor);
    width: 5px;
}

/* .cm-detail blockquote::after {
    letter-spacing: -.3px;
    content: '"';
    font-size: 70px;
    color: var(--cmPrimaryColor);
    position: absolute;
    text-align: left;
    bottom: -30px;
    right: 0;
} */

.cm-see-more {
    background: transparent;
    align-self: center;
    justify-self: center;
    border: 0;
    color: var(--cmPrimaryColor);
    cursor: pointer;
}

.cm-see-more:hover {
    text-decoration: underline;
}

@keyframes comment-fadein {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.cm-mobile-section {
    position: fixed;
    height: 100vh;
    width: 100vw;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.cm-container {
    position: absolute;
    left: 0;
    height: calc(70vh);
    width: calc(100vw);
    padding: 1rem;
    padding-bottom: 70px;
    padding-top: 0;
    background-color: #fff;
    bottom: calc(-100vh);
    transition: bottom 0.5s;
}

.cm-mobile-section.show .cm-container {
    bottom: 0;
}

.cm-mobile-content {
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

.cm-mobile-section .cm-mobile-title {
    font-weight: bold;
    font-size: 20px;
    color: var(--cmPrimaryColor);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 50;
}

.cm-mobile-section .button-group {
    position: sticky;
    bottom: -20px;
    background-color: #fff;
    z-index: 50;
    padding: 1rem 0;
}

.cm-mobile-content {
    padding-bottom: 1rem;
}


.cm-mobile-section.hide {
    display: flex;
    opacity: 0;
    visibility: hidden;
}

.cm-mobile-section.show {
    display: flex;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.cm-mobile-section .my-reply-section>img {
    display: none;
}

.cm-time-wrapper {
    display: flex;
    column-gap: 8px;
}

.cm-dropdown {
    position: absolute;
    right: 0;
    top: 4px;
    color: var(--cmSecondaryColor);
}

.cm-dropdown .dropdown-menu {
    overflow: hidden;
    border-radius: 10px;
    padding: 0;
}

.cm-dropdown-button {
    padding: 4px;
}

.cm-dropdown-button,
.cm-dropdown .dropdown-item {
    cursor: pointer;
}

.cm-dropdown .dropdown-item {
    display: flex;
    column-gap: 16px;
    padding: 0.5rem 1rem !important;
    align-items: center;
}


.cm-dropdown .dropdown-item:hover,
.cm-dropdown .dropdown-item:focus,
.cm-dropdown .dropdown-item:active {
    background-color: var(--cmPrimaryColor);
    color: #fff;
}

.cm-button-group .cm-first {
    display: flex;
    column-gap: 8px;
}

.cm-button-group .cm-first .cm-like {
    display: flex;
    column-gap: 4px;
    align-items: center;
    transition: color 0.5s;
    cursor: pointer;
}

.cm-button-group .cm-first .cm-like.liked {
    color: var(--cmPrimaryColor) !important;
}



.cm-button-group .cm-first .cm-like::after {
    content: attr(data-like);
}

.comment-main.hide {
    display: none;
}

.cm-h-line {
    position: absolute;
    top: 1.25rem;
    left: -11px;
    height: 15px;
    width: 11px;
    border-left: 2px solid var(--cmBorderColor);
    border-bottom: 2px solid var(--cmBorderColor);
    border-radius: 0 0 0 7px;
}

/* .my-reply-section > .cm-h-line {
    top: 0;
    left: -20px
} */

.cm-hide-line {
    position: absolute;
}

.comment-main .comment-main:last-child>.cm-hide-line,
.comment-main .my-reply-section:last-child>.cm-hide-line {
    position: absolute;
    height: calc(100% - 2px);
    width: 4px;
    top: calc(1.25rem + 2px);
    left: -12px;
    background-color: #f8fafc;
}

.comment-section .comment-main:hover .cm-hide-line,
.comment-section .my-reply-section .cm-hide-line {
    border-color: #fff;
    background-color: #fff;
}

@media (max-width: 575px) {

    .comment-section>.list-comment-section>.comment-main>.cm-profile,
    .comment-section>.my-comment-section>.cm-profile {
        flex: 0 0 30px !important;
        width: 30px !important;
        height: 30px !important;
    }

    .comment-section .cm-profile {
        flex: 0 0 30px !important;
        width: 30px !important;
        height: 30px !important;
    }


    .cm-head-inside {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
    }

    .comment-section>.list-comment-section>.comment-main:has(.comment-main)>.cm-line,
    .comment-section>.list-comment-section>.comment-main:has(.my-reply-section)>.cm-line {
        position: absolute;
        height: calc(100% - 1.25rem - 30px - 5px);
        left: calc(1.25rem + 15px);
        top: calc(1.25rem + 30px);
        border-left: 2px solid var(--cmBorderColor);
    }

    .comment-section>.list-comment-section>.comment-main:has(.comment-main)>.cm-content>.comment-main {
        padding-right: 0;
        padding-left: 0;
        margin-left: -20px;
        width: calc(100% + 20px);
    }

    .comment-section>.list-comment-section>.comment-main>.cm-content>.my-reply-section {
        margin-left: -20px;
        width: calc(100% + 20px);
    }
}

/** sm */
@media (min-width: 576px) {}

/** md */
@media (min-width: 768px) {}

/** lg */
@media (min-width: 992px) {}

/** xl */
@media (min-width: 1200px) {}
