/* Shared Chat Styles */

/* Bubbles Base */
.chat-bubble {
    padding: 12px;
    max-width: 85%;
    word-wrap: break-word;
    position: relative;
}

.chat-bubble-user {
    color: white;
    border-radius: 16px 16px 0 16px;
    /* Background color is set dynamically via inline style */
}

.chat-bubble-ai {
    background-color: #f0f0f0;
    color: black;
    border-radius: 16px 16px 16px 0;
}

.chat-bubble-operator {
    background-color: #ff9800; /* Default operator color (Orange) */
    color: white;
    border-radius: 16px 16px 16px 0;
}

/* Markdown Content Styles */
.chat-content p {
    margin-bottom: 0.5rem;
}

.chat-content p:last-child {
    margin-bottom: 0;
}

.chat-content ul, .chat-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.chat-content code {
    background-color: rgba(0,0,0,0.1); /* Transparent black for adaptability */
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.chat-content pre {
    background-color: #333;
    color: #fff;
    padding: 8px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.chat-content pre code {
    background-color: transparent;
    color: inherit;
}

.chat-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: bold;
}

/* Typing Indicator */
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Scrollbar styling for chat areas */
.chat-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.chat-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll-area::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-scroll-area::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}
