/* public/css/style.css */

/* --- 1. БАЗОВЫЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ --- */
:root {
    --color-primary: #8A2BE2; /* Яркий фиолетовый для акцентов */
    --color-primary-dark: #7B1FA2; /* Темный фиолетовый для ховеров */
    --color-dark: #1A1A2D;     /* Глубокий темно-синий/фиолетовый фон */
    --color-light: #F4F4F9;    /* Очень светлый фон для контраста */
    --color-text: #333333;     /* Основной цвет текста на светлом фоне */
    --color-text-light: #E0E0E0;/* Основной цвет текста на темном фоне */
    --font-family: 'Montserrat', sans-serif; /* Рекомендую подключить с Google Fonts */
    --container-width: 1140px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* Сброс стилей для консистентности в браузерах */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* Плавный скролл по якорям */
}

body {
    font-family: var(--font-family);
    background-color: var(--color-light);
    color: var(--color-text);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--color-primary-dark);
}

/* --- 2. УТИЛИТАРНЫЕ КЛАССЫ И ОБЩИЕ КОМПОНЕНТЫ --- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section {
    padding: 60px 0;
}

.section--dark {
    background-color: var(--color-dark);
    color: var(--color-text-light);
}

.section__title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    font-weight: 700;
}

/* Стили для кнопок */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-align: center;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.btn--primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn--large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn--header {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--header:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* --- 3. СТИЛИЗАЦИЯ БЛОКОВ --- */

/* HEADER */
.header {
    background-color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
}

.nav {
    display: none; /* Скрываем навигацию на мобильных */
}

/* HERO SECTION */
.hero {
    padding-top: 40px;
    padding-bottom: 60px;
}

.hero__inner {
    display: flex;
    flex-direction: column; /* Столбиком на мобильных */
    text-align: center;
    align-items: center;
}

.hero__content {
    margin-bottom: 40px;
}

.hero__title {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero__subtitle {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #555;
}

.hero__visual img {
    max-width: 80%;
    margin: 0 auto;
}


/* PROBLEMS SECTION */
.problems__grid {
    display: grid;
    grid-template-columns: 1fr; /* Одна колонка на мобильных */
    gap: 25px;
}

.problem-card {
    background-color: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.problem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.problem-card__icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.problem-card__title {
    font-size: 1.3rem;
    margin-bottom: 10px;
}


/* FOOTER */
.footer {
    background-color: var(--color-dark);
    color: var(--color-text-light);
    padding: 40px 0;
    text-align: center;
}

.footer a {
    color: #aaa;
}

.footer a:hover {
    color: #fff;
}

/* Дополнительные стили для новых блоков (УСИЛЕННАЯ ВЕРСИЯ) */
.section__subtitle { text-align: center; max-width: 700px; margin: -30px auto 40px; color: #777; }
.section--dark .section__subtitle { color: #ccc; }

.solution__grid, .how-it-works__grid, .testimonials__grid { display: grid; gap: 30px; }

/* Стили для светлых блоков */
.how-it-works__step { background: #fff; text-align: center; padding: 25px; border-radius: var(--border-radius); }
.step__number { width: 50px; height: 50px; background: var(--color-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; margin: 0 auto 15px; }

/* Стили для тёмных блоков - УСИЛЕННАЯ ВЕРСИЯ */
.section--dark .solution-item,
.section--dark .testimonial-card {
    background: rgba(255,255,255,0.05);
    padding: 25px;
    border-radius: var(--border-radius);
    color: var(--color-text-light) !important; /* Указываем светлый цвет и повышаем приоритет */
}
.section--dark .solution-item h3 {
    color: #fff !important; /* Делаем заголовки белыми с высоким приоритетом */
    margin-bottom: 10px;
}
.section--dark .solution-item p,
.section--dark .testimonial-card p {
    color: var(--color-text-light) !important; /* Текст параграфов тоже делаем светлым */
}
.testimonial-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.testimonial-author { display: flex; align-items: center; gap: 15px; margin-top: 20px; }
.testimonial-author img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.section--dark .testimonial-author span {
    font-weight: 700;
    color: #fff !important; /* Текст автора тоже делаем светлым с высоким приоритетом */
}

/* Демонстрация */
.demo-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 40px; }
.demo-gallery img { border-radius: var(--border-radius); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

/* Форма заявки */
.form-container { max-width: 600px; margin: 0 auto; background: #fff; padding: 40px; border-radius: var(--border-radius); box-shadow: 0 5px 20px rgba(0,0,0,0.08); }
#request-form { display: flex; flex-direction: column; gap: 15px; }
#request-form input, #request-form textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: var(--border-radius); font-family: var(--font-family); font-size: 1rem; }
#request-form textarea { resize: vertical; min-height: 100px; }

/* Адаптивность для сеток */
@media(min-width: 768px) {
    .solution__grid { grid-template-columns: repeat(3, 1fr); }
    .how-it-works__grid { grid-template-columns: repeat(3, 1fr); }
    .testimonials__grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- 4. АДАПТИВНОСТЬ (MEDIA QUERIES) --- */

/* Для планшетов и больше */
@media (min-width: 768px) {
    .nav {
        display: flex;
        gap: 25px;
    }

    .btn--header {
        /* Прячем кнопку на мобильных, чтобы не было слишком много элементов */
        /* На десктопе можно и показать, но часто скрывают и оставляют в меню */
    }

    .hero__inner {
        flex-direction: row; /* В строку на больших экранах */
        text-align: left;
        align-items: center;
        gap: 40px;
    }

    .hero__content {
        flex: 1; /* Занимает половину пространства */
    }

    .hero__visual {
        flex: 1; /* Занимает вторую половину */
    }

    .hero__visual img {
        max-width: 100%;
    }

    .problems__grid {
        grid-template-columns: repeat(2, 1fr); /* Две колонки */
    }
}

/* Для десктопов */
@media (min-width: 1024px) {
    .section__title {
        font-size: 3rem;
    }

    .hero__title {
        font-size: 3.2rem;
    }

    .problems__grid {
        grid-template-columns: repeat(4, 1fr); /* Четыре колонки */
    }
}

/* --- 5. СТИЛИ ДЛЯ ИНТЕРАКТИВНЫХ ЭЛЕМЕНТОВ (ИСПРАВЛЕННАЯ ВЕРСИЯ) --- */

/* Стили для Бургера */
.burger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
    /* Убираем кнопку "Войти в бот" из хедера на мобильных */
    margin-left: auto;
}

/* Скрываем кнопку в хедере на мобильных */
.header .btn--header {
    display: none;
}


.burger__line {
    width: 30px;
    height: 3px;
    background-color: var(--color-dark);
    border-radius: 3px;
    transition: all var(--transition-speed) ease-in-out;
}

/* Анимация бургера в крестик */
.burger.active .burger__line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}
.burger.active .burger__line:nth-child(2) {
    opacity: 0;
}
.burger.active .burger__line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Стили для мобильного меню */
.nav {
    display: flex; /* <-- ВОТ ГЛАВНОЕ ИСПРАВЛЕНИЕ! Было display: none; */
    position: fixed;
    top: 0;
    right: -100%; /* Уезжает за экран */
    height: 100vh;
    background-color: var(--color-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: right var(--transition-speed) ease-in-out;
    z-index: 105;
    gap: 15px;
}

/* Кнопка "Войти в бот", которая будет внутри мобильного меню */
.nav .btn--header-mobile {
    display: block; /* Показываем ее только здесь */
    margin-top: 30px;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}


.nav.active {
    right: 0; /* Приезжает на экран */
}

.nav__link {
    color: #fff;
    font-size: 1.5rem;
    margin: 10px 0;
}

/* Стили для FAQ аккордеона (без изменений) */
.faq__container { max-width: 800px; margin: 0 auto; }
.faq-item { background: #fff; margin-bottom: 10px; border-radius: var(--border-radius); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.faq-item__question { padding: 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.faq-item__icon { font-size: 1.5rem; font-weight: 300; transition: transform var(--transition-speed); }
.faq-item.active .faq-item__icon { transform: rotate(45deg); }
.faq-item__answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-speed) ease-out, padding var(--transition-speed) ease-out; padding: 0 20px; color: #555; }
.faq-item.active .faq-item__answer { max-height: 200px; padding: 0 20px 20px; }

/* Стили для анимации при скролле (без изменений) */
.section__title, .problem-card, .hero__content, .hero__visual, .how-it-works__step, .solution-item, .demo-gallery img, .testimonial-card, .form-container { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.section__title.is-visible, .problem-card.is-visible, .hero__content.is-visible, .hero__visual.is-visible, .how-it-works__step.is-visible, .solution-item.is-visible, .demo-gallery img.is-visible, .testimonial-card.is-visible, .form-container.is-visible { opacity: 1; transform: translateY(0); }
.problem-card:nth-child(2) { transition-delay: 0.1s; } .problem-card:nth-child(3) { transition-delay: 0.2s; } .problem-card:nth-child(4) { transition-delay: 0.3s; }
.how-it-works__step:nth-child(2) { transition-delay: 0.1s; } .how-it-works__step:nth-child(3) { transition-delay: 0.2s; }

/* Класс для блокировки скролла */
body.no-scroll { overflow: hidden; }

/* Переопределяем стили для десктопа */
@media (min-width: 820px) {
    .burger { display: none; }
    /* Возвращаем кнопку в хедер на десктопе */
    .header .btn--header { display: inline-block; }
    .nav { position: static; flex-direction: row; height: auto; width: auto; background-color: transparent; gap: 25px; }
    .nav__link { color: var(--color-text); font-size: 1rem; margin: 0; }
    .nav__link:hover { color: var(--color-primary); }
    /* Прячем мобильную кнопку на десктопе */
    .nav .btn--header-mobile { display: none; }
}