@charset "utf-8";
/* ========================================= */
/* ОБЩИЕ СТИЛИ И СБРОС */
/* ========================================= */

/* Сброс стандартных отступов и установка box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные стили для body */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
	background-color: #E9E9E9; 
    color: #333;
   /* background: linear-gradient(135deg, #527395 0%, #55a3ff 100%);*/
    min-height: 100vh;
}

/* Основной контейнер приложения */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
}

/* ========================================= */
/* ТИПОГРАФИКА */
/* ========================================= */

/* Заголовки h3 - центрированные, обычный вес */
h3 {
    text-align: center;
    font-weight: 400;
}

/* Заголовки h4 - увеличенный межстрочный интервал и отступ */
h4 {
   /* text-indent: 1.5em;*/
    line-height: 2.5;
    font-size: 18px;
    font-weight: 500;
}

/* Жирный текст */
strong {
    font-weight: 500;
}

/* Цитаты */
blockquote {
    font-style: italic;
    margin: 20px 0;
    padding: 10px 20px;
    border-left: 5px solid #ccc;
    color: #555;
    background-color: #f9f9f9;
}

/* ========================================= */
/* ХЕДЕР И НАВИГАЦИЯ - ТРЕХЧАСТНАЯ СТРУКТУРА */
/* ========================================= */

/* Основной хедер - flex контейнер */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Левая часть - логотип */
.header-left {
    flex: 0 0 auto;
}

.header-logo {
    height: 60px;
    width: auto;
    display: block;
}

/* Центральная часть - заголовок */
.header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.header-center h1 {
    margin: 0;
    font-size: 20px;
    color: white;
    line-height: 1.2;
    word-wrap: break-word;
}

/* Правая часть - меню */
.header-right {
    flex: 0 0 auto;
}

/* Кнопка меню-гамбургер */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Иконка гамбургера */
.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

/* Линии гамбургера */
.hamburger span {
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Анимация гамбургера при активации */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================= */
/* БОКОВАЯ ПАНЕЛЬ (SIDEBAR) */
/* ========================================= */

/* Боковая панель навигации */
.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 200;
    overflow-y: auto;
}

/* Активное состояние боковой панели */
.sidebar.active {
    right: 0;
}

/* Хедер боковой панели */
.sidebar-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Заголовок боковой панели */
.sidebar-title {
    font-size: 18px;
    font-weight: bold;
}

/* Кнопка закрытия боковой панели */
.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Контент боковой панели */
.sidebar-content {
    padding: 20px;
}

/* Секция меню */
.menu-section {
    margin-bottom: 30px;
}

/* Заголовок секции меню */
.menu-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Список меню */
.menu-list {
    list-style: none;
}

/* Элемент меню */
.menu-item {
    margin-bottom: 8px;
}

/* Ссылка в меню */
.menu-link {
    display: block;
    padding: 12px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background: #f8f9fa;
    color: #2c3e50;
    border-left-color: #667eea;
    transform: translateX(5px);
}

/* Активная ссылка в меню */
.menu-link.active {
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%);
    color: white;
    border-left-color: #ffffff;
}

/* Иконки в меню - квадратики с градиентом */
.menu-icon {
    width: 27px !important;
    height: 27px !important;
    background: #5485ba !important;
    color: white !important;
    border-radius: 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    margin-right: 10px !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
}

/* Принудительно убираем ВСЕ стили у содержимого menu-icon */
.menu-icon *,
.menu-icon::before,
.menu-icon::after {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: white !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Принудительно стили для текстового содержимого */
.menu-icon:not(:empty) {
    line-height: 1 !important;
    text-decoration: none !important;
}

.menu-link:hover .menu-icon {
    background: #4674a8 !important;
    transform: scale(1.05);
}

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

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

/* ========================================= */
/* ГЛАВНАЯ СЕКЦИЯ (HERO) */
/* ========================================= */

/* Главная секция с градиентным фоном */
.hero-section {
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%) !important;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Контент главной секции - сетка */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1000px;
    width: 100%;
    padding: 40px 30px;
    z-index: 2;
}

/* Текстовая часть главной секции */
.hero-text {
    color: white;
}

/* Главный заголовок */
.hero-title {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 20px;
    line-height: 0.8 !important; 
    color: white;
}

/* Подзаголовок */
.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Кнопка призыва к действию */
.hero-cta {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Контейнер изображения в главной секции */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}


@media (max-width: 768px) {
    .hero-image img {
        margin-bottom: 30px;
    }
}
/* Изображение в главной секции */
.hero-image img {
    max-width: 100%;
	margin-bottom: 20px;
    height: auto;
    border-radius: 15px;
   /* box-shadow: 0 10px 40px rgba(0,0,0,0.1);*/
    transition: transform 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.hero-image img:hover {
    transform: scale(1.05);
}

/* ========================================= */
/* СОДЕРЖАНИЕ И КОНТЕНТ */
/* ========================================= */

/* Секция оглавления */
.table-of-contents {
    padding: 60px 20px 120px 20px;
    background: white;
}

/* Хедер оглавления */
.toc-header {
    text-align: center;
    margin-bottom: 50px;
}

/* Заголовок оглавления */
.toc-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Описание оглавления */
.toc-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Сетка глав */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Карточка главы */
.chapter-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    text-decoration: none;
    color: #2c3e50;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

/* Псевдоэлемент для эффекта наведения на карточку */
.chapter-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.chapter-card:hover:before {
    opacity: 0.05;
}

/* Эффект наведения на карточку главы */
.chapter-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-left-color: #764ba2;
}

/* Контент карточки главы */
.chapter-card-content {
    position: relative;
    z-index: 2;
}

/* Номер главы - скругленные квадраты (ЕДИНСТВЕННОЕ ОПРЕДЕЛЕНИЕ) */
.chapter-number {
    width: 40px;
    height: 40px;
    background: #5485ba !important;
    color: white !important;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(84, 133, 186, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Убираем фон у всех дочерних элементов */
.chapter-number * {
    background: transparent !important;
    color: inherit !important;
}

.chapter-card:hover .chapter-number {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(84, 133, 186, 0.4);
    background: #4674a8;
}

/* Заголовок главы */
.chapter-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Описание главы */
.chapter-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

/* Список глав (альтернативный вид) */
.chapter-list {
    list-style: none;
}

/* Элемент списка глав */
.chapter-item {
    margin-bottom: 15px;
}

/* Ссылка на главу в списке */
.chapter-link {
    display: block;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #2c3e50;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chapter-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-left-color: #764ba2;
}

/* Контент страницы */
.page-content {
    padding: 20px;
    padding-bottom: 120px;
    animation: fadeIn 0.3s ease-in;
}

/* Заголовки в контенте страницы */
.page-content h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Параграфы в контенте с отступом */
.page-content p {
    margin-bottom: 15px;
    text-align: left;/* 
   /* text-indent: 1.5em;*/
}

/* Параграфы в списках */
.page-content li p {
    text-indent: 0;
}

/* Списки в контенте */
.page-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

/* Элементы списков */
.page-content li {
    margin-bottom: 10px;
}

/* Термины определений */
.page-content dt {
    font-weight: bold;
    color: #2c3e50;
    margin-top: 15px;
}

/* Определения */
.page-content dd {
    margin-bottom: 10px;
    padding-left: 15px;
}

/* Список библиографии с нумерацией */
.bibliography-list {
    list-style-type: decimal;
    margin-left: 20px;
    padding: 0;
}

/* Элемент библиографии */
.bibliography-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Подрисуночные надписи и сноски */
.footnotes {
    margin-top: -40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.8em;
    color: #666;
}
.footnotes ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin: 0;
}

.footnotes li {
    margin-bottom: 5px;
}

/* ========================================= */
/* НИЖНЯЯ НАВИГАЦИЯ */
/* ========================================= */

/* Нижняя панель навигации */
.navigation {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    max-width: 800px;
    width: 100%;
    gap: 10px;
}

/* Кнопки навигации */
.nav-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

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

/* Неактивные кнопки навигации */
.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ========================================= */
/* ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ */
/* ========================================= */

/* Промпт для установки приложения */
.install-prompt {
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%);
    color: white;
    padding: 15px;
    text-align: center;
    display: none;
}

/* Кнопка установки */
.install-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    font-weight: bold;
}

/* ========================================= */
/* АНИМАЦИИ */
/* ========================================= */

/* Анимация плавающего элемента */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================= */
/* МОБИЛЬНЫЕ УСТРОЙСТВА */
/* ========================================= */

@media (max-width: 768px) {
    /* Хедер на мобильных - трехчастная структура */
    .header {
        padding: 15px 10px;
        gap: 10px;
    }
    
    /* Логотип на мобильных */
    .header-logo {
        height: 32px;
    }
    
    /* Заголовок сжимается и переносится */
    .header-center h1 {
        font-size: 16px;
        line-height: 1.1;
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Меню компактнее */
    .menu-toggle {
        padding: 8px;
    }
    
    /* Главная секция на мобильных - вертикальная */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    /* Заголовки на главной странице на мобильных */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Сетка глав на мобильных - одна колонка */
    .chapter-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Оглавление на мобильных */
    .table-of-contents {
        padding: 40px 15px 120px 15px;
    }
    
    .toc-title {
        font-size: 1.5rem;
    }
    
    /* Ссылки глав на мобильных */
    .chapter-link {
        padding: 15px;
    }
    
    .chapter-title {
        font-size: 16px;
    }
    
    /* Контент страницы на мобильных */
    .page-content {
        font-size: 16px;
        padding: 15px;
        padding-bottom: 120px;
    }
    
    /* Кнопки навигации на мобильных */
    .nav-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-width: 70px;
    }
    
    /* Навигационная панель на мобильных */
    .navigation {
        padding: 10px;
    }

    /* Боковая панель на мобильных */
    .sidebar {
        width: 300px;
        right: -300px;
    }
    
    /* Номера глав на мобильных - чуть меньше */
    .chapter-number {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    /* Иконки меню на мобильных */
    .menu-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }
    
    /* Стили библиотеки книг на мобильных */
    .book-cover {
        width: 70px;
        height: 98px;
        margin-right: 15px;
    }

    .book-info {
        padding-left: 15px;
    }

    .book-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .book-description {
        font-size: 0.85rem;
    }

    .library-chapter-card-content {
        align-items: center;
    }
}

/* ========================================= */
/* СТИЛИ ДЛЯ БИБЛИОТЕКИ КНИГ */
/* ========================================= */

/* Стили для обложек книг */
.book-cover {
    width: 100px;
    height: 140px;
    position: relative;
    flex-shrink: 0;
    margin-right: 20px;
    perspective: 1000px;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.2),
        0 2px 4px rgba(0,0,0,0.1),
        inset 0 0 0 1px rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Эффект "корешка" книги */
.book-cover::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 5px;
    width: 6px;
    height: calc(100% - 10px);
    background: linear-gradient(90deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.05) 100%);
    border-radius: 2px 0 0 2px;
    z-index: -1;
}

/* Hover эффекты для обложек */
.chapter-card:hover .book-cover-image {
    transform: translateY(-5px) rotateY(-5deg);
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.2),
        inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* Адаптация существующей структуры карточек */
.library-chapter-card-content {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.book-info {
    flex: 1;
    padding-left: 20px;
}

.book-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #2c3e50;
}

.book-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

/* Эффект загрузки изображения */
.book-cover-image {
    background: linear-gradient(135deg, #f0f2f5 0%, #e6e9ef 100%);
}

.book-cover-image:not([src]) {
    background: linear-gradient(135deg, #5387c1 0%, #5b7d9d 100%);
}

/* Альтернативный фон если изображение не загрузилось */
.book-cover-image::before {
    content: '📖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    z-index: 1;
}

/* ========================================= */
/* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ ДЛЯ MENU-ICON */
/* ========================================= */

/* Финальное переопределение всех стилей menu-icon */
span.menu-icon,
.menu-link span.menu-icon,
.menu-item span.menu-icon {
    background: #5485ba !important;
    background-color: #5485ba !important;
    background-image: none !important;
    width: 27px !important;
    height: 27px !important;
    color: white !important;
    border: none !important;
    border-radius: 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    margin-right: 10px !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Мобильная версия с высочайшим приоритетом */
@media screen and (max-width: 768px) {
    span.menu-icon,
    .menu-link span.menu-icon,
    .menu-item span.menu-icon {
        background: #5485ba !important;
        background-color: #5485ba !important;
        background-image: none !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }
}