/*!
  QQ Comment Service v1.1.0
 */

:root {
  --comment-primary-color: #f8bc01;
}

#comment-root {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    font-family: 'Nunito', sans-serif;
}

#comment-root button {
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.comment-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-item .comment-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-item .comment-info .avatar,
.comment-item .comment-info .avatar-text {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid gray;
}

.comment-item .comment-info .avatar-text {
    line-height: 35px;
    text-align: center;
    font-weight: 700;
    background: #eee;
    flex: none;
}

.comment-item .comment-info .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.comment-item .comment-info .title {
    display: flex;
    gap: 12px;
    align-items: center;
}

.comment-item .comment-info .title .name {
    margin: 0;
}

.comment-item .comment-info .title .time {
    font-size: 14px;
    color: gray;
}

.comment-item .comment-des {
    padding-left: 50px;
    margin-bottom: 10px;
    font-size: 15px;
    word-break: break-all;
}

.comment-item .comment-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-left: 50px;
    position: relative;
    transition: opacity .3s ease-in-out;
}

.comment-item .comment-summary .summary-item span {
    font-weight: 500;
    font-size: 15px;
}

.comment-item .comment-summary>div {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
}

.comment-item .comment-summary .summary-item .tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-size: 12px;
    z-index: 10;
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.comment-item .comment-btn-action {
    cursor: pointer;
    position: relative;
    transition: opacity .3s ease-in-out;
}

.summary-item.disabled {
    cursor: default;
}

.comment-item .summary-item.disabled:hover > span {
    color: #656565;
}

.comment-item .summary-item.disabled:hover > svg > path {
    fill: #656565;
}

.comment-item .summary-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.comment-item .summary-item:hover > span {
    color: var(--comment-primary-color);
}

.comment-item .summary-item:hover > svg > path {
    fill: var(--comment-primary-color);
}

.comment-item .comment-btn-action svg>path {
    fill: #656565;
}

.comment-item .comment-btn-action span {
    color: initial;
}

.comment-item .comment-btn-action.active svg>path {
    fill: var(--comment-primary-color);
}

.comment-item .comment-btn-action.active span {
    color: var(--comment-primary-color);
}

.summary-item button {
    border: none;
    background: none;
    display: flex;
    cursor: pointer;
    padding: 6px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown content */
.dropdown-content, .dropdown-sort-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
    top: 12px;
}

.dropdown-sort-content {
    top: 30px;
    right: 0;
}

.dropdown-content button, .dropdown-sort-content button {
    background: none;
    border: none;
    display: flex;
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    gap: 9px;
    align-items: center;
    color: black;
}

.dropdown-content .delete-btn {
    color: #ED3849
}

.dropdown-content button svg {
    width: 22px;
}

.dropdown-content button span {
    font-size: 14px !important;
}

.dropdown-content button:hover, .dropdown-sort-content button:hover {
    background: #F7F7F7 !important;
}

.dropdown-content.show, .dropdown-sort-content.show {
    display: block;
}

.reply-box {
    padding-left: 48px;
}

.comment-replies {
    padding-left: 48px;
    margin: 12px 0px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.comment-replies::before {
    content: "";
    width: 1px;
    height: 100%;
    background-image: linear-gradient(to bottom, transparent, #c8c8c8 10%, #c8c8c8 90%, transparent);
    position: absolute;
    top: -50px;
    left: 20px;
}

.comment-replies .comment-item {
    position: relative;
}

.comment-replies .comment-item::before {
    content: "";
    width: 18px;
    height: 1px;
    background-image: linear-gradient(to right, transparent, #c8c8c8 30%, #c8c8c8 70%, transparent);
    position: absolute;
    top: 20px;
    left: -25px;
}

.comment-des-show-more-btn {
    color: var(--comment-primary-color);
    font-size: 14px;
}

#editor-root .editor-wrap .editor {
    max-height: 200px;
    overflow: auto;
}

.load-more {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--comment-primary-color);
    font-size: 14px;
    justify-content: center;
    padding: 6px 0px 20px;
    font-weight: 600;
}

#toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#toolbar-actions button.cancel-btn {
    color: black;
    font-size: 14px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: black;
    font-size: 14px;
    margin-top: 16px;
}

.comment-header span.count {
    font-weight: 600;
}

.comment-header div.sort {
    position: relative;
}

.comment-header div.sort, .comment-header button.sort-by {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-header button.sort-by {
    color: var(--comment-primary-color);
    gap: 6px;
}

.guest-only {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid #DDDDDD;
    color: #747C88;
    font-size: 14px;
    margin: 16px 0;
    background: #f7f7f7;
}

.guest-only div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #DDDDDD;
    padding: 22px;
    align-items: center
}

.guest-only div a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--comment-primary-color);
    font-weight: 600;
}

.guest-only p.des {
    padding: 22px;
}

.emoji {
    display: inline-block;
}

@media screen and (max-width: 576px) {
    #editor-root .editor-wrap {
        padding: 8px;
    }

    #editor-root .editor-wrap .editor {
        max-height: 160px;
        overflow: auto;
    }

    .toolbar-btn-actions button.btn-format, .toolbar-btn-actions button.line {
        display: none;
    }

    .emoji-picker {
        max-width: 91% !important;
        box-sizing: border-box;
    }

    .reply-box .sticker-picker {
        left: -50px;
    }

    .toolbar button.send {
        padding: 6px 12px !important;
    }

    .comment-item .comment-info .title {
        gap: 0;
        flex-wrap: wrap;
        overflow: hidden;
    }

    .comment-item .comment-info .title .time {
        width: 100%;
    }

    .comment-item .comment-info .title .name {
        text-overflow: ellipsis;
        overflow: hidden
    }

    .dropdown-content.show {
        right: 0;
        top: 25px;
    }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.editor-skeleton {
    display: flex;
    width: 100%;
    border-radius: 16px !important;
    border: 1px solid #DDDDDD !important;
    color: #747C88 !important;
    font-size: 14px;
    margin: 16px 0;
    background: #f7f7f7;
    height: 120px;
}

.skeleton {
  background: #f0f0f0;
  background-image: linear-gradient(to right, #f0f0f0 0%, #ecebeb 20%, #f0f0f0 40%, #f0f0f0 100%);
  background-repeat: no-repeat;
  background-size: 1000px 100%;
  display: inline-block;
  position: relative;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-action {
    width: 40px;
    height: 16px;
    border-radius: 4px;
}

.skeleton-line {
    height: 12px;
    width: 100%;
}

.skeleton-name {
    width: 120px;
}

.skeleton-time {
    width: 80px;
}
