/* Кнопка поддержки */
#support-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100px; /* Увеличено в 2 раза от предыдущих 50px */
    height: 100px;
    background-color: #007bff; /* Синий, как указано */
    border-radius: 50%; /* Круглый */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px; /* Размер иконки увеличен пропорционально */
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Тень для темной темы */
    z-index: 1000;
    transition: transform 0.3s;
}

#support-btn:hover {
    transform: scale(1.1);
}

/* Модалка чата (темная тема) */
.chat-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8); /* Более темный фон */
    align-items: center;
    justify-content: center;
    overflow:hidden;
}

.chat-modal-content {
    position: relative; /* Для позиционирования крестика */
    background-color: #1c1c1e; /* Темный фон (почти черный) */
    margin: 5% auto; /* Центрирование */
    padding: 0; /* Убрано общее padding, чтобы header и content были отдельно */
    border: 1px solid #333; /* Темная граница */
    width: 90%; /* Почти весь экран на мобильных */
    max-width: 600px; /* Для десктопа */
    height: 80vh; /* Для десктопа */
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    color: #e0e0e0; /* Светлый текст */
    overflow: hidden; /* Чтобы скролл не выходил за границы */
}

.chat-header {
    background-color: #2c2c2e; /* Темный заголовок */
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    position: relative;
    display: flex;
    justify-content: space-between; /* Заголовок слева, крестик справа */
    align-items: center;
}

.chat-title {
    margin: 0;
    font-size: 18px;
    color: #e0e0e0; /* Светлый текст */
    font-weight: bold;
    display: flex;
    align-items: center;
}

.chat-title i {
    margin-right: 10px; /* Отступ от иконки до текста */
    font-size: 20px; /* Размер иконки */
    color: #007bff; /* Синий для иконки */
}

.chat-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.chat-close:hover,
.chat-close:focus {
    color: #fff; /* Белый на hover для темной темы */
    text-decoration: none;
}

.chat-history {
    flex: 1;
    display: flex; /* Добавлено для выравнивания сообщений */
    flex-direction: column; /* Сообщения в столбец */
    overflow-y: auto;
    padding: 10px;
    border: none; /* Убрана граница, чтобы не дублировать */
    background-color: #2c2c2e; /* Темный фон истории */
}

.chat-history .message {
    margin: 10px 0;
    padding: 10px 15px;
    max-width: 80%; /* Как в Jivo, не на всю ширину */
    border-radius: 20px; /* Закругленные углы для bubble */
    color: #e0e0e0;
    word-wrap: break-word;
}

.chat-history .sent {
    background-color: #3a3a3c; /* Изменено на темно-серый, вместо синего */
    align-self: flex-end; /* Мои сообщения справа */
    border-radius: 20px 20px 0 20px; /* Закруглено слева снизу */
}

.chat-history .received {
    background-color: #4a4a4c; /* Чуть светлее серый для полученных (поддержки) */
    align-self: flex-start; /* Сообщения поддержки слева */
    border-radius: 20px 20px 20px 0; /* Закруглено справа снизу */
}

.chat-history .message .time {
    font-size: 12px; /* Меньший шрифт для времени */
    color: #aaa; /* Серый цвет для отличия */
    font-weight: normal; /* Не жирный */
    margin-right: 5px; /* Отступ от времени до остального текста */
}

.chat-input-area {
    display: flex;
    padding: 15px 10px; /* Добавлен отступ сверху и снизу (15px снизу для отступа от низа модалки) */
    background-color: #1c1c1e; /* Темный фон для ввода */
    border-top: 1px solid #333;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #333;
    border-radius: 20px; /* Закругленное поле ввода, как в Jivo */
    background-color: #2c2c2e;
    color: #e0e0e0;
    margin-right: 10px;
}

#chat-input::placeholder {
    color: #aaa;
}

#chat-send {
    padding: 10px 20px;
    background-color: #007bff; /* Синий для кнопки */
    color: white;
    border: none;
    border-radius: 20px; /* Закругленная кнопка */
    cursor: pointer;
}

#chat-send:hover {
    background-color: #0056b3; /* Темнее синий на hover */
}

/* Responsive для мобильных */
@media (max-width: 600px) {
    .chat-modal-content {
        width: 95%;
        height: 85vh; /* Чуть меньше по высоте, как просил */
        margin: 7.5% auto; /* Центрирование с отступом */
    }

    #support-btn {
        width: 80px; /* Увеличено в 2 раза от предыдущих 40px на мобильных */
        height: 80px;
        font-size: 40px;
    }
}

.chat-history::-webkit-scrollbar {
    width: 8px; /* Ширина скролла */
}

.chat-history::-webkit-scrollbar-track {
    background: #2c2c2e; /* Цвет трека */
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #4a4a4c; /* Цвет ползунка */
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #5a5a5c; /* Hover для ползунка */
}

/* Для Firefox */
.chat-history {
    scrollbar-width: thin;
    scrollbar-color: #4a4a4c #2c2c2e;
}