/* =========================================================================
   Floating AI Assistant Widget - CSS Stylesheet (LeadPulse RTL Edition)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

.ai-float-trigger,
.ai-float-window {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    box-sizing: border-box !important;
}

.ai-float-window *,
.ai-float-trigger * {
    box-sizing: border-box !important;
}

/* 1. Floating Trigger Button (Bottom-Left so it doesn't overlap RTL Right Sidebar) */
.ai-float-trigger {
    position: fixed;
    bottom: 24px;
    left: 28px;
    z-index: 999990;
    background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
    color: #FFFFFF;
    padding: 12px 22px;
    border-radius: 50px;
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.ai-float-trigger:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.65), 0 0 18px rgba(56, 189, 248, 0.5);
    border-color: #38BDF8;
}

.ai-trigger-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-trigger-svg {
    stroke: #FFFFFF;
}

.ai-pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background-color: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: aiGreenPulse 2s infinite;
}

@keyframes aiGreenPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 2. Floating Window */
.ai-float-window {
    position: fixed;
    bottom: 88px;
    left: 28px;
    width: 465px;
    max-width: calc(100vw - 32px);
    height: 640px;
    max-height: calc(100vh - 110px);
    background: #0F172A;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(79, 70, 229, 0.25);
    z-index: 999995;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: aiFadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-float-window.d-none {
    display: none !important;
}

@keyframes aiFadeInUp {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.ai-float-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #0284c7);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.ai-header-title {
    font-size: 15px;
    font-weight: 800;
    color: #FFFFFF;
}

.ai-brand-pill {
    background: #10b981;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 50px;
    margin-right: 4px;
}

.ai-header-subtitle {
    font-size: 11.5px;
    color: #94A3B8;
}

.ai-close-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.ai-close-btn:hover {
    color: #FFFFFF;
}

/* Tabs */
.ai-float-tabs {
    display: flex;
    background: #09111E;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-tab-btn:hover {
    color: #F8FAFC;
}

.ai-tab-btn.active {
    color: #38BDF8;
    border-bottom-color: #38BDF8;
    background: rgba(56, 189, 248, 0.06);
}

/* Body & Panes */
.ai-float-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0B132B;
}

.ai-tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
}

.ai-tab-pane.active {
    display: flex;
}

/* Messages */
.ai-messages-box {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    max-width: 95%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.65;
    animation: aiMsgIn 0.25s ease;
}

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

.ai-msg-bot {
    align-self: flex-start;
    background: #1E293B;
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 3.5px solid #38BDF8;
    border-radius: 14px 14px 14px 2px;
}

.ai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5 0%, #0284C7 100%);
    color: #FFFFFF;
    border-radius: 14px 14px 2px 14px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.ai-msg-sender {
    font-size: 11px;
    font-weight: 800;
    color: #38BDF8;
    margin-bottom: 3px;
}

.ai-msg-time {
    font-size: 10px;
    color: #64748B;
    margin-top: 4px;
    text-align: left;
}

/* Quick Chips */
.ai-quick-chips {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    white-space: nowrap;
    background: #09111E;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-chip {
    background: #1E293B;
    border: 1px solid #334155;
    color: #94A3B8;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-chip:hover {
    background: #334155;
    color: #FFFFFF;
    border-color: #38BDF8;
}

/* Input Bar */
.ai-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #09111E;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-input {
    flex: 1;
    background: #1E293B;
    border: 1px solid #334155;
    color: #FFFFFF;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-input:focus {
    border-color: #38BDF8;
}

.ai-send-btn {
    background: #4f46e5;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-send-btn:hover {
    background: #4338ca;
}

/* Other Panes */
.ai-pane-content {
    padding: 16px;
}

.ai-faq-item {
    background: #1E293B;
    border: 1px solid #334155;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ai-faq-item:hover {
    border-color: #38BDF8;
}

.ai-faq-item strong {
    color: #38BDF8;
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.ai-faq-item p {
    color: #CBD5E1;
    font-size: 12.5px;
    margin: 0;
}

.ai-about-card {
    background: #1E293B;
    border: 1px solid #334155;
    padding: 16px;
    border-radius: 12px;
    color: #E2E8F0;
    line-height: 1.7;
    font-size: 13px;
}
