/* Стили для виртуального менеджера */
.vm-widget-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Переместили влево, чтобы не перекрывать кнопку Telegram */
    right: auto;
    z-index: 9998;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Кнопка открытия чата */
.vm-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 10000;
}

.vm-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6);
}

.vm-toggle-btn i {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.vm-toggle-btn.active i {
    transform: rotate(90deg);
    /* Пример анимации иконки при открытии */
}


/* Контейнер чата */
.vm-chat-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: auto;
    width: 350px;
    max-height: 500px;
    /* Ограничение высоты */
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    /* Чтобы не мешал кликам когда скрыт */
}

.vm-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Заголовок чата */
.vm-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vm-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #764ba2;
    font-size: 20px;
    flex-shrink: 0;
}

.vm-title h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.vm-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.vm-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.vm-close-btn:hover {
    opacity: 1;
}

/* Область сообщений */
.vm-chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
}

/* Сообщения */
.vm-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: messageFadeIn 0.3s ease-out forwards;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vm-message.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.vm-message.user {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

/* Список вопросов (кнопки) */
.vm-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.vm-question-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 8px 12px;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.vm-question-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(3px);
}

/* Индикатор ввода (точки) */
.vm-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.vm-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.vm-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.vm-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Кнопка "Написать в Telegram" внутри чата */
.vm-telegram-link {
    display: inline-block;
    margin-top: 10px;
    background: linear-gradient(135deg, #0088cc 0%, #00bfa5 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    transition: transform 0.2s;
    text-align: center;
}

.vm-telegram-link:hover {
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3);
}

/* Адаптив */
@media (max-width: 480px) {
    .vm-chat-window {
        width: 300px;
        bottom: 70px;
        left: 0;
        /* Выравнивание по левому краю контейнера */
        right: auto;
    }
}