:root {
    --comment-icon-bg: #2e9fff;
    --comment-submit-bg-hover: #1b5fd8;
    --comment-submit-color: #fff;
    --comment-container-blockquote: #555;
    --comment-container-blockquote-color: #dceeff;
    --comment-container-blockquote-border: #2e9fff;
    --highlighted: #dceeff;
    --comment-mini-btn: #6c757d;
    --comment-mini-btn-hover: #e9ecef;
    --comment-editor-border: #2e9fff;
}

/* Основные стили для системы комментариев */
.comment {
    margin-bottom: 16px;
    position: relative;
}

.comment-hidden {
    display: none !important;
}

.comment.parent-comment {
    margin-bottom: 20px;
}

.comment-body {
    padding: 5px;
    position: relative;
    margin-left: 58px; /* Отступ для аватарки */
    min-height: 60px;
}

/*.comment.parent-comment > .comment-body {
    margin-left: 0;
}*/

/* Аватарка */
.comment-avatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    z-index: 2;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 9px;
    object-fit: cover;
    border: 2px solid var(--comment-submit-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Заголовок комментария */
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-user {
    font-weight: 700;
    color: var(--comment-icon-bg);
    font-size: 12px;
}

.comment-time {
    color: var(--comment-mini-btn);
    font-size: 12px;
}

/* Текст комментария */
.comment-text {
    color: #333;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comment-text blockquote {
    background: var(--comment-mini-btn-hover);
    border-left: 4px solid #cdcdcd;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-style: italic;
    color: #495057;
}

/* Действия с комментарием */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.action-btn {
    background: none;
    border: none;
    color: var(--comment-mini-btn);
    cursor: pointer;
    padding: 4px 4px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: var(--comment-mini-btn-hover);
    color: #495057;
}

/* Дочерние комментарии */
/*.comment-children {
    margin-left: 30px;
    padding-left: 28px;
    position: relative;
}*/
/* Ограничиваем максимальную вложенность */
.comment-children {
    margin-left: clamp(10px, 4vw, 32px); /* Отступ адаптируется под экран */
    padding-left: 12px;
}
/*.comment-children::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent 0%, #e9ecef 10%, #e9ecef 90%, transparent 100%);
}*/

/* Пользовательские элементы */
.user-actions {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--comment-mini-btn);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
}

.user-menu-btn:hover {
    background: var(--comment-mini-btn-hover);
}

.user-menu {
    background: white;
    border: 1px solid var(--comment-editor-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px;
    right: 0;
}

.user-action {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s ease;
}

.user-action:hover {
    background: #f8f9fa;
}

/* Админские элементы */
.admin-actions {
    position: relative;
}

.admin-menu-btn {
    background: none;
    border: none;
    color: var(--comment-mini-btn);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
}

.admin-menu-btn:hover {
    background: var(--comment-mini-btn-hover);
}

.admin-menu {
    background: white;
    border: 1px solid var(--comment-editor-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px;
}

.admin-action {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s ease;
}

.admin-action:hover {
    background: #f8f9fa;
}

/* Кнопка сворачивания */
.collapse-btn {
    background: none;
    border: none;
    color: var(--comment-mini-btn);
    cursor: pointer;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    margin-left: auto;
    font-weight: bold;
}

.collapse-btn:hover {
    background: var(--comment-mini-btn-hover);
}

/* Статусы модерации */
.comment.moderation>.comment-body>.comment-text {
    color: #d3d3d3;
}
/*.comment.moderation .comment-body {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.comment.rejected .comment-body {
    background: #f8d7da;
    border-color: #f5c6cb;
}*/

/* Плавные анимации */
.comment {
    transition: all 0.3s ease;
}

.vendor-comments-ctr {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--comment-icon-bg);
}


.comment.collapsed .comment-text,
.comment.collapsed .comment-actions {
    display: none !important;
}

.comment.collapsed .collapse-btn {
    transform: rotate(180deg);
}

/* Улучшенная читаемость для длинных веток */
.comment-children .comment-children {
    margin-left: 25px;
}

.comment-children .comment-children .comment-children {
    margin-left: 20px;
}

/* Градиент для визуального разделения глубоких веток */
.comment-children .comment-children .comment-children::before {
    background: linear-gradient(to bottom, transparent 0%, #dee2e6 10%, #dee2e6 90%, transparent 100%);
}

/* иконки в тексте */
.quote-wrapper {
    position: relative;
    display: inline-block;
}

#quote-btn {
    font-size: 25px !important;
    background-color: #fdfdfd00;
    border: none;
}

.quote-badge {
    position: absolute;
    right: 100%; /* полностью слева от родителя */
    margin-right: 8px; /* отступ между меткой и текстом */
    top: 1.2em;

    background-color: #f5f5f5;
    color: #000000;
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.quote-badge:hover {
    background-color: var(--highlighted);
}


.quote-popup-list {
    max-height: 300px;
    overflow-y: auto;
}

.quote-popup-item:hover {
    background-color: var(--comment-container-blockquote-color);
}

.popup-window-close-icon {
    right: 0px;
    top: 0px;
}

/* контейнер формы */
.editor-container {
    max-width: 700px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* панель инструментов */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--comment-editor-border);
    padding-bottom: 6px;
}

.toolbar button {
    background: var(--comment-submit-color);
    border: 1px solid var(--comment-editor-border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    color: #444;
    transition: background 0.2s, color 0.2s;
}

.toolbar button:hover {
    background: #f0f0f0;
    color: #000;
}

/* поле редактора */
.editor {
    min-height: 90px;
    padding: 8px;
    border: 1px solid var(--comment-editor-border);
    border-radius: 4px;
    background: var(--comment-submit-color);
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.editor:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
}

/* нижняя панель формы */
.form-footer {
    display: flex;
    align-items: center;
    margin-top: 10px;
    justify-content: flex-end;
    gap: 10px;
}

.form-footer button {
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

/* кнопка HTML */
.html-toggle {
    background: transparent;
    color: #666;
}

.html-toggle:hover {
    color: #000;
}

/* кнопка отправки */
.form-footer button[type="submit"] {
    background: var(--comment-icon-bg);
    color: var(--comment-submit-color);
    font-weight: bold;
}

.form-footer button[type="submit"]:hover {
    background: var(--comment-submit-bg-hover);
}

/* превью HTML */
.html-preview {
    margin-top: 10px;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    background: #f8f8f8;
    border: 1px solid var(--comment-editor-border);
    border-radius: 4px;
    padding: 8px;
    color: #444;
}


/*
.highlighted {
    background: var(--highlighted) !important;
    transition: background 0.5s ease;
}
*/
.highlighted {
    background: var(--highlighted) !important;
    transition: background 0.5s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
    box-shadow: 0 0 6px 0 #1a6cb9;
    transform: translateY(-2px) scale(1.02);
}

.editor .reply-name {
    font-weight: bold;
}

.vendor-comments-container blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--comment-container-blockquote-border);
    background: var(--comment-container-blockquote-color);
    color: var(--comment-container-blockquote);
    font-style: italic;
    border-radius: 4px;
}

.comments-more-wrap {
    width: 100%;
    text-align: center;
    margin: 20px 0px;
}

.comments-more-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--comment-icon-bg);
    border: 1px solid var(--comment-icon-bg);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.comments-more-btn:hover {
    background: linear-gradient(90deg, var(--comment-icon-bg), var(--comment-submit-bg-hover));
    color: var(--comment-submit-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.comments-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.vendor-comments-form {
    margin: 20px 0px 20px 0px;
}

.highlighted_avatar {
    border: solid 3px var(--comment-submit-bg-hover) !important;
}

.highlight-parent {
    font-size: 15px;
    padding: 0px 4px 4px 4px;
    color: var(--comment-icon-bg);
    font-weight: bold;
}

.input-hidden {
    opacity: 0;
    display: none;
}

.avatar-letter {
    background: var(--comment-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: var(--comment-submit-color);
    width: 100%;
    height: 100%;
    border-radius: 9px;
    border: 2px solid var(--comment-submit-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

i.fa-solid, i.fa-regular {
    color: var(--comment-icon-bg);
    pointer-events: none;
}

a.highlight-parent:hover i {
    color: var(--comment-submit-bg-hover);
}

.vendor-comments-container hr {
    border-color: var(--comment-editor-border);
    height: 0px;
}

#quotePopup {
    border: solid 1px var(--comment-editor-border);
    border-radius: 6px;
}

#quote-btn i {
    pointer-events: none;
}
.vendor-comments-container i {
    pointer-events: none;
}

.form_warn {
    text-align: center;
    color: var(--comment-icon-bg);
    font-size: 17px;
    font-weight: bold;
}

.comment-text img {
    max-width: 300px;
}
.vendor-comments-form img {
    max-width: 150px;
}

.twa-emoji {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    cursor: pointer;
    margin: 1px;
}

.comment-text .twa-emoji {
    cursor: auto;
}

#emoji-panel {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid var(--comment-editor-border);
    border-radius: 4px;
    padding: 10px;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 9999;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    width: 280px;
}

.form-warning {
    color: red;
    font-weight: bold;
    font-size: 12px;
}

/*#emoji-panel .twa-emoji:hover {
    padding: 2px;
}*/

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .comment-body {
        margin-left: 50px;
        padding: 12px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
    }

    .comment-header {
        gap: 6px;
    }

    .comment-user {
        font-size: 14px;
    }

    .comment-time {
        font-size: 9px;
    }

    .comment-text {
        font-size: 13px;
    }

    .comment-actions {
        gap: 8px;
    }

    .action-btn {
        font-size: 12px;
        padding: 4px 4px;
    }
    .comment-children {
        margin-left: 15px;
        padding-left: 0px;
    }

    .comment-children .comment-children {
        margin-left: 10px;
    }

    .comment-children .comment-children .comment-children {
        margin-left: 5px;
    }
}

@media (max-width: 480px) {
    .comment-body {
        margin-left: 46px;
        padding: 10px;
    }

    .comment-children {
        margin-left: 10px;
        padding-left: 0px;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
    }

    .collapse-btn {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .admin-actions {
        order: 1;
    }


    .comment-children .comment-children {
        margin-left: 5px;
    }

    .comment-children .comment-children .comment-children {
        margin-left: 0px;
    }
}
