/* Стили для списка статей */
.articles-container {
    margin: 20px 0;
    overflow: visible; /* Разрешаем tooltip выходить за границы контейнера */
}

/* Visibility Utilities */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

@media (max-width: 768px) {
    .mobile-only { display: flex !important; }
    .desktop-only { display: none !important; }
}

/* Page Heading */
.articles-page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cat-border, #e2e8f0);
}

.articles-page-heading h1 {
    margin: 0 !important;
    border-bottom: none !important;
		padding: 0;
}

@media (max-width: 576px) {
    .articles-page-heading {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        justify-content: space-between;
				margin-bottom: 0;
    }
    .articles-page-heading h1 {
        font-size: 1.25rem !important;
    }
}

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

}

i.fas.fa-calendar-alt.date-trigger {
    display: flex;
}

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

.right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-buttons .right-controls {
    margin-left: auto;
}

/* Ensure mobile header controls behave correctly */
.articles-page-heading .right-controls.mobile-only {
    margin-left: auto;
    margin-right: 0;
}

.sidebar-toggle-wrapper {
    display: flex;
    align-items: center;
}

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

.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: #747bf5;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.3);
}

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

/* Базовые стили карточек статей */
/* Базовые стили карточек статей (структура) */
.article-card {
    display: flex;
    flex-direction: column;
    overflow: visible; /* Разрешаем tooltip выходить за границы карточки */
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card.menu-open {
    z-index: 99999 !important; /* Выводим карточку на самый передний план */
}

/* Вид "Список" (Специфичные стили) */
.articles-container:not(.view-grid-2) .article-card,
.articles-grid .article-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 0;
}

.articles-container:not(.view-grid-2) .article-card:hover,
.articles-grid .article-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

div#articles-list>.articles-container.view-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 35px !important;
}

/* Вид "Сетка 2 колонки" (Стабильный Grid) */
.articles-container.view-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    row-gap: 44px !important;
    column-gap: 10px !important;
}

.articles-container.view-grid-2 .article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: none;
    transition: none;
    position: relative;
    overflow: visible; /* Разрешаем выпадающему меню выходить за границы */
    margin-bottom: 0 !important; /* Отступы задаются через grid gap */
}

.articles-container.view-grid-2 .article-card:hover {
    transform: none;
    box-shadow: none;
    border-color: #cbd5e1;
}

/* Заголовок */
.articles-container.view-grid-2 .article-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
}

.article-title.title-in-header {
    margin-top: 0;
    margin-bottom: 5px;
    min-height: auto;
}

.article-title.title-in-header:empty {
    display: none;
}

.articles-container.view-grid-2 .article-title a {
    color: inherit;
    text-decoration: none;
}

.articles-container.view-grid-2 .wiki-label {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #3b82f6;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
}

.articles-container.view-grid-2 .read-status-icon {
    font-size: 0.8rem;
    color: #10b981;
}

/* Мета */
.articles-container.view-grid-2 .article-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #64748b;
}

.articles-container.view-grid-2 .article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Статистика компактно */
.articles-container.view-grid-2 .ds-article-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.articles-container.view-grid-2 .ds-card-stats-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #475569;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.articles-container.view-grid-2 .ds-card-stats-item:hover {
    transform: none;
    background: none;
    color: #3b82f6;
}

.articles-container.view-grid-2 .ds-card-stats-icon {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.articles-container.view-grid-2 .ds-card-stats-item.article-rating-display {
    color: #d97706;
}

/* Категории и теги компактно */
.articles-container.view-grid-2 .article-categories,
.articles-container.view-grid-2 .article-tags {
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.articles-container.view-grid-2 .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.articles-container.view-grid-2 .tag {
    padding: 1px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #475569;
}

/* Компактный футер */
.articles-container.view-grid-2 .article-actions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.articles-container.view-grid-2 .article-read-more-button {
    padding: 6px 14px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.articles-container.view-grid-2 .article-card-bookmark-container {
    display: flex;
    gap: 4px;
    margin-left: 0 !important;
}

.articles-container.view-grid-2 .bookmark-btn,
.articles-container.view-grid-2 .share-btn,
.articles-container.view-grid-2 .article-more-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Скрываем лишнее */
.articles-container.view-grid-2 .article-preview-image,
.articles-container.view-grid-2 .article-content-body,
.articles-container.view-grid-2 .article-bottom-rating,
.articles-container.view-grid-2 .article-toggle-container {
    display: none !important;
}

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

/* Улучшенные стили для грид-видов */
.articles-container.view-grid-2 .article-stats {
    margin-bottom: 5px;
}

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

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

/* Дополнительные стили для тегов в grid-2 */

/* Адаптивность */

@media (max-width: 1080px) {
    .articles-container.view-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-card {
        border-radius: 6px;
        padding: 10px;
    }
    .action-buttons {
        align-items: stretch;
    }
    .view-toggle {
        display: none !important;
    }
    .articles-container.view-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .article-meta {
        gap: 10px;
        margin-bottom: 8px;
    }
    .article-meta span {
        gap: 4px;
        font-size: 13px;
    }
    .author-avatar-mini {
        width: 20px;
        height: 20px;
    }

    /* Скрытие переключателя сайдбара на мобильную версию мы теперь регулируем по желанию */
    .articles-page-heading .sidebar-toggle-wrapper {
        display: none !important; /* Убираем переключатель сайдбара в шапке, оставляем только feed-toggle */
    }

    .action-buttons .right-controls {
        display: none !important;
    }

    /* Обеспечиваем видимость feed-toggle в шапке мобильной версии */
    .articles-page-heading .right-controls.mobile-only {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

.article-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 21px;
		display: flex;
		align-items: center;
		line-height: 1.5rem;
		gap: 5px;
}

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

.article-title a:hover {
    color: #747bf5;
}

.article-meta {
    margin-bottom: 5px;
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    flex-direction: row;
    align-items: center;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta i[data-tooltip] {
    cursor: help;
    transition: transform 0.2s ease;
}

.article-meta i[data-tooltip]:hover {
    transform: scale(1.2);
    color: #747bf5;
}

.article-author a {
    color: #747bf5;
    text-decoration: none;
}

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

/* --- Improved Article Card Stats --- */
.ds-article-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding: 5px 4px; */
    /* background: #fdfdfd; */
    border-radius: 8px;
    margin: 5px 0;
    /* border: 1px solid #edf2f7; */
    flex-wrap: wrap;
    gap: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ds-article-card-stats:hover {
    /* background: #f8fafc;
    border-color: #e2e8f0; */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); */
}

.ds-stats-main, .ds-stats-extras {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.ds-card-stats-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 9px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eaedf0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ds-card-stats-item:hover {
    color: #3b82f6;
    background: #f0f7ff;
    border-color: #d0e1fd;
    transform: translateY(-2.5px);
    box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.12);
}

.ds-card-stats-icon {
    font-size: 0.85rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.ds-card-stats-item:hover .ds-card-stats-icon {
    color: #3b82f6;
    transform: scale(1.15);
}

/* Specific item overrides */
.ds-card-stats-item.article-rating-display {
    background: #fffbef;
    border-color: #fef3c7;
    color: #92400e;
}

.ds-card-stats-item.article-rating-display:hover {
    background: #fff9db;
    border-color: #fde68a;
    color: #b45309;
}

.ds-card-stats-item.likes-count:hover {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ds-card-stats-item.dislikes-count:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.ds-card-stats-item.views-count:hover {
    color: #0891b2;
    background: #ecfeff;
    border-color: #a5f3fc;
}

.ds-card-stats-item.off-comments-count:hover {
    color: #7c3aed;
    background: #f5f3ff;
    border-color: #ddd6fe;
}

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

.article-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 15px;
}

.article-card-bookmark-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto; /* В списке прижимаем вправо */
}

.container {
    padding: 0px;
}

/* Стили для полной статьи */
.full-article {
    background-color: #fff;
    border-radius: 8px;
    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;
		padding-top: 10px;
    border-top: 1px solid #eee;
}

.title-counter {
    margin-top: 5px;
}

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

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

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

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

.article-form textarea {
    width: 100%;
    padding: 8px;
    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: 0;
    /* flex-wrap: wrap; */
    align-items: baseline;
}

.container>.action-buttons {
    flex-wrap: nowrap;
    margin-bottom: 0;
    gap: 8px;
    align-items: center;
}

.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:hover {
    background-color: #e5e7eb;
		color: #000000 !important;
}

/* Новые стили для кнопок в виде иконок */
.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);
		color: #666666;
}

/* Новые стили для выпадающего меню "..." */
.article-more-actions {
    position: relative;
    display: inline-block;
}

.article-more-btn {
    background: none;
    border: none;
    color: #6c757d;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

.article-more-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

.article-more-dropdown {
    position: absolute;
    bottom: 100%;
    left: var(--menu-left, 0);
    right: auto;
    background: #fff;
    min-width: 180px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 1001; /* Повышаем z-index */
    display: none;
    border: 1px solid #eee;
    margin-bottom: 8px;
    animation: fadeInScaleUp 0.15s ease-out;
}

.article-more-dropdown.dropdown-bottom {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: fadeInScaleDown 0.15s ease-out;
}

/* Треугольник для меню "..." */
.article-more-dropdown::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: var(--arrow-x, 11px);
    width: 12px;
    height: 12px;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.article-more-dropdown.dropdown-bottom::after {
    bottom: auto;
    top: -6px;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid #eee;
    border-top: 1px solid #eee;
}

@keyframes fadeInScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInScaleDown {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.article-more-dropdown.show {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: none;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.dropdown-item.edit-link i {
    color: #747bf5;
}

.dropdown-item.delete-link {
    color: #dc3545;
}

.dropdown-item.delete-link i {
    color: #dc3545;
}

.dropdown-item.delete-link:hover {
    background: #fef2f2;
}

/* Группа действий в карточке статьи */
.article-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    overflow: visible; /* Разрешаем tooltip выходить за границы */
}

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

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

.label-text-tags-help{
	padding: 5px;
}

/* Стили для категорий статей */
.categories-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 0;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 0px 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: #747bf5;
    color: white;
    border-color: #747bf5;
}

.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: #747bf5;
    text-decoration: none;
    transition: color 0.2s;
}

.category-tag:hover,
.category-link:hover {
    color: #6366f1;
    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: 0 solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

.comment {
    padding: 12px;
    margin: 5px 0;
    border-radius: 8px;
    background: #fff;
		border: 1px solid #dee2e6;
}
.comment:hover {
		border: 1px solid #747bf5;
}

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

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

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

.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: #747bf5;
}

.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: #747bf5;
    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: #747bf5;
    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-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: #747bf5;
}

.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: 0;
    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: #747bf5;
}

.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 #747bf5;
    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;
}

/* Сворачивание веток комментариев */
.comment-branch-footer {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.toggle-replies-btn {
    background: hwb(0 100% 0%);
    border: none;
    width: 24px;
    height: 24px;
    padding: 0;
    cursor: pointer;
    color: #747bf5;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.toggle-replies-btn:hover {
    background-color: hwb(0 100% 0%);
}

.toggle-replies-btn i {
    line-height: 1;
}

.comment.collapsed > .comment-replies {
    display: none !important;
}

.comment.collapsed {
    padding-bottom: 8px !important;
}

.comment.collapsed .toggle-replies-btn {
    color: #3b82f6;
}

.collapsed-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #10b981; /* Зеленый при развернутом состоянии */
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    border: 1px solid #059669;
}

.comment.collapsed .collapsed-info {
    background: #f1f5f9; /* #f1f5f9 при свернутом состоянии */
    color: #6366f1;
    border-color: #e2e8f0;
    box-shadow: none;
}

.comment.collapsed .collapsed-info:hover {
    background: #e2e8f0;
    transform: none;
    box-shadow: none;
}

.collapsed-info i {
    color: #fff;
    font-size: 12px;
}

.comment.collapsed .collapsed-info i {
    color: #747bf5;
}

.total-collapsed-count {
    font-weight: 700;
}

.branches-collapsed-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.comment.collapsed .branches-collapsed-count {
    color: #28a745;
}



.comment.collapsed .toggle-replies-btn i::before {
    content: "\f0fe"; /* fas fa-plus-square */
}

/* Изменяем иконку при сворачивании */
.comment:not(.collapsed) .toggle-replies-btn i::before {
    content: "\f146"; /* fas fa-minus-square */
}


.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: #747bf5;
}

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

.replies-toggle>button.expanded {
    background: #e2e6ea;
    color: #747bf5;
    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;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
}

.comment-header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1; /* Чтобы занимало доступное место */
}

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

.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,
.comment-link {
    color: #6c757d;
    font-size: 12px;
}

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

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

.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);
    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: #747bf5;
    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;
    color: #333;
}

.article-content-body {
    /* line-height: 1.6; */
    color: #333;
    margin-bottom: 20px;
    /* font-size: 15px; */
}

/* Стили для элементов внутри превью (теперь подхватываются из .article-content) */
/* .article-content-body p {margin-top: 0;margin-bottom: 0; } */
.article-content-body ul, .article-content-body ol { margin-bottom: 10px; padding-left: 20px; }
/* .article-content-body h1, .article-content-body h2, .article-content-body h3 { font-size: 1.1em; margin-top: 15px; margin-bottom: 8px; } */

.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: #747bf5;
    text-decoration: none;
    transition: color 0.2s;
}

.category-tag:hover {
    color: #6366f1;
    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: "\f075";
    font-family: "Font Awesome 5 Free";
    font-weight: 400; /* Regular comment icon */
    font-size: 16px;
}

.comments-count:hover {
    color: #747bf5;
    text-decoration: underline;
}

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

.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 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    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: #747bf5;
    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: 5px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 0 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;
}

.article-read-more-button{
padding: 6px 10px;
border-radius: 6px;
border: 1px solid;
font-size: 14px;
}



.article-stats {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
    align-items: center;
    margin-bottom: 5px;
}

.poll-indicator-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    background-color: rgba(52, 152, 219, 0.1);
    transition: all 0.2s ease;
    margin-left: 10px;
    color: #747bf5;
    cursor: default;
}

.poll-indicator-bottom:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.poll-votes-count {
    /* margin-left: 6px; */
    font-size: 13px;
    font-weight: 600;
}

button.rating-action-btn.btn-like{
	border: 2px solid #d0d0d0;

}
button.rating-action-btn.btn-like:hover{
	border: 2px solid #d0d0d0;
}

button.rating-action-btn.btn-dislike{
	border: 2px solid #d0d0d0;
}

article.full-article>.article-footer{
	border-top: 0px solid #eee;
}

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

.article-card:hover {
    transform: none;

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

	.article-comments {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0px 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: center;
    }

    .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: 4px 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;
    }
		.article-card {
			/* padding: 10px; */
			border-radius: 4px;
			box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
		}
	}

/* Стили для 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: #747bf5 !important;
    color: #fff !important;
    border-radius: 6px;
    border-color: #747bf5;
    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: #747bf5;
    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.ds-card-stats-item.views-count {
    display: flex;
    align-items: center;
    gap: 4px;
}
span.ds-card-stats-item.likes-count,span.ds-card-stats-item.dislikes-count{
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 0;
}
span.ds-card-stats-item.likes-count:hover,
span.ds-card-stats-item.dislikes-count:hover {
    color: #3b82f6;
}
a.ds-card-stats-item.off-comments-count {
    display: flex;
    align-items: center;
		color: #6c757d;
		gap: 4px;
}
a.ds-card-stats-item.off-comments-count:hover {
		color: #3b82f6;
}
.articles-card-list-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    /* font-size: 16px; */
    color: #6c757d;
}
.articles-card-list-toolbar:hover {
    color: #747bf5;
}
i.fas.fa-image{
	color: #6c757d;
}
i.fas.fa-image:hover{
	color: #747bf5;
}
.fa-image:before{
	color: #747bf5;
}
.fa-image:hover:before{
	color: #6366f1;
}

.likes-count-clickable:hover,
.dislikes-count-clickable:hover {
    background-color: rgba(52, 152, 219, 0);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none!important;
}

.ds-card-stats-item.article-rating-display:hover{
	color: #3b82f6;
	cursor: pointer;
}

.article-card{
	margin: 0;
}

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

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

/* Стили для превью изображения статьи */
/* Стили для превью изображения статьи */
.article-preview-image {
    width: calc(100% + 30px);
    margin: -15px -15px 12px -15px;
    height: auto;
    max-height: 450px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.article-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-preview-image:hover img {
    transform: scale(1.02);
}

/* Fallback Header Styles for Article Cards */
.article-card-header-fallback {
    width: calc(100% + 30px);
    margin: -15px -15px 12px -15px;
    height: 180px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.fallback-header-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 5;
    position: relative;
}

.fallback-header-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.site-header-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
}

.fallback-logo {
    max-height: 55px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.fallback-header-link:hover .fallback-logo {
    transform: scale(1.1);
}

.fallback-icon {
    font-size: 3.5rem;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.9);
}

.fallback-site-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    font-family: 'Montserrat', sans-serif;
}

.fallback-article-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 15px rgba(0,0,0,0.6);
    display: block;
    line-height: 1.2;
    max-width: 90%;
    margin: 0 auto;
}

.article-card-header-fallback.has-custom-header {
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.article-card-header-fallback .article-header-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.article-card-header-fallback.has-divider .header-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    z-index: 2;
    line-height: 0;
}

.article-card-header-fallback.has-divider .header-divider svg {
    height: 30px;
    width: 100%;
}

/* Адаптация для разных режимов отображения */

.articles-container.view-grid-2 .article-card {
    display: flex;
    flex-direction: column;
}

/* Стили для индикатора загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sidebar Toggle and Layout */
.right-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.switch .slider:before {
    height: 19px;
    width: 19px;
		left: 0;
    top: 0;
}

.sidebar-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

label.switch {
    margin-bottom: 0;
}

input:checked + .slider {
    background-color: #747bf5;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.articles-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
    margin-top: 0px;
}

.articles-main-content {
    flex: 1;
    min-width: 0;
}

.right-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.sidebar-hidden .right-sidebar {
    display: none !important;
}

.sidebar-hidden .articles-main-content {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .articles-layout {
        gap: 15px;
    }
    .right-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .articles-layout {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .articles-main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }
    
    .right-sidebar {
        width: 100%;
        display: none; /* Usually hidden on mobile unless explicitly toggled (existing mobile logic) */
    }
    
    .sidebar-toggle-wrapper {
        display: none; /* Hide toggle on mobile as sidebar is already handled differently */
    }
    
    /* Переключаем grid на одну колонку на мобильных */
    .articles-container.view-grid-2 {
        grid-template-columns: 1fr !important;
    }
    
    .article-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
		.article-form {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    padding: 5px;
    margin-bottom: 10px;
}
.full-article {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    padding: 15px;
    margin-bottom: 20px;
}
}

/* Стили для развертывания статей */
.article-card.is-expanded {
    position: relative;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.15) !important;
    margin-bottom: 25px !important;
    /* transition: all 0.3s ease; */
    border: 4px solid #3fb400;
    background-color: #fbfdff;
}

/* Вертикальная полоска сбоку при развертывании */
.article-card.is-expanded::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 6px;
    background: #747bf5;
    border-radius: 4px;
    animation: stripeIn 0.3s ease-out;
    z-index: 10;
}

@keyframes stripeIn {
    from { opacity: 0; transform: scaleY(0); }
    to { opacity: 1; transform: scaleY(1); }
}

.article-full-content {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.7;
    color: #2c3e50;
    font-size: 16px;
    animation: fadeIn 0.4s ease;
}

.article-card.is-expanded .article-full-content {
    display: block;
}

.article-card.is-expanded .article-content-body {
    max-height: none;
    overflow: visible;
}

.article-card.is-expanded .article-preview-image {
    display: none; /* Скрываем превью, если статья развернута - Pikabu style */
}

/* Круглые кнопки + и - */
.article-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: -30px; /* Сильнее заезжаем на текст для эффекта наложения */
    padding-bottom: 0;
    position: relative;
    z-index: 100;
    pointer-events: none; /* Чтобы контейнер не мешал кликам по тексту, если он перекрывает */
}

/* Кнопки должны реагировать на клики */
.expand-article-btn, .collapse-article-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Уменьшили размер до "небольшого" */
    height: 30px;
    background: #fff;
    border: 1px solid #747bf5;
    border-radius: 50% !important;
    color: #747bf5;
    font-size: 14px; /* Чуть меньше шрифт */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.expand-article-btn:hover, .collapse-article-btn:hover {
    background: #747bf5;
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.article-card.is-expanded .expand-article-btn {
    display: none !important;
}

.article-card:not(.is-expanded) .collapse-article-btn {
    display: none !important;
}

/* Стили для тела статьи с сохранением HTML структуры */
.article-card:not(.is-expanded) .article-content-body.can-expand {
    position: relative;
    max-height: 400px; /* Приблизительно 400 символов текста */
    overflow: hidden;
    margin-bottom: 10px;
}

.article-card:not(.is-expanded) .article-content-body.can-expand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Уменьшили высоту градиента, чтобы он не залезал на начало текста */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 95%);
    pointer-events: none;
}

/* Кнопка сворачивания под текстом */
.article-card.is-expanded .article-toggle-container {
    position: relative;
    top: auto;
    float: none;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}


/* Блок рейтинга внизу статьи */
.article-bottom-rating {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
    text-align: center;
}

/* Скрываем только если есть кнопка развертывания и статья НЕ развернута */
.article-card.has-expand-btn:not(.is-expanded) .article-bottom-rating {
    display: none;
}

/* Показываем при раскрытии (с анимацией) */
.article-card.is-expanded .article-bottom-rating {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Для коротких статей блок показывается по умолчанию (display: block у самого класса) */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.article-rating-title {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
    font-weight: 600;
}

.article-rating-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.rating-action-btn {
    width: 38px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rating-action-btn:hover {
    transform: scale(1.1);
    border-color: #bdc3c7;
    color: #ffffff;
}

.rating-action-btn.btn-like.active,
.rating-action-btn.btn-like:active {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.rating-action-btn.btn-dislike.active,
.rating-action-btn.btn-dislike:active {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* Эффект вылетающей цифры (+1/-1) */
.rating-fly-indicator {
    position: absolute;
    font-weight: bold;
    font-size: 18px;
    pointer-events: none;
    z-index: 1000;
    animation: ratingFlyUp 0.8s ease-out forwards;
    white-space: nowrap;
}

.rating-fly-indicator.plus {
    color: #27ae60;
}

.rating-fly-indicator.minus {
    color: #e74c3c;
}

p.ds-markdown-paragraph {
    padding: 0;
    margin: 10px 0;
}

@keyframes ratingFlyUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1);
    }
}

.article-rating-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.current-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.current-rating-badge:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

i.fas.fa-chart-pie{
	color: #6c757d;
}
/*.poll-indicator-stats*/
.poll-indicator-stats {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 14px;
    cursor: default;
}
.poll-indicator-stats:hover {
    color: #495057;
}

.poll-votes-count {
    font-weight: 500;
}


@media (max-width: 768px) {
    .article-card.is-expanded .article-toggle-container {
        top: auto;
        margin-right: 0;
    }
}

.article-card.is-expanded .article-read-more-button,
.article-card.is-expanded .button-secondary {
    display: none; /* Скрываем оригинальную кнопку "Читать далее" при развертывании */
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Мобильная версия */
@media (max-width: 768px) {
    .article-card.is-expanded::before {
        left: -8px;
        width: 4px;
    }

    .article-toggle-container {
        display: flex !important;
    }

    /* Стили для сокращенного контента на мобильных */

    .expand-article-btn {
        animation: mobilePulse 2s infinite;
    }

    .article-card.is-expanded .article-toggle-container {
        position: sticky;
        top: 80px;
        float: right;
        margin-top: 0;
        margin-right: 0;
        z-index: 100;
    }

    .expand-article-btn, .collapse-article-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }
		.article-content-body {
				margin-bottom: 8px;
			}
		/* .article-content-body p{
				margin-top: 0;
				margin-bottom: 0;
		} */
		.rating-action-btn {
				width: 32px;
				height: 32px;
				border-radius: 50%;
				border: 0 solid #e0e0e0;
				background: #fff;
				color: #aaa;
				font-size: 16px;
		}
		.article-actions a {
        min-width: 40px;
        height: inherit;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
		.article-title {
    font-size: 21px;
		display: flex;
		align-items: center;
		/* flex-wrap: wrap; */
}
.article-title a {
    font-size: 1.5rem;
}
}



/* Стили для прочитанных статей */
.article-card.is-read {
    /* opacity: 0.8;
    transition: opacity 0.3s ease; */
}

.article-card.is-read:hover {
    opacity: 0.95;
}

.article-card.is-read .article-title a {
    /* color: #888 !important; */
}

.read-status-icon {
    display: none; /* Скрыто по умолчанию */
    margin-left: auto;
    font-size: 1.1em;
    color: #2ecc71;
    vertical-align: middle;
    opacity: 0.9;
    cursor: pointer;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.read-status-icon::before {
    content: '\f058'; /* fas fa-check-circle */
}

/* Показываем только если есть класс is-read на карточке */
.article-card.is-read .read-status-icon {
    display: inline-block;
}

/* Дополнительная мера: форсированное скрытие если класса нет */
.article-card:not(.is-read) .read-status-icon {
    display: none;
}


.article-card.is-read .article-preview-image img {
    /* filter: grayscale(0.6);
    transition: filter 0.3s ease; */
}

.article-card.is-read:hover .article-preview-image img {
    /* filter: grayscale(0.2); */
}

/* Новые стили для кнопок в черновиках */
.article-draft-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0px solid #edf2f7;
}

.article-draft-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    flex-shrink: 0;
}

.article-draft-actions a i {
    font-size: 16px;
}

/* Редактировать - Slate/Indigo */
.btn-edit-draft {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-edit-draft:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Опубликовать - Emerald */
.btn-publish-draft {
    background-color: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.btn-publish-draft:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

/* Удалить - Rose */
.btn-delete-draft {
    background-color: #fff1f2;
    color: #e11d48;
    border-color: #ffe4e6;
}

.btn-delete-draft:hover {
    background-color: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.2);
}

.article-draft-actions a:active {
    transform: translateY(0);
    filter: brightness(0.9);
}

.longread-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.longread-btn-prev {
    justify-content: flex-start;
}

.longread-btn-next {
    justify-content: flex-end;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.longread-btn-next:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.longread-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    color: #64748b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.longread-btn-next .longread-btn-icon {
    margin-left: 16px;
    color: #3b82f6;
}

.longread-btn-prev .longread-btn-icon {
    margin-right: 16px;
}

.longread-btn:hover .longread-btn-icon {
    transform: scale(1.1);
}

.longread-btn-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.longread-btn-next .longread-btn-content {
    align-items: flex-end;
    text-align: right;
}

.longread-btn-prev .longread-btn-content {
    align-items: flex-start;
    text-align: left;
}

.longread-btn-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 4px;
}

.longread-btn-next .longread-btn-label {
    color: #60a5fa;
}

.longread-btn-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.longread-btn-next .longread-btn-title {
    color: #1e3a8a;
}

/* Сообщение об окончании статьи */
.longread-end-message {
    grid-column: 1 / -1;
    background: #ecfdf5;
    border: 1px dashed #6ee7b7;
    color: #047857;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.longread-end-message i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

/* =========================================================
   ARTICLE LAYOUT WRAPPER (SIDEBAR TOC)
   ========================================================= */
.article-layout-wrapper {
    display: flex;
    gap: 30px;
    align-items: stretch; /* Позволяет детям занимать всю высоту контейнера */
}

.article-right-sidebar {
    width: 250px;
    flex-shrink: 0;
    order: 2; /* Оглавление справа */
    position: relative;
    /* JS будет плавно двигать .sidebar-sticky внутри этого контейнера */
}

/* Применяем скролл и ограничения к внутреннему блоку */
.sidebar-sticky {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    width: 100%;
    will-change: transform;
}

/* Скрываем нативный "чистый" скролл для красоты на десктопе */
.sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}
.sidebar-sticky::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.article-right-sidebar .longread-toc {
    margin-top: 0;
    margin-bottom: 20px;
}

.article-main-column {
    flex-grow: 1;
    min-width: 0;
    width: 100%;
    order: 1;
}

.article-mobile-toc-container {
    display: none;
    margin: 15px 0;
}

/* Компактный режим в мобильном контейнере */
.article-mobile-toc-container .longread-toc {
    margin: 0;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}
.article-mobile-toc-container .longread-toc-header {
    padding: 10px 15px;
    font-size: 1rem;
}
.article-mobile-toc-container .longread-toc-item a {
    padding: 10px 15px;
    gap: 12px;
}
.article-mobile-toc-container .longread-toc-num {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}
.article-mobile-toc-container .longread-toc-text {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
	.article-mobile-toc-container .longread-toc-header {
    padding: 6px 8px;
    font-size: 0.8rem;
	}
	div#articles-list>.articles-container.view-list {
    gap: 20px !important;
}
	.article-meta {
		flex-direction: row;
}
    .article-draft-actions {
        gap: 12px;
    }
    
    .article-draft-actions a {
        width: 44px;
        height: 44px;
    }
    .comment-header {
        align-items: center !important;
    }
    .comment.reply, .comment.reply-1 {
    margin-left: 0;
    border-left: 1px solid #747bf5;
    background: #f8fbff;
    padding-left: 8px;
}
.comment-actions {
    display: flex;
    align-items: center;
}
.articles-container:not(.view-grid-2) .article-card, .articles-grid .article-card {
    padding: 8px;
}


/* Стили для развернутой статьи */
.article-card.is-expanded {
    border: 2px solid #28a745 !important;
    position: relative;
    transition: border-color 0.3s ease, padding-left 0.3s ease;
}

/* --- НОВЫЙ ИНДИКАТОР: ПОЛУКРУГ ПО ЦЕНТРУ (V2-B) --- */

.reading-collapse-semi-circle {
    position: fixed;
    bottom: 55px; /* Высота мобильного меню */
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 50px;
    height: 30px; /* Ровно половина ширины для идеального полукруга */
    background: rgba(40, 167, 69, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50px 50px 0 0; /* Верхние углы скруглены */
    display: flex;
    align-items: flex-end; /* Иконка ближе к верху полукруга */
    justify-content: center;
    color: white;
    z-index: 1001; /* Поверх всего */
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, background 0.2s;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    padding-bottom: 0;
}

.reading-collapse-semi-circle.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.reading-collapse-semi-circle:hover {
    background: rgba(40, 167, 69, 1);
    height: 32px; /* Небольшой эффект при наведении */
}

.reading-collapse-semi-circle i {
    font-size: 16px;
    margin-bottom: 7px; /* Центрируем иконку в полукруге */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.reading-collapse-semi-circle .progress-text {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.reading-collapse-semi-circle:hover .progress-text {
    opacity: 1;
}

/* Скрываем на десктопе, если мешает */
@media screen and (min-width: 1025px) {
    .reading-collapse-semi-circle {
        bottom: 20px; /* Нет мобильного меню на десктопе обычно */
    }
}


/* Rating Fly Indicator Animation */
.rating-fly-indicator {
    position: absolute;
    z-index: 9999;
    font-weight: 800;
    pointer-events: none;
    animation: ratingFlyUp 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 14px;
}

.rating-fly-indicator.plus {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.rating-fly-indicator.minus {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

@keyframes ratingFlyUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.2);
    }
    100% {
        transform: translateY(-50px) scale(1);
        opacity: 0;
    }
}

/* Rating Button Loading State */
.rating-action-btn.is-loading {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
    position: relative;
}

.rating-action-btn.is-loading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: #747bf5;
    animation: ratingPulse 1s infinite ease-in-out;
    border-radius: 2px;
}

@keyframes ratingPulse {
    0%, 100% { transform: scaleX(0.5); opacity: 0.3; }
    50% { transform: scaleX(1); opacity: 1; }
}
}

/* =========================================================
   LONGREAD PAGINATION (MODERN TOC & NAVIGATION)
   ========================================================= */
.longread-toc {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 20px 0 30px;
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.longread-toc-header {
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    /* border-bottom: 1px solid #e2e8f0; */
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.longread-toc-header:hover {
    background: #f1f5f9;
}

.longread-toc-header i.fa-list-ul {
    color: #3b82f6;
    font-size: 1.2rem;
}

.longread-toc-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.longread-toc-main-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.longread-toc-sub-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.1;
}

.longread-toc-header .toggle-arrow {
    margin-left: auto;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    display: none; /* Скрыто на десктопе */
}

.longread-toc.is-open .longread-toc-header .toggle-arrow {
    transform: rotate(180deg);
}

.longread-toc-count {
    display: none;
}

@media (max-width: 1024px) {
    .longread-toc-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        color: #3b82f6;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 700;
        margin-left: 8px;
        border: 1px solid #dbeafe;
    }
    
    .longread-toc-main-title {
        display: none;
    }
    
    .longread-toc-sub-title {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        display: flex;
        align-items: center;
    }
}

.longread-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.longread-toc-item {
    border-bottom: 1px solid #f1f5f9;
}

.longread-toc-item:last-child {
    border-bottom: none;
}

.longread-toc-item a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #475569;
    transition: all 0.2s ease;
    gap: 16px;
}

.longread-toc-item:hover a {
    background: #f8fafc;
    color: #0f172a;
}

.longread-toc-item.active a {
    background: #eff6ff;
    color: #1d4ed8;
    position: relative;
}

.longread-toc-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3b82f6;
}

.longread-toc-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.longread-toc-item.active .longread-toc-num {
    background: #3b82f6;
    color: white;
}

.longread-toc-item:hover .longread-toc-num {
    background: #e2e8f0;
    color: #334155;
}

.longread-toc-text {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* =========================================================
   BOTTOM NAVIGATION PROMPTS
   ========================================================= */
.longread-nav-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 5px 0 15px 0;
}

@media (min-width: 640px) {
    .longread-nav-bottom {
        grid-template-columns: 1fr 1fr;
    }
    
    .longread-nav-bottom .longread-btn-next:only-child {
        grid-column: 2;
    }
}

.longread-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Компактный режим для мобильных */
@media (max-width: 640px) {
    .longread-nav-bottom {
        gap: 8px;
        margin: 5px 0 15px 0;
    }
    
    .longread-btn {
        padding: 8px 12px;
        border-radius: 10px;
    }
    
    .longread-btn-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
    }
    
    .longread-btn-next .longread-btn-icon {
        margin-left: 8px !important;
    }
    
    .longread-btn-prev .longread-btn-icon {
        margin-right: 8px !important;
    }
    
    .longread-btn-label {
        font-size: 0.7rem !important;
    }
    
    .longread-btn-title {
        font-size: 0.8rem !important;
    }
}



@media (max-width: 1024px) {
    .article-layout-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .article-right-sidebar {
        display: none !important; /* На мобильных используем .article-mobile-toc-container */
    }
    
    .article-mobile-toc-container {
        display: block;
    }
    
    /* На мобильных делаем стрелочку видимой */
    .longread-toc-header .toggle-arrow {
        display: inline-block;
    }
    
    /* Скрываем список по умолчанию на мобильных и переводим в режим bottom-sheet */
    .article-mobile-toc-container .longread-toc-list {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100vw;
        background: #ffffff;
        z-index: 10001;
        padding: 55px 0 15px;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.25);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
        display: flex !important; /* Всегда flex для внутренней разметки */
        flex-direction: column;
        pointer-events: none;
        visibility: hidden;
        box-sizing: border-box;
    }
    
    .article-mobile-toc-container .longread-toc.is-open .longread-toc-list {
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
        animation: none; /* Отключаем старую анимацию */
    }

    /* Заголовок для bottom-sheet оглавления */
    .article-mobile-toc-container .longread-toc-list::after {
        content: 'Оглавление лонгрида'; /* Keep it simple or match? The user usually wants consistency */
        position: absolute;
        top: 22px;
        left: 20px;
        font-size: 1rem;
        font-weight: 800;
        color: #0f172a;
    }

    /* Ручка для вытягивания */
    .article-mobile-toc-container .longread-toc-list::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 3px;
    }

    /* Стили элементов внутри списка в режиме bottom-sheet */
    .article-mobile-toc-container .longread-toc-item {
        border-bottom: 1px solid #f1f5f9;
    }
    
    .article-mobile-toc-container .longread-toc-item:last-child {
        border-bottom: none;
    }
}

@keyframes dropDownToc {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}