﻿/* ============================================================
   FLOATING ACTIONS — Call · WhatsApp · AI Chat
   COMPLETE FILE — includes Markdown table styling
   ============================================================ */

/* ==================== FLOATING BUTTONS ==================== */
.floating-actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9998;
    pointer-events: none;
}

.fa-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    text-decoration: none;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: faRise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

    .fa-btn:nth-child(1) {
        animation-delay: 0.15s;
    }

    .fa-btn:nth-child(2) {
        animation-delay: 0.25s;
    }

    .fa-btn:nth-child(3) {
        animation-delay: 0.35s;
    }

@keyframes faRise {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Colors */
.fa-call {
    background: linear-gradient(135deg, #E31E24, #B8141A);
}

.fa-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.fa-ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Hover */
.fa-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.fa-call:hover {
    box-shadow: 0 16px 40px rgba(227, 30, 36, 0.5);
}

.fa-whatsapp:hover {
    box-shadow: 0 16px 40px rgba(37, 211, 102, 0.5);
}

.fa-ai:hover {
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5);
}

/* Call pulse ring */
.fa-call::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(227, 30, 36, 0.6);
    animation: faCallPulse 2.5s ease-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes faCallPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* AI pulse dot */
.fa-ai-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #FFB800;
    border-radius: 50%;
    border: 2px solid #667eea;
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.8);
    animation: faAiPulse 2s ease-in-out infinite;
}

@keyframes faAiPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Hover label */
.fa-label {
    position: absolute;
    right: 70px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.25s ease;
    pointer-events: none;
}

    .fa-label::after {
        content: '';
        position: absolute;
        right: -4px;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        width: 8px;
        height: 8px;
        background: rgba(15, 23, 42, 0.95);
    }

.fa-btn:hover .fa-label {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== AI CHAT PANEL ==================== */
.ai-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

    .ai-chat-panel.open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

/* Header */
.aichat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0E1035 0%, #1A1B4B 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.aichat-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aichat-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.aichat-online {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #0E1035;
}

.aichat-head-text h6 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.2px;
}

.aichat-head-text small {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.aichat-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: aichatDot 2s ease-in-out infinite;
}

@keyframes aichatDot {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.aichat-head-right {
    display: flex;
    gap: 4px;
}

.aichat-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

    .aichat-icon-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

/* Messages */
.aichat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    min-height: 0;
}

    .aichat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .aichat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .aichat-messages::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }

/* Welcome message */
.aichat-welcome {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    color: #0B0F2E;
    font-size: 0.875rem;
    line-height: 1.5;
    align-self: flex-start;
    max-width: 90%;
    display: flex;
    gap: 8px;
    animation: aichatMsgIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

    .aichat-welcome i {
        color: #667eea;
        font-size: 1rem;
        flex-shrink: 0;
        margin-top: 2px;
    }

/* Message bubbles */
.aichat-msg {
    display: flex;
    gap: 8px;
    animation: aichatMsgIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    max-width: 90%;
}

@keyframes aichatMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aichat-msg-bot {
    align-self: flex-start;
}

.aichat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.aichat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
}

.aichat-msg-user .aichat-msg-avatar {
    background: linear-gradient(135deg, #0B0F2E, #1A1B4B);
}

.aichat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
    /* ⚠️ REMOVE white-space: pre-wrap — Markdown renderer needs HTML spacing */
}

.aichat-msg-bot .aichat-msg-bubble {
    background: #fff;
    color: #0B0F2E;
    border: 1px solid #eef1f6;
    border-bottom-left-radius: 4px;
    /* Prevent very wide content from breaking out */
    max-width: 100%;
    overflow-wrap: break-word;
}

.aichat-msg-user .aichat-msg-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap; /* Keep user messages formatted as typed */
}

/* Typing indicator */
.aichat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

    .aichat-typing span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #667eea;
        animation: aichatTyping 1.2s ease-in-out infinite;
    }

        .aichat-typing span:nth-child(2) {
            animation-delay: 0.15s;
        }

        .aichat-typing span:nth-child(3) {
            animation-delay: 0.3s;
        }

@keyframes aichatTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Quick replies */
.aichat-quick {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #eef1f6;
    flex-wrap: wrap;
    flex-shrink: 0;
}

    .aichat-quick:empty {
        display: none;
    }

.aichat-quick-btn {
    padding: 8px 14px;
    border-radius: 100px;
    border: 1.5px solid #e6e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .aichat-quick-btn:hover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.05);
        color: #667eea;
        transform: translateY(-1px);
    }

/* Input */
.aichat-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eef1f6;
    flex-shrink: 0;
    margin: 0;
}

    .aichat-input input {
        flex: 1;
        padding: 12px 16px;
        border-radius: 100px;
        border: 1.5px solid #e6e8f0;
        font-size: 0.875rem;
        outline: none;
        font-family: inherit;
        transition: all 0.2s;
        min-width: 0;
        background: #fff;
    }

        .aichat-input input:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
        }

.aichat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

    .aichat-send:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
    }

    .aichat-send:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }

/* Footer */
.aichat-footer {
    padding: 10px 16px;
    text-align: center;
    font-size: 0.7rem;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #eef1f6;
    flex-shrink: 0;
}

    .aichat-footer a {
        color: #667eea;
        font-weight: 700;
        text-decoration: none;
    }

        .aichat-footer a:hover {
            text-decoration: underline;
        }

/* Lead form */
.aichat-lead-form {
    padding: 16px;
    background: #fff;
    border: 1.5px solid #eef1f6;
    border-radius: 16px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: aichatMsgIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.aichat-lead-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 4px;
}

    .aichat-lead-head i {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: linear-gradient(135deg, #E31E24, #B8141A);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
    }

    .aichat-lead-head strong {
        display: block;
        font-size: 0.875rem;
        color: #0B0F2E;
        font-weight: 800;
    }

    .aichat-lead-head small {
        display: block;
        font-size: 0.72rem;
        color: #6B7280;
    }

.aichat-lead-form input {
    padding: 10px 14px;
    border: 1.5px solid #e6e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

    .aichat-lead-form input:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    }

.aichat-lead-submit {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .aichat-lead-submit:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }

    .aichat-lead-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Backdrop (mobile) */
.ai-chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .ai-chat-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

/* ============================================================
   ⭐ NEW: CHAT MARKDOWN — tables, lists, code, headings
   This is what makes AI product tables render beautifully
   ============================================================ */

/* ---------- Tables (product list from AI) ---------- */
.aichat-msg-bubble .aichat-table-wrap {
    margin: 10px 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e6e8f0;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.aichat-msg-bubble .aichat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0;
    min-width: 100%;
}

    .aichat-msg-bubble .aichat-table thead {
        background: linear-gradient(135deg, #0E1035, #1A1B4B);
    }

        .aichat-msg-bubble .aichat-table thead th {
            padding: 10px 12px;
            text-align: left;
            font-weight: 800;
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #fff;
            white-space: nowrap;
            border-bottom: 1px solid #e6e8f0;
        }

    .aichat-msg-bubble .aichat-table tbody tr {
        border-bottom: 1px solid #eef1f6;
        transition: background 0.2s;
    }

        .aichat-msg-bubble .aichat-table tbody tr:last-child {
            border-bottom: none;
        }

        .aichat-msg-bubble .aichat-table tbody tr:nth-child(even) {
            background: #f8fafc;
        }

        .aichat-msg-bubble .aichat-table tbody tr:hover {
            background: rgba(102, 126, 234, 0.06);
        }

    .aichat-msg-bubble .aichat-table tbody td {
        padding: 10px 12px;
        color: #0B0F2E;
        vertical-align: middle;
        line-height: 1.4;
    }

        /* Column 1 — Product name emphasis */
        .aichat-msg-bubble .aichat-table tbody td:first-child {
            font-weight: 700;
            color: #0E1035;
        }

        /* Column 3 — Price (red, bold) */
        .aichat-msg-bubble .aichat-table tbody td:nth-child(3) {
            color: #E31E24;
            font-weight: 800;
            white-space: nowrap;
        }

        /* Last column — Stock (green) */
        .aichat-msg-bubble .aichat-table tbody td:last-child {
            color: #16a34a;
            font-weight: 700;
            text-align: center;
            font-size: 0.72rem;
        }

/* ---------- Headings ---------- */
.aichat-msg-bubble h2,
.aichat-msg-bubble h3,
.aichat-msg-bubble h4 {
    color: #0B0F2E;
    font-weight: 800;
    margin: 12px 0 6px;
    line-height: 1.3;
}

.aichat-msg-bubble h2 {
    font-size: 1rem;
}

.aichat-msg-bubble h3 {
    font-size: 0.95rem;
}

.aichat-msg-bubble h4 {
    font-size: 0.9rem;
}

/* ---------- Bold + italic ---------- */
.aichat-msg-bubble strong {
    font-weight: 800;
    color: #0E1035;
}

.aichat-msg-bubble em {
    font-style: italic;
}

/* ---------- Lists ---------- */
.aichat-msg-bubble ul,
.aichat-msg-bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}

    .aichat-msg-bubble ul li,
    .aichat-msg-bubble ol li {
        margin: 4px 0;
        line-height: 1.5;
    }

        .aichat-msg-bubble ul li::marker,
        .aichat-msg-bubble ol li::marker {
            color: #667eea;
            font-weight: 800;
        }

/* ---------- Paragraphs ---------- */
.aichat-msg-bubble p {
    margin: 0 0 8px;
}

    .aichat-msg-bubble p:last-child {
        margin-bottom: 0;
    }

/* ---------- Inline code ---------- */
.aichat-msg-bubble code {
    background: rgba(102, 126, 234, 0.1);
    color: #0E1035;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'SF Mono', Consolas, monospace;
}

/* ---------- Links ---------- */
.aichat-msg-bubble a {
    color: #667eea;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(102, 126, 234, 0.4);
    text-underline-offset: 2px;
    transition: color 0.2s;
}

    .aichat-msg-bubble a:hover {
        color: #764ba2;
        text-decoration-color: #764ba2;
    }

/* ---------- Mobile table scroll ---------- */
@media (max-width: 575px) {
    .aichat-msg-bubble .aichat-table {
        font-size: 0.72rem;
    }

        .aichat-msg-bubble .aichat-table thead th,
        .aichat-msg-bubble .aichat-table tbody td {
            padding: 8px 10px;
        }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .floating-actions {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .fa-btn {
        width: 52px;
        height: 52px;
        font-size: 1.15rem;
    }
}

@media (max-width: 767px) {
    .floating-actions {
        bottom: 16px;
        right: 16px;
        gap: 8px;
    }

    .fa-btn {
        width: 48px;
        height: 48px;
        font-size: 1.05rem;
    }

    .fa-label {
        display: none;
    }

    .ai-chat-panel {
        width: 100%;
        height: 85vh;
        max-height: 85vh;
        bottom: 0;
        right: 0;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

        .ai-chat-panel.open {
            transform: translateY(0);
        }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .fa-btn,
    .fa-call::before,
    .fa-ai-pulse,
    .aichat-dot,
    .aichat-msg,
    .aichat-typing span {
        animation: none !important;
    }

        .fa-btn:hover {
            transform: none !important;
        }

    .ai-chat-panel {
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   CHAT MESSAGE AVATAR — Logo Fix
   ============================================================ */

/* The container that holds the image */
.aichat-msg-avatar-logo {
    width: 32px !important; /* Match the bot avatar size */
    height: 32px !important;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    overflow: hidden; /* ✅ Crops any overflowing image */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #eef1f6;
}
/* ============================================================
   FIX: Dynamic Chat Message Avatar (Bot Logo)
   ============================================================ */

/* 1. The Container */
.aichat-msg-avatar.aichat-msg-avatar-logo {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    overflow: hidden; /* Stops the image from spilling out */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eef1f6;
}

    /* 2. The Image inside */
    .aichat-msg-avatar.aichat-msg-avatar-logo img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain; /* Keeps the logo from getting cut off */
        border-radius: 50%;
        display: block;
    }
    /* The image inside the chat message */
    .aichat-msg-avatar-logo img {
        width: 100% !important; /* ✅ Force image to fit container */
        height: 100% !important; /* ✅ Force image to fit container */
        object-fit: contain; /* ✅ Don't crop the logo, fit it */
        border-radius: 50%;
        display: block;
    }
/* 10.04*/
/* ============================================================
   FLOATING BUTTON WITH LOGO
   ============================================================ */

/* ============================================================
   AI CHAT FLOATING BUTTON — Logo Fixed
   ============================================================ */

.fa-ai-logo {
    background: linear-gradient(135deg, #0E1035 0%, #1A1B4B 100%);
    padding: 0; /* ✅ Remove padding */
    overflow: visible;
}

/* The Logo Image */
.fa-ai-logo-img {
    width: 100%; /* ✅ Fill the button */
    height: 100%;
    border-radius: 50%;
    object-fit: cover; /* ✅ COVER instead of contain */
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fa-ai-logo:hover .fa-ai-logo-img {
    transform: scale(1.08) rotate(-3deg);
}

/* The Fallback "A" (shows if image fails) */
.fa-ai-logo-text {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E31E24, #B8141A);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 6px rgba(227, 30, 36, 0.3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fa-ai-logo:hover .fa-ai-logo-text {
    transform: scale(1.08) rotate(-3deg);
}

/* The Green Online Dot (Fixed overlap) */
.fa-ai-badge-dot {
    position: absolute;
    bottom: 2px; /* ✅ Inside the button, not outside */
    right: 2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0a0e27;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: onlinePulse 2s ease-in-out infinite;
    z-index: 3;
}

@keyframes onlinePulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
    }
}

/* ============================================================
   HEADER AVATAR — Logo & Fallback
   ============================================================ */

.aichat-avatar-logo {
    background: #fff;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.aichat-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

/* Header fallback "A" */
.aichat-avatar-text {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #E31E24, #B8141A);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}