/* LLM Chat Panel Styles */
.note-context-chat {
    background-color: var(--main-background-color);
}

/* Message Styling */
.chat-message {
    margin-bottom: 1rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.user-avatar {
    background-color: var(--input-background-color);
    color: var(--cmd-button-icon-color);
}

.assistant-avatar {
    background-color: var(--subtle-border-color, var(--main-border-color));
    color: var(--hover-item-text-color);
}

.message-content {
    max-width: calc(100% - 50px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    color: var(--main-text-color);
}

.user-content {
    border-radius: 0.5rem 0.5rem 0 0.5rem !important;
    background-color: var(--input-background-color) !important;
}

.assistant-content {
    border-radius: 0.5rem 0.5rem 0.5rem 0 !important;
    background-color: var(--main-background-color);
    border: 1px solid var(--subtle-border-color, var(--main-border-color));
}

/* Tool Execution Styling */
.tool-execution-info {
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--subtle-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    background-color: var(--main-background-color);
    /* Add a subtle transition effect */
    transition: all 0.2s ease-in-out;
}

.tool-execution-status {
    background-color: var(--accented-background-color, rgba(0, 0, 0, 0.03)) !important;
    border-radius: 0 !important;
    padding: 0.5rem !important;
    max-height: 250px !important;
    overflow-y: auto;
}

.tool-execution-status .d-flex {
    border-bottom: 1px solid var(--subtle-border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.tool-step {
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    background-color: var(--main-background-color);
    border: 1px solid var(--subtle-border-color);
    transition: background-color 0.2s ease;
}

.tool-step:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.tool-step:last-child {
    margin-bottom: 0;
}

/* Tool step specific styling */
.tool-step.executing {
    background-color: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
}

.tool-step.result {
    background-color: rgba(40, 167, 69, 0.05);
    border-color: rgba(40, 167, 69, 0.2);
}

.tool-step.error {
    background-color: rgba(220, 53, 69, 0.05);
    border-color: rgba(220, 53, 69, 0.2);
}

/* Tool result formatting */
.tool-result pre {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0.25rem;
    overflow: auto;
    max-height: 300px;
}

.tool-result code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.tool-args code {
    display: block;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.85em;
    color: var(--muted-text-color);
    white-space: pre-wrap;
    overflow: auto;
    max-height: 100px;
}

/* Tool Execution in Chat Styling */
.chat-tool-execution {
    padding: 0 0 0 36px; /* Aligned with message content, accounting for avatar width */
    width: 100%;
    margin-bottom: 1rem;
}

.tool-execution-container {
    background-color: var(--accented-background-color, rgba(245, 247, 250, 0.7));
    border: 1px solid var(--subtle-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-width: calc(100% - 20px);
    transition: all 0.3s ease;
}

.tool-execution-container.collapsed {
    display: none;
}

.tool-execution-header {
    background-color: var(--main-background-color);
    border-bottom: 1px solid var(--subtle-border-color);
    margin-bottom: 0.5rem;
    color: var(--muted-text-color);
    font-weight: 500;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tool-execution-header:hover {
    background-color: var(--hover-item-background-color, rgba(0, 0, 0, 0.03));
}

.tool-execution-toggle {
    color: var(--muted-text-color) !important;
    background: transparent !important;
    padding: 0.2rem 0.4rem !important;
    transition: transform 0.2s ease;
}

.tool-execution-toggle:hover {
    color: var(--main-text-color) !important;
}

.tool-execution-toggle i.bx-chevron-down {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.tool-execution-toggle i.bx-chevron-right {
    transform: rotate(-90deg);
    transition: transform 0.3s ease;
}

.tool-execution-chat-steps {
    padding: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Make error text more visible */
.text-danger {
    color: #dc3545 !important;
}

/* Sources Styling */
.sources-container {
    background-color: var(--accented-background-color, var(--main-background-color));
    border-top: 1px solid var(--main-border-color);
    color: var(--main-text-color);
}

.source-item {
    transition: all 0.2s ease;
    background-color: var(--main-background-color);
    border-color: var(--subtle-border-color, var(--main-border-color)) !important;
}

.source-item:hover {
    background-color: var(--link-hover-background, var(--hover-item-background-color));
}

.source-link {
    color: var(--link-color, var(--hover-item-text-color));
    text-decoration: none;
    display: block;
    width: 100%;
}

.source-link:hover {
    color: var(--link-hover-color, var(--hover-item-text-color));
}

/* Input Area Styling */
.note-context-chat-form {
    background-color: var(--main-background-color);
    border-top: 1px solid var(--main-border-color);
}

.context-option-container {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--subtle-border-color, var(--main-border-color));
    color: var(--main-text-color);
}

.chat-input-container {
    padding-top: 0.5rem;
}

.note-context-chat-input {
    border-color: var(--subtle-border-color, var(--main-border-color));
    background-color: var(--input-background-color) !important;
    color: var(--input-text-color) !important;
    resize: none;
    transition: all 0.2s ease;
    min-height: 50px;
    max-height: 150px;
}

.note-context-chat-input:focus {
    border-color: var(--input-focus-outline-color, var(--main-border-color));
    box-shadow: 0 0 0 0.25rem var(--input-focus-outline-color, rgba(13, 110, 253, 0.25));
}

.note-context-chat-send-button {
    width: 40px;
    height: 40px;
    align-self: flex-end;
    background-color: var(--cmd-button-background-color) !important;
    color: var(--cmd-button-text-color) !important;
}

/* Loading Indicator */
.loading-indicator {
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--muted-text-color);
}

/* Thinking display styles */
.llm-thinking-container {
    margin: 1rem 0;
    animation: fadeInUp 0.3s ease-out;
}

.thinking-bubble {
    background-color: var(--accented-background-color, var(--main-background-color));
    border: 1px solid var(--subtle-border-color, var(--main-border-color));
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.thinking-bubble:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.thinking-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--hover-item-background-color, rgba(0, 0, 0, 0.03)), transparent);
    animation: shimmer 2s infinite;
    opacity: 0.5;
}

.thinking-header {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.thinking-header:hover {
    background-color: var(--hover-item-background-color, rgba(0, 0, 0, 0.03));
    padding: 0.25rem;
    margin: -0.25rem;
}

.thinking-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--link-color, var(--hover-item-text-color));
    border-radius: 50%;
    animation: thinkingPulse 1.4s infinite ease-in-out;
}

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

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

.thinking-dots span:nth-child(3) {
    animation-delay: 0s;
}

.thinking-label {
    font-weight: 500;
    color: var(--link-color, var(--hover-item-text-color)) !important;
}

.thinking-toggle {
    color: var(--muted-text-color) !important;
    transition: transform 0.2s ease;
    background: transparent !important;
    border: none !important;
}

.thinking-toggle:hover {
    color: var(--main-text-color) !important;
}

.thinking-toggle.expanded {
    transform: rotate(180deg);
}

.thinking-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--subtle-border-color, var(--main-border-color));
    animation: expandDown 0.3s ease-out;
}

.thinking-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--main-text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: var(--input-background-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--subtle-border-color, var(--main-border-color));
    max-height: 300px;
    overflow-y: auto;
    transition: border-color 0.2s ease;
}

.thinking-text:hover {
    border-color: var(--main-border-color);
}

/* Animations */
@keyframes thinkingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        inset-inline-start: -100%;
    }
    100% {
        inset-inline-start: 100%;
    }
}

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

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .thinking-bubble {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    .thinking-text {
        font-size: 0.8rem;
        padding: 0.5rem;
        max-height: 200px;
    }
} 