﻿.assistant-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1055;
    font-family: inherit;
}

.assistant-widget__button {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    border: 0;
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    font-weight: 700;
    cursor: pointer;
}

    .assistant-widget__button:hover {
        background: #0b5ed7;
    }

.assistant-widget__button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assistant-widget__panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 15px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.assistant-widget--open .assistant-widget__panel {
    display: flex;
    flex-direction: column;
}

.assistant-widget--open .assistant-widget__button {
    display: none;
}

.assistant-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #0d6efd;
    color: #fff;
}

.assistant-widget__title {
    font-weight: 700;
    line-height: 1.2;
}

.assistant-widget__subtitle {
    font-size: .85rem;
    opacity: .9;
}

.assistant-widget__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.assistant-widget__icon-button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

    .assistant-widget__icon-button:hover {
        background: rgba(255, 255, 255, .28);
    }

.assistant-widget__messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f6f7f9;
}

.assistant-widget__empty {
    color: #6c757d;
    font-size: .95rem;
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, .06);
}

.assistant-widget__message {
    display: flex;
    margin-bottom: 10px;
}

.assistant-widget__message--user {
    justify-content: flex-end;
}

.assistant-widget__message--assistant {
    justify-content: flex-start;
}

.assistant-widget__bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .95rem;
    line-height: 1.35;
}

.assistant-widget__message--user .assistant-widget__bubble {
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.assistant-widget__message--assistant .assistant-widget__bubble {
    background: #fff;
    color: #212529;
    border: 1px solid rgba(0, 0, 0, .08);
    border-bottom-left-radius: 4px;
}

.assistant-widget__bubble--typing {
    color: #6c757d;
    font-style: italic;
}

.assistant-widget__error {
    margin: 10px 12px 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8d7da;
    color: #842029;
    font-size: .9rem;
}

.assistant-widget__quote {
    margin: 0.75rem 1rem 0.75rem;
    font-weight: 600;
    box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.25);
}

.assistant-widget__quote--pulse:not(.d-none) {
    animation: assistantQuotePulse 0.85s ease-in-out 3;
}

@keyframes assistantQuotePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.25);
    }

    50% {
        transform: scale(1.045);
        box-shadow: 0 0 0 0.35rem rgba(var(--bs-primary-rgb), 0.22);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.25);
    }
}

.assistant-widget__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
}

.assistant-widget__input {
    flex: 1;
    resize: none;
    border: 1px solid #ced4da;
    border-radius: 12px;
    padding: 9px 10px;
    font: inherit;
}

    .assistant-widget__input:focus {
        outline: 0;
        border-color: #86b7fe;
        box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
    }

.assistant-widget__send {
    align-self: flex-end;
    border-radius: 12px;
}

@media (max-width: 767.98px) {
    .assistant-widget {
        right: 16px;
        bottom: 16px;
    }

    .assistant-widget__panel {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        border: 0;
    }

    .assistant-widget__form {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .assistant-widget__bubble {
        max-width: 88%;
    }
}
