/* Стили для списка статей */
.articles-container {
    margin: 20px 0;
}

/* Переключатель видов отображения */
button {
    font-family: 'Arial', Helvetica, sans-serif !important;
    /* padding: 8px 8px!important; */
    /* font-size: 16px!important; */

}

.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    flex-direction: row;
}

.left-actions {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    color: #495057;
    background: rgba(0, 123, 255, 0.1);
}

.view-btn.active {
    background: #3498db;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.3);
}

.view-btn i {
    font-size: 14px;
}

/* Базовые стили карточек статей */
.article-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Вид "Список" (по умолчанию) */
.articles-container.view-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

.articles-container.view-list .article-card {
    margin-bottom: 0 !important;
    /* width: 100% !important; */
    max-width: 100% !important;
    flex: none !important;
}

/* Стили для тегов в режиме списка */
.articles-container.view.list .article-tags {
    margin-top: 0;
    /*12px;*/
    margin-bottom: 8px;
}

.articles-container.view-list .article-tags .tag,
.articles-container.view-list .article-tags .article-tag-link {
    /* font-size: 14px;
    padding: 4px 10px;
    margin-right: 8px;
    margin-bottom: 4px; */
}

/* Вид "2 колонки" */
.articles-container.view-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.articles-container.view-grid-2 .article-card {
    margin-bottom: 0;
    height: fit-content;
}

/* Вид "3 колонки" */
.articles-container.view-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.articles-container.view-grid-3 .article-card {
    margin-bottom: 0;
    height: fit-content;
}

.articles-container.view-grid-3 .article-title {
    font-size: 21px;
}

.articles-container.view-grid-3 .article-excerpt {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Улучшенные стили для грид-видов */
.articles-container.view-grid-2 .article-title,
.articles-container.view-grid-3 .article-title {
    /* margin-bottom: 12px;
    line-height: 1.3; */
}

.articles-container.view-grid-2 .article-meta,
.articles-container.view-grid-3 .article-meta,
.articles-container.view-list .article-meta {
    /* margin-bottom: 12px;
    font-size: 13px; */
}

.articles-container.view-grid-2 .article-stats,
.articles-container.view-grid-3 .article-stats {
    margin-bottom: 10px;
}

.articles-container.view-grid-3 .article-stats {
    gap: 12px;
}

.articles-container.view-grid-3 .stats-item {
    /* font-size: 13px; */
}

/* Улучшенное отображение категорий и тегов в гриде */
.articles-container.view-grid-2 .article-categories,
.articles-container.view-grid-3 .article-categories {
    margin-bottom: 8px;
}

.articles-container.view-grid-2 .article-tags,
.articles-container.view-grid-3 .article-tags {
    margin-bottom: 8px;
}

.articles-container.view-grid-3 .category-link,
.articles-container.view-grid-3 .tag-link,
.articles-container.view-grid-3 .tag,
.articles-container.view-grid-3 .article-tag-link {
    /* font-size: 12px;
    padding: 3px 8px; */
}

/* Дополнительные стили для тегов в grid-2 */
.articles-container.view-grid-2 .tag,
.articles-container.view-grid-2 .article-tag-link {
    /* font-size: 13px;
    padding: 4px 9px; */
}

/* Компактные действия для грида */
.articles-container.view-grid-3 .article-actions {
    gap: 5px;
    font-size: 13px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .articles-container.view-grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 900px) {
    .articles-container.view-grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .articles-container.view-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
	.article-card {
    border-radius: 6px;
    padding: 15px;
}
    .action-buttons {
        /* flex-direction: column; */
        align-items: stretch;

    }

    .view-toggle {
        justify-content: center;
    }

    .articles-container.view-grid-2,
    .articles-container.view-grid-3 {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

.article-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 21px;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.article-title a:hover {
    color: #3498db;
}

.article-meta {
    margin-bottom: 10px;
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.article-author a {
    color: #3498db;
    text-decoration: none;
}

.article-author a:hover {
    text-decoration: underline;
}

.article-excerpt {
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative; /* Added for positioning bookmark button */
}

.article-card-bookmark-container {
    position: absolute;
    bottom: 0;
    right: 0;
}

/* Стили для полной статьи */
.full-article {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.article-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.article-header h1 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 32px;
}

.article-content {
    line-height: 24px;
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-footer {
    margin-top: 10px;
    border-top: 1px solid #eee;
}

/* Стили для формы создания/редактирования статьи */
.article-form {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.article-form .form-group {
    margin-bottom: 20px;

}

.article-form label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.article-form input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.article-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
}

.article-form small {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
}

.char-counter {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
    margin-bottom: 8px;
    text-align: right;
}

.char-counter #comment-char-count {
    font-weight: bold;
}

.char-counter.title-counter {
    margin-top: 5px;
    text-align: left;
}

.char-counter.over-limit {
    color: #e74c3c;
    font-weight: 600;
}

.char-counter.near-limit {
    color: #f39c12;
    font-weight: 500;
}

/* Кнопки для статей */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    /* flex-wrap: wrap; */
    align-items: baseline;
}

.container>.action-buttons {
    flex-wrap: nowrap;
    margin-bottom: 10px;
    gap: 8px;
}

.container>.action-buttons>a.button-primary {
    padding: 4px 8px;
}

.action-buttons .button-primary,
.action-buttons .button-secondary {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.action-buttons .button-primary {
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
}

.action-buttons .button-primary:hover {
    background-color: #218838;
}

.action-buttons .button-secondary {
    /* background-color: #6c757d;
    color: white; */
}

.action-buttons .button-secondary:hover {
    background-color: #e5e7eb;
}

/* Новые стили для кнопок в виде иконок */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    color: #6c757d;
    margin-right: 5px;
    text-decoration: none;
    /* Добавляем для правильного отображения ссылок */
}

.action-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    /* Убедимся, что SVG иконки не заполнены */
}

.action-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.edit-icon {
    color: #3498db;
}

.edit-icon:hover {
    color: #0056b3;
    background-color: rgba(0, 123, 255, 0.1);
}

.delete-icon {
    color: #dc3545;
}

.delete-icon:hover {
    color: #bd2130;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Группа действий в карточке статьи */
.article-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.article-actions .button-secondary {
    margin-right: 10px;
}

.icon-actions {
    display: flex;
    align-items: center;
}

/* Стили для категорий статей */
.categories-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    flex-direction: row;
    flex-wrap: wrap;
}

.category-checkbox {
    position: relative;
    margin-bottom: 0;
}

.category-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

label.category-label {
    margin-bottom: 0;
}

.category-label {
    display: inline-block;
    padding: 6px 8px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #495057;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-checkbox input[type="checkbox"]:checked+.category-label {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.category-checkbox input[type="checkbox"]:focus+.category-label {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.category-checkbox:hover .category-label {
    background-color: #e9ecef;
}

.category-checkbox input[type="checkbox"]:checked:hover+.category-label {
    background-color: #0069d9;
    border-color: #0062cc;
}

.article-categories {
    margin-top: 10px;
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 14px;
}

.categories-label {
    font-weight: 500;
}

.category-tag,
.category-link {
    display: inline-block;
    margin-right: 5px;
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.category-tag:hover,
.category-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Стили для тегов */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-tags {
    margin: 10px 0;
    color: #6c757d;
    font-size: 14px;
}

.tags-label {
    font-weight: 500;
}

.tag {
    display: inline-block;
    background-color: #6f42c1;
    color: white;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #5a2d91;
    color: white;
}

.article-tag-link {
    display: inline-block;
    background-color: #6f42c1;
    color: white;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.article-tag-link:hover {
    background-color: #5a2d91;
    color: white;
    text-decoration: none;
}

.tag-filter-info {
    background-color: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #4a148c;
}

.tag-filter-info a {
    color: #6a1b9a;
    text-decoration: underline;
}

/* Стили для комментариев */
.article-comments {
    border-top: 1px solid #eee;
}

.comment-form-container {
    margin-bottom: 30px;
}

.comment-form-container h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.comment-actions .button-secondary {
    margin-right: 10px;
}

/* Основные кнопки действий комментариев */
/* .comment-actions .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 8px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    transition: background 0.18s;
    color: #6c757d;
}

.comment-actions .action-btn:last-child {
    margin-right: 0;
}

.comment-actions .action-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.comment-actions .action-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #888;
    stroke-width: 1.8;
    display: block;
    transition: stroke 0.18s;
}

.comment-actions .action-btn:hover svg {
    stroke: #3498db;
}

.comment-actions .action-btn.reply-btn:hover {
    background: #d4edda;
    color: #155724;
}

.comment-actions .action-btn.reply-btn:hover svg { 
    stroke: #28a745; 
}

.comment-actions .action-btn.edit-btn:hover {
    background: #cce5ff;
    color: #004085;
}

.comment-actions .action-btn.edit-btn:hover svg { 
    stroke: #084298; 
}

.comment-actions .action-btn.delete-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

.comment-actions .action-btn.delete-btn:hover svg { 
    stroke: #dc3545; 
}

.comment-actions .action-btn.copy-btn:hover {
    background: #e2e3e5;
    color: #495057;
}

.comment-actions .action-btn.copy-btn:hover svg { 
    stroke: #6c757d; 
} */
/*END*/
.comment-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.comment-rating-value {
    font-weight: bold;
    color: #3498db;
    min-width: 20px;
    text-align: center;
}

.comment-rating button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background-color: #f3f4f6;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.comment-rating button:hover {
    background-color: #e5e7eb;
    transform: scale(1.1);
}

.comment-rating-value {
    font-weight: bold;
    color: #3498db;
    min-width: 20px;
    text-align: center;
}

/* Базовые стили для всех кнопок действий */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* Специфичные стили для кнопок лайков/дизлайков (основные) */
.like-btn:hover,
.like-btn.active {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.dislike-btn:hover,
.dislike-btn.active {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

/* Стили для кнопки ответа */
.reply-btn:hover {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

/* Стили для кнопки редактирования */
.edit-btn:hover {
    border-color: #f59e0b;
    background: #f59e0b;
    color: white;
}

/* Стили для кнопки удаления */
.delete-btn:hover {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

/* Стили для кнопки копирования */
.copy-btn:hover {
    border-color: #6b7280;
    background: #6b7280;
    color: white;
}

/* Стили для кнопки жалобы */
.report-btn {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.report-btn:hover {
    background: #ffeeba;
    border-color: #ffdf7e;
}

/* Специальные стили для кнопок голосования в комментариях */
.action-btn.vote-up,
.action-btn.vote-down {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-btn.vote-up {
    color: #28a745;
}

.action-btn.vote-down {
    color: #dc3545;
}

.action-btn.vote-up:hover {
    background: #d4edda;
    border-color: #28a745;
    transform: translateY(0px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.action-btn.vote-down:hover {
    background: #f8d7da;
    border-color: #dc3545;
    transform: translateY(0px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Анимация изменения рейтинга */
@keyframes rating-change-fly {
    0% {
        opacity: 1;
        transform: translateY(0px) scale(1);
        top: 0px;
        left: 50%;
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
        top: -20px;
        left: 50%;
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
        top: -40px;
        left: 50%;
    }
}

.rating-change {
    transform: translateX(-50%);
}

/* Улучшенные состояния кнопок */
.action-btn.vote-up:disabled,
.action-btn.vote-down:disabled {
    cursor: not-allowed;
    opacity: 0.7 !important;
}

/* Эффект подсветки рейтинга при изменении */
.comment-rating-value {
    transition: all 0.3s ease;
}

.comment-rating-value.rating-updated {
    color: #28a745;
    transform: scale(1.1);
    font-weight: bold;
}

/* Анимация для кликов по кнопкам голосования */
.action-btn.vote-up:active,
.action-btn.vote-down:active {
    transform: translateY(0px) scale(0.95);
    transition: all 0.1s ease;
}

.action-btn.vote-up.active:active {
    transform: translateY(0px) scale(0.95);
}

.action-btn.vote-down.active:active {
    transform: translateY(0px) scale(0.95);
}

/* Анимация появления/исчезновения активного состояния */
@keyframes vote-activation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.action-btn.vote-up.active,
.action-btn.vote-down.active {
    animation: vote-activation 0.3s ease;
}

/* Пульсация для активных кнопок */
@keyframes vote-pulse {
    0% { box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4); }
    50% { box-shadow: 0 6px 16px rgba(40, 167, 69, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4); }
}

@keyframes vote-pulse-down {
    0% { box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 6px 16px rgba(220, 53, 69, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4); }
}

.action-btn.vote-up.active {
    animation: vote-pulse 2s infinite;
}

.action-btn.vote-down.active {
    animation: vote-pulse-down 2s infinite;
}

/* Активные состояния */


.action-btn.vote-up.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #1e7e34;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(0px);
}

.action-btn.vote-down.active {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    border-color: #bd2130;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    transform: translateY(0px);
}

button.action-btn.vote-down.compact.active{
    background-color: #f44336;
    transform: translateY(0px);
}
button.action-btn.vote-up.compact.active {
    background-color: #41b125;
    transform: translateY(0px);
}

.action-btn.vote-up.active:hover {
    /* transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.5);
    background: linear-gradient(135deg, #20c997, #28a745); */
}

.action-btn.vote-down.active:hover {
    /* transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.5); */
    background: linear-gradient(135deg, #fd7e14, #dc3545);
}

/* Компактные версии */
.action-btn.compact {
    width: 28px;
    height: 28px;
    margin: 0 2px;
    border-radius: 6px;
}

.action-btn.vote-up.compact svg,
.action-btn.vote-down.compact svg {
    width: 14px;
    height: 14px;
}

.action-btn.compact svg {
    width: 14px;
    height: 14px;
}

.action-btn.report-btn {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 4px;
    padding: 0;
}

.action-btn.report-btn:hover {
    background: #ffeeba;
}

/* Компактные стили для блока рейтинга и жалобы */
.comment-rating.compact {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
    vertical-align: middle;
}

.comment-rating-value.compact {
    font-size: 15px;
    min-width: 18px;
    padding: 0 2px;
}

.action-btn.compact {
    width: 22px;
    height: 22px;
    font-size: 15px;
    padding: 0;
    margin: 0 1px;
    border-radius: 4px;
}

.action-btn.vote-up.compact {
    color: #3498db;
}

.action-btn.vote-down.compact {
    color: #dc3545;
}

.action-btn.report-btn.compact {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    font-size: 13px;
    margin-left: 2px;
}

.action-btn.compact:hover {
    background: #f2f2f2;
}

.action-btn.report-btn.compact:hover {
    background: #ffeeba;
}

/* Компактный блок рейтинга комментариев */
.comment-rating.compact {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    vertical-align: middle;
    font-size: 13px;
}

/* Кнопки рейтинга - компактные */
.action-btn.vote-up.compact,
.action-btn.vote-down.compact,
.action-btn.report-btn.compact {
    width: 22px;
    height: 22px;
    font-size: 13px;
    padding: 0;
    border-radius: 50%;
    margin: 0 1px;
    border: 1px solid #e5e7eb;
    background: #f8f9fa;
    transition: background 0.2s, color 0.2s;
}

.action-btn.vote-up.compact {
    color: #3498db;
}

.action-btn.vote-down.compact {
    color: #dc3545;
}

.action-btn.report-btn.compact {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.action-btn.vote-up.compact:hover {
    background: #deffe6;
}

.action-btn.vote-down.compact:hover {
    background: #f8d7da;
}

.action-btn.report-btn.compact:hover {
    background: #ffeeba;
}

.comment-rating-value.compact {
    min-width: 18px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    margin: 0 2px;
}

/* Уровни вложенности */
.comment.reply,
.comment.reply-1 {
    margin-left: 20px;
    border-left: 1px solid #3498db;
    background: #f8fbff;
    padding-left: 12px;
}

.comment.reply-2 {
    margin-left: 40px;
    border-left: 1px solid #28a745;
    background: #f6fff8;
    padding-left: 12px;
}

/* Плоский третий уровень: без доп. отступа */
.comment.reply-3 {
    margin-left: 0;
    border-left: 1px солид #ffc107;
    background: #fffdf5;
    padding-left: 12px;
}

/* Контейнер ответов не добавляет смещения — отступ регулируют сами карточки */
.comments-section .comment>.comment-replies {
    margin-left: 0;
    margin-top: 10px;
}

/* Свёртка */
.replies-toggle {
    margin-top: 8px;
}

.replies-toggle>button {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: background 0.2s, color 0.2s;
}

.replies-toggle>button:hover {
    background: #e2e6ea;
    color: #3498db;
}

.replies-toggle>button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.replies-toggle>button.expanded {
    background: #e2e6ea;
    color: #3498db;
    font-weight: 500;
}

/* Подсветка нового */
@keyframes comment-flash {
    0% {
        background: #fffbe6;
    }

    100% {
        background: inherit;
    }
}

.comment.flash-highlight {
    animation: comment-flash 2.5s ease-out;
}

/* Финальные переопределения против старых css */
.comments-section .comment-replies {
    margin-left: 0 !important;
}

.comments-section .comment.reply-3 {
    margin-left: 0 !important;
}

.comments-section .comment.reply-3+.reply-form {
    margin-left: 0 !important;
}

.comment-replies {
    margin-left: 0;
    margin-top: 10px;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
}

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

.comment-date {
    color: #6c757d;
    font-size: 12px;
}

.comment-content {
    margin-bottom: 10px;
}

.comment-content p {
    margin: 5px 0;
}

.comment-actions {
    display: flex;
    gap: 5px;
}

.reply-button,
.edit-button,
.delete-button {
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: none;
    transition: background-color 0.2s, color 0.2s;
}

.reply-button {
    background-color: #e9ecef;
    color: #212529;
}

.reply-button:hover {
    background-color: #dee2e6;
		color: #666666;
}

.edit-button {
    background-color: #cfe2ff;
    color: #084298;
}

.edit-button:hover {
    background-color: #b6d4fe;
    color: #052c65;
}

.delete-button {
    background-color: #f8d7da;
    color: #721c24;
}

.delete-button:hover {
    background-color: #f5c6cb;
    color: #58151c;
}

/* Стиль для кнопки удаления */
.button-danger {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.button-danger:hover {
    background-color: #c82333;
    color: #fff;
}

/* Стили для кнопки избранного */
.bookmark-button {
    background-color: #fff3e0;
    color: #ff6600;
    border: 2px solid #ff6600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bookmark-button:hover {
    background-color: #ffe0b2;
    color: #e65100;
    border-color: #e65100;
    transform: translateY(-1px);
}

.bookmark-button.active {
    background-color: #ff6600;
    color: white;
    border-color: #ff6600;
}

.bookmark-button.active:hover {
    background-color: #e65100;
    border-color: #e65100;
}

/* Стили для отметки о редактировании комментария */
.edited-mark {
    font-size: 11px;
    font-style: italic;
    color: #6c757d;
    margin-left: 5px;
}

/* Стили для страницы редактирования комментария */
.comment-edit-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

.comment-edit-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

.breadcrumbs {
    margin-bottom: 20px;
    color: #6c757d;
    font-size: 14px;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Стили для модерации */
.moderation-container {
    margin-top: 20px;
}

.moderation-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.moderation-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.moderation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
}

.moderation-excerpt {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

.moderation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Улучшенные стили для категорий в карточках статей */
.article-categories {
    margin-top: 0;
    /*10px*/
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 14px;
}

.categories-label {
    font-weight: 500;
}

.category-tag {
    display: inline-block;
    margin-right: 5px;
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.category-tag:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Стили для счетчика комментариев */
.comments-count {
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    gap: 5px;
    transition: color 0.2s;
}

.comments-count:before {
    /* content: "💬"; */
    font-size: 16px;
}

.comments-count:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Стили для информации о фильтре категории */
.category-filter-info {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #1565c0;
}

.category-filter-info a {
    color: #0d47a1;
    text-decoration: underline;
}

.category-filter-info a:hover {
    color: #1565c0;
}

/* Стили для взаимодействия со статьей */
.article-interaction {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
    align-items: baseline;
}

.article-likes {
    display: flex;
    gap: 10px;
}

/* Улучшенные стили для кнопок лайков */
.like-button,
.dislike-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.like-button {
    background-color: #e3f2fd;
    color: #1976d2;
    border-color: #1976d2;
}

.like-button:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
}

.like-button.active {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
}

.dislike-button {
    background-color: #ffebee;
    color: #d32f2f;
    border-color: #d32f2f;
}

.dislike-button:hover {
    background-color: #ffcdd2;
    transform: translateY(-1px);
}

.dislike-button.active {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.like-button:disabled,
.dislike-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Стили для readonly отображения лайков */
.article-likes-readonly {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.likes-display,
.dislikes-display {
    padding: 4px 6px;
    background-color: #e9ecef;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

.login-prompt {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

.login-prompt a {
    color: #3498db;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* Стили для облака популярных тегов */
.popular-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background-color: #6f42c1;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-cloud-item:hover {
    background-color: #5a2d91;
    color: white;
    transform: scale(1.1);
}

.tag-cloud-count {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 10px;
}

/* Стили для ввода тегов */
.tags-help {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.popular-tags-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.tag-suggestion {
    background-color: #717fa3;
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    -ms-border-radius: 6px;
    -o-border-radius: 6px;
}

.tag-suggestion:hover {
    background-color: #308aeb;
}

/* Стили для автодополнения тегов */
.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.tag-suggestion-item:hover {
    background-color: #f8f9fa;
}

.tag-suggestion-item:last-child {
    border-bottom: none;
}

/* Позиционирование для поля ввода тегов */
.form-group {
    position: relative;
}

button#report-article-btn {
    padding: 8px;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
	.article-form {
    padding: 5px;
}

.article-card:hover {
    transform: translateY(0);

}
	.article-footer {
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid #eee;
}

	.article-comments {
    margin-top: 10px;
    padding-top: 0;
    border-top: 1px solid #eee;
}

    .article-actions .button-secondary {
        margin-right: 5px;
    }
    button#report-article-btn {
        padding: 6px;
        width: auto;
    }
    
    /* Скрываем текст в кнопке "Пожаловаться" на мобильных, оставляем только иконку */
    button#report-article-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;  
    }
    
    button#report-article-btn svg {
        margin-right: 0 !important;
    }
    
    /* Скрываем текст "Пожаловаться" */
    button#report-article-btn {
        font-size: 0;
    }
    
    /* Показываем только SVG иконку */
    button#report-article-btn svg {
        font-size: initial;
    }

    .user-articles {
        margin-top: 5px;
    }

    .user-article-meta {
        flex-direction: row;
        gap: 5px;
    }

    .form-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-inline label {
        margin-bottom: 5px;
    }

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

    .categories-selector {
        /* flex-direction: column; */
        align-items: flex-start;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .moderation-actions,
    .article-actions,
    .comment-actions {
        flex-direction: row;
        align-items: flex-start;
    }

    .moderation-actions>*,
    .article-actions>*,
    .comment-actions>* {
        margin-bottom: 5px;
        width: auto;
        box-sizing: border-box;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .error-page h1 {
        font-size: 2em;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .error-actions .button-primary,
    .error-actions .button-secondary {
        width: 200px;
    }

    article.full-article>footer.article-footer>.article-actions>a.button-secondary,
    a.button-secondary {
        width: auto;
        display: flex;
        flex-wrap: wrap;
    }

    .articles-container>article.article-card.draft-card>.article-actions>a.button-primary,
    a.button-secondary,
    a.button-danger {
        width: auto;
    }

    main.main-content>.container>.action-buttons>a.button-primary,
    a.button-secondary {
        width: auto;
    }

    .comment-rating button {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .comment-rating-value {
        font-size: 12px;
    }

    .comment {
        padding: 5px;
        margin: 8px 0;
    }

    .comment-actions .action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-right: 6px;
        /* background: none; */
        border: none;
        border-radius: 4px;
        cursor: pointer;
        width: 16px;
        height: 16px;
        transition: background 0.18s;
    }
}

/* Стили для PopUp, поиска и скролла */
.show-more-btn {
    background: #e3f2fd;
    color: #1565c0;
    border: none;
    border-radius: 6px !important;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    -webkit-border-radius: 6px !important;
    -moz-border-radius: 6px !important;
    -ms-border-radius: 6px !important;
    -o-border-radius: 6px !important;
}

.show-more-btn:hover {
    background: #bbdefb;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px 28px;
    min-width: 340px;
    max-width: 420px;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    position: relative;
    display: flex;
    flex-direction: column;
    top: 65px;
    margin: 0 auto;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
}

.popup-list {
    margin-top: 18px;
    overflow-y: auto;
    max-height: 48vh;
    border-radius: 4px;
    border: 1px solid #e3f2fd;
    padding: 8px;
    background: #f8f9fa;
}

#tags-popup-search,
#categories-popup-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e3f2fd;
    margin-top: 8px;
    font-size: 15px;
    background: #f8f9fa;
}

.popup-list .tag-suggestion {
    display: inline-block;
    margin: 4px 6px 4px 0;
    cursor: pointer;
}

.popup-list .category-checkbox {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .popup-content {
        min-width: 90vw;
        max-width: 98vw;
        padding: 18px 8px 12px 8px;
    }
}

.tag-suggestion.selected {
    background: #3498db !important;
    color: #fff !important;
    border-radius: 6px;
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/**/

.search-form {
    margin-bottom: 20px;
}

.search-form form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.search-form input[type="text"] {
    padding: 8px;
    width: 100%;
}

.search-form select {
    padding: 8px;
}

.search-form button {
    padding: 9px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* Add to ../css/articles.css */

/* For highlighting the article */
.article-card.highlight {
    background-color: #f0f8ff;
    /* Светлый фон для подсветки */
    transition: background-color 1s ease;
}

/* Компактная пагинация */
.page-current {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 10px;
    color: #666;
    font-weight: bold;
}

/* SVG иконки в кнопках действий */
.action-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    display: block;
    transition: stroke 0.18s;
}

.action-btn:hover svg {
    stroke: currentColor;
}

.action-btn.reply-btn:hover svg { 
    stroke: white; 
}

.action-btn.edit-btn:hover svg { 
    stroke: white; 
}

.action-btn.delete-btn:hover svg { 
    stroke: white; 
}

.action-btn.copy-btn:hover svg { 
    stroke: white; 
}

/* Специальные размеры для компактных кнопок */
.action-btn.compact svg {
    width: 14px;
    height: 14px;
}

span.stats-item.views-count {
    display: flex;
    align-items: center;
    gap: 5px;
}
span.stats-item.likes-count,span.stats-item.dislikes-count{
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    margin-left: 0;
}
a.stats-item.off-comments-count {
    display: flex;
    align-items: center;
}
a.stats-item.off-comments-count:hover {
    transform: scale(1.05);
    transition: all 0.2s ease;
}
.articles-card-list-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    color: #6c757d;
}
.likes-count-clickable:hover,
.dislikes-count-clickable:hover {
    background-color: rgba(52, 152, 219, 0);
    transform: scale(1.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none!important;
}

.article-card{
	margin: 0;
}

a.button-primary.open-filter-btn {
    padding: 8px 15px;
}

/* Скрытие панели действий на мобильной версии */
@media (max-width: 768px) {
    .action-buttons {
        display: none;
    }
}
