/* AI Chatbot - FINAL STABLE STYLES */

#cb-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 2147483647 !important; /* Force on top of everything */
    font-family: 'Inter', -apple-system, sans-serif;
    display: block !important;
    visibility: visible !important;
}

/* Floating Button */
.cb-button {
    width: 60px;
    height: 60px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.cb-button:hover { transform: scale(1.1); }
.cb-button svg { width: 30px; height: 30px; }

/* Window */
#cb-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cb-pop 0.3s ease-out;
}

.cb-hidden { display: none !important; }

/* Header */
.cb-header {
    background: #4f46e5;
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-status {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.cb-close-btn { cursor: pointer; font-size: 24px; opacity: 0.8; }
.cb-close-btn:hover { opacity: 1; }

/* Messages */
.cb-msgs {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
}

.cb-chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: cb-slide 0.3s ease;
}

.cb-chat-msg.bot {
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.cb-chat-msg.user {
    background: #4f46e5;
    color: white;
    margin-left: auto;
    border-top-right-radius: 2px;
}

/* Input Area */
.cb-chat-input {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#cb-msg-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    font-size: 14px;
}

#cb-send-btn {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-typing {
    background: #f8fafc;
    padding: 0 15px 10px 15px;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

/* Greeting Bubble */
.cb-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: cb-slide 0.5s ease;
}

.cb-bubble-tip {
    position: absolute;
    bottom: -8px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1e293b;
}

/* Keyframes */
@keyframes cb-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cb-slide { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile Fixes */
@media (max-width: 480px) {
    #cb-chat-window { width: calc(100vw - 40px); height: 80vh; bottom: 70px; }
}
