/* Общие стили и сброс отступов */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основной стиль для темного фона */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #0f172a; /* Темно-синий фон */
    color: #e2e8f0; /* Светлый текст */
    min-height: 100vh;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
}

/* Стили для тела при открытом меню (блокировка прокрутки) */
body.menu-open {
    overflow: hidden;
}

/* Шапка сайта */
header {
    background-color: #1e293b; /* Темно-серый фон шапки */
    border-bottom: 1px solid #334155; /* Тонкая граница */
    padding: 1rem 1.5rem;
    margin-bottom: 2rem; /* Отступ снизу для нормального потока */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: none;
}

.search-input {
    background-color: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    width: 200px;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.mobile-menu-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

/* Боковая колонка (выезжает справа) */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-left: 1px solid #334155;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar.open {
    transform: translateX(0);
}

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

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
}

.sidebar-close {
    background: #334155;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: #475569;
    color: #e2e8f0;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-link:hover {
    background-color: #334155;
}

.sidebar-link.active {
    background-color: #334155;
    color: #8b5cf6;
}

.sidebar-link i {
    width: 1.25rem;
    text-align: center;
}

/* Оверлей (затемнение) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Основной контент статьи */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem 1.5rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

/* Изображение в карточке статьи */
.article-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.article-title:hover {
    color: #8b5cf6;
}

.article-excerpt {
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.article-stats {
    display: flex;
    gap: 1rem;
}

.article-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Стили для полной статьи */
.article-header {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1e293b, #334155);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
}

.article-title {
    font-size: 2rem; /* Уменьшенный размер заголовка */
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-image-full {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

/* Адаптивные изображения в контенте статьи */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: block;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #cbd5e1;
    max-width: 800px;
    margin: 0 auto;
}

/* Отдельный стиль для контента полной статьи */
.full-article .article-content {
    padding: 0;
}

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

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 2rem 0 1rem 0;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 1.5rem 0 1rem 0;
}

.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

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

.article-content blockquote {
    border-left: 4px solid #8b5cf6;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: #1e293b;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #94a3b8;
}

.article-content code {
    background-color: #1e293b;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: #f8fafc;
}

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

.article-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid #334155;
}

.article-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
}

.stat-item i {
    color: #8b5cf6;
}

.article-actions-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: #334155;
}

/* Комментарии */
.comments-section {
    max-width: 800px;
    margin: 4rem auto 0;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #e2e8f0;
}

.comment-form {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 1rem;
    color: #e2e8f0;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
}

.comment-form textarea::placeholder {
    color: #94a3b8;
}

.comment-form button {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border-left: 3px solid #8b5cf6;
}

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

.comment-author {
    font-weight: 600;
    color: #e2e8f0;
}

.comment-date {
    color: #94a3b8;
    font-size: 0.875rem;
}

.comment-text {
    color: #cbd5e1;
    line-height: 1.6;
}

/* Подвал сайта */
footer {
    background-color: #1e293b;
    border-top: 1px solid #334155;
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #8b5cf6;
}

.footer-copyright {
    color: #94a3b8;
    font-size: 0.875rem;
    text-align: center;
}

/* Адаптивные стили */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        gap: 2rem;
    }
    
    .search-container {
        display: block;
    }
    
    /* На планшетах и десктопе - горизонтальное расположение */
    .article-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .article-stats {
        justify-content: flex-start;
    }
    
    .article-actions-buttons {
        justify-content: flex-end;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
    
    .sidebar {
        position: static;
        width: 280px;
        height: auto;
        transform: translateX(0);
        border-left: none;
        border-right: 1px solid #334155;
        border-radius: 0.75rem;
        margin-right: 2rem;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .overlay {
        display: none;
    }
    
    .main-layout {
        display: flex;
        gap: 2rem;
    }
}