/* Стили для аватаров в комментариях */
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #e1e1e1;
}

/* Стили для аватаров в ответах (можно сделать меньше) */
.comment.reply .comment-avatar {
    width: 32px;
    height: 32px;
}

/* Обертка для автора комментария и аватара */
.comment-author {
    display: flex;
    margin-bottom: 5px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

/* Стили для имени автора */
.author-name {
    font-weight: bold;
    color: #2a5885;
    text-decoration: none;
}

.author-name:hover {
    text-decoration: underline;
}

.author-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 10px;
    background-color: #fff3cd; /* мягкий желтый */
    color: #8a6d3b;
    border: 1px solid #ffeeba;
}

/* CSS маски для иконок комментариев */
.comment-icon-thumbs-up {
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M313.4 32.9c26 5.2 42.9 30.5 37.7 56.5l-2.3 11.4c-5.3 26.7-15.1 52.1-28.8 75.2H464c26.5 0 48 21.5 48 48c0 18.5-10.5 34.6-25.9 42.6C497 275.4 504 288.9 504 304c0 23.4-16.8 42.9-38.9 47.1c4.4 7.3 6.9 15.8 6.9 24.9c0 21.3-13.9 39.4-33.1 45.6c.7 3.3 1.1 6.8 1.1 10.4c0 26.5-21.5 48-48 48H294.5c-19 0-37.5-5.6-53.3-16.1l-38.5-25.7C176 420.4 160 390.4 160 358.3V320 272c0-17.7 14.3-32 32-32s32 14.3 32 32v4.4c0 6.3-2.1 12.4-6 17.2L192 320v38.3c0 23.5 14.1 44.7 35.8 53.7l38.5 25.7c11.4 7.6 24.7 11.3 38.2 11.3H392c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h128c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h160c8.8 0 16-7.2 16-16s-7.2-16-16-16H318.3c-14.9 0-29.1-5.9-39.6-16.4l-30.4-30.4c-10.1-10.1-15.8-23.8-15.8-38.1v-35.6c0-17.7 14.3-32 32-32s32 14.3 32 32v35.6c0 1.9.8 3.7 2.2 5.1l30.4 30.4c4.7 4.7 11.1 7.4 17.8 7.4H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H341.2c-14.9 0-29.1-5.9-39.6-16.4l-50.6-50.6c-10.1-10.1-15.8-23.8-15.8-38.1V96c0-17.7 14.3-32 32-32s32 14.3 32 32v38.7c0 1.9.8 3.7 2.2 5.1l50.6 50.6c4.7 4.7 11.1 7.4 17.8 7.4H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H398.4c-14.9 0-29.1-5.9-39.6-16.4l-17.8-17.8c-10.1-10.1-15.8-23.8-15.8-38.1V64c0-17.7 14.3-32 32-32h13.9c11.1 0 20.1 9 20.1 20.1c0 5.9-2.6 11.5-7.1 15.3l-14.5 12.2c-23.3 19.6-25.4 54.4-4.6 76.7L386.9 168.9c10.1 10.1 23.8 15.8 38.1 15.8H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H425c-1.9 0-3.7-.8-5.1-2.2L397.7 128.5c-10.1-10.1-15.8-23.8-15.8-38.1c0-26.5 21.5-48 48-48H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H429.9c-14.9 0-29.1-5.9-39.6-16.4L373.1 26.2c-10.1-10.1-23.8-15.8-38.1-15.8c-17.7 0-32 14.3-32 32v11.4c0 1.9.8 3.7 2.2 5.1l17.2 17.2c10.1 10.1 15.8 23.8 15.8 38.1v19.3c0 17.7-14.3 32-32 32s-32-14.3-32-32V114.3c0-26.5 21.5-48 48-48c1.4 0 2.8.1 4.2.2 2.2.2 4.4.6 6.6 1.2z"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M313.4 32.9c26 5.2 42.9 30.5 37.7 56.5l-2.3 11.4c-5.3 26.7-15.1 52.1-28.8 75.2H464c26.5 0 48 21.5 48 48c0 18.5-10.5 34.6-25.9 42.6C497 275.4 504 288.9 504 304c0 23.4-16.8 42.9-38.9 47.1c4.4 7.3 6.9 15.8 6.9 24.9c0 21.3-13.9 39.4-33.1 45.6c.7 3.3 1.1 6.8 1.1 10.4c0 26.5-21.5 48-48 48H294.5c-19 0-37.5-5.6-53.3-16.1l-38.5-25.7C176 420.4 160 390.4 160 358.3V320 272c0-17.7 14.3-32 32-32s32 14.3 32 32v4.4c0 6.3-2.1 12.4-6 17.2L192 320v38.3c0 23.5 14.1 44.7 35.8 53.7l38.5 25.7c11.4 7.6 24.7 11.3 38.2 11.3H392c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h128c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h160c8.8 0 16-7.2 16-16s-7.2-16-16-16H318.3c-14.9 0-29.1-5.9-39.6-16.4l-30.4-30.4c-10.1-10.1-15.8-23.8-15.8-38.1v-35.6c0-17.7 14.3-32 32-32s32 14.3 32 32v35.6c0 1.9.8 3.7 2.2 5.1l30.4 30.4c4.7 4.7 11.1 7.4 17.8 7.4H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H341.2c-14.9 0-29.1-5.9-39.6-16.4l-50.6-50.6c-10.1-10.1-15.8-23.8-15.8-38.1V96c0-17.7 14.3-32 32-32s32 14.3 32 32v38.7c0 1.9.8 3.7 2.2 5.1l50.6 50.6c4.7 4.7 11.1 7.4 17.8 7.4H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H398.4c-14.9 0-29.1-5.9-39.6-16.4l-17.8-17.8c-10.1-10.1-15.8-23.8-15.8-38.1V64c0-17.7 14.3-32 32-32h13.9c11.1 0 20.1 9 20.1 20.1c0 5.9-2.6 11.5-7.1 15.3l-14.5 12.2c-23.3 19.6-25.4 54.4-4.6 76.7L386.9 168.9c10.1 10.1 23.8 15.8 38.1 15.8H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H425c-1.9 0-3.7-.8-5.1-2.2L397.7 128.5c-10.1-10.1-15.8-23.8-15.8-38.1c0-26.5 21.5-48 48-48H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H429.9c-14.9 0-29.1-5.9-39.6-16.4L373.1 26.2c-10.1-10.1-23.8-15.8-38.1-15.8c-17.7 0-32 14.3-32 32v11.4c0 1.9.8 3.7 2.2 5.1l17.2 17.2c10.1 10.1 15.8 23.8 15.8 38.1v19.3c0 17.7-14.3 32-32 32s-32-14.3-32-32V114.3c0-26.5 21.5-48 48-48c1.4 0 2.8.1 4.2.2 2.2.2 4.4.6 6.6 1.2z"/></svg>') no-repeat center;
}

.comment-icon-thumbs-down {
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M198.6 479.1c-26-5.2-42.9-30.5-37.7-56.5l2.3-11.4c5.3-26.7 15.1-52.1 28.8-75.2H48c-26.5 0-48-21.5-48-48c0-18.5 10.5-34.6 25.9-42.6C15 236.6 8 223.1 8 208c0-23.4 16.8-42.9 38.9-47.1c-4.4-7.3-6.9-15.8-6.9-24.9c0-21.3 13.9-39.4 33.1-45.6c-.7-3.3-1.1-6.8-1.1-10.4c0-26.5 21.5-48 48-48H217.5c19 0 37.5 5.6 53.3 16.1l38.5 25.7C336 91.6 352 121.6 352 153.7V192 240c0 17.7-14.3 32-32 32s-32-14.3-32-32v-4.4c0-6.3 2.1-12.4 6-17.2L320 192v-38.3c0-23.5-14.1-44.7-35.8-53.7l-38.5-25.7c-11.4-7.6-24.7-11.3-38.2-11.3H120c-8.8 0-16 7.2-16 16s7.2 16 16 16h88c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16 7.2-16 16s7.2 16 16 16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H193.7c14.9 0 29.1 5.9 39.6 16.4l30.4 30.4c10.1 10.1 15.8 23.8 15.8 38.1v35.6c0 17.7-14.3 32-32 32s-32-14.3-32-32v-35.6c0-1.9-.8-3.7-2.2-5.1l-30.4-30.4c-4.7-4.7-11.1-7.4-17.8-7.4H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H170.8c14.9 0 29.1 5.9 39.6 16.4l50.6 50.6c10.1 10.1 15.8 23.8 15.8 38.1V416c0 17.7-14.3 32-32 32s-32-14.3-32-32v-38.7c0-1.9-.8-3.7-2.2-5.1l-50.6-50.6c-4.7-4.7-11.1-7.4-17.8-7.4H80c-8.8 0-16 7.2-16 16s7.2 16 16 16H113.6c14.9 0 29.1 5.9 39.6 16.4l17.8 17.8c10.1 10.1 15.8 23.8 15.8 38.1V448c0 17.7-14.3 32-32 32H140.1c-11.1 0-20.1-9-20.1-20.1c0-5.9 2.6-11.5 7.1-15.3l14.5-12.2c23.3-19.6 25.4-54.4 4.6-76.7L125.1 343.1c-10.1-10.1-23.8-15.8-38.1-15.8H48c-8.8 0-16 7.2-16 16s7.2 16 16 16h39c1.9 0 3.7.8 5.1 2.2L114.3 383.5c10.1 10.1 15.8 23.8 15.8 38.1c0 26.5-21.5 48-48 48H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H82.1c14.9 0 29.1 5.9 39.6 16.4L138.9 485.8c10.1 10.1 23.8 15.8 38.1 15.8c17.7 0 32-14.3 32-32v-11.4c0-1.9-.8-3.7-2.2-5.1l-17.2-17.2c-10.1-10.1-15.8-23.8-15.8-38.1v-19.3c0-17.7 14.3-32 32-32s32 14.3 32 32v19.3c0 26.5-21.5 48-48 48c-1.4 0-2.8-.1-4.2-.2-2.2-.2-4.4-.6-6.6-1.2z"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M198.6 479.1c-26-5.2-42.9-30.5-37.7-56.5l2.3-11.4c5.3-26.7 15.1-52.1 28.8-75.2H48c-26.5 0-48-21.5-48-48c0-18.5 10.5-34.6 25.9-42.6C15 236.6 8 223.1 8 208c0-23.4 16.8-42.9 38.9-47.1c-4.4-7.3-6.9-15.8-6.9-24.9c0-21.3 13.9-39.4 33.1-45.6c-.7-3.3-1.1-6.8-1.1-10.4c0-26.5 21.5-48 48-48H217.5c19 0 37.5 5.6 53.3 16.1l38.5 25.7C336 91.6 352 121.6 352 153.7V192 240c0 17.7-14.3 32-32 32s-32-14.3-32-32v-4.4c0-6.3 2.1-12.4 6-17.2L320 192v-38.3c0-23.5-14.1-44.7-35.8-53.7l-38.5-25.7c-11.4-7.6-24.7-11.3-38.2-11.3H120c-8.8 0-16 7.2-16 16s7.2 16 16 16h88c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16 7.2-16 16s7.2 16 16 16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H193.7c14.9 0 29.1 5.9 39.6 16.4l30.4 30.4c10.1 10.1 15.8 23.8 15.8 38.1v35.6c0 17.7-14.3 32-32 32s-32-14.3-32-32v-35.6c0-1.9-.8-3.7-2.2-5.1l-30.4-30.4c-4.7-4.7-11.1-7.4-17.8-7.4H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H170.8c14.9 0 29.1 5.9 39.6 16.4l50.6 50.6c10.1 10.1 15.8 23.8 15.8 38.1V416c0 17.7-14.3 32-32 32s-32-14.3-32-32v-38.7c0-1.9-.8-3.7-2.2-5.1l-50.6-50.6c-4.7-4.7-11.1-7.4-17.8-7.4H80c-8.8 0-16 7.2-16 16s7.2 16 16 16H113.6c14.9 0 29.1 5.9 39.6 16.4l17.8 17.8c10.1 10.1 15.8 23.8 15.8 38.1V448c0 17.7-14.3 32-32 32H140.1c-11.1 0-20.1-9-20.1-20.1c0-5.9 2.6-11.5 7.1-15.3l14.5-12.2c23.3-19.6 25.4-54.4 4.6-76.7L125.1 343.1c-10.1-10.1-23.8-15.8-38.1-15.8H48c-8.8 0-16 7.2-16 16s7.2 16 16 16h39c1.9 0 3.7.8 5.1 2.2L114.3 383.5c10.1 10.1 15.8 23.8 15.8 38.1c0 26.5-21.5 48-48 48H48c-8.8 0-16 7.2-16 16s7.2 16 16 16H82.1c14.9 0 29.1 5.9 39.6 16.4L138.9 485.8c10.1 10.1 23.8 15.8 38.1 15.8c17.7 0 32-14.3 32-32v-11.4c0-1.9-.8-3.7-2.2-5.1l-17.2-17.2c-10.1-10.1-15.8-23.8-15.8-38.1v-19.3c0-17.7 14.3-32 32-32s32 14.3 32 32v19.3c0 26.5-21.5 48-48 48c-1.4 0-2.8-.1-4.2-.2-2.2-.2-4.4-.6-6.6-1.2z"/></svg>') no-repeat center;
}

/* Стили для Font Awesome иконок в комментариях */
.comment-rating .action-btn i,
.comment-actions .action-btn i,
.reply-btn i,
.edit-btn i,
.delete-btn i,
.copy-btn i,
.vote-up i,
.vote-down i {
    /* font-size: 14px;
    transition: all 0.2s ease; */
}

/* Цвета для разных типов действий */
.vote-up i {
    color: #28a745;
}

.vote-up:hover i {
    color: #1e7e34;
    transform: scale(1.1);
}

/* Активное состояние кнопки "Нравится" */
.vote-up.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.vote-up.active i {
    color: white;
    transform: scale(1.1);
}

.vote-up.active:hover {
    background: linear-gradient(135deg, #1e7e34, #1a9e8c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.vote-down i {
    color: #dc3545;
}

.vote-down:hover i {
    color: #c82333;
    transform: scale(1.1);
}

/* Активное состояние кнопки "Не нравится" */
.vote-down.active {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.vote-down.active i {
    color: white;
    transform: scale(1.1);
}

.vote-down.active:hover {
    background: linear-gradient(135deg, #c82333, #d63031);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Курсор для рейтинга */
.comment-rating-value {
    cursor: pointer;
}

/* Стили для гостей - кнопки голосования неактивны */
.comment-rating .action-btn:not(.report-btn) {
    cursor: pointer;
}

.comment-rating .action-btn:not(.report-btn):not(:hover) {
    opacity: 0.7;
}

.comment-rating .action-btn:not(.report-btn):hover {
    opacity: 1;
}

.comment-rating-value:hover {
    background: #f8f9fa;
    color: #3498db;
    text-decoration: underline;
}

/* Стили для индикатора сохранения черновика */
#draft-saved-indicator i {
    color: #2196f3 !important;
    font-size: 16px !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .comment-rating .action-btn i,
    .comment-actions .action-btn i {
        font-size: 12px;
    }
    
    #draft-saved-indicator i {
        font-size: 14px !important;
    }
    
    #rating-modal {
        padding: 10px;
    }
    
    .rating-modal-content {
        width: 95%;
        max-height: calc(90vh - 20px);
    }
}

@media (max-height: 600px) {
    .rating-modal-content {
        max-height: calc(95vh - 20px);
    }
}

/* Дополнительная фиксация центрирования для старых браузеров */
@supports not (display: flex) {
    #rating-modal {
        display: table;
        table-layout: fixed;
    }
    
    .rating-modal-content {
        display: table-cell;
        vertical-align: middle;
        text-align: center;
    }
}

/* Состояния активности для кнопок рейтинга */
.action-btn.voted i {
    transform: scale(1.2);
    font-weight: bold;
}

.vote-up.voted i {
    color: #1e7e34;
}

.vote-down.voted i {
    color: #c82333;
}

/* Улучшенные стили кнопок действий */
.action-btn {
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    /* background: rgba(0, 0, 0, 0.05); */
    transform: translateY(0);
}

.action-btn:active {
    transform: translateY(0);
}

/* Стили для компактного режима */
.compact .action-btn {
    padding: 4px 6px;
}

.compact .action-btn i {
    font-size: 12px;
}

/* Стили для модального окна статистики рейтинга комментариев */
#rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rating-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 10000;
}

.rating-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    margin: 0;
}

/* Принудительное центрирование для всех браузеров */
#rating-modal .rating-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10001 !important;
}

/* Отладочные стили для проверки центрирования */
#rating-modal {
    display: block !important;
}


/* Убираем возможные конфликты */
.rating-modal-content * {
    box-sizing: border-box;
}

.rating-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.rating-modal-header h3 {
    margin: 0;
    color: #333;
}

.rating-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-modal-close:hover {
    color: #333;
}

.rating-modal-body {
    padding: 20px;
}

.rating-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
}

.rating-summary-item.rating-likes {
    background: #d4edda;
    color: #155724;
}

.rating-summary-item.rating-dislikes {
    background: #f8d7da;
    color: #721c24;
}

.rating-summary-item.rating-total {
    background: #e2e3e5;
    color: #495057;
    font-weight: bold;
}

.user-vote-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.user-vote-info small {
    color: #666;
    margin-left: 4px;
}

.votes-list h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.votes-items {
    max-height: 200px;
    overflow-y: auto;
}

.vote-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.vote-item.vote-like {
    background: #d4edda;
    color: #155724;
}

.vote-item.vote-dislike {
    background: #f8d7da;
    color: #721c24;
}

.vote-nickname.current-user {
    font-weight: bold;
    color: #2196f3;
}

.vote-date {
    margin-left: auto;
    color: #666;
    font-size: 11px;
}

/* Медиа-запросы для улучшения центрирования модального окна */
@media (max-width: 768px) {
	.comment-form {
		margin-top: 5px;
		padding: 12px;
		margin-bottom: 5px;
}

	.comment {
    padding: 5px;
    margin: 5px 0;
    border-radius: 4px;
    background: #fff;
}

    .rating-modal-content {
        width: 95%;
        max-width: 95vw;
    }
}

@media (max-height: 600px) {
    .rating-modal-content {
        max-height: 90vh;
    }
}

/* Дополнительная фиксация центрирования для старых браузеров */
@supports not (display: flex) {
    #rating-modal {
        display: table;
        table-layout: fixed;
    }
    
    .rating-modal-content {
        display: table-cell;
        vertical-align: middle;
        text-align: center;
    }
}