/* Mercury shell styling: sidebar + main content layout. */

:root {
    --mercury-sidebar-width: 260px;
    --mercury-sidebar-bg: #f8f9fa;
}

/* Layout wrapper */
.mercury-layout {
    min-height: 100vh;
}

/* Fixed left sidebar on large screens */
@media (min-width: 992px) {
    .mercury-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--mercury-sidebar-width);
        background: var(--mercury-sidebar-bg);
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .mercury-main {
        margin-left: var(--mercury-sidebar-width);
    }
}

/* Navigation pills */
.mercury-nav .nav-link {
    color: #212529;
    border-radius: 0.375rem;
}

.mercury-nav .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mercury-nav .nav-link.active {
    background: #0d6efd;
    color: #fff;
}

/* Offcanvas nav reuses the same sidebar background */
.mercury-offcanvas {
    background: var(--mercury-sidebar-bg);
}

/* Rendered document Markdown: wrap long lines, keep formatting readable. */
.mercury-markdown {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 32rem;
    overflow-y: auto;
    font-size: 0.875rem;
    background: var(--mercury-sidebar-bg);
    padding: 1rem;
    border-radius: 0.375rem;
}

/* Chat: recent-chats sidebar + message thread. */
.mercury-chat-list {
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

.mercury-messages {
    max-height: calc(100vh - 20rem);
    overflow-y: auto;
}

.mercury-messages-pane {
    max-height: calc(100vh - 22rem);
}

/* Chat message bubbles */
.mercury-message {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    max-width: 90%;
}

.mercury-message-user {
    background: #e7f1ff;
    margin-left: auto;
}

.mercury-message-assistant {
    background: var(--mercury-sidebar-bg);
    margin-right: auto;
}

.mercury-message-content {
    word-break: break-word;
}

.mercury-context-list {
    max-height: 18rem;
    overflow-y: auto;
}

/* Floating "Ask AI" button that opens the workspace chat offcanvas (< lg). */
.mercury-ask-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1045;
    border-radius: 2rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
}

/* On large screens the workspace chat pane sticks alongside the goal content. */
@media (min-width: 992px) {
    .mercury-workspace-chat {
        position: sticky;
        top: 1rem;
    }
}

/* Global HTMX request spinner hook */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}
