/* AI Mode chat page (client/ai-mode-page.vm) and the homepage button (client/layout/layout.vm) */

.ai-mode {
    max-width: 820px;
    margin: 0 auto 40px;
}

.ai-mode-toolbar {
    margin-bottom: 12px;
}

.ai-chat-log {
    height: 55vh;
    min-height: 280px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

.ai-chat-message {
    display: flex;
    margin-bottom: 12px;
}

.ai-chat-message-user {
    justify-content: flex-end;
}

.ai-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e3e6ea;
    /* replies are plain text: keep the model's line breaks */
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-chat-bubble a {
    word-break: break-all;
}

.ai-chat-message-user .ai-chat-bubble {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.ai-chat-message-error .ai-chat-bubble {
    background: #fff5f5;
    border-color: #f5c6cb;
    color: #721c24;
}

.ai-chat-error {
    margin: 12px 0 0;
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-end;
}

.ai-chat-form textarea {
    resize: vertical;
}

.ai-chat-form .btn {
    min-width: 110px;
}

.ai-chat-note {
    font-size: 0.85em;
    margin-top: 6px;
}

.spinner-dot {
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.1em;
    animation: ai-spin 0.75s linear infinite;
}

@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

/* homepage entry point */
.ai-mode-launcher {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1030;
    border-radius: 999px;
    padding: 10px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
