/**
 * Widget Chat Smaar - Interface  simple
 */
.smaar-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.smaar-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.smaar-chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.smaar-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.smaar-chat-window.active {
    display: flex;
}

/* Beta Banner - Sticky at top */
.smaar-chat-beta-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe082 100%);
    border-bottom: 2px solid #ffc107;
    padding: 14px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 80px;
    box-sizing: border-box;
}

.smaar-beta-content {
    flex: 1;
    font-size: 12px;
    color: #333;
}

.smaar-beta-warning {
    font-weight: 600;
    margin-bottom: 8px;
    color: #d32f2f;
}

.smaar-beta-contact {
    font-size: 11px;
    line-height: 1.4;
    color: #555;
}

.smaar-contact-number {
    color: #0066cc;
    font-weight: 600;
    margin: 4px 0;
    font-size: 13px;
}

.smaar-contact-names {
    font-size: 10px;
    color: #777;
    margin-top: 3px;
}

.smaar-reset-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    padding: 4px 8px;
    width: auto;
    min-width: 24px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
}

.smaar-reset-btn:hover {
    transform: scale(1.2);
}

.smaar-chat-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.smaar-chat-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.smaar-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.smaar-chat-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

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

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

.smaar-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

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

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

.smaar-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.smaar-product-result {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.smaar-product-result:hover {
    border-color: #1976d2;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
    transform: translateY(-2px);
}

.smaar-product-result.top-result {
    border-color: #4caf50;
    background: #f1f8f4;
}

.smaar-product-result .badge-top {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.smaar-product-result h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
    word-break: break-word;
}

.smaar-product-result .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    font-size: 11px;
}

.smaar-product-result .sku {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.smaar-product-result .brand {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 6px;
    border-radius: 3px;
}

.smaar-product-result .price {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.smaar-product-result .product-link {
    display: inline-block;
    margin-top: 8px;
    color: #1976d2;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid #1976d2;
    border-radius: 4px;
    transition: all 0.2s;
}

.smaar-product-result .product-link:hover {
    background: #1976d2;
    color: white;
}

.smaar-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

.smaar-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.smaar-chat-input:focus {
    border-color: #1976d2;
}

.smaar-chat-send-btn {
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.smaar-chat-send-btn:hover {
    background: #1565c0;
}

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

.smaar-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
}

.smaar-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.smaar-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.smaar-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

@media (max-width: 480px) {
    .smaar-chat-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .smaar-chat-bubble {
        bottom: 15px;
        right: 15px;
    }
}
