/* Chatbot floating widget */
.chatbot-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    font-family: var(--app-font-body, system-ui, sans-serif);
}

.chatbot-widget--hidden {
    display: none !important;
}

.chatbot-widget__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chatbot-widget__toggle:hover {
    transform: scale(1.06);
}

.chatbot-widget__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-widget__panel--hidden {
    display: none !important;
}

.chatbot-widget__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-weight: 600;
}

.chatbot-widget__header .chatbot-widget__title {
    flex: 1;
    font-size: 0.95rem;
}

.chatbot-widget__header button {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.85;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.chatbot-widget__header button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.chatbot-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.875rem;
}

.chatbot-widget__msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-widget__msg--bot {
    align-self: flex-start;
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-body-color, #212529);
    border-bottom-left-radius: 4px;
}

.chatbot-widget__msg--user {
    align-self: flex-end;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-widget__input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.chatbot-widget__input {
    flex: 1;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.875rem;
    outline: none;
}

.chatbot-widget__input:focus {
    border-color: var(--bs-primary, #0d6efd);
}

.chatbot-widget__send {
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    flex: 0 0 auto;
}

.chatbot-widget__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-widget__typing {
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-widget__toggle {
        transition: none;
    }
}
