/* WooCommerce AI Chat - Estilos */

/* Widget Container */
.wooai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Botão Flutuante */
.wooai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #9B9B83;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
}

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

.wooai-chat-button svg {
    width: 28px;
    height: 28px;
}

/* Container do Chat */
.wooai-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.12);
    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);
    }
}

/* Cabeçalho */
.wooai-chat-header {
    background: #9B9B83;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wooai-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.wooai-chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.wooai-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área de Mensagens */
.wooai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.wooai-chat-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

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

.wooai-chat-message.bot {
    align-items: flex-start;
}

.wooai-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.wooai-chat-message.user .wooai-chat-bubble {
    background: #373737;
    color: white;
    border-bottom-right-radius: 4px;
}

.wooai-chat-message.bot .wooai-chat-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Produtos Sugeridos */
.wooai-chat-products {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.wooai-chat-product {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.wooai-chat-product:hover {
    background: #e9ecef;
}

.wooai-chat-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.wooai-chat-product-info {
    flex: 1;
    min-width: 0;
}

.wooai-chat-product-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wooai-chat-product-price {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

/* Input Container */
.wooai-chat-input-container {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.wooai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wooai-chat-input:focus {
    border-color: #667eea;
}

.wooai-chat-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #9B9B83;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.wooai-chat-send:hover {
    transform: scale(1.05);
}

.wooai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.wooai-chat-loading {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background: white;
    padding: 8px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wooai-chat-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar customizada */
.wooai-chat-messages::-webkit-scrollbar,
.wooai-chat-products::-webkit-scrollbar {
    width: 6px;
}

.wooai-chat-messages::-webkit-scrollbar-track,
.wooai-chat-products::-webkit-scrollbar-track {
    background: transparent;
}

.wooai-chat-messages::-webkit-scrollbar-thumb,
.wooai-chat-products::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.wooai-chat-messages::-webkit-scrollbar-thumb:hover,
.wooai-chat-products::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsivo */
@media (max-width: 480px) {
    .wooai-chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 90px;
        right: 20px;
    }
    
    .wooai-chat-bubble {
        max-width: 85%;
    }
}

/* Estado vazio */
.wooai-chat-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}
