/* ============================================= */
/* Root Variables                                */
/* ============================================= */
:root {
    --primary: #FFD700;
    --secondary: #111111;
    --accent: #FFC400;
    --text: #E0E0E0;
    --dark-gray: #222222;
    --card-background: #121212; /* Новая переменная для фона карточек */
    --benefit-background: #1A1A1A; /* Новая переменная для фона секции преимуществ */
}

/* ============================================= */
/* Body and Basic HTML Elements                  */
/* ============================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary);
    color: var(--text); /* Установлено здесь для всех параграфов по умолчанию */
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px; /* Учитывает фиксированный хедер */
}

h1, h2, h3, h4 {
    color: var(--primary);
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

h1 {
    font-size: 2.5rem;
    margin-top: 1em;
}

h2 {
    font-size: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1.2em;
    /* color: var(--text); уже установлено на body, но можно переопределить при необходимости */
    /* margin-top: 0.5rem; применимо, если нужно для всех параграфов, иначе оставляем в специфичных селекторах */
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
    list-style-type: disc;
}

li {
    margin-bottom: 8px;
}

/* ============================================= */
/* Layout / Structure                            */
/* ============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.topbar {
    background-color: var(--secondary);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    /* position: fixed; width: 100%; top: 0; z-index: 1000; - эти стили теперь в header.html для фиксированного хедера */
}

header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: rgba(0, 0, 0, 0.8) !important; /* Черный с 70% непрозрачности */
}

.article-header {
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
}

.intro-section {
    margin: 40px 0;
}

.tool-section {
    margin-bottom: 60px;
}

.mind-map {
    display: flex;
    justify-content: center;
    padding: 2rem;
    overflow-x: auto;
}

.mind-map-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.section-divider {
    border-top: 1px solid #333;
    margin: 40px 0;
}

/* ============================================= */
/* Components                                    */
/* ============================================= */

/* Logo */
.logo { /* Generic image logo */
    max-width: 60px;
    height: auto;
    margin-bottom: 20px;
}

.topbar .logo { /* Text logo in topbar */
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Navigation */
.topbar nav a {
    margin-left: 1rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
}
/* Navigation Items */
.nav-item {
    position: relative;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-item:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-item:hover:after,
.nav-item.active:after {
    width: 100%;
}

.nav-item.active {
    color: var(--primary);
}


.topbar nav a:hover {
    color: var(--primary);
}

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out; /* Для плавной анимации высоты */
}

#mobile-menu:not(.hidden) {
    max-height: 200px; /* Достаточно большая высота, чтобы вместить все пункты меню */
}

#mobile-menu a { /* Стили для ссылок в мобильном меню */
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    background-color: var(--secondary);
}

#mobile-menu a:hover {
    background-color: var(--dark-gray);
    color: var(--primary);
}


.toc-link { /* Table of Contents Link */
    color: var(--text); /* Используем переменную для консистентности */
    transition: color 0.2s ease;
}

.toc-link:hover {
    color: var(--primary);
}

/* Header Content */
header h1 { /* More specific than general h1 */
    font-size: 2rem; /* Overrides general h1, was 2.5rem. Check which is intended */
    color: var(--primary);
}

header p {
    color: var(--text);
    margin-top: 0.5rem;
}

/* Mind Map Components */
.central-node {
    background: var(--primary);
    color: var(--secondary);
    border-radius: 10px;
    padding: 1rem 2rem;
    margin: 1rem auto;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.branches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.branch {
    background: var(--dark-gray);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    flex: 1 1 300px; /* min-width 300px, can grow */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.branch-title {
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-icon {
    width: 1rem;
    /* Add height or aspect-ratio if it's an image/svg for better layout */
}

.subbranches,
.leaf-nodes {
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.subbranch {
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    margin-top: 0.5rem;
}

.leaf {
    background: #333; /* Consider var(--dark-gray) or a new variable */
    color: var(--text);
    border-left: 3px solid var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Cards & Badges */
.tool-card {
    background-color: var(--card-background); /* Используем новую переменную */
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.tool-name {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.category-badge {
    display: inline-block;
    background-color: #2D2D2D; /* Пока оставил HEX, можно добавить переменную */
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.feature-item {
    background-color: var(--card-background); /* Используем новую переменную для консистентности */
    padding: 20px;
    border-radius: 5px;
    border-left: 3px solid var(--primary);
}

/* Social Icons */
.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark-gray);
    color: var(--primary);
    border-radius: 50%;
    margin-right: 10px; /* Add margin-left if multiple are inline without a gap */
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    background-color: var(--primary);
    color: var(--secondary);
}

/* Other Components */
.header-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain; /* 'cover' might be better depending on image aspect ratios */
    margin: 20px 0;
}

.ai-benefit {
    padding: 15px;
    margin-bottom: 30px;
    background-color: var(--benefit-background); /* Используем новую переменную */
    border-radius: 5px;
}

.price { /* Often associated with product/service items */
    color: var(--primary);
    font-weight: 500;
}

/* ============================================= */
/* Utility Classes                               */
/* ============================================= */
.highlight {
    color: var(--primary);
    font-weight: bold;
}

.text-accent {
    color: var(--accent); /* Определение стиля для text-accent */
}

/* ============================================= */
/* States                                        */
/* ============================================= */
.collapsed .leaf-nodes,
.collapsed .subbranches {
    display: none;
}

/* Other :hover, :focus, .active states are typically co-located
   with their base component selectors, which is good practice. */