/* Глобальный адаптор */
* {
    max-width: 100vw; /* Ни один элемент не может быть шире экрана */
    box-sizing: border-box; /* Считает отступы внутрь, а не наружу */
}

html, body {
    overflow-x: hidden; /* Запрещает горизонтальную прокрутку (тряску сайта влево-вправо) */
    width: 100%;
    position: relative;
}
/* ========================================= */
/* 1. БАЗОВЫЕ СТИЛИ */
/* ========================================= */
:root {
    --primary-color: #007bff; /* Основной синий для кнопок/акцентов */
    --secondary-color: #1a1a1a; /* Темный цвет для текста */
    --background-color: #f4f7f6; /* Светлый фон */
    --card-bg: #ffffff; /* Фон карточек/модального окна */
    --success-color: #28a745; /* Зеленый для успеха */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--secondary-color);
    line-height: 1.6;
}

/* ========================================= */
/* 2. ШАПКА И ССЫЛКИ */
/* ========================================= */

@media (min-width: 768px) {
    .header-right {
        width: auto; /* На компьютерах возвращаем как было в ряд */
    }
    .main-header {
        justify-content: space-between;
    }
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
}

.auth-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.auth-link:hover {
    background-color: var(--primary-color);
    color: var(--card-bg);
}

/* ========================================= */
/* 3. ОСНОВНОЙ КОНТЕНТ ЛЕНДИНГА */
/* ========================================= */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.center-content {
    text-align: center;
    padding: 60px 0;
}

.hero-section h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.hero-section p {
    font-size: 1.2em;
    max-width: 700px;
    margin: 0 auto;
}

/* 4. ОТЗЫВЫ */
.reviews-section {
    padding: 40px 0;
    background-color: #e9ecef;
    text-align: center;
}

.reviews-section h2 {
    margin-bottom: 30px;
}

.review-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.review-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* width: 300px;   <-- Можно заменить на строку ниже */
    flex: 1 1 300px; 
    max-width: 350px;
    text-align: left;
    transition: transform 0.3s;
}

.review-card:hover {
    transform: translateY(-5px);
}

.reviewer-name {
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    text-align: right;
}

/* 5. КНОПКА ПОКУПКИ */
.cta-section {
    padding: 50px 0;
}

.buy-button, .buy-link-button {
    background: linear-gradient(45deg, #0056b3, var(--primary-color));
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
    transition: background 0.3s, transform 0.2s;
    text-decoration: none; 
    display: inline-block;
}

.buy-button:hover, .buy-link-button:hover {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    transform: translateY(-2px);
}

/* 6. МОДАЛЬНОЕ ОКНО ЛЕНДИНГА */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); 
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto; 
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.product-list li i {
    color: var(--primary-color);
    margin-right: 10px;
}

.gift-section {
    padding: 15px;
    background-color: #f0fff0;
    border: 1px solid var(--success-color);
    border-radius: 5px;
    margin-bottom: 20px;
}

.price-box {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
}

.price-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-color);
}
/* Добавьте стили для адаптивности сюда */
@media (max-width: 768px) {
    .review-grid {
        flex-direction: column;
        align-items: center;
    }
}
/* ========================================= */
/* 7. АДАПТИВНОСТЬ И ФИКСЫ (W2026) */
/* ========================================= */

/* Убираем горизонтальный скролл всей страницы */
html, body {
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    .review-grid {
        flex-direction: column;
        align-items: center;
    }
}

/* ФИНАЛЬНЫЙ БЛОК ДЛЯ МОБИЛОК (До 600px) */
@media (max-width: 600px) {
    /* Фиксируем шапку в одну строку */
    .main-header {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px !important;
        gap: 5px !important;
    }

    .header-right {
        display: flex !important;
        width: auto !important; 
        gap: 8px !important;
        flex-shrink: 0;
        justify-content: flex-end !important;
    }

    .logo {
        font-size: 1.1em !important; 
        flex-shrink: 1;
    }

    /* 1. Уменьшаем иконки флагов и темы на треть */
    .lang-ball, .theme-toggle {
        width: 28px !important; 
        height: 28px !important;
        min-width: 28px;
        font-size: 14px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .lang-ball img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        border-radius: 50%;
    }

    /* 2. Скрываем текст в кнопке Войти/Кабинет и красим иконку в зеленый */
    .login-btn-text, .auth-link span, .logout-text {
        display: none !important; 
    }

    /* Применяем стиль ко всем состояниям и вложенным элементам */
.login-btn, 
.auth-link, 
.logout-btn,
.logout-btn span,
.logout-btn i {
    color: #007bff !important; /* Принудительный синий */
    text-decoration: none !important;
}

/* Специально для ссылок: сброс системных цветов */
.logout-btn:link, 
.logout-btn:visited, 
.logout-btn:hover, 
.logout-btn:active {
    color: #007bff !important;
    text-decoration: none !important;
}

/* Оставляем зеленый ТОЛЬКО для мобильной иконки */
@media (max-width: 600px) {
    .login-btn i, 
    .auth-link i, 
    .logout-btn i {
        color: #28a745 !important; /* Тот самый зеленый на мобильных */
    }
}

/* Центровка и отступы (твой код) */
.login-btn, .auth-link, .logout-btn {
    padding: 5px !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

/* Эффект при нажатии */
.logout-btn:active i {
    transform: scale(0.9);
    opacity: 0.8;
}

    /* 3. Вернуться на главную -> Иконка домика */
    .back-home-text {
        display: none !important; 
    }
    
    .back-home-link::before {
        content: "\f015"; /* Код иконки дома FontAwesome */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 22px;
        color: var(--primary-color);
    }
}

/* Исправление модальных окон */
.modal {
    z-index: 9999 !important;
}

/* ... твой предыдущий код модальных окон ... */
.modal-content {
    z-index: 10000 !important;
    margin: 20% auto;
}

/* ========================================= */
/* 8. СПЕЦИАЛЬНЫЙ ФИКС ДЛЯ ЛИЧНОГО КАБИНЕТА  */
/* ========================================= */

/* 1. Делаем текст ЯРКО-СИНИМ и предотвращаем его исчезновение */
.sidebar .sidebar-nav ul li, 
.sidebar .menu-item-with-submenu span,
.sidebar .nav-link {
    color: #007bff !important; /* Твой ярко-синий */
    display: flex !important;   /* ПРИНУДИТЕЛЬНО показываем текст (отмена display:none выше) */
    align-items: center !important;
    font-weight: 500 !important;
}

/* 2. Иконки - оставляем белыми (или синими), даем отступ */
.sidebar i {
    margin-right: 12px !important;
    min-width: 20px !important;
    text-align: center !important;
}

/* 3. Убираем наложение и возвращаем отступы */
.sidebar ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar li {
    padding: 12px 20px !important; 
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* 4. ФОН КОНТЕНТА (Тёмно-синий как на лендинге) */
#mainContent.main-content {
    background-color: #0a192f !important; /* Тот самый темно-синий */
    color: #ffffff !important;           /* Текст внутри уроков - белый */
    padding: 30px !important;
}
/* 5. АДАПТИВНОСТЬ ТАБЛИЦ ИЗ БАЗЫ ДАННЫХ */
#mainContent table, 
.lesson-content table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important; /* Включает горизонтальную прокрутку */
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05); /* Легкий фон, чтобы таблицу было видно на темном */
}

/* Фикс для ячеек, чтобы текст не слипался */
#mainContent table td, 
#mainContent table th {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px; /* Чтобы колонки не сжимались в "ниточку" */
}

/* 6. ФИКС ПРОКРУТКИ ДО КОНЦА (Чтобы контент не обрезался внизу) */
#mainContent {
    padding-bottom: 100px !important; 
    height: auto !important;
    min-height: 100vh;
}