/* Chat Container */
#smart-rag-chat-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999999;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Chat Toggle Button (Gradient & Shadow) */
.smart-rag-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 114, 255, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.smart-rag-chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 114, 255, 0.45);
}

.smart-rag-chat-toggle:active {
    transform: scale(0.95);
}

/* Chat Box */
.smart-rag-chat-box {
    display: none;
    width: 380px;
    height: 550px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid #f0f0f0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-rag-chat-box.active {
    display: flex;
}

/* Header */
.smart-rag-chat-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.smart-rag-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.smart-rag-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-rag-chat-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.smart-rag-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Messages Area */
.smart-rag-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8faff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.smart-rag-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.smart-rag-chat-messages::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 3px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.bot-message {
    background: white;
    color: #2d3748;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #eef1f6;
}

.user-message {
    background: #0072FF;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.2);
}

/* Product Card */
.smart-rag-product-card {
    background: white;
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
    border: 1px solid #f0f0f0;
}

.smart-rag-product-card:hover {
    transform: translateY(-2px);
}

.smart-rag-product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.smart-rag-product-info {
    padding: 12px 14px;
}

.smart-rag-product-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1a202c;
}

.smart-rag-product-price {
    color: #0072FF;
    font-weight: 700;
    font-size: 15px;
}

/* Input Area */
.smart-rag-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

#smart-rag-chat-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f9fc;
    padding: 8px;
    border-radius: 24px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

#smart-rag-chat-form:focus-within {
    background: white;
    border-color: #0072FF;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.1);
}

#smart-rag-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 5px;
    outline: none;
    font-size: 14px;
    color: #2d3748;
}

#smart-rag-chat-input::placeholder {
    color: #a0aec0;
}

.smart-rag-chat-send-btn,
.smart-rag-chat-image-btn {
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 6px;
    border-radius: 50%;
}

.smart-rag-chat-image-btn:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.smart-rag-chat-send-btn {
    color: #0072FF;
    background: rgba(0, 114, 255, 0.1);
}

.smart-rag-chat-send-btn:hover {
    background: #0072FF;
    color: white;
}

/* Image Preview */
.smart-rag-chat-preview {
    display: flex;
    gap: 8px;
    padding: 0 5px 10px 5px;
    flex-wrap: wrap;
    align-content: flex-start;
}

.smart-rag-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
}

.smart-rag-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.smart-rag-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .smart-rag-chat-box {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
        z-index: 99999999;
    }
}