/* Базовые стили */
:root {
    --primary: #0a0a12;
    --secondary: #ff4655;
    --accent: #2a2a3a;
    --light: #161622;
    --dark: #e0e0e0;
    --text: #e0e0e0;
    --text-light: #8a8aa3;
    --shadow: 0 4px 6px rgba(255, 70, 85, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

h1, h2, h3, h4 {
    color: var(--dark);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 10px;
}

h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--secondary);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #ff6b7a;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    background: #ff6b7a;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Общие стили для таблиц */
.table-section {
    background: var(--primary);
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem; 
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    background: var(--light);
}

    .table-container th {
    background: var(--secondary);
    color: var(--primary);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-container td {
    padding: 15px;
    border-bottom: 1px solid var(--accent);
    color: var(--text);
}

.table-container tr:last-child td {
    border-bottom: none;
}

.table-container tr:hover {
    background: rgba(255, 70, 85, 0.05);
}

/* Общие стили для секций с фоном */
.section-light {
    background: var(--light);
}

.section-dark {
    background: var(--primary);
    }

/* Стили для сетки навыков */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 2.5rem;
    align-items: stretch;
}

.feature-category {
    background: var(--accent);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #3a3a4a;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-list {
    list-style: none;
    margin-bottom: 1.5rem;
    flex: 1;
}

.feature-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 70, 85, 0.15);
}

.feature-category h3 {
    color: var(--dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
}

.feature-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: var(--text);
}

.feature-list li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--secondary);
}

/* Стили для списков "Плюсы" и "Минусы" */
.pros-list, .cons-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.pros-list li, .cons-list li {
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
    color: var(--text);
}

.pros-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.2rem;
}

.cons-list li:before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #f44336;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Стили для характеристик движков */
.engine-characteristics {
    list-style: none;
    margin-bottom: 1.5rem;
}

.engine-characteristics li {
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
    color: var(--text);
}

.engine-characteristics li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* Шапка */
header {
    background: linear-gradient(135deg, var(--primary), #050508);
    color: var(--dark);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--accent);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--secondary);
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 20px;
}

nav a {
    color: var(--dark);
    font-weight: 500;
}

nav a:hover {
    color: var(--secondary);
}

/* Герой секция */
.hero {
    background: linear-gradient(rgba(10, 10, 18, 0.9), rgba(10, 10, 18, 0.95));
    background-size: cover;
    background-position: center;
    color: var(--dark);
    padding: 100px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--dark);
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-light);
}

/* О себе */
.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 1;
}

/* Контакты */
.contact {
    border-top: 1px solid var(--accent);
}

.contact-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 20px;
    background: var(--accent);
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid #3a3a4a;
}

.contact-item:hover {
    background: #3a3a4a;
    transform: translateY(-5px);
}

.contact-item i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary);
}

.contact-item h3 {
    color: var(--dark);
}

.contact-item p {
    color: var(--text-light);
}

/* Футер */
footer {
    background: #050508;
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--accent);
}

.footer-links {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-light);
    margin: 0 15px;
}

.footer-links a:hover {
    color: var(--secondary);
}

/* Стили для содержания */
.content-ol {
    list-style-type: none;
    margin-left: 0;
    color: var(--text);
    margin-bottom: 2rem; 
}

.content-ol li {
    margin-bottom: 12px;
}

.content-ol ol {
    list-style-type: none;
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 1.5rem; 
}

.content-ol ol li {
    margin-bottom: 6px;
}

.content-ol a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.content-ol a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.decimal-list {
    list-style-type: decimal;
    margin-left: 30px;
    color: var(--text);
    margin-bottom: 2rem; 
}

.decimal-list li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.references-list ol {
    list-style: decimal;
    margin-left: 20px;
    margin-bottom: 2rem; 
}

.references-list li {
    margin-bottom: 15px;
    color: var(--text);
}

nav a.active {
    color: var(--secondary);
    font-weight: 600;
}
a:hover {
    text-decoration: underline;
}

/* Стили для скрытия нумерации в содержании, но оставления в тексте */
.content-ol > li::before,
.content-ol ol > li::before {
    display: none;
}

/* Дополнительные отступы для улучшенного визуального разделения */
.about-text > *:last-child {
    margin-bottom: 2rem; 
}

.feature-category:last-child,
.table-container:last-child,
.features-grid:last-child {
    margin-bottom: 2.5rem; 
}

.hero .btn {
    background: var(--secondary);
    color: var(--primary);
}

.hero .btn:hover {
    background: #ff6b7a;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.hero-link {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.hero-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.hero-content a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.hero-content a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Стили для ссылок на источники в тексте */
a.ref-link {
    color: var(--text) !important;
    text-decoration: none;
}

a.ref-link:hover {
    color: var(--secondary) !important;
    text-decoration: underline;
}

/* Отступ для якорей, чтобы контент не перекрывался фиксированным меню */
a[name] {
    display: block;
    position: relative;
    top: -100px; /* Высота меню + небольшой отступ */
    visibility: hidden;
}

h2, h3, h4 {
    scroll-margin-top: 100px; /* Для современных браузеров */
}

/* Стили для нумерованного списка источников */
.references-list ol {
    list-style-type: decimal;
    margin-left: 30px;
    margin-bottom: 2rem;
}

.references-list li {
    margin-bottom: 15px;
    padding-left: 10px;
    line-height: 1.6;
    scroll-margin-top: 80px; /* Для плавной прокрутки к источнику */
}

.references-list li a {
    transition: var(--transition);
}

.references-list li a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav li {
        margin: 5px 10px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .table-container {
        font-size: 0.9rem;
    }
    
    .table-container th, 
    .table-container td {
        padding: 10px;
    }
}

.abstract {
    background: var(--accent);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary);
}

.keywords {
    margin-top: 15px;
    font-style: italic;
    color: var(--text-light);
}

.authors {
    margin-bottom: 2rem;
    color: var(--text-light);
}
.formula {
    background: var(--accent);
    padding: 20px;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    border: 1px solid #3a3a4a;
    overflow-x: auto;
}
        
.formula img {
    max-width: 100%;
    height: auto;
}
        
.figure {
    margin: 2rem 0;
    text-align: center;
}
        
.figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--accent);
}
        
.figure-caption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-light);
}
        
.steps-list {
    list-style: none;
     margin-bottom: 2rem;
}
        
.steps-list li {
    margin-bottom: 1.5rem;
    padding: 20px;
    background: var(--accent);
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}
        
.step-number {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}
/* Выравнивание по ширине только для текстового контента статей */
.about-text,
.about-text p,
.abstract p,
.abstract .keywords p,
.feature-list li,
.pros-list li,
.cons-list li,
.engine-characteristics li,
.content-ol li,
.decimal-list li,
.references-list li {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto; /* Для переноса слов, если поддерживается */
}

/* Отдельно для абзацев внутри текстовых блоков */
.about-text p,
.abstract p {
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1rem;
}

/* Для элементов списков */
.feature-list li,
.pros-list li,
.cons-list li,
.engine-characteristics li {
    text-align: justify;
    text-justify: inter-word;
}

/* Для литературы */
.references-list li {
    text-align: justify;
    text-justify: inter-word;
}

/* Для ссылок внутри текста оставляем как есть */
.about-text a,
.ref-link {
    text-align: left;
    display: inline;
}

/* Для мобильных устройств - отключаем выравнивание по ширине для лучшей читаемости */
@media (max-width: 768px) {
    .about-text,
    .about-text p,
    .abstract p,
    .abstract .keywords p,
    .feature-list li,
    .pros-list li,
    .cons-list li,
    .engine-characteristics li,
    .content-ol li,
    .decimal-list li,
    .references-list li,
    .authors p,
    .hero p {
        text-align: left;
        text-justify: auto;
    }
}