@font-face {
    font-family: 'WAGOConnective';
    src: url('/public/font/WAGOConnectiveVar.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'WAGOConnective';
    src: url('/public/font/WAGOConnectiveVar-Italic.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
}

html,
body {
    font-family: 'WAGOConnective', sans-serif !important;
}

.light {
    --bg-color: #FFFFFF;
    --secondary-bg-color: #EFF0F1;
    --text-color: #1F2837;
    --secondary-text-color: #A5A8AF;
    --error-color: #BB0522;
    /* Components for tool updates shimmer.  HSL equivalent of #1f2837 and #eeeee2 */
    --tool-update-shimmer-base-color: 218 28% 17%;
    --tool-update-shimmer-highlight-color: 60 25% 91%;
    /*
    Calculated filter chain of #1F2837 to recolor the icon in light mode.
    Generated by [https://angel-rs.github.io/css-color-filter-generator/]
    */
    --text-color-as-filter: brightness(0) saturate(100%) invert(11%) sepia(23%) saturate(1006%) hue-rotate(178deg) brightness(97%) contrast(89%);
}

.dark {
    --bg-color: #333B48;
    --secondary-bg-color: #1F2837;
    --text-color: #FFFFFF;
    --secondary-text-color: #616A73;
    --error-color: #FF7F73;
    /* Components for tool updates shimmer.  HSL equivalent of #1f2837 and #eeeee2 */
    --tool-update-shimmer-base-color: 60 25% 91%;
    --tool-update-shimmer-highlight-color: 218 28% 17%;
    /*
    Calculated filter chain of #FFFFFF to recolor the icon in dark mode.
    Generated by [https://angel-rs.github.io/css-color-filter-generator/]
    */
    --text-color-as-filter: brightness(0) saturate(100%) invert(100%) sepia(33%) saturate(2061%) hue-rotate(181deg) brightness(110%) contrast(106%);
}

/*
BEGIN Light/ Dark Theme
*/
.placeholder\:text-muted-foreground::placeholder {
    color: var(--secondary-text-color) !important;
}

div.text-muted-foreground span {
    color: var(--secondary-text-color) !important;
}

/* Chainlit displays completed tool updates as muted text. Keep tool headings readable in both themes. */
[data-step-type="tool"] p.text-muted-foreground,
[data-step-type="tool"] button.text-muted-foreground {
    color: var(--tool-update-text-color) !important;
}

/* Set the colors used by Chainlit's existing animated shimmer without overriding its animation. */
[data-step-type="tool"] .loading-shimmer {
    --muted: var(--tool-update-shimmer-base-color);
    --foreground: var(--tool-update-shimmer-highlight-color);
}

div .py-1 {
    border: none !important;
}

svg.\!size-6 path {
    fill: var(--text-color) !important;
}

svg.lucide-arrow-down {
    color: var(--text-color) !important;
}

#search-chats-button {
    color: var(--text-color) !important;
}

.text-sidebar-foreground\/70 {
    color: var(--secondary-text-color) !important;
}

img[src*="circle-question-mark.svg"] {
    filter: var(--text-color-as-filter);
}

img[src*="license.svg"] {
    filter: var(--text-color-as-filter);
}

/* Disclaimer color below */
.watermark .prose div.leading-7[role="article"]:last-child {
    color: var(--secondary-text-color) !important;
}

/* Dialog text color (alertdialog/dialog) */
div[role="alertdialog"],
div[role="dialog"] {
    color: var(--text-color) !important;
}

/* thread name input */
#name {
    background-color: var(--secondary-bg-color);
}

/* AlertDialog Cancel-Button */
div[role="alertdialog"] button.bg-background,
/* Settings Cancel-Button */
#chat-settings .flex.sm\:flex-row button:nth-of-type(2) {
    color: var(--text-color) !important;
    border-color: var(--text-color) !important;
    border-width: 1px !important;
    background: transparent !important;
}

/* AlertDialog Cancel Hover*/
div[role="alertdialog"] button.bg-background:hover,
/* Dialog Cancel Hover */
div[role="dialog"] button.bg-background:hover,
/* Secondary Button Hover */
button.bg-background:hover,
/* Settings Cancel-Button Hover */
#chat-settings .flex.sm\:flex-row button:nth-of-type(2):hover {
    background-color: color-mix(in srgb, var(--bg-color) 90%, var(--text-color) 10%) !important;
}

/* Dialog Cancel Click (alertdialog/dialog) */
div[role="alertdialog"] button.bg-background:active,
/* Dialog Cancel Click (alertdialog/dialog) */
div[role="dialog"] button.bg-background:active,
/* Secondary Button Click */
button.bg-background:active,
/* Settings Cancel-Button Click */
#chat-settings .flex.sm\:flex-row button:nth-of-type(2):active {
    background-color: color-mix(in srgb, var(--bg-color) 80%, var(--text-color) 20%) !important;
}

/* Overlay color */
body>div[data-state="open"][aria-hidden="true"]:not([role]) {
    background-color: color-mix(in srgb, var(--text-color) 50%, transparent);
}

/* Login headline */
h1 span {
    color: var(--text-color) !important;
}

/* Secondary Button */
button.bg-background {
    color: var(--text-color) !important;
    border-color: var(--text-color);
    border-width: 1px !important;
    background: transparent !important;
}

/* Fix broken 'Go to bottom'-button from above rule */
button.bg-background.rounded-full {
    background: var(--secondary-bg-color) !important;
    border: none;
}

/* Privacy Policy Link (Button) */
div[role="dialog"] button.text-primary {
    color: var(--text-color) !important;
    text-decoration: underline !important;
}

/* Code card headline */
div.text-card-foreground div span.text-muted-foreground {
    color: var(--secondary-text-color) !important;
}

/*
END Light/ Dark Theme
*/

/*
BEGIN Common theme values
*/
/* AlertDialog Confirm-Button */
div[role="alertdialog"] button.bg-primary.text-primary-foreground {
    color: #FFFFFF !important;
    background-color: #BB0522 !important;
}

/* AlertDialog Confirm Hover */
div[role="alertdialog"] button.bg-primary.text-primary-foreground:hover {
    background-color: color-mix(in srgb, #BB0522 90%, #1F2837 10%) !important;
}

/* AlertDialog Confirm Click */
div[role="alertdialog"] button.bg-primary.text-primary-foreground:active {
    background-color: color-mix(in srgb, #BB0522 80%, #1F2837 20%) !important;
}

/* Dialog Confirm Hover */
div[role="dialog"] button.bg-primary.text-primary-foreground:hover {
    background-color: color-mix(in srgb, #6EC800 90%, #1F2837 10%) !important;
}

/* Dialog Confirm Click */
div[role="dialog"] button.bg-primary.text-primary-foreground:active {
    background-color: color-mix(in srgb, #6EC800 80%, #1F2837 20%) !important;
}

/* Profile Letter in top right corner */
#user-nav-button span {
    color: #1F2837 !important;
}

/* Chat dots should not change color when hover */
#thread-options:hover {
    color: inherit !important;
}

/* Always use dark color for green buttons (also in light theme) */
button.bg-primary {
    color: #1F2837 !important;
}

#chat-submit svg path {
    fill: #1F2837 !important;
}

/* Explain why the send button is disabled when the message exceeds its limit. */
.input-limit-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: transparent;
    pointer-events: auto;
}

.input-limit-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

.input-limit-tooltip__content {
    padding: 0.375rem 0.75rem;
    overflow: hidden;
    color: var(--text-color);
    font-size: 0.875rem;
    background: var(--secondary-bg-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);
}

.input-limit-counter {
    position: absolute;
    top: 50%;
    right: calc(100% + 0.5rem);
    transform: translateY(-50%);
    color: var(--secondary-text-color);
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.input-limit-counter--invalid {
    color: hsl(var(--destructive));
}

/* Code block copy button */
div.text-card-foreground button:not(.bg-primary) {
    color: var(--secondary-text-color) !important;
}

/*
END Common theme values
*/

/* Toast notifications (e.g. "Chat deleted" / "Deleting Chat") */
[data-sonner-toast] {
    background-color: var(--secondary-bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--secondary-bg-color) !important;
}

[data-sonner-toast] [data-title] {
    color: var(--text-color) !important;
}

[data-sonner-toast] [data-description] {
    color: var(--secondary-text-color) !important;
}

[data-sonner-toast] [data-close-button] {
    background-color: var(--secondary-bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--secondary-bg-color) !important;
}

/* Success toast "Chat deleted" */
[data-sonner-toast][data-type="success"] {
    background-color: #6EC800 !important;
    border-color: #6EC800 !important;
    color: #1F2837 !important;
}

/* Error toast (e.g. Upload failed) */
[data-sonner-toast][data-type="error"] {
    background-color: #BB0522 !important;
    border-color: #BB0522 !important;
    color: #FFFFFF !important;
}

[data-sonner-toast][data-type="error"] [data-title],
[data-sonner-toast][data-type="error"] [data-description] {
    color: #FFFFFF !important;
}

[data-sonner-toast][data-type="error"] svg {
    color: #FFFFFF !important;
}

/* Session error banner "Could not reach the server" */
#session-error {
    background-color: #BB0522 !important;
    border-color: #BB0522 !important;
}

#session-error p,
#session-error span {
    color: #FFFFFF !important;
}

#session-error svg {
    color: #FFFFFF !important;
}

/* Info banner "No chat found" – uses theme colors */
.alert.bg-blue-50 {
    background-color: var(--bg-color) !important;
    border-color: var(--bg-color) !important;
}

.alert.bg-blue-50 p,
.alert.bg-blue-50 span {
    color: var(--text-color) !important;
}

.alert.bg-blue-50 svg {
    color: var(--text-color) !important;
}

/* This rule removes the empty tool tip from the help button in the header. */
#header button:has(a[href="/user-manual"])+[data-radix-popper-content-wrapper] {
    display: none !important;
}

#header button:has(a[href="/activate-license"])+[data-radix-popper-content-wrapper] {
    display: none !important;
}

/* Ensure Login page image is not too big */
img[src='/public/custom-background.svg'] {
    object-fit: scale-down;
}

/* Change the slider thumb */
#Requests [role="slider"] {
    display: none;
}

label[for="Requests"]>div.inline-flex {
    display: none;
}

#LicenseExpiration [role="slider"] {
    display: none;
}

label[for="LicenseExpiration"]>div.inline-flex {
    display: none;
}

#TrialPhase [role="slider"] {
    display: none;
}

label[for="TrialPhase"]>div.inline-flex {
    display: none;
}

/* Remove "Reset" button from settings */
#chat-settings .flex.flex-col-reverse.sm\:flex-row button:first-child {
    display: none;
}