:root {
    --ask-docs-primary-color: #0d6efd;
    --ask-docs-primary-color-soft: rgba(13, 110, 253, 0.13);
}

#askDocsModal .modal-xl {
    max-width: 1200px;
}

@media (max-width: 1400px) {
    #askDocsModal .modal-xl {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    #askDocsModal .modal-xl {
        max-width: 100%;
        margin: 0.5rem;
    }

    #chatMessages {
        height: 400px !important;
    }
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.3s ease-in;
}

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

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

.chat-message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .message-bubble {
        max-width: 90%;
    }
}

.message-bubble h1, .message-bubble h2, .message-bubble h3,
.message-bubble h4, .message-bubble h5, .message-bubble h6 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message-bubble h1 { font-size: 1.5em; }
.message-bubble h2 { font-size: 1.3em; }
.message-bubble h3 { font-size: 1.1em; }

.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-bubble li {
    margin: 4px 0;
}

.message-bubble code {
    background-color: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.message-bubble pre {
    background-color: rgba(0,0,0,0.08);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-bubble pre code {
    background-color: transparent;
    padding: 0;
}

.message-bubble blockquote {
    border-left: 3px solid rgba(0,0,0,0.2);
    padding-left: 12px;
    margin: 8px 0;
    font-style: italic;
    opacity: 0.9;
}

.message-bubble strong {
    font-weight: 700;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble a {
    color: inherit;
    text-decoration: underline;
}

.message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

.message-bubble table th,
.message-bubble table td {
    border: 1px solid rgba(0,0,0,0.2);
    padding: 8px;
    text-align: left;
}

.message-bubble table th {
    font-weight: 600;
    background-color: rgba(0,0,0,0.05);
}

/* Special styling for code in user messages (white background) */
.chat-message.user .message-bubble code {
    background-color: rgba(255,255,255,0.2);
}

.chat-message.user .message-bubble pre {
    background-color: rgba(255,255,255,0.15);
}

.chat-message.user .message-bubble blockquote {
    border-left-color: rgba(255,255,255,0.5);
}

.chat-message.user .message-bubble {
    background-color: var(--ask-docs-primary-color, #0d6efd);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-bubble {
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-role {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.7;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    max-width: 75%;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

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

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

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

#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#chatMessages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.session-list {
    max-height: 450px;
    overflow-y: auto;
}

.session-card {
    border: 1px solid #e6e9ef;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background-color: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 12px;
}

.session-card:last-child {
    margin-bottom: 0;
}

.session-card.active {
    border-color: var(--ask-docs-primary-color, #0d6efd);
    box-shadow: 0 0 0 1px var(--ask-docs-primary-color-soft, rgba(13, 110, 253, 0.13));
}

.session-card h6 {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.session-card small {
    display: block;
}

.session-empty {
    padding: 2rem;
    text-align: center;
    border: 1px dashed #cfd5e3;
    border-radius: 14px;
    background-color: #fff;
    color: #6c757d;
}

.session-list::-webkit-scrollbar {
    width: 6px;
}

.session-list::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 3px;
}

.session-list::-webkit-scrollbar-track {
    background: transparent;
}

.ask-docs-primary-btn {
    background-color: var(--ask-docs-primary-color, #0d6efd);
    border-color: var(--ask-docs-primary-color, #0d6efd);
    color: white;
}

.ask-docs-primary-btn:hover,
.ask-docs-primary-btn:focus {
    color: white;
    background-color: var(--ask-docs-primary-color, #0d6efd);
    border-color: var(--ask-docs-primary-color, #0d6efd);
}

