/* AI Chatbot Styles - Black and White Theme */
#ai-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#chatbot-toggle {
    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 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

#chatbot-toggle span {
    font-size: 24px;
    color: white;
}

#chatbot-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix for white title in header */
#chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white !important;  /* Force white color */
}

#chatbot-close {
    background: none;
    border: none;
    color: white !important;  /* Force white color */
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-message, .bot-message {
    display: flex;
    max-width: 80%;
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bot-message .message-content {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 18px;
    font-size: 14px;
    color: #666;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

#chatbot-input-area {
    display: flex;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chatbot-input:focus {
    border-color: #000000;
}

#chatbot-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

#chatbot-send:hover {
    transform: translateY(-1px);
}

#chatbot-send:active {
    transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #ai-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    #chatbot-container {
        width: calc(100vw - 20px);
        height: 70vh;
        bottom: 70px;
        right: -10px;
    }
    
    #chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    #chatbot-toggle span {
        font-size: 20px;
    }
}
/* Markdown and Links Styling */
.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
    color: inherit;
}

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.bot-message .message-content code {
    background: rgba(0, 0, 0, 0.08);
}

.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
    color: inherit;
}

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.bot-message .message-content code {
    background: rgba(0, 0, 0, 0.08);
}

.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

/* Links Section - Always at Bottom */
.message-links {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.links-header {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-links a {
    display: block;
    margin: 6px 0;
    padding: 12px 15px;
    background: linear-gradient(135deg,  #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.message-links a:hover {
    background: linear-gradient(135deg, #333333 0%, #555555 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Add a subtle arrow indicator instead of emoji */
.message-links a:after {
    content: "→";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.message-links a:hover:after {
    opacity: 1;
    right: 12px;
}

/* Ensure links section doesn't break the message layout */
.bot-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.bot-message .message-content {
    flex: 1;
}

/* Handle long product names */
.message-links a {
    word-break: break-word;
    line-height: 1.3;
    min-height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 45px; /* Space for arrow */
}