/* ═══════════════════════════════════════════
   ALPHA AI — ChatBot Widget v1.5.0
   Includes: typing indicator on load,
   live dot pulse, callback form styles
   ═══════════════════════════════════════════ */

.alpha-ai-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex; flex-direction: column;
    border-radius: 16px; overflow: hidden;
    border: 1px solid var(--aai-border, #2A2A5A);
    background: var(--aai-bg-card, #111430);
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    line-height: 1.55; font-size: 14px;
    color: var(--aai-text-body, #E0E0FF);
}
.alpha-ai-chatbot--inline { width: 100%; max-width: 440px; height: 540px; }
.alpha-ai-chatbot--floating {
    position: fixed; bottom: 96px; right: 24px;
    width: 400px; height: 540px; z-index: 99999;
    transition: opacity .3s ease, transform .3s ease;
}
.alpha-ai-chatbot--floating.alpha-ai-chatbot--hidden {
    opacity: 0; pointer-events: none; transform: translateY(16px) scale(.96);
}

/* Header */
.alpha-ai-header {
    display: flex; align-items: center; padding: 14px 18px; gap: 8px;
    background: var(--aai-bg-primary, #0D0F2A);
    border-bottom: 1px solid var(--aai-border, #2A2A5A); flex-shrink: 0;
}
.alpha-ai-header__dots { display: flex; gap: 6px; margin-right: 6px; }
.alpha-ai-dot { width: 10px; height: 10px; border-radius: 50%; }
.alpha-ai-dot--1 { background: var(--aai-accent, #7C3AED); opacity: .5; }
.alpha-ai-dot--2 { background: var(--aai-accent, #7C3AED); opacity: .65; }
.alpha-ai-dot--3 { background: var(--aai-accent-light, #A78BFA); opacity: .8; }
.alpha-ai-header__title { font-weight: 600; font-size: 15px; color: var(--aai-text-body, #E0E0FF); white-space: nowrap; }
.alpha-ai-header__status { font-size: 14px; color: var(--aai-text-muted, #8888BB); white-space: nowrap; }
.alpha-ai-header__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.alpha-ai-live-badge { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: #34D399; }

/* Live dot pulse */
.alpha-ai-live-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10B981;
    animation: aai-live-pulse 2s ease-in-out infinite;
}
@keyframes aai-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
    50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

.alpha-ai-header__close {
    background: none; border: none; color: var(--aai-text-muted, #8888BB);
    font-size: 22px; cursor: pointer; opacity: .7; transition: opacity .15s; line-height: 1; padding: 0 2px;
}
.alpha-ai-header__close:hover { opacity: 1; color: #fff; }
.alpha-ai-chatbot--inline .alpha-ai-header__close { display: none; }

/* Messages */
.alpha-ai-messages {
    flex: 1; overflow-y: auto; padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
    background: var(--aai-bg-card, #111430);
}
.alpha-ai-messages::-webkit-scrollbar { width: 4px; }
.alpha-ai-messages::-webkit-scrollbar-thumb { background: var(--aai-border, #2A2A5A); border-radius: 2px; }

/* Bubbles */
.alpha-ai-bubble {
    max-width: 85%; padding: 12px 16px; border-radius: 14px;
    word-wrap: break-word; animation: aai-fadeIn .25s ease; font-size: 14px; line-height: 1.55;
}
@keyframes aai-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alpha-ai-bubble--bot {
    align-self: flex-start; background: var(--aai-bot-bg, #1E1B4B);
    color: var(--aai-bot-text, #E0E0FF); border: 1px solid var(--aai-border, #2A2A5A);
    border-bottom-left-radius: 4px;
}
.alpha-ai-bubble--user {
    align-self: flex-end; background: var(--aai-user-bg, #7C3AED);
    color: #fff; border-bottom-right-radius: 4px;
}

/* Typing indicator */
.alpha-ai-typing {
    display: flex; align-items: center; gap: 5px; padding: 14px 20px;
    align-self: flex-start;
    background: var(--aai-bot-bg, #1E1B4B);
    border: 1px solid var(--aai-border, #2A2A5A);
    border-bottom-left-radius: 4px;
}
.alpha-ai-typing-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--aai-accent-light, #A78BFA); opacity: .4;
    animation: aai-typingDot 1.2s ease-in-out infinite;
}
.alpha-ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.alpha-ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.alpha-ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aai-typingDot {
    0%, 80%, 100% { opacity: .4; transform: scale(1); }
    40%           { opacity: 1;  transform: scale(1.2); }
}

/* Input row */
.alpha-ai-input-row {
    display: flex; align-items: center; padding: 14px; gap: 10px;
    background: var(--aai-bg-primary, #0D0F2A);
    border-top: 1px solid var(--aai-border, #2A2A5A); flex-shrink: 0;
}
.alpha-ai-input {
    flex: 1; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-family: inherit;
    background: var(--aai-bg-input, #080A1A); color: var(--aai-text-body, #E0E0FF);
    border: 1px solid var(--aai-border, #2A2A5A); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.alpha-ai-input::placeholder { color: var(--aai-text-muted, #8888BB); }
.alpha-ai-input:focus { border-color: var(--aai-accent, #7C3AED); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.alpha-ai-send {
    width: 44px; height: 44px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, var(--aai-accent, #7C3AED), var(--aai-accent-hover, #6D28D9));
    color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity .15s, transform .1s;
    box-shadow: 0 2px 8px rgba(124,58,237,.3);
}
.alpha-ai-send:hover { opacity: .9; }
.alpha-ai-send:active { transform: scale(.94); }
.alpha-ai-send:disabled { opacity: .4; cursor: not-allowed; }

/* FAB */
.alpha-ai-fab {
    position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px;
    border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--aai-accent, #7C3AED), var(--aai-accent-hover, #6D28D9));
    color: #fff; cursor: pointer; box-shadow: 0 4px 20px rgba(124,58,237,.35);
    display: flex; align-items: center; justify-content: center; z-index: 99998;
    transition: transform .2s ease;
}
.alpha-ai-fab:hover { transform: scale(1.08); }

/* Action cards & callback form */
.alpha-ai-action-card { align-self: flex-start; max-width: 88%; animation: aai-fadeIn .25s ease; }
.alpha-ai-action-label { font-size: 13px; color: var(--aai-text-muted, #8888BB); margin-bottom: 8px; }
.alpha-ai-action-btn {
    display: inline-block; padding: 9px 18px; border-radius: 10px;
    border: 1.5px solid var(--aai-cyan, #38BDF8); background: transparent;
    color: var(--aai-cyan, #38BDF8); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background .15s, color .15s; font-family: inherit;
}
.alpha-ai-action-btn:hover { background: var(--aai-cyan, #38BDF8); color: var(--aai-bg-primary, #0D0F2A); }
.alpha-ai-callback-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; animation: aai-fadeIn .2s ease; }
.alpha-ai-callback-form--hidden { display: none; }
.alpha-ai-cb-input, .alpha-ai-cb-textarea {
    padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--aai-border, #2A2A5A); background: var(--aai-bg-input, #080A1A);
    color: var(--aai-text-body, #E0E0FF); font-size: 13px; font-family: inherit; outline: none;
}
.alpha-ai-cb-input::placeholder, .alpha-ai-cb-textarea::placeholder { color: var(--aai-text-muted, #8888BB); }
.alpha-ai-cb-input:focus, .alpha-ai-cb-textarea:focus { border-color: var(--aai-accent, #7C3AED); }
.alpha-ai-cb-textarea { resize: none; }
.alpha-ai-cb-submit {
    padding: 10px 18px; border-radius: 8px; border: none;
    background: linear-gradient(135deg, var(--aai-accent, #7C3AED), var(--aai-accent-hover, #6D28D9));
    color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.alpha-ai-cb-submit:disabled { opacity: .5; cursor: not-allowed; }
.alpha-ai-cb-status { font-size: 12px; min-height: 16px; }
.alpha-ai-cb-status--error { color: #f87171; }

/* Responsive */
@media (max-width: 480px) {
    .alpha-ai-chatbot--floating { width: calc(100vw - 24px); right: 12px; bottom: 88px; height: 65vh; }
    .alpha-ai-fab { right: 16px; bottom: 16px; }
    .alpha-ai-header__status { display: none; }
}
