/* Smartcom AI Chatbot - Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --bg-light: #f8f9fa;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
}

/* Chatbot Container */
#smartcom-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-buttons {
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
}

/* Messages Container */
#messagesContainer {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message */
.message {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

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

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message.bot .message-content {
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--border-color);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--border-color);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typing 1.4s infinite;
}

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

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

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

/* Product Card */
.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
}

.product-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin: 8px 0;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 8px 0;
}

.product-card p {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-light);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-small {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add-cart {
    background: var(--success-color);
    color: white;
}

.btn-add-cart:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-details {
    background: var(--primary-color);
    color: white;
}

.btn-details:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* Input Area */
.input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    background: white;
}

#messageInput {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

#messageInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Scrollbar */
#messagesContainer::-webkit-scrollbar {
    width: 6px;
}

#messagesContainer::-webkit-scrollbar-track {
    background: transparent;
}

#messagesContainer::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#messagesContainer::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Responsive */
@media (max-width: 480px) {
    #smartcom-chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .message-content {
        max-width: 90%;
    }

    .product-card img {
        height: 120px;
    }
}

/* Print Styles */
@media print {
    #smartcom-chatbot-container {
        display: none;
    }
}
