/* blog-article.css - Стили для статей блога non_agent */

/* Импорт шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Основные переменные */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* Общие стили для статей */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

/* Заголовки */
.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-subheading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Мета-информация */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.article-date, .article-author, .article-read-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-author a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.article-author a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Основной контент */
.article-content {
    margin-bottom: 3rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content code {
    background-color: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9em;
}

.article-content pre {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Таблицы */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
}

.article-content table th {
    background-color: #f8fafc;
    font-weight: 600;
}

.article-content table th, .article-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    text-align: left;
}

.article-content table tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Интерактивные элементы */
.article-interactions {
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
    margin-top: 3rem;
}

.article-rating {
    margin-bottom: 2rem;
}

.rating-heading {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avg-rating {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stars-container {
    display: flex;
    gap: 0.5rem;
}

.star {
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1.5rem;
}

.star:hover, .star.active {
    color: #f59e0b;
}

.rating-count {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Кнопка "Нравится" */
.like-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.like-button {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
}

.like-button:hover {
    background-color: #e5e7eb;
}

.like-button.liked {
    color: #ef4444;
}

.like-button.liked svg path {
    fill: #ef4444;
}

.like-button svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s;
}

.like-button.liked svg {
    transform: scale(1.1);
}

.like-count {
    font-weight: 500;
}

/* Кнопки шаринга */
.share-container {
    margin-bottom: 2rem;
}

.share-heading {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.share-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-facebook {
    background-color: #4267B2;
}

.share-linkedin {
    background-color: #0077B5;
}

.share-telegram {
    background-color: #0088cc;
}

/* Комментарии */
.comments-section {
    margin-top: 3rem;
}

.comments-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comments-count {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 1rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form-heading {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.comment-input-group {
    margin-bottom: 1rem;
}

.comment-input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.comment-name-container {
    display: flex;
    gap: 0.5rem;
}

.comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.random-name-button {
    border: none;
    background: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.random-name-button:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.comment-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-submit:hover {
    background-color: var(--primary-hover);
}

.comment-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.comment-cancel:hover {
    color: var(--text-primary);
}

/* Отдельные комментарии */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
}

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

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-content {
    margin-bottom: 0.75rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-action {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.comment-action:hover {
    color: var(--primary-color);
}

.comment-action svg {
    width: 0.9rem;
    height: 0.9rem;
}

/* Вложенные комментарии */
.comment-replies {
    margin-top: 1rem;
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reply-form {
    margin-top: 1rem;
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-light);
}

/* Оповещения */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

/* Теги */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.article-tag {
    background-color: #f3f4f6;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}

.article-tag:hover {
    background-color: #e5e7eb;
    color: var(--text-primary);
}

/* Карточки для связанных статей */
.related-articles {
    margin-top: 3rem;
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
}

.related-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.related-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.related-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.related-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.related-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

/* Стилизация скроллбара */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .article-container {
        padding: 1.5rem 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-subtitle {
        font-size: 1.35rem;
    }
    
    .like-container, .share-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-name-container {
        flex-direction: column;
    }
    
    .related-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .article-container {
        padding: 1.25rem 0.75rem;
    }
    
    .article-title {
        font-size: 1.75rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stars-container {
        gap: 0.25rem;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    .comment-actions {
        flex-wrap: wrap;
    }
    
    .related-container {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.liked-animation {
    animation: heartbeat 0.5s;
}

/* Кнопки "Читать далее" */
.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    gap: 0.25rem;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--primary-hover);
}

.read-more svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
}

.read-more:hover svg {
    transform: translateX(3px);
}

/* Подсветка синтаксиса кода */
.hljs {
    display: block;
    overflow-x: auto;
    padding: 1em;
    color: #abb2bf;
    background: #282c34;
    border-radius: 0.5rem;
}

.hljs-comment,
.hljs-quote {
    color: #5c6370;
    font-style: italic;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula {
    color: #c678dd;
}

.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
    color: #e06c75;
}

.hljs-literal {
    color: #56b6c2;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
    color: #98c379;
}

.hljs-built_in,
.hljs-class .hljs-title {
    color: #e6c07b;
}

.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
    color: #d19a66;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
    color: #61aeee;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* Затемнение для модальных окон */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Утилиты */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

/* Мерцание при загрузке */
@keyframes skeleton-loading {
    0% {
        background-color: #f3f4f6;
    }
    50% {
        background-color: #e5e7eb;
    }
    100% {
        background-color: #f3f4f6;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
}