/* ===== AI Customer Care Chat Widget ===== */

/* Container - Fixed Bottom Right */
.ai-chat-container {
    position: fixed;
    right: 18px;
    bottom: 90px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Floating Toggle Button */
.ai-chat-toggle {
    height: 44px;
    padding: 0 18px 0 12px;
    border-radius: 50px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.ai-chat-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.6);
}
.ai-toggle-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.pulse-ai {
    animation: pulseAI 2.5s infinite;
}
@keyframes pulseAI {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.ai-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* Chat Box */
.ai-chat-box {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background: #0b1120;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483647;
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ai-chat-header-info {
    display: flex;
    flex-direction: column;
}
.ai-chat-title {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.3px;
}
.ai-chat-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.ai-chat-online {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 5px;
    animation: onlinePulse 2s infinite;
}
@keyframes onlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.ai-chat-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.ai-chat-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #0f172a;
}
.ai-msg {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}
.ai-msg-bot {
    background: #1e293b;
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
}
.ai-msg-bot strong {
    color: #34d399;
}
.ai-msg-user {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Quick Action Buttons */
.ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.ai-quick-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.ai-quick-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    transform: translateY(-1px);
}

/* Input Area */
.ai-chat-input-area {
    padding: 14px 18px;
    padding-bottom: 22px;
    background: #0f172a;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 10px;
}
.ai-chat-input-area input {
    flex: 1;
    border: 1px solid #334155;
    border-radius: 24px;
    padding: 11px 18px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: #1e293b;
    color: #f1f5f9;
    transition: border-color 0.2s;
}
.ai-chat-input-area input::placeholder {
    color: #64748b;
}
.ai-chat-input-area input:focus {
    border-color: #10b981;
}
.ai-chat-send {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ai-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}
.ai-chat-send:disabled {
    background: #334155;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 16px;
    background: #1e293b;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: max-content;
    border: 1px solid rgba(255,255,255,0.06);
}
.typing-indicator span {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Footer */
.ai-chat-footer {
    text-align: center;
    font-size: 10px;
    color: #475569;
    padding: 6px 0;
    background: #0f172a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-container {
        right: 12px !important;
        bottom: 80px !important;
    }
    .ai-chat-toggle {
        height: 38px !important;
        padding: 0 14px 0 10px !important;
    }
    .ai-toggle-text { font-size: 11px !important; }
    .ai-icon { width: 18px !important; height: 18px !important; }
    .ai-chat-box {
        width: 100vw !important;
        top: 0 !important;
        bottom: 0 !important;
        height: auto !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
}
