/* ═══════════════════════════════════════════════════════════
   AXONBOX CHAT INTERFACE — Elementor Widget Styles
   These styles scope to the #axb-chat-window container
   ═══════════════════════════════════════════════════════════ */

#axb-chat-window {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #1e293b;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.4);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Chat Header ── */
#axb-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #1e293b;
    background: rgba(30, 41, 59, 0.5);
}

#axb-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Chat Messages ── */
#axb-chat-messages {
    min-height: 380px;
    max-height: 520px;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

#axb-chat-messages::-webkit-scrollbar { width: 4px; }
#axb-chat-messages::-webkit-scrollbar-track { background: transparent; }
#axb-chat-messages::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

/* ── Messages ── */
.axb-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: axbMsgIn 0.35s ease-out;
}

@keyframes axbMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.axb-msg.axb-user { flex-direction: row-reverse; }

.axb-msg-av {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.axb-msg.axb-ai .axb-msg-av {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.axb-msg.axb-user .axb-msg-av {
    background: #1e3a5f;
}

.axb-msg-bub {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #f8fafc;
}

.axb-msg.axb-ai .axb-msg-bub {
    background: #1a1f3d;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-top-left-radius: 4px;
}

.axb-msg.axb-user .axb-msg-bub {
    background: #6366f1;
    border-top-right-radius: 4px;
    color: white;
}

.axb-msg-bub p { margin-bottom: 8px; }
.axb-msg-bub p:last-child { margin-bottom: 0; }
.axb-msg-bub strong { color: #818cf8; font-weight: 600; }
.axb-msg.axb-user .axb-msg-bub strong { color: white; }
.axb-msg-bub ul, .axb-msg-bub ol { padding-left: 20px; margin: 8px 0; }
.axb-msg-bub li { margin-bottom: 4px; color: #cbd5e1; }

.axb-msg-bub blockquote,
.axb-msg-bub .axb-highlight {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0;
    font-size: 0.85rem;
}

/* ── Typing Indicator ── */
.axb-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.axb-typing span {
    width: 7px;
    height: 7px;
    background: #6366f1;
    border-radius: 50%;
    animation: axbTypeBounce 1.4s infinite;
}

.axb-typing span:nth-child(2) { animation-delay: 0.2s; }
.axb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes axbTypeBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ── Chat Input ── */
#axb-chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid #1e293b;
    background: rgba(30, 41, 59, 0.3);
}

#axb-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e293b;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 4px 4px 4px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#axb-input-row:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#axbChatInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    padding: 10px 0;
}

#axbChatInput::placeholder { color: #475569; }

#axbSendBtn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #6366f1;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#axbSendBtn:hover { background: #8b5cf6; transform: scale(1.05); }
#axbSendBtn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Lead Capture Form ── */
.axb-lead-form-bub {
    max-width: 90% !important;
}

.axb-lead-field {
    margin-bottom: 10px;
}

.axb-lead-field input {
    width: 100%;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.axb-lead-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.axb-lead-field input::placeholder {
    color: #475569;
}

.axb-lead-submit {
    width: 100%;
    padding: 11px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border: none;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    margin-top: 4px;
}

.axb-lead-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #axb-chat-messages {
        min-height: 300px;
        max-height: 400px;
        padding: 16px;
    }
    .axb-msg-bub { max-width: 90%; }
    #axb-chat-header { padding: 12px 16px; }
    #axb-chat-input-area { padding: 12px 16px; }
}
