/* WooCommerce AI Sales Agent - Chat Styles v5.0.0 */

/* Chat Bubble Button */
.woo-ai-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    transition: all 0.3s ease;
}

.woo-ai-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.woo-ai-chat-bubble svg {
    width: 28px;
    height: 28px;
}

.woo-ai-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Container */
.woo-ai-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Chat Header */
.woo-ai-chat-header {
    padding: 16px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.woo-ai-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.woo-ai-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.woo-ai-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.woo-ai-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.woo-ai-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.woo-ai-header-actions {
    display: flex;
    gap: 8px;
}

.woo-ai-clear-btn,
.woo-ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.woo-ai-clear-btn:hover,
.woo-ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.woo-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.woo-ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.woo-ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.woo-ai-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.woo-ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Messages */
.woo-ai-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.woo-ai-user-message {
    flex-direction: row-reverse;
}

.woo-ai-message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woo-ai-message-content {
    max-width: 75%;
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.woo-ai-user-message .woo-ai-message-content {
    background: var(--primary-color, #0066cc);
    color: white;
}

.woo-ai-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Typing Indicator */
.woo-ai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.woo-ai-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.woo-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.woo-ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Product Cards */
.woo-ai-product-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.woo-ai-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.woo-ai-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.woo-ai-product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}

.woo-ai-product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.woo-ai-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.woo-ai-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.woo-ai-price {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.woo-ai-regular-price {
    font-size: 13px;
    color: #64748b;
    text-decoration: line-through;
}

.woo-ai-sale-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.woo-ai-product-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.woo-ai-add-to-cart-btn,
.woo-ai-view-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.woo-ai-add-to-cart-btn {
    background: var(--primary-color, #0066cc);
    color: white;
}

.woo-ai-add-to-cart-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.woo-ai-view-btn {
    background: #f1f5f9;
    color: #475569;
}

.woo-ai-view-btn:hover {
    background: #e2e8f0;
}

.woo-ai-out-of-stock {
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
}

/* Chat Input */
.woo-ai-chat-input {
    padding: 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.woo-ai-chat-input form {
    display: flex;
    gap: 8px;
}

#woo-ai-message-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#woo-ai-message-input:focus {
    border-color: var(--primary-color, #0066cc);
}

#woo-ai-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#woo-ai-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

#woo-ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Powered By */
.woo-ai-powered-by {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.woo-ai-powered-by a {
    color: var(--primary-color, #0066cc);
    text-decoration: none;
    font-weight: 600;
}

.woo-ai-powered-by a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .woo-ai-chat-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .woo-ai-chat-bubble {
        bottom: 15px;
        right: 15px;
    }
    
    .woo-ai-product-card {
        flex-direction: column;
    }
    
    .woo-ai-product-image {
        width: 100%;
        height: 150px;
    }
}

/* Loading Animation */
.woo-ai-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary-color, #0066cc);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
