/* =====================================================================
   Авемедий — стили страницы /assistant и плавающего виджета.
   Все классы с префиксом av- или assistant- чтобы не конфликтовать
   с вашими существующими стилями. Цветовая палитра подогнана под
   ваш сайт (warning = жёлтый Bootstrap), также используется
   фирменный оранжевый из жилетки кота для акцентов чата.
   ===================================================================== */

:root {
    --av-primary:   #e95a2b;   /* оранжевый из жилетки Авемедия */
    --av-primary-2: #ffb547;
    --av-warning:   #ffc107;   /* стандартный btn-warning Bootstrap */
    --av-dark:      #2b2b3a;
    --av-bubble-bot:#f1f1f6;
    --av-bubble-user:#e95a2b;
    --av-shadow:    0 8px 24px rgba(0,0,0,.08);
    --av-radius:    14px;
}

/* ---------- HERO ---------- */
.av-hero { padding: 20px 0; }
.av-avatar-wrap { position: relative; display: inline-block; }
.av-avatar {
    width: 260px; max-width: 80%;
    border-radius: 50%;
    box-shadow: var(--av-shadow);
    background: #fff;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}
.av-status {
    position: absolute; bottom: 10px; right: 10px;
    background: #fff; padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: #2bb05a;
    box-shadow: var(--av-shadow);
}
.av-status .av-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #2bb05a; margin-right: 6px;
    animation: av-pulse 1.6s infinite;
}
@keyframes av-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(43,176,90,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(43,176,90,0); }
    100% { box-shadow: 0 0 0 0 rgba(43,176,90,0); }
}
.av-title { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.av-lead  { font-size: 16px; line-height: 1.5; margin-bottom: 14px; }
.av-bullets li { padding: 3px 0; font-size: 15px; }

/* ---------- ВИДЕО ---------- */
.av-video-frame {
    max-width: 720px;
    border-radius: var(--av-radius);
    overflow: hidden;
    box-shadow: var(--av-shadow);
    background: #000;
}
.av-video-frame video { display: block; }

/* ---------- ЧАТ-КАРТА (вписана в .card .border-warning) ---------- */
.av-chat-card { box-shadow: var(--av-shadow); overflow: hidden; }
.av-chat-header {
    display: flex !important; align-items: center; gap: 12px;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #ffc107, #ffb547) !important;
    color: #2b2b3a;
    border-bottom: 1px solid #ffe082;
}
.av-chat-header-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: #fff; object-fit: cover; flex-shrink: 0;
}
.av-chat-name { font-weight: 700; font-size: 15px; }
.av-chat-sub  { font-size: 12px; opacity: .75; }

.av-chat-body {
    min-height: 320px; max-height: 480px; overflow-y: auto;
    padding: 18px; background: #fafafd;
}
.msg { display: flex; margin-bottom: 12px; flex-wrap: wrap; }
.msg .bubble {
    max-width: 78%; padding: 9px 14px; border-radius: 14px;
    line-height: 1.45; font-size: 14.5px; white-space: pre-wrap;
    word-wrap: break-word;
}
.msg--bot  { justify-content: flex-start; }
.msg--bot  .bubble { background: var(--av-bubble-bot); color: var(--av-dark); border-bottom-left-radius: 4px; }
.msg--user { justify-content: flex-end; }
.msg--user .bubble { background: var(--av-primary); color: #fff; border-bottom-right-radius: 4px; }

.msg .sources {
    margin-top: 8px; font-size: 12px; color: #666;
    display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
}
.msg .sources a {
    background: #fff; border: 1px solid #ffc107; color: #d39e00;
    padding: 2px 10px; border-radius: 999px; text-decoration: none;
    transition: .15s;
}
.msg .sources a:hover { background: #ffc107; color: #2b2b3a; }

/* «печатает…» */
.msg--typing .bubble { display: flex; gap: 4px; padding: 12px 14px; }
.msg--typing .bubble span {
    width: 7px; height: 7px; border-radius: 50%; background: #c5c5d0;
    animation: av-typing 1.2s infinite;
}
.msg--typing .bubble span:nth-child(2) { animation-delay: .15s; }
.msg--typing .bubble span:nth-child(3) { animation-delay: .30s; }
@keyframes av-typing { 0%,80%,100% { opacity:.3 } 40% { opacity:1 } }

/* быстрые подсказки */
.av-chat-suggestions {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 14px; background: #fff;
    border-top: 1px solid #f0f0f4;
}
.av-chat-suggestions .suggestion-chip {
    border-radius: 999px !important;
    font-size: 12.5px !important;
    padding: 4px 12px !important;
}

/* форма ввода */
.av-chat-form {
    display: flex; gap: 8px; padding: 12px 14px;
    border-top: 1px solid #f0f0f4; background: #fff;
}
.av-chat-form .form-control {
    flex: 1; border-radius: 999px; padding: 8px 16px;
    border: 1px solid #e1e1ea;
}
.av-chat-form .form-control:focus {
    border-color: var(--av-warning);
    box-shadow: 0 0 0 .15rem rgba(255,193,7,.20);
}
.av-chat-form .btn { border-radius: 999px; padding: 8px 20px; }

/* ---------- ВОЗМОЖНОСТИ ---------- */
.av-features { margin-top: 10px; }
.av-feature-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }

/* ---------- ПЛАВАЮЩИЙ ВИДЖЕТ ---------- */
.assistant-widget {
    position: fixed; right: 20px; bottom: 20px; z-index: 9999;
    font-family: inherit;
}
.assistant-widget-toggle {
    width: 64px; height: 64px; border-radius: 50%; border: none;
    background: var(--av-warning); padding: 0; cursor: pointer;
    box-shadow: 0 6px 20px rgba(255,193,7,.5);
    position: relative; overflow: hidden;
    transition: transform .2s;
}
.assistant-widget-toggle:hover { transform: scale(1.08); }
.assistant-widget-toggle img { width: 100%; height: 100%; object-fit: cover; }
.assistant-widget-badge {
    position: absolute; top: -4px; right: -4px;
    background: #fff; color: #d39e00;
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 13px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.assistant-widget-panel {
    position: absolute; bottom: 80px; right: 0;
    width: 360px; max-width: calc(100vw - 40px);
    background: #fff; border-radius: var(--av-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden; display: flex; flex-direction: column;
    border: 1px solid #ffe082;
}
.assistant-widget-panel .av-chat-body { min-height: 280px; max-height: 380px; }
.assistant-widget-close {
    margin-left: auto; background: transparent; border: none;
    color: #2b2b3a; font-size: 26px; line-height: 1; cursor: pointer;
    padding: 0 4px; opacity: .7;
}
.assistant-widget-close:hover { opacity: 1; }

/* ---------- МОБИЛЬНЫЕ ---------- */
@media (max-width: 575.98px) {
    .av-title { font-size: 26px; }
    .av-lead  { font-size: 15px; }
    .av-avatar { width: 200px; }
    .assistant-widget-panel {
        position: fixed; right: 10px; left: 10px; bottom: 90px; width: auto;
    }
    .assistant-widget { right: 12px; bottom: 12px; }
    .assistant-widget-toggle { width: 56px; height: 56px; }
}
