/* Chat Container */
.wcai-chat-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 20px 0;
    overflow: hidden;
}

.wcai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wcai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wcai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcai-close-btn:hover {
    opacity: 0.8;
}

.wcai-messages {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.wcai-message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.wcai-message.user {
    justify-content: flex-end;
}

.wcai-message.user .wcai-message-content {
    background: #667eea;
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.wcai-message.bot .wcai-message-content {
    background: white;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #eee;
}

.wcai-message-content {
    padding: 10px 15px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
}

.wcai-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.wcai-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.wcai-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wcai-send-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.wcai-send-btn:hover {
    background: #764ba2;
}

.wcai-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Search Widget */
.wcai-search-container {
    margin: 20px 0;
}

.wcai-search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.wcai-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.wcai-search-input:focus {
    border-color: #667eea;
}

.wcai-search-btn {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.wcai-search-btn:hover {
    background: #764ba2;
}

.wcai-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.wcai-product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.wcai-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.wcai-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
}

.wcai-product-info {
    padding: 12px;
}

.wcai-product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcai-product-price {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.wcai-product-rating {
    font-size: 12px;
    color: #666;
}

/* Floating Widget */
.wcai-floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wcai-widget-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    font-size: 24px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.wcai-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.wcai-widget-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wcai-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wcai-widget-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wcai-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcai-widget-close:hover {
    opacity: 0.8;
}

.wcai-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.wcai-message {
    margin-bottom: 12px;
    display: flex;
    animation: slideIn 0.3s ease-out;
}

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

.wcai-message.bot .wcai-message-content {
    background: white;
    color: #333;
    border-radius: 12px 12px 12px 4px;
    border: 1px solid #eee;
    padding: 10px 12px;
    max-width: 85%;
}

.wcai-message.user {
    justify-content: flex-end;
}

.wcai-message.user .wcai-message-content {
    background: #667eea;
    color: white;
    border-radius: 12px 12px 4px 12px;
    padding: 10px 12px;
    max-width: 85%;
}

.wcai-widget-input {
    padding: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.wcai-widget-input-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
}

.wcai-widget-input-field:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wcai-widget-send {
    width: 36px;
    height: 36px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.3s;
}

.wcai-widget-send:hover {
    background: #764ba2;
}

.wcai-notice {
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    margin: 20px 0;
}

.wcai-notice p {
    margin: 0;
}

/* Loading State */
.wcai-loading {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #667eea;
    animation: wcaiLoadingPulse 1.5s infinite;
}

.wcai-loading:nth-child(2) {
    animation-delay: 0.2s;
}

.wcai-loading:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wcaiLoadingPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .wcai-chat-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .wcai-widget-chat {
        width: 100%;
        height: 100%;
        border-radius: 0;
        position: fixed;
        bottom: 0;
        right: 0;
    }

    .wcai-floating-widget {
        bottom: 10px;
        right: 10px;
    }

    .wcai-search-results {
        grid-template-columns: 1fr;
    }
}
