/* --- Chatbot Specific Styles --- */
.chatbot-container {
    max-width: 90%; /* Increased from 800px */
    margin: 40px auto 0;
    background-color: var(--secondary-bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    height: 85vh; /* Increased from 70vh */
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background-color: var(--primary-color);
    color: #fff;
}

.chat-header .chat-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #fff;
}

.chat-header h2 {
    font-size: 1.5em;
    font-weight: 600;
}

.chat-header p {
    font-size: 0.9em;
    opacity: 0.8;
}

.chat-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: var(--secondary-bg-color);
    margin-top: 20px;
}

.footer-button {
    text-decoration: none;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-button:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.chat-history {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 12px 20px;
    border-radius: 20px;
    line-height: 1.5;
}

.user-message {
    background-color: var(--accent-color);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.ria-message {
    background-color: #eee;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    display: flex;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
}

#userQueryInput {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 50px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

#userQueryInput:focus {
    border-color: var(--accent-color);
}

.send-button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.send-button:hover {
    background-color: #1a242f;
}

/* Typing Indicator Dots */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: #333;
    border-radius: 50%;
    margin: 0 4px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- Markdown Rendering in Chat Bubbles --- */
.ria-message h1,
.ria-message h2,
.ria-message h3,
.ria-message h4,
.ria-message h5,
.ria-message h6 {
    text-align: left;
    margin: 0.5em 0;
    font-weight: bold;
}

.ria-message p {
    margin: 0.3em 0;
    line-height: 1.5;
}

.ria-message ul,
.ria-message ol {
    margin: 0.5em 0 0.5em 1.5em;
    padding-left: 1em;
}

.ria-message li {
    margin-bottom: 0.3em;
}

.ria-message strong,
.ria-message b {
    font-weight: bold;
}

/* Add to manufacturing/conversation-ai.css */

.ria-message-content {
    display: flex;
    align-items: flex-start; /* Aligns icon and text at the top */
    gap: 10px; /* Space between the icon and the message text */
}

.ria-message-icon {
    width: 30px; /* Adjust icon size as needed */
    height: 30px;
    border-radius: 50%; /* If your icon is circular */
    object-fit: cover; /* Ensures image covers the area */
    flex-shrink: 0; /* Prevents icon from shrinking */
}

/* Optional: Adjust padding for RIA message if icon causes issues */
.ria-message {
    padding: 12px 15px 12px 12px; /* Adjusted padding if icon is inside */
}

/* Add to manufacturing/conversation-ai.css */
/* Decrease the overall font size for chat messages */
.chat-message p,
.chat-message ul,
.chat-message ol,
.chat-message li {
    font-size: 0.9em; /* You can adjust this value as needed, 1em is the default */
}

/* Optional: Adjust other elements to match the new font size */

#userQueryInput {
    font-size: 0.9em; /* Adjusts the font size of the input text */
}

/* .chat-header p {
    font-size: 0.8em; /* Reduces the subtitle font size for better hierarchy */
} */
