/* Общие стили */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: #fbfbfb;
    color: #333;
}

/* Стили для анимации загрузки (три точки) */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #007aff; /* Цвет точек */
    border-radius: 50%;
    opacity: 0.6;
    animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Дополнительные стили для отключённого состояния кнопки отправки */
button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Обновленный класс hidden */
.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.modal.fade-in {
    opacity: 1;
}

.modal.fade-out {
    opacity: 0;
}

.modal-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 30px;
}

.modal-content button {
    padding: 15px 25px;
    margin: 0 10px;
    border: none;
    background-color: #007aff;
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: #0051c7;
}

/* Основной контент */
#main-content {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

#main-content.fade-in {
    opacity: 1;
    pointer-events: auto;
}

/* Шапка сайта */
header {
    background-color: #fff;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-radius: 0 0 20px 20px;
}

header h1 {
    margin: 0;
    font-size: 3em;
    color: #333;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header h2 {
    margin-top: 10px;
    font-size: 1.2em;
    color: #555;
    font-weight: 300;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header h4 {
    color: #c9c9c9;
}

/* Основной контент */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Контейнер для кнопок */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.button-container button, .button-container a {
    margin: 10px;
}

#chat-button {
    padding: 15px 25px;
    border: none;
    background-color: #007aff;
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#chat-button:hover {
    background-color: #0051c7;
}

.telegram-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

/* Стили для иконок Telegram, чтобы сделать их более кликабельными и круглыми */
.telegram-button img {
    width: 100px;
    height: 100px;
    border: 2px solid #007bff; /* Синяя рамка */
    border-radius: 50%; /* Круглая рамка */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Тень */
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s; /* Переходы для анимации */
    cursor: pointer; /* Курсор в виде руки */
    object-fit: cover; /* Масштабирование изображения для заполнения контейнера */
}

.telegram-button img:hover {
    transform: scale(1.05); /* Увеличение при наведении */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2); /* Усиленная тень */
    border-color: #0056b3; /* Изменение цвета рамки при наведении */
    opacity: 0.95; /* Немного уменьшенная непрозрачность */
}

.telegram-button img:active {
    transform: scale(0.95); /* Эффект нажатия */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Уменьшенная тень */
    opacity: 0.9; /* Более уменьшенная непрозрачность */
}

/* Стили для иконок Telegram на мобильных устройствах */
@media (max-width: 480px) {
    .telegram-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        padding: 15px; /* Увеличенные отступы */
        cursor: pointer; /* Курсор в виде руки */
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    }

    .telegram-button img {
        width: 60px;
        height: 60px;
        border: 2px solid #007bff; /* Синяя рамка */
        border-radius: 50%; /* Круглая рамка */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Тень */
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        object-fit: cover; /* Масштабирование изображения для заполнения контейнера */
    }

    .telegram-button:hover img {
        transform: scale(1.05); /* Увеличение при наведении */
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2); /* Усиленная тень */
        border-color: #0056b3; /* Изменение цвета рамки при наведении */
        opacity: 0.95; /* Немного уменьшенная непрозрачность */
    }

    .telegram-button:active img {
        transform: scale(0.95); /* Эффект нажатия */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Уменьшенная тень */
        opacity: 0.9; /* Более уменьшенная непрозрачность */
    }
}

.telegram-button span {
    margin-top: 5px;
    font-size: 1em;
    color: #333;
    text-align: center;
}

.chat-window {
    background-color: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chat-window:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.chat-messages {
    overflow-y: auto;
    margin-bottom: 20px;
    height: 500px;
    border-radius: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages .message {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 70%;
    word-wrap: break-word;
}

.chat-messages .message.user {
    background-color: #007aff;
    color: #fff;
    align-self: flex-end;
}

.chat-messages .message.bot {
    background-color: #e1e1e1;
    color: #333;
    align-self: flex-start;
}

.chat-input {
    display: flex;
}

.chat-input input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none;
    font-size: 1em;
    margin-right: 10px;
    background-color: #f0f0f0; /* Цвет фона по умолчанию */
    transition: background-color 0.3s ease; /* Плавный переход */
}

.chat-input input:not(:focus) {
    background-color: #d0d0d0; /* Более темный цвет для неактивного состояния */
}

.chat-input button {
    padding: 15px 25px;
    border: none;
    background-color: #007aff;
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #0051c7;
}

/* Добавим стили для переключателя и кнопок */
.chat-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-switch label {
    margin-right: 10px;
    font-weight: bold;
}

.toggle-switch select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Стили для кнопок "Очистить историю" и "Ввести ключ" */
.button-group {
    display: flex;
    align-items: center;
}

.button-group button {
    padding: 10px 15px;
    margin-left: 10px;
    border: none;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.button-group button:hover {
    background-color: #e0e0e0;
}

#enter-key-btn {
    background-color: #007aff;
    color: #fff;
}

#enter-key-btn:hover {
    background-color: #0051c7;
}

@media (max-width: 768px) {
    /* Стили для планшетов */
    #clear-history-btn {
        padding: 8px 12px;
        font-size: 0.9em;
        margin-top: 10px;
        margin-left: 0;
        width: 100%; /* Кнопка займет всю ширину */
    }

    .chat-options {
        flex-direction: column;
        align-items: stretch;
    }

    header h1 {
        font-size: 2em;
    }

    .chat-messages {
        height: 400px;
    }

    .button-container {
        flex-direction: column;
    }

    .telegram-button img {
        width: 80px;
        height: 80px;
    }

    .chat-window {
        padding: 15px;
    }

    .chat-input input {
        font-size: 0.9em;
    }

    .chat-input button {
        font-size: 0.9em;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .modal-content button {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .subscriptions {
        padding: 40px 20px;
    }

    .subscription-table th, .subscription-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    /* Стили для телефонов */
    #clear-history-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    header h1 {
        font-size: 1.5em;
    }

    .chat-messages {
        height: 300px;
    }

    .telegram-button img {
        width: 60px;
        height: 60px;
    }

    .telegram-button span {
        font-size: 0.9em;
    }

    .chat-input input {
        font-size: 0.8em;
    }

    .chat-input button {
        font-size: 0.8em;
    }

    .subscription-table th, .subscription-table td {
        padding: 8px;
        font-size: 0.9em;
    }
}

/* Информационная секция */
.subscriptions {
    text-align: center;
    padding: 60px 20px;
    background-color: #fff;
    border-top: 1px solid #ddd;
    border-radius: 20px 20px 0 0;
    opacity: 1;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.subscriptions.animate {
    opacity: 1;
    transform: translateY(0);
}

.subscriptions h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

/* Стили для карточек подписок */
.subscription-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.subscription-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.subscription-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.subscription-card.highlight {
    background-color: #e0f7fa;
    border: 2px solid #007aff;
}

.subscription-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.subscription-card .price {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.subscription-card .old-price {
    color: red;
    text-decoration: line-through;
}

.subscription-card .new-price {
    color: green;
}

.subscription-card ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-bottom: 20px;
}

.subscription-card ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px; /* Увеличен отступ для пространства между галочкой и текстом */
}

.subscription-card ul li::before {
    content: "\2714"; /* Unicode-код символа галочки (✔) */
    position: absolute;
    left: 0;
    color: #8edcab;
    margin-right: 5px; /* Добавлен небольшой отступ справа от галочки */
}

/* Стиль для серой галочки */
.subscription-card ul li.gray-check::before {
    content: "\2714"; /* Unicode-код символа галочки (✔) */
    color: gray; /* Серая галочка */
}

.subscribe-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007aff;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.subscribe-button:hover {
    background-color: #0051c7;
}

/* Стили для активной кнопки подписки */
.active-button {
    background-color: #ccc; /* Серый фон */
    color: #666; /* Темно-серый текст */
    border-radius: 25px;
    padding: 10px 20px;
    display: inline-block;
    font-size: 1em;
    cursor: default; /* Указатель по умолчанию */
    text-align: center;
}

/* Убираем эффект наведения для активной кнопки */
.active-button:hover {
    background-color: #ccc; /* Оставляем тот же цвет */
    color: #666; /* Тот же текст */
    cursor: default; /* Указатель по умолчанию */
}

/* Стили для старой таблицы подписок */
.subscription-table {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border-collapse: collapse;
}

.subscription-table th, .subscription-table td {
    border: none; /* Невидимые границы */
    padding: 15px;
    text-align: center;
}

.subscription-table th {
    background-color: #f9f9f9;
    font-weight: bold;
    font-size: 1.1em;
}

.subscription-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subscription-table tr:hover {
    background-color: #e9e9e9;
}

.subscription-table td:first-child {
    text-align: left;
}

.checkmark {
    color: green;
    font-weight: bold;
}

.crossmark {
    color: red;
    font-weight: bold;
}

.price {
    font-size: 1.2em;
    font-weight: bold;
}

.highlight {
    background-color: #e0f7fa;
    border-radius: 10px;
}

.image-container {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

.image-container img {
    display: block;
    width: 100%;
    height: auto;
}

.image-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.5) 65%, rgba(255, 255, 255, 0.8) 68%, rgba(255, 255, 255, 1) 70%);
    pointer-events: none;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    /* Скрыть таблицу подписок на мобильных устройствах */
    .subscription-table {
        display: none;
    }

    /* Карточки подписок займут всю ширину контейнера */
    .subscription-cards {
        flex-direction: column;
        align-items: center;
    }

    .subscription-card {
        width: 90%;
    }
}

@media (max-width: 480px) {
    /* Дополнительные настройки для очень маленьких экранов */
    .subscriptions {
        padding: 40px 10px;
    }

    .subscription-card {
        padding: 15px;
    }

    .subscription-card h3 {
        font-size: 1.3em;
    }

    .subscription-card .price {
        font-size: 1.1em;
    }

    .subscribe-button {
        font-size: 0.9em;
        padding: 8px 16px;
    }

    .active-button {
        font-size: 0.9em;
        padding: 8px 16px;
    }

    .subscription-card ul li {
        font-size: 0.9em;
    }
}

/* Информационная секция */
.chat-info-section {
    background-color: #fbfbfbfb;
    padding: 20px;
    border-top: 2px solid #ccc;
}

.chat-info-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #333;
}

.chat-info-content h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.chat-info-content p {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

.chat-info-section2 {
    background-color: #ffffffff;
    padding: 20px;
    border-top: 2px solid #ccc;
}

.chat-info-content2 {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #333;
}

.chat-info-content2 h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.chat-info-content2 p {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.video-item video {
    border-radius: 40px; /* Радиус закругления углов */
    overflow: hidden; /* Чтобы закругление работало корректно */
}

.video-item img {
    border-radius: 40px; /* Радиус закругления углов */
}

video {
    max-width: 100%;
    height: auto;
}

.video-item p {
    margin-top: 10px;
}

/* Медиа-запросы для видео-грид */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* Стили для значка HOT */
.hot-label {
    display: inline-block;
    background: linear-gradient(90deg, #a9dfff, #c53fe7); /* Градиент для привлекательности */
    color: #fff; /* Белый текст */
    font-size: 0.8em; /* Чуть меньше заголовка */
    font-weight: bold; /* Жирный текст */
    padding: 4px 8px; /* Внутренние отступы */
    border-radius: 12px; /* Скругленные углы */
    text-transform: uppercase; /* Заглавные буквы */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Легкая тень */
    animation: bounce 1.5s infinite ease-in-out; /* Эффект подпрыгивания */
}

/* Анимация для значка */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Дополнительные стили для всплывающего окна */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.popup-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 400px;
    animation: popupAnimation 0.5s ease;
}

@keyframes popupAnimation {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-content input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.popup-content button {
    padding: 10px 20px;
    border: none;
    background-color: #007aff;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
}

.popup-content button:hover {
    background-color: #0051c7;
}