/* Базовые сбросы и шрифты */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* Контейнер */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка и навигация */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}

/* Основное меню */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    height: 100%;
}

.menu-item {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-item>a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    padding: 25px 0;
    position: relative;
    transition: color 0.3s ease;
}

/* Анимированное подчеркивание */
.menu-item>a::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #000;
    transition: width 0.3s ease;
}

.menu-item:hover>a::after {
    width: 100%;
}

.menu-item:hover>a {
    color: #000;
}

/* Мега-меню */
.mega-menu-wrapper {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100vw;
    background-color: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
}

.mega-menu {
    width: 100%;
    padding: 50px 0;
    background-color: #fff;
}

.menu-item:hover .mega-menu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Контент мега-меню */
.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.mega-menu-column h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-links {
    list-style: none;
}

.mega-menu-links li {
    margin-bottom: 12px;
}

.mega-menu-links a {
    text-decoration: none;
    color: #666;
    font-size: 15px;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

.mega-menu-links a:hover {
    color: #000;
}

/* Правая часть меню (кнопки) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
}

.nav-button {
    background-color: #000;
    color: #fff !important;
    padding: 10px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #333;
}

/* Мобильное меню */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Параллакс секции */
.parallax-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateZ(0);
    will-change: transform;
}

.parallax-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

/* Герой-секция с параллаксом */
.hero {
    padding: 180px 0 100px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23f8f9fa" points="0,0 1000,100 1000,1000 0,1000"/></svg>') no-repeat;
    background-size: cover;
    transform: translateZ(-1px) scale(1.5);
    will-change: transform;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.hero p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease 0.2s;
}

.cta-button {
    display: inline-block;
    background-color: #000;
    color: #fff;
    padding: 15px 35px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease 0.4s;
}

.hero.visible h1,
.hero.visible p,
.hero.visible .cta-button {
    opacity: 1;
    transform: translateY(0);
}

.cta-button:hover {
    background-color: #333;
    transform: translateY(-2px);
}

/* Секции с анимацией по скроллу */
.section {
    padding: 100px 0;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-dark {
    background-color: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 15px;
}

.section-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Особенности */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #333;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Футер */
footer {
    background-color: #000;
    color: #fff;
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-column h3 {
    color: #fff;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 15px;
}

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

.footer-info p {
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 15px;
}

.contact-info {
    margin-top: 20px;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #ccc;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 18px;
}

.social-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    color: #999;
    font-size: 14px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .mega-menu-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-menu,
    .nav-actions {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mega-menu-wrapper {
        display: none;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .nav-menu.mobile-active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        padding: 20px;
        border-top: 1px solid #eee;
        gap: 20px;
    }

    .nav-actions.mobile-active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 200px);
        left: 0;
        width: 100%;
        background-color: #fff;
        padding: 20px;
        gap: 15px;
        align-items: flex-start;
    }
}
/* Стили для страницы обзора блога */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.category-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.category-card h3 {
    margin-bottom: 15px;
    color: #333;
}

.category-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.category-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.category-link:hover {
    color: #0056b3;
}

/* Стили для карточек статей */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.blog-card-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    font-size: 4rem;
    opacity: 0.8;
}

.blog-card-content {
    padding: 25px;
}

.blog-card-content h3 {
    margin-bottom: 15px;
}

.blog-card-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-content h3 a:hover {
    color: #007bff;
}

.blog-card-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #999;
}

.blog-meta .category {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

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

/* Стили для изображений из CKEditor 5 */
.blog-post-content img {
    max-width: 100%;
    height: auto;
}

/* Обработка data-атрибутов размера от CKEditor */
.blog-post-content img[data-width] {
    width: attr(data-width px, auto);
}

.blog-post-content img[data-height] {
    height: attr(data-height px, auto);
}

/* Стили для выравнивания изображений */
.blog-post-content img[data-align] {
    display: block;
    margin: 20px auto;
}

.blog-post-content img[data-align="left"] {
    float: left;
    margin: 0 20px 20px 0;
}

.blog-post-content img[data-align="right"] {
    float: right;
    margin: 0 0 20px 20px;
}

.blog-post-content img[data-align="center"] {
    display: block;
    margin: 20px auto;
}

/* Очистка float */
.blog-post-content:after {
    content: "";
    display: table;
    clear: both;
}

/* Стили для блоков кода с формулами и диаграммами */
.blog-post-content pre[class*="language-"] {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

/* Стили для MathJax формул */
.mjx-chtml {
    padding: 10px 0;
}

/* Стили для Mermaid диаграмм */
.mermaid {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}