/* -------------------- */
/* Кнопка открытия чата */
/* -------------------- */
#chat-open-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: #007bdb;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 99998;
    transition: transform 0.3s;
    animation: pulse 2s infinite;
}

    #chat-open-btn:hover {
        transform: scale(1.1);
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.chat-logo {
    width: 32px;
    filter: brightness(0) invert(1);
}

/* -------------------- */
/* Виджет чата */
/* -------------------- */
#chat-widget {
    width: 420px;
    height: 70vh;
    max-height: 680px;
    background: #fff;
    position: fixed;
    bottom: 95px;
    right: 22px;
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
    z-index: 99999;
}


@keyframes fadeInUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* -------------------- */
/* Заголовок чата */
/* -------------------- */
#chat-header {
    background: #007bdb;
    color: white;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-logo {
    width: 28px;
    filter: brightness(0) invert(1);
}

#chat-close {
    cursor: pointer;
    font-size: 18px;
}

/* -------------------- */
/* Тело чата */
/* -------------------- */
#chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f9fc;
    display: flex;
    flex-direction: column;
}

/* -------------------- */
/* Сообщения */
/* -------------------- */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin: 5px 0;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Сообщения пользователя — справа */
.msg-user {
    text-align: right;
    background-color: #d1e7ff;
    color: #003b73;
    display: inline-block;
    margin-left: auto;
    margin-right: 0;
    align-self: flex-end;
}

/* Сообщения бота — слева */
.msg-bot {
    text-align: left;
    background-color: #f1f1f1;
    border: 1px solid #c9e6ff;
    color: #003b73;
    display: inline-block;
    margin-right: auto;
    margin-left: 0;
    align-self: flex-start;
}

/* -------------------- */
/* Блок ввода */
/* -------------------- */
#chat-input-block {
    display: flex;
    border-top: 1px solid #ddd;
    background: white;
}

#chat-input {
    flex: 1;
    border: none;
    padding: 12px;
    outline: none;
    font-size: 14px;
}

#chat-send {
    width: 55px;
    border: none;
    background: #007bdb;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

    #chat-send:hover {
        background-color: #0056b3;
    }

/* -------------------- */
/* Подсказки-кнопки */
/* -------------------- */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.suggestion-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

    .suggestion-btn:hover {
        background-color: #0056b3;
        transform: scale(1.05);
    }

@media (max-width: 576px) {

    #chat-open-btn {
        width: 56px;
        height: 56px;
        right: 16px;
        bottom: 16px;
    }

    #chat-widget {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    #chat-header {
        padding: 12px;
        font-size: 15px;
    }

    #chat-body {
        padding: 12px;
    }

    .message {
        font-size: 14px;
        max-width: 90%;
    }

    #chat-input {
        font-size: 16px;
        padding: 14px;
    }

    #chat-send {
        width: 60px;
        font-size: 22px;
    }
}

@media (min-width: 577px) and (max-width: 991px) {

    #chat-widget {
        width: 360px;
        height: 600px;
        right: 18px;
        bottom: 90px;
    }

    .message {
        font-size: 14px;
        max-width: 85%;
    }
}

@media (min-width: 992px) and (max-width: 1440px) {
    #chat-widget {
        width: 380px;
        height: 65vh;
        max-height: 620px;
    }
}

