/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #F2F1F1;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    transition: opacity 0.3s ease; /* Плавное появление после инициализации */
}

/* Глобальная переменная для отступа sticky-элементов */
:root { 
    --sticky-offset: 20px;
}


/* Контейнер документации */
.documentation-container {
    display: flex;
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

/* Левое меню (Сайдбар) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 50%, #2E8B6A 100%);
    overflow-y: auto;
    z-index: 1005;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Скрытие заголовка сайдбара в мобильной версии */
@media (max-width: 768px) {
    .sidebar-header {
        display: none; /* Полностью скрываем заголовок в мобильной версии */
    }
    
    /* Меню начинается с первого раздела с отступом от хедера */
    .navigation {
        padding: 85px 0 15px 0; /* Отступ сверху чтобы не скрывался под хедером */
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Заголовок сайдбара */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-text {
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Навигация */
.navigation {
    padding: 20px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

/* Подменю */
.nav-sublist {
    list-style: none;
    background: rgba(0, 0, 0, 0.1);
}

.nav-subitem {
    margin-bottom: 1px;
}

.nav-sublink {
    display: block;
    padding: 10px 20px 10px 40px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-sublink:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.4);
}

.nav-sublink.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Основной контент */
.main-content {
    margin-left: 300px;
    flex: 1;
    min-height: 100vh;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px 100px;
}

/* Секции контента */
.content-section {
    margin-bottom: 80px;
    scroll-margin-top: var(--sticky-offset);
}

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: #2E8B6A;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border-radius: 2px;
}

.section-content {
    color: #444;
    font-size: 16px;
    line-height: 1.7;
}

/* Подсекции */
.subsection {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #E1E1E1;
    scroll-margin-top: var(--sticky-offset);
}

.subsection-title {
    font-size: 24px;
    font-weight: 600;
    color: #44A08D;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* Плейсхолдеры */
.placeholder-text {
    color: #666;
    font-style: italic;
    background: rgba(78, 205, 196, 0.05);
    padding: 20px 24px;
    border-radius: 8px;
    border-left: 4px solid #4ECDC4;
    margin: 20px 0;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .content-wrapper {
        padding: 40px 30px 80px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .subsection-title {
        font-size: 22px;
    }
}

/* Overlay для затемнения контента при открытом меню */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(2px);
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.mobile-open {
        width: 280px;
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 30px 20px 60px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .subsection-title {
        font-size: 20px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .nav-sublink {
        font-size: 13px;
        padding: 8px 20px 8px 35px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 20px 16px 40px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .subsection-title {
        font-size: 18px;
    }
    
    .sidebar-header {
        padding: 20px 16px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Мобильный хедер с кнопкой меню и поиском */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1010;
    padding: 10px 15px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Мобильная кнопка меню в хедере */
.mobile-menu-toggle {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border: none;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #5FD3CB, #4FB8A5);
}

.mobile-menu-toggle:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

/* Анимация иконки меню */
.mobile-menu-toggle .menu-icon {
    transition: all 0.3s ease;
    font-weight: 600;
}

.mobile-menu-toggle.menu-open .menu-icon {
    transform: rotate(90deg);
}

/* Состояние открытого меню для body */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
}

/* Скролл-индикатор */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 300px;
    right: 0;
    height: 3px;
    background: rgba(78, 205, 196, 0.2);
    z-index: 999;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
    width: 0%;
    transition: width 0.1s ease;
}

@media (max-width: 768px) {
    .scroll-indicator {
        left: 0;
    }
}

/* Поисковый хедер */
.search-header {
    position: fixed;
    top: 20px;
    left: 300px; /* Начинается от края контентной области */
    right: 40px; /* Отступ справа */
    z-index: 1003;
    max-width: 500px; /* Уменьшенная максимальная ширина */
    margin: 0 auto;
    padding: 0;
    transform: translateY(0) translateZ(0);
    transition: all 0.45s cubic-bezier(0.23, 1, 0.320, 1);
    will-change: transform, opacity;
}

.search-header.hidden {
    transform: translateY(-120px) translateZ(0);
    opacity: 0;
    pointer-events: none;
}

.search-header.compact .search-container {
    transform: scale(0.92) translateZ(0);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.320, 1);
}

.search-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 24px; /* Более современный радиус */
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.35s cubic-bezier(0.23, 1, 0.320, 1);
    transform: scale(1) translateZ(0);
    will-change: transform, box-shadow, border-color;
}

.search-container:hover {
    transform: scale(1.01) translateZ(0);
    box-shadow: 
        0 6px 32px rgba(78, 205, 196, 0.08),
        0 2px 8px rgba(78, 205, 196, 0.04);
    border-color: rgba(78, 205, 196, 0.3);
}

.search-container:focus-within {
    transform: scale(1.02) translateZ(0);
    box-shadow: 
        0 8px 40px rgba(78, 205, 196, 0.15),
        0 4px 16px rgba(78, 205, 196, 0.1);
    border-color: rgba(78, 205, 196, 0.5);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 20px; /* Уменьшенный padding */
    gap: 10px;
}

.search-icon {
    color: #666;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px; /* Уменьшенный размер шрифта */
    color: #333;
    font-family: inherit;
    font-weight: 400;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-loading {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    color: #4ECDC4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
    pointer-events: none;
}

.search-loading.show {
    opacity: 1;
    visibility: visible;
}

.search-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    color: #666;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-clear:hover {
    background: rgba(78, 205, 196, 0.1);
    color: #4ECDC4;
    transform: scale(1.1);
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    opacity: 1;
    visibility: visible;
}

/* Результаты поиска */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    border-radius: 18px;
    margin-top: 12px;
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95) translateZ(0);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    will-change: transform, opacity;
}

.search-results.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1) translateZ(0);
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.3);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.5);
}

.search-results-header {
    padding: 16px 20px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-results-count {
    font-size: 14px;
    font-weight: 600;
    color: #4ECDC4;
}

.search-results-list {
    padding: 8px 0;
}

.search-result-item {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 10px;
    margin: 2px 8px;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.320, 1);
    cursor: pointer;
    transform: translateX(0) translateZ(0);
    opacity: 0;
    animation: slideInResult 0.4s cubic-bezier(0.23, 1, 0.320, 1) forwards;
    will-change: transform, background-color, border-color;
}

.search-result-item.highlighted {
    background: rgba(78, 205, 196, 0.12) !important;
    border-left-color: #4ECDC4 !important;
    transform: translateX(8px) translateZ(0) !important;
    box-shadow: 
        0 6px 20px rgba(78, 205, 196, 0.12),
        0 2px 8px rgba(78, 205, 196, 0.08) !important;
}

.search-result-item:nth-child(1) { animation-delay: 0ms; }
.search-result-item:nth-child(2) { animation-delay: 60ms; }
.search-result-item:nth-child(3) { animation-delay: 120ms; }
.search-result-item:nth-child(4) { animation-delay: 180ms; }
.search-result-item:nth-child(5) { animation-delay: 240ms; }
.search-result-item:nth-child(n+6) { animation-delay: 300ms; }

@keyframes slideInResult {
    from {
        opacity: 0;
        transform: translateX(-16px) translateY(8px) scale(0.96) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1) translateZ(0);
    }
}

.search-result-item:hover {
    background: rgba(78, 205, 196, 0.08);
    border-left-color: #4ECDC4;
    transform: translateX(6px) translateZ(0);
    box-shadow: 
        0 4px 16px rgba(78, 205, 196, 0.1),
        0 1px 4px rgba(78, 205, 196, 0.05);
}

.search-result-item:active {
    transform: translateX(3px) scale(0.99) translateZ(0);
    transition: all 0.1s cubic-bezier(0.23, 1, 0.320, 1);
}

.search-result-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #2E8B6A;
}

.search-result-snippet {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-path {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* Выделение найденного текста */
.search-result-snippet mark {
    background: linear-gradient(120deg, rgba(78, 205, 196, 0.3) 0%, rgba(78, 205, 196, 0.1) 100%);
    color: #2E8B6A;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Отсутствие результатов */
.search-no-results {
    padding: 24px 20px;
    text-align: center;
    color: #666;
    display: none;
}

.search-no-results.show {
    display: block;
}

.search-no-results p {
    font-weight: 500;
    margin-bottom: 4px;
}

.search-no-results small {
    font-size: 13px;
    color: #999;
}

/* Логотип в мобильном хедере */
.mobile-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    margin: 0 10px;
    min-width: 0;
}

.mobile-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-logo-text {
    color: #2E8B6A;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
}

/* Компактная иконка поиска для мобильных */
.mobile-search-toggle {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.mobile-search-toggle:hover {
    background: linear-gradient(135deg, #5FD3CB, #4FB8A5);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.1);
}

.mobile-search-toggle:active {
    transform: scale(0.98);
}

/* Чистый и элегантный мобильный поиск */
.mobile-header.search-mode {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    box-shadow: 0 2px 16px rgba(78, 205, 196, 0.08);
}

/* Основные элементы хедера с плавной анимацией в обе стороны */
.mobile-menu-toggle,
.mobile-logo-section,
.mobile-search-toggle {
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* При активном поиске - сдвигаем вправо */
.mobile-header.search-mode .mobile-menu-toggle,
.mobile-header.search-mode .mobile-logo-section,
.mobile-header.search-mode .mobile-search-toggle {
    transform: translateX(100vw);
}

/* Контейнер поиска изначально скрыт слева и невидим */
.mobile-search-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    transform: translateX(-100vw);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* При активном поиске - появляется и смещается на место */
.mobile-header.search-mode .mobile-search-container {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* Оптимизированные элементы поиска */
.mobile-search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: calc(100% - 50px); /* Оставляем место для крестика */
}

.mobile-search-input-field {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 21px;
    padding: 0 40px 0 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.mobile-search-input-field:focus {
    border-color: #4ECDC4;
    background: white;
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.1);
}

.mobile-search-input-field::placeholder {
    color: #999;
}

.mobile-search-icon-inline {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #4ECDC4;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.mobile-search-close-btn {
    width: 38px;
    height: 38px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 50%;
    color: #dc3545;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.mobile-search-close-btn:hover {
    background: rgba(220, 53, 69, 0.15);
    transform: scale(1.05);
}

/* Упрощенные результаты поиска */
.mobile-search-results-dropdown {
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(78, 205, 196, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1012;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.mobile-search-results-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-search-results-dropdown::-webkit-scrollbar {
    width: 4px;
}

.mobile-search-results-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.mobile-search-results-dropdown::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.3);
    border-radius: 2px;
}

.mobile-search-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.5);
}

.mobile-search-results-list {
    padding: 8px;
}

/* Адаптивные стили для мобильного поиска */
@media (max-width: 480px) {
    .mobile-search-container {
        gap: 8px;
        padding: 0 12px;
    }
    
    .mobile-search-input-field {
        height: 40px;
        font-size: 16px;
        padding: 0 35px 0 14px;
    }
    
    .mobile-search-close-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .mobile-search-results-dropdown {
        top: 65px;
        left: 8px;
        right: 8px;
        max-height: 350px;
    }
}

/* Упрощенные стили для элементов результатов */
.mobile-search-result-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px 8px;
    user-select: none;
}

.mobile-search-result-item:hover {
    background: rgba(78, 205, 196, 0.08);
}

.mobile-search-result-item:active {
    background: rgba(78, 205, 196, 0.12);
    transform: scale(0.98);
}



.mobile-search-result-title {
    font-weight: 600;
    font-size: 15px;
    color: #2E8B6A;
    margin-bottom: 4px;
    line-height: 1.3;
}

.mobile-search-result-snippet {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-search-result-path {
    font-size: 11px;
    color: #999;
    font-style: italic;
    opacity: 0.8;
}

.mobile-search-no-results {
    text-align: center;
    padding: 24px 20px;
    color: #666;
}

.mobile-search-no-results p {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #2E8B6A;
}

.mobile-search-no-results small {
    font-size: 13px;
    color: #999;
}

.mobile-search-results-header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(78, 205, 196, 0.1);
    font-size: 13px;
    font-weight: 600;
    color: #4ECDC4;
    background: rgba(78, 205, 196, 0.05);
    border-radius: 16px 16px 0 0;
}

/* Выделение найденного текста в мобильном поиске */
.mobile-search-result-snippet mark {
    background: linear-gradient(120deg, rgba(78, 205, 196, 0.25) 0%, rgba(78, 205, 196, 0.1) 100%);
    color: #2E8B6A;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Адаптивность поиска */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Планшеты - оставляем стандартный поиск, но делаем его более отзывчивым */
    .search-header {
        left: 280px;
        right: 30px;
        max-width: 450px;
    }
    
    .search-container {
        border-radius: 22px;
        backdrop-filter: blur(25px);
    }
    
    .search-container:hover {
        transform: scale(1.005) translateZ(0);
    }
    
    .search-container:focus-within {
        transform: scale(1.01) translateZ(0);
    }
    
    .search-results {
        border-radius: 16px;
        max-height: 380px;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .search-header {
        display: none; /* Скрываем стандартный поиск на мобильных */
    }

    /* Отступ для контента под мобильным хедером */
    .main-content {
        padding-top: 70px;
    }

    .search-input-wrapper {
        padding: 10px 16px;
    }

    .search-input {
        font-size: 14px;
    }

    .search-results {
        max-height: 280px;
    }

    .search-result-item {
        padding: 10px 16px;
    }

}

@media (max-width: 640px) {
    .main-content {
        padding-top: 68px;
    }

    .mobile-header {
        height: 68px;
        padding: 8px 14px;
    }


}

@media (max-width: 480px) {
    .main-content {
        padding-top: 65px;
    }

    .mobile-header {
        height: 65px;
        padding: 8px 12px;
    }


}

@media (max-width: 360px) {
    .main-content {
        padding-top: 62px;
    }

    .mobile-header {
        height: 62px;
        padding: 6px 10px;
    }


}

@media (max-width: 320px) {
    .main-content {
        padding-top: 60px;
    }

    .mobile-header {
        height: 60px;
        padding: 6px 10px;
    }

    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 14px;
        border-radius: 10px;
    }



    .mobile-logo-section {
        gap: 4px;
        margin: 0 6px;
    }

    .mobile-logo-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
        border-radius: 5px;
    }

    .mobile-logo-text {
        font-size: 12px;
    }

    .mobile-overlay {
        backdrop-filter: none; /* Отключаем размытие на очень слабых устройствах */
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
        font-size: 16px;
    }

    .mobile-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .mobile-logo-text {
        font-size: 14px;
    }

    .mobile-logo-section {
        gap: 6px;
        margin: 0 8px;
    }

    /* Дополнительные стили для маленьких экранов */
    .mobile-overlay {
        backdrop-filter: blur(1px); /* Меньше размытия на слабых устройствах */
    }

    .sidebar.mobile-open {
        width: 260px; /* Немного уже на маленьких экранах */
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
    }
}

/* Иллюстрации */
.illustration {
    max-width: 100%;
    height: auto;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    pointer-events: none;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: white;
    padding: 4px;
}

.illustration:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Контейнер для иллюстраций с текстом */
.content-with-illustration {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin: 24px 0;
    position: relative;
}

/* Иллюстрация справа от текста */
.illustration-right {
    flex-direction: row;
}

.illustration-right .illustration-container {
    flex: 0 0 auto;
    max-width: 400px;
    width: 40%;
}

.illustration-right .text-content {
    flex: 1;
    min-width: 0;
}

/* Иллюстрация слева от текста */
.illustration-left {
    flex-direction: row-reverse;
}

.illustration-left .illustration-container {
    flex: 0 0 auto;
    max-width: 400px;
    width: 40%;
}

.illustration-left .text-content {
    flex: 1;
    min-width: 0;
}

/* Полноширинная иллюстрация */
.illustration-full {
    margin: 32px 0;
    text-align: center;
}

.illustration-full .illustration {
    max-width: 800px;
    width: 100%;
}

/* Иллюстрация по центру с ограниченной шириной */
.illustration-center {
    margin: 32px 0;
    text-align: center;
}

.illustration-center .illustration {
    max-width: 500px;
    width: 80%;
}

/* Подпись к иллюстрации */
.illustration-caption {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

/* Sticky-колонка внутри секций с иллюстрацией и текстом */
.content-with-illustration .text-content,
.content-with-illustration .illustration-container {
    align-self: flex-start;
}

.content-with-illustration .sticky-col {
    position: sticky;
    top: var(--sticky-offset);
}

/* Маленькие иллюстрации (иконки) */
.illustration-small {
    max-width: 200px;
    width: 100%;
}

.illustration-small .illustration {
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 
                0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 4px;
}

/* Группа иллюстраций */
.illustrations-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.illustrations-group .illustration-item {
    text-align: center;
}

.illustrations-group .illustration {
    max-width: 100%;
    margin-bottom: 12px;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .content-with-illustration {
        gap: 24px;
    }
    
    .illustration-right .illustration-container,
    .illustration-left .illustration-container {
        width: 45%;
        max-width: 350px;
    }
    
    .illustration-full .illustration,
    .illustration-center .illustration {
        max-width: 600px;
    }
    
    .illustrations-group {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .content-with-illustration {
        flex-direction: row !important; /* Сохраняем разметку как на десктопе */
        gap: 16px;
        align-items: flex-start;
    }

    .illustration-right .illustration-container,
    .illustration-left .illustration-container {
        width: 48%;
        max-width: none;
        order: 0; /* Без принудительного переноса изображения вверх */
    }

    .content-with-illustration .text-content {
        width: 52%;
        min-width: 0;
    }

    .illustration-full .illustration,
    .illustration-center .illustration {
        max-width: 100%;
        width: 95%;
    }

    .illustrations-group {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }

    .illustration {
        border-radius: 24px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 
                    0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .mobile-header {
        display: flex;
    }

    .search-header {
        display: none; /* Скрываем стандартный поиск на мобильных */
    }

    /* Отступ для контента под мобильным хедером */
    .main-content {
        padding-top: 70px;
    }

    .search-input-wrapper {
        padding: 10px 16px;
    }

    .search-input {
        font-size: 14px;
    }

    .search-results {
        max-height: 280px;
    }

    .search-result-item {
        padding: 10px 16px;
    }

}

@media (max-width: 640px) {
    .main-content {
        padding-top: 68px;
    }

    .mobile-header {
        height: 68px;
        padding: 8px 14px;
    }


}

@media (max-width: 480px) {
    .main-content {
        padding-top: 65px;
    }

    .mobile-header {
        height: 65px;
        padding: 8px 12px;
    }


}

@media (max-width: 360px) {
    .main-content {
        padding-top: 62px;
    }

    .mobile-header {
        height: 62px;
        padding: 6px 10px;
    }


}

@media (max-width: 320px) {
    .main-content {
        padding-top: 60px;
    }

    .mobile-header {
        height: 60px;
        padding: 6px 10px;
    }

    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 14px;
        border-radius: 10px;
    }



    .mobile-logo-section {
        gap: 4px;
        margin: 0 6px;
    }

    .mobile-logo-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
        border-radius: 5px;
    }

    .mobile-logo-text {
        font-size: 12px;
    }

    .mobile-overlay {
        backdrop-filter: none; /* Отключаем размытие на очень слабых устройствах */
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
        font-size: 16px;
    }

    .mobile-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .mobile-logo-text {
        font-size: 14px;
    }

    .mobile-logo-section {
        gap: 6px;
        margin: 0 8px;
    }

    /* Дополнительные стили для маленьких экранов */
    .mobile-overlay {
        backdrop-filter: blur(1px); /* Меньше размытия на слабых устройствах */
    }

    .sidebar.mobile-open {
        width: 260px; /* Немного уже на маленьких экранах */
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
    }
}

/* Специальные стили для ландшафтной ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-header {
        height: 60px;
        padding: 8px 15px;
    }
    
    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .mobile-logo-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .mobile-logo-text {
        font-size: 15px;
    }
    
    .main-content {
        padding-top: 60px;
    }
    
    .sidebar.mobile-open {
        width: 240px; /* Еще уже в ландшафтном режиме */
    }
    
    .navigation {
        padding: 75px 0 15px 0; /* Меньший отступ в ландшафтном режиме */
    }
    
}

/* Дополнительные медиа-запросы для очень маленьких устройств */
@media (max-width: 320px) {
    .mobile-header {
        height: 60px;
        padding: 6px 10px;
    }
    
    .mobile-menu-toggle,
    .mobile-search-toggle {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .mobile-logo-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .mobile-logo-text {
        font-size: 13px;
    }
    
    .mobile-logo-section {
        gap: 5px;
        margin: 0 6px;
    }
    
    .main-content {
        padding-top: 60px;
    }
    
    .sidebar.mobile-open {
        width: 240px;
    }
    
    .navigation {
        padding: 75px 0 15px 0; /* Отступ для очень маленьких экранов */
    }
    
    
    .mobile-search-input-field {
        height: 42px;
        font-size: 15px;
        padding: 0 45px 0 16px;
    }
    
    .mobile-search-close-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .mobile-search-result-item {
        padding: 10px 14px;
    }
    
    .mobile-search-result-title {
        font-size: 14px;
    }
    
    .mobile-search-result-snippet {
        font-size: 12px;
    }
    
    .mobile-overlay {
        backdrop-filter: none; /* Отключаем размытие на очень слабых устройствах */
    }
}

/* === Унифицированная адаптивность иллюстраций на узких экранах === */
@media (max-width: 640px) {
    /* Читаемый, но более компактный текст рядом с иллюстрациями */
    .content-with-illustration .text-content {
        font-size: 15px;
        line-height: 1.6;
    }

    /* Немного уменьшаем заголовки внутри иллюстрационных секций */
    .content-with-illustration .text-content h2,
    .content-with-illustration .text-content h3,
    .content-with-illustration .text-content h4 {
        font-size: 18px;
    }

    /* Иллюстрации вписываются в доступную ширину, не выходя за край */
    .illustration {
        max-width: 100%;
        height: auto;
    }

    /* Группы иллюстраций: две равные колонки с адекватными отступами */
    .illustrations-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}