/* Custom styles for Agentic SAM demo */

:root {
    --sidebar-bg: #f8f9fa;
    --border-color: #dee2e6;
    --reasoning-color: #6c757d;
    --reasoning-summary-color: #0dcaf0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

.container-fluid {
    height: 100vh;
    overflow: hidden;
}

.row {
    height: 100%;
}

/* Sidebars */
.sidebar-left,
.sidebar-right {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    height: 100vh;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

/* Chat Container */
.chat-container {
    height: 100vh;
    overflow: hidden;
}

.chat-header {
    background-color: white;
}

.chat-messages {
    overflow-y: auto;
    background-color: #f5f5f5;
}

.chat-input {
    background-color: white;
}

/* Message Cards */
.agent-message {
    margin-bottom: 1rem;
}

.agent-badge {
    font-size: 0.85rem;
    font-weight: 600;
}

.agent-content {
    margin-top: 0.5rem;
}

.collapsible-section {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.collapsible-header {
    background-color: #e9ecef;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.25rem;
}

.collapsible-header:hover {
    background-color: #dee2e6;
}

.collapsible-header.collapsed {
    border-radius: 0.25rem;
}

.collapsible-body {
    padding: 0.75rem;
    background-color: white;
}

.collapsible-body.collapsed {
    display: none;
}

/* Reasoning styling */
.reasoning-text {
    color: var(--reasoning-color);
    font-size: 0.9rem;
    font-style: italic;
}

.reasoning-summary-text {
    color: var(--reasoning-summary-color);
    font-size: 0.9rem;
}

/* Response text */
.response-text {
    font-size: 1rem;
    line-height: 1.6;
}

/* Metadata footer */
.metadata-footer {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Special result displays */
.result-display {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.result-display.rejected {
    background-color: #ffe7e7;
    border-left-color: #dc3545;
}

.result-display.success {
    background-color: #e7ffe7;
    border-left-color: #198754;
}

/* Connection status */
#connection-status {
    font-size: 0.75rem;
}

#connection-status.connected {
    background-color: #198754;
}

#connection-status.disconnected {
    background-color: #dc3545;
}

#connection-status.connecting {
    background-color: #ffc107;
}

/* Code blocks */
pre {
    background-color: #1e1e1e;
    border-radius: 0.25rem;
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    color: #d4d4d4;
    font-size: 0.9rem;
}

/* Document list items */
.kb-doc-item {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.kb-doc-item:hover {
    background-color: #f8f9fa;
}

.kb-doc-item.kb-doc-selected {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
}

.kb-doc-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.kb-doc-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Input textarea auto-resize */
#user-input {
    resize: none;
    max-height: 150px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* User message styling */
.user-message {
    background-color: #007bff;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    margin-left: 3rem;
}

/* Loading indicator */
.loading-indicator {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Agent config note */
.model-settings-note {
    display: block;
    margin-top: 0.5rem;
}

/* Accordion custom styling */
.accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0d6efd;
}

/* Card improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Badge spacing */
.badge+.badge {
    margin-left: 0.25rem;
}

/* Markdown content styling */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 0.75rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.markdown-content code {
    background-color: #f5f5f5;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .sidebar-left.show,
    .sidebar-right.show {
        display: block;
        position: fixed;
        z-index: 1000;
        width: 80%;
        height: 100vh;
    }
}