/* ── Raza AI Chatbot Styles ──────────────────────────────────────────────── */

#raza-ai-chatbot {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#raza-ai-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--raza-primary, #2563eb);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 26px;
    box-shadow: 0 4px 20px rgba(37,99,235,.45);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
#raza-ai-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37,99,235,.55); }

.raza-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Chat Window */
#raza-ai-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    max-height: 540px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: razaSlideUp .25s ease;
}
@keyframes razaSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
#raza-ai-header {
    background: var(--raza-primary, #2563eb);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.raza-ai-avatar {
    width: 40px; height: 40px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.raza-ai-header-name  { font-weight: 700; font-size: 15px; }
.raza-ai-header-status { font-size: 12px; opacity: .8; }
#raza-ai-close-btn {
    margin-left: auto;
    background: none; border: none; color: #fff;
    font-size: 18px; cursor: pointer; opacity: .8;
    padding: 4px; line-height: 1;
}
#raza-ai-close-btn:hover { opacity: 1; }

/* Messages */
#raza-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.raza-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: razaFadeIn .2s ease;
}
@keyframes razaFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.raza-bubble.bot {
    background: #fff;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    align-self: flex-start;
}
.raza-bubble.user {
    background: var(--raza-primary, #2563eb);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* Typing dots */
.raza-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.raza-dots span {
    width: 7px; height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: razaBounce 1.2s infinite;
}
.raza-dots span:nth-child(2) { animation-delay: .2s; }
.raza-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes razaBounce {
    0%,80%,100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Input area */
#raza-ai-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
#raza-ai-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
#raza-ai-input:focus { border-color: var(--raza-primary, #2563eb); }
#raza-ai-send {
    width: 40px; height: 40px;
    background: var(--raza-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: opacity .2s;
}
#raza-ai-send:hover { opacity: .85; }
#raza-ai-send:disabled { opacity: .4; cursor: not-allowed; }

/* Footer */
#raza-ai-footer {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    padding: 6px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
}
#raza-ai-footer a { color: #6b7280; text-decoration: none; }

/* Lead captured notice */
.raza-lead-notice {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    align-self: center;
    text-align: center;
}

/* Mobile */
@media (max-width: 420px) {
    #raza-ai-window { width: calc(100vw - 24px); right: -14px; }
    #raza-ai-chatbot { bottom: 16px; right: 16px; }
}
