/* Berlin AI custom theme overrides */

/* Hide the light/dark mode toggle since we force dark */
#theme-toggle {
    display: none !important;
}

/* Login page styling */
.cl-login-page {
    background-color: #0B0B0B !important;
}

/* Login page logo: resize for square icon (text injected by branding.js) */
img.logo[alt="logo"] {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain;
}

/* Scrollbar styling to match dark theme */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0B0B0B;
}
::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1F6F5B;
}

/* Header bar action buttons (profile + admin) */
.bais-profile-btn,
.bais-admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #262626;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
    margin-right: 8px;
}
.bais-profile-btn:hover,
.bais-admin-btn:hover {
    color: #1F6F5B;
    background-color: rgba(31, 111, 91, 0.12);
    border-color: #1F6F5B;
}
.bais-profile-btn:focus-visible,
.bais-admin-btn:focus-visible {
    outline: 2px solid #1F6F5B;
    outline-offset: 2px;
}

/* Fix Sonner toast container intercepting clicks on action buttons.
   The invisible fixed-position <ol> covers part of the viewport even
   when no toasts are visible. Let clicks pass through the container
   but keep actual toast notifications interactive. */
[data-sonner-toaster] {
    pointer-events: none !important;
}
[data-sonner-toast] {
    pointer-events: auto !important;
}

/* Fix: Chainlit 2.10 action button click-target offset (GitHub #2204)
   Root cause: Chainlit's auto-scroll spacer (div.flex-shrink-0) dynamically
   sets its height to push the last user message to the viewport top. When a
   file attachment card is in the user message, the spacer height is calculated
   before the card fully renders, creating excess space that pushes action
   buttons down. Hit-test regions cache the pre-shift position. DevTools fixes
   it because resize triggers spacer recalculation.
   Fix: Zero out the spacer. The assistant auto-scroll (scrollTop = scrollHeight)
   still works and is the better UX anyway. */
div.flex-shrink-0:last-child {
    height: 0px !important;
}

/* --- Workflow progress card ---
   Applied by branding.js when a workflow progress message is detected. */
[data-workflow-progress] {
    background: #141414 !important;
    border: 1px solid #262626 !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    margin: 4px 0 !important;
}
[data-workflow-progress] p {
    line-height: 1.8 !important;
}

/* --- Workflow completion card ---
   Applied by branding.js when a workflow completion message is detected. */
[data-workflow-complete] {
    background: linear-gradient(135deg, #0F3D2E 0%, #141414 40%) !important;
    border: 1px solid #1F6F5B !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    margin: 4px 0 !important;
}

/* --- Input blocking during workflow execution ---
   body.workflow-running is set by branding.js when a progress card is active. */
body.workflow-running [class*="composer"] {
    opacity: 0.35 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}
