/* ======================= БАЗА ВИДЖЕТА ======================= */
.vkbot-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    /* Подхватываем шрифты твоего сайта */
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ======================= КНОПКА-ЛОНЧЕР ======================= */
.vkbot-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    /* Градиент как у кнопок твоего сайта */
    background: linear-gradient(135deg, #00b9e4, #7dd3fc);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px -8px rgba(0, 119, 182, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow .3s;
}
.vkbot-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px -10px rgba(0, 185, 228, 0.7);
}
.vkbot-launcher svg { display: block; }

/* ======================= ОКНО ЧАТА ======================= */
.vkbot-window {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 24px; /* Скругление как у карточек на сайте */
    box-shadow: 0 20px 60px -20px rgba(0, 119, 182, 0.35); /* Твоя тень --shadow */
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 185, 228, 0.12);
}
.vkbot-open .vkbot-window { display: flex; }
.vkbot-open .vkbot-launcher { display: none; }

/* ======================= ШАПКА ======================= */
.vkbot-header {
    background: linear-gradient(135deg, #00b9e4, #0077b6);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.vkbot-header-text { flex: 1; min-width: 0; }
.vkbot-header-title {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.vkbot-header-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.vkbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.2);
}
.vkbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}
.vkbot-close:hover { background: rgba(255,255,255,.15); }

/* ======================= СООБЩЕНИЯ ======================= */
.vkbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    background: #f8fbff; /* Цвет фона твоего сайта (--bg) */
}
.vkbot-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px !important;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: normal;
    box-shadow: 0 2px 8px -4px rgba(0, 119, 182, 0.1);
}
.vkbot-msg-bot {
    background: #ffffff;
    color: #0f172a; /* --ink */
    border-bottom-left-radius: 4px;
}
.vkbot-msg-user {
    background: #00b9e4; /* --primary */
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.vkbot-msg a { color: #0077b6; text-decoration: underline; text-decoration-color: rgba(0,185,228,0.4); }
.vkbot-msg-user a { color: #ffffff; text-decoration-color: rgba(255,255,255,0.5); }

/* ======================= ИНДИКАТОР "ПЕЧАТАЕТ" ======================= */
.vkbot-typing { display: flex; gap: 4px; padding: 12px 16px; }
.vkbot-typing span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #7dd3fc; /* --primary-light */
    animation: vkbot-bounce 1.4s infinite ease-in-out both;
}
.vkbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.vkbot-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes vkbot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* ======================= ФОРМА ВВОДА ======================= */
.vkbot-form {
    display: flex;
    border-top: 1px solid rgba(0, 185, 228, 0.12);
    padding: 12px;
    gap: 8px;
    background: #ffffff;
    align-items: center;
}
.vkbot-input {
    flex: 1;
    border: 1px solid rgba(0, 185, 228, 0.2);
    border-radius: 100px; /* --radius-pill */
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.vkbot-input:focus {
    border-color: #00b9e4;
    box-shadow: 0 0 0 3px rgba(0, 185, 228, 0.15);
}
.vkbot-send {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: #00b9e4;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}
.vkbot-send:hover {
    background: #0077b6;
    transform: scale(1.05);
}

/* ======================= СКРЕПКА И ПРЕВЬЮ ======================= */
.vkbot-attach-btn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.vkbot-attach-btn:hover { background: rgba(0, 185, 228, 0.08); color: #00b9e4; }

.vkbot-attach-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fbff;
    border-top: 1px solid rgba(0, 185, 228, 0.12);
}
.vkbot-attach-preview img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 8px;
    object-fit: cover;
}
.vkbot-attach-remove {
    background: rgba(0, 185, 228, 0.1);
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #0077b6;
    transition: background 0.2s;
}
.vkbot-attach-remove:hover { background: rgba(0, 185, 228, 0.2); }

/* ======================= КАРТИНКИ В СООБЩЕНИЯХ ======================= */
.vkbot-msg-image {
    max-width: 100%;
    max-height: 240px;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity .2s;
}
.vkbot-msg-image:hover { opacity: .9; }
.vkbot-msg-user:has(.vkbot-msg-image) {
    max-width: 90%;
    padding: 6px; /* Меньше отступ, если это картинка */
    background: #00b9e4;
}

/* ======================= ЛАЙТБОКС (МОДАЛЬНОЕ ОКНО) ======================= */
.vkbot-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.85); /* Темный фон с оттенком --ink */
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(5px);
}
.vkbot-lightbox.vkbot-lightbox-visible {
    opacity: 1;
    visibility: visible;
}
.vkbot-lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    object-fit: contain;
    background: #fff;
}
.vkbot-lightbox-visible .vkbot-lightbox-img {
    transform: scale(1);
}
.vkbot-lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 40px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}
.vkbot-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ======================= АНИМАЦИЯ ВНИМАНИЯ ======================= */
@keyframes vkbot-jump {
    0%   { transform: translateY(0); }
    15%  { transform: translateY(-12px); }
    30%  { transform: translateY(0); }
    45%  { transform: translateY(-8px); }
    60%  { transform: translateY(0); }
    100% { transform: translateY(0); }
}
.vkbot-pulse .vkbot-launcher {
    animation: vkbot-jump 1s ease-in-out;
    /* Коралловое свечение из твоей палитры (--accent) */
    box-shadow: 0 0 0 8px rgba(244, 63, 94, 0.3);
}

/* ======================= МОБИЛЬНАЯ ВЕРСИЯ ======================= */
@media (max-width: 480px) {
    .vkbot-window {
        position: fixed;
        right: 0; left: 0; bottom: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    /* Делаем шапку липкой, чтобы она не уезжала */
    .vkbot-header {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Вытаскиваем кнопку закрытия поверх всего */
    .vkbot-close {
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 99999999; /* поверх шапки */
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #fff;
        padding: 0;
        margin: 0;
    }
    .vkbot-close:hover {
        background: rgba(0, 0, 0, 0.5);
    }

    /* Чтобы логотип не прилипал вплотную к краю */
    .vkbot-header {
        padding-right: 60px;
    }
}
.vkbot-header-sub {
    transition: opacity 0.4s ease;
}