/* Шрифты */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap&subset=cyrillic,latin');

:root {
    /* Основные цвета светлой темы */
    --primary-color: #6c63ff;
    --primary-light: #8a84ff;
    --primary-dark: #4b44d1;
    --secondary-color: #e6e0fc;
    --accent-color: #5851db;
    --text-color: #333344;
    --light-text: #333344;
    --border-color: rgba(0, 0, 0, 0.06);
    --bg-color: #f9f9fb;
    --bg-gradient-1: #f9f9fb;
    --bg-gradient-2: #f0f0f5;
    
    /* Элементы интерфейса */
    --header-height: 70px;
    --shadow: 0 4px 16px rgba(98, 87, 255, 0.06);
    --shadow-small: 0 2px 8px rgba(98, 87, 255, 0.04);
    --shadow-hover: 0 6px 24px rgba(98, 87, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius: 10px;
    --border-light: 1px solid rgba(255, 255, 255, 0.06);
    --border-dark: 1px solid rgba(0, 0, 0, 0.05);
    
    /* Полупрозрачные фоны */
    --overlay-light: rgba(108, 99, 255, 0.04);
    --overlay-dark: rgba(108, 99, 255, 0.06);
    --glassmorphism: rgba(249, 249, 251, 0.9);
    --header-bg: rgba(249, 249, 251, 0.98);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    transition: all 0.4s ease;
    font-weight: 400;
}

/* Заголовок */
header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--light-text);
    height: var(--header-height);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: var(--shadow-small);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    transition: all 0.4s ease;
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-left: 50px;
    color: var(--light-text);
    letter-spacing: 0.2px;
}

/* Кнопки в хедере */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 20px;
}

/* Кнопка выхода */
.exit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--light-text);
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    transition: all 0.3s ease;
}

.exit-btn:hover {
    background: var(--overlay-light);
    transform: translateY(-2px);
}

.exit-btn svg {
    width: 20px;
    height: 20px;
}

/* Кнопка меню */
.menu-toggle {
    position: absolute;
    left: 20px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 200;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--light-text);
    border-radius: 4px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Основной контейнер */
.container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    transition: background 0.4s ease;
    overflow: hidden;
}

/* Боковое меню */
.sidebar {
    width: 260px;
    background: var(--bg-color);
    box-shadow: var(--shadow-small);
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.4s ease, background 0.4s ease;
    z-index: 99;
    border-right: 1px solid var(--border-color);
}

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

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.sidebar.active {
    transform: translateX(0);
}

/* Вкладки */
.tabs {
    display: flex;
    background: var(--bg-color);
    overflow-x: auto;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.tabs.hidden {
    display: none;
}

.tabs::-webkit-scrollbar {
    height: 0;
    display: none;
}

.tab {
    flex: 1;
    padding: 16px;
    color: var(--light-text);
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    min-width: 80px;
    opacity: 0.7;
}

.tab:hover {
    background-color: var(--overlay-light);
    opacity: 0.9;
}

.tab.active {
    opacity: 1;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Содержимое вкладок */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    display: block;
}

/* Темы */
.topic {
    border-bottom: 1px solid var(--border-color);
}

.topic-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 15px 16px;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: var(--light-text);
    font-weight: 400;
}

.topic-btn:hover {
    background-color: var(--overlay-light);
    padding-left: 18px;
}

.topic-btn::after {
    content: '\002B';
    font-size: 1.2rem;
    transition: var(--transition);
    opacity: 0.7;
}

.topic-btn.active {
    color: var(--primary-color);
    font-weight: 500;
}

.topic-btn.active::after {
    content: '\2212';
    color: var(--primary-color);
}

/* Подтемы */
.subtopics {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: var(--overlay-dark);
}

.subtopic {
    display: block;
    padding: 12px 16px 12px 18px;
    text-decoration: none;
    color: var(--light-text);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 32px;
}

.subtopic:hover {
    background-color: var(--overlay-light);
    color: var(--primary-color);
}

/* Основной контент */
.content {
    flex-grow: 1;
    margin-left: 0;
    padding: 25px;
    transition: margin 0.4s ease, background 0.4s ease;
    overflow-x: hidden;
}

.content.sidebar-active {
    margin-left: 260px;
}

.welcome {
    max-width: 800px;
    margin: 20px auto;
    background: rgba(var(--bg-color), 0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
}

.welcome h1 {
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
    font-size: 2rem;
    position: relative;
}

.welcome p {
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 1rem;
}

.welcome h2 {
    color: var(--primary-color);
    margin: 30px 0 15px;
    font-size: 1.4rem;
    font-weight: 500;
}

.welcome ul {
    margin: 0 0 20px 20px;
    color: var(--text-color);
}

.welcome ul li {
    margin-bottom: 10px;
}

/* Стилизация прокрутки для всей страницы */
body::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

/* Адаптивный дизайн */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 260px;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .header-title {
        margin-left: 20px;
    }
}

@media (max-width: 768px) {
    .welcome {
        padding: 25px;
    }
    
    .welcome h1 {
        font-size: 1.6rem;
    }
    
    .welcome h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .header-title {
        font-size: 1.3rem;
        margin-left: 30px;
    }
    
    .welcome {
        padding: 20px;
        margin: 10px auto;
    }
    
    .header-buttons {
        gap: 10px;
        margin-right: 10px;
    }
}

/* Стили для секции с обратной связью */
.feedback-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    color: #4a9eff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-link i {
    margin-right: 8px;
    font-size: 18px;
}

.contact-link:hover {
    color: #6db5ff;
    transform: translateX(5px);
}

/* Стили для элементов с темным фоном */
.resources-section, 
.practice-tips, 
.interactive-resources,
.next-steps,
.visual-guide,
.operators-cheatsheet,
.conclusion {
    color: #e6e6e6; /* Светлый текст для темного фона */
}

/* Стили для важных заметок с темным фоном */
.resources-section p, 
.practice-tips p, 
.interactive-resources p,
.next-steps p,
.visual-guide p,
.operators-cheatsheet p,
.conclusion p {
    color: #e6e6e6;
}

/* Стили для списков в блоках с темным фоном */
.resources-section li, 
.practice-tips li, 
.interactive-resources li,
.next-steps li,
.visual-guide li,
.operators-cheatsheet li {
    color: #e6e6e6;
}

/* Стили для заголовка "Важно понимать разницу" */
.resources-section h4,
.practice-tips h4,
.interactive-resources h4,
.next-steps h4,
.visual-guide h4,
.operators-cheatsheet h4,
.conclusion h4 {
    color: #58a6ff; /* Яркий голубой для заголовков */
}

/* Улучшенные стили для таблиц в темных блоках */
.operators-cheatsheet table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    color: #e6e6e6; /* Светлый текст для всей таблицы */
}

.operators-cheatsheet th,
.operators-cheatsheet td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #4d5566; /* Более контрастная граница */
    color: #e6e6e6; /* Явно задаем цвет текста */
}

.operators-cheatsheet th {
    background-color: #373e47;
    color: #58a6ff; /* Голубой цвет для заголовков */
    font-weight: 600;
}

.operators-cheatsheet td {
    background-color: #2d333b; /* Темный фон для ячеек */
}

/* Стили для светлой темы */
.light-theme .operators-cheatsheet table {
    color: #333344; /* Темный текст для светлой темы */
}

.light-theme .operators-cheatsheet th,
.light-theme .operators-cheatsheet td {
    border: 1px solid #d0d7de;
    color: #333344;
}

.light-theme .operators-cheatsheet th {
    background-color: #e6e6e6;
    color: #0366d6;
}

.light-theme .operators-cheatsheet td {
    background-color: #f6f8fa;
}

/* Улучшенные стили для визуальных блоков */
.visual-guide {
    background-color: #2d333b;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    border-left: 4px solid #7ee787;
}

.visual-guide h4 {
    color: #7ee787;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.visual-guide ul {
    margin-left: 20px;
}

.visual-guide li {
    color: #e6e6e6;
    margin-bottom: 12px;
    line-height: 1.5;
}

.visual-guide strong {
    color: #7ee787;
    font-weight: 600;
}

.visual-guide p {
    color: #e6e6e6;
    margin-bottom: 10px;
}

/* Стили для светлой темы */
.light-theme .visual-guide {
    background-color: #f1f1f1;
    border-left: 4px solid #2ea44f;
}

.light-theme .visual-guide h4 {
    color: #2ea44f;
}

.light-theme .visual-guide li,
.light-theme .visual-guide p {
    color: #333344;
}

.light-theme .visual-guide strong {
    color: #2ea44f;
}

/* Улучшенные стили для блока заключения */
.conclusion {
    background-color: #2d333b;
    border-radius: 8px;
    padding: 25px 30px;
    margin: 40px auto;
    border-left: 4px solid #d2a8ff;
    text-align: center;
    max-width: 800px;
}

.conclusion h3 {
    color: #d2a8ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

.conclusion p {
    color: #e6e6e6;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Стили для светлой темы */
.light-theme .conclusion {
    background-color: #f1f1f1;
    border-left: 4px solid #8a63d2;
}

.light-theme .conclusion h3 {
    color: #6f42c1;
}

.light-theme .conclusion p {
    color: #333344;
}
