/* Front-end styles for AI Assistant chat */

#aiw-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: sans-serif;
}

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

/* Floating bubble */
.aiw-bubble {
    display: flex;
    align-items: center;
    background: var(--aiw-primary, #0a7f99);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform .2s ease;
}

.aiw-bubble:hover {
    transform: scale(1.05);
}

.aiw-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.aiw-bubble-label {
    font-weight: 600;
}

/* Chat window */
.aiw-window {
    width: 320px;
    max-height: 480px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.aiw-window header {
    background: var(--aiw-primary, #0a7f99);
    color: #fff;
    padding: 10px;
    display: flex;
    align-items: center;
}

.aiw-window header .aiw-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.aiw-window header .aiw-header-title {
    flex: 1;
    font-weight: bold;
}

.aiw-window header .aiw-header-close {
    cursor: pointer;
    font-size: 20px;
}

.aiw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #fafafa;
}

.aiw-message {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}
.aiw-message .aiw-bubble-inner {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.aiw-message.user {
    align-items: flex-end;
}

.aiw-message.user .aiw-bubble-inner {
    background: var(--aiw-primary, #0a7f99);
    color: #fff;
}

.aiw-message.assistant {
    align-items: flex-start;
}

.aiw-message.assistant .aiw-bubble-inner {
    background: #e9eff1;
    color: #333;
}

/* Input area */
.aiw-input {
    border-top: 1px solid #eee;
    padding: 8px;
    display: flex;
    align-items: center;
    background: #fff;
}

.aiw-input button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--aiw-primary, #0a7f99);
}

.aiw-input .aiw-text-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
}

.aiw-input .aiw-send-btn {
    margin-left: 6px;
    background: var(--aiw-primary, #0a7f99);
    color: #fff;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Lead form */
.aiw-lead-form {
    border-top: 1px solid #eee;
    padding: 12px;
    background: #f7f7f7;
}

.aiw-lead-form label {
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
}
.aiw-lead-form input,
.aiw-lead-form textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
}
.aiw-lead-form button {
    width: 100%;
    background: var(--aiw-primary, #0a7f99);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.aiw-lead-form button:hover {
    opacity: 0.9;
}

/* Attachments preview */
.aiw-attachment-preview {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}

/* Product suggestions */
.aiw-products {
    margin-top: 12px;
}
.aiw-product {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.aiw-product:hover {
    background: #f5f5f5;
}
.aiw-product img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
}
.aiw-product .aiw-product-info {
    flex: 1;
}
.aiw-product .aiw-product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.aiw-product .aiw-product-price {
    font-size: 13px;
    color: var(--aiw-primary, #0a7f99);
}