@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@source "../../../node_modules/streamdown/dist/*.js";

@custom-variant dark (&:is(.dark *));

@theme inline {
    --color-background: var(--background);
    --color-foreground: var(--foreground);
    --color-border: var(--border);
    --color-ring: var(--ring);
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
    --font-heading: var(--font-sans);
    --font-sans: var(--font-sans);
    --color-sidebar-ring: var(--sidebar-ring);
    --color-sidebar-border: var(--sidebar-border);
    --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
    --color-sidebar-accent: var(--sidebar-accent);
    --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
    --color-sidebar-primary: var(--sidebar-primary);
    --color-sidebar-foreground: var(--sidebar-foreground);
    --color-sidebar: var(--sidebar);
    --color-chart-5: var(--chart-5);
    --color-chart-4: var(--chart-4);
    --color-chart-3: var(--chart-3);
    --color-chart-2: var(--chart-2);
    --color-chart-1: var(--chart-1);
    --color-input: var(--input);
    --color-destructive: var(--destructive);
    --color-accent-foreground: var(--accent-foreground);
    --color-accent: var(--accent);
    --color-muted-foreground: var(--muted-foreground);
    --color-muted: var(--muted);
    --color-secondary-foreground: var(--secondary-foreground);
    --color-secondary: var(--secondary);
    --color-primary-foreground: var(--primary-foreground);
    --color-primary: var(--primary);
    --color-popover-foreground: var(--popover-foreground);
    --color-popover: var(--popover);
    --color-card-foreground: var(--card-foreground);
    --color-card: var(--card);
    --radius-2xl: calc(var(--radius) * 1.8);
    --radius-3xl: calc(var(--radius) * 2.2);
    --radius-4xl: calc(var(--radius) * 2.6);
}

:root {
    --radius: 0.625rem;
    --border: oklch(0.922 0 0);
    --ring: oklch(0.708 0 0);
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.145 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.97 0 0);
    --secondary-foreground: oklch(0.205 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --accent: oklch(0.97 0 0);
    --accent-foreground: oklch(0.205 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --input: oklch(0.922 0 0);
    --chart-1: oklch(0.87 0 0);
    --chart-2: oklch(0.556 0 0);
    --chart-3: oklch(0.439 0 0);
    --chart-4: oklch(0.371 0 0);
    --chart-5: oklch(0.269 0 0);
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: oklch(0.205 0 0);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.708 0 0);
}

.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --border: oklch(1 0 0 / 10%);
    --ring: oklch(0.556 0 0);
    --card: oklch(0.205 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.205 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --input: oklch(1 0 0 / 15%);
    --chart-1: oklch(0.87 0 0);
    --chart-2: oklch(0.556 0 0);
    --chart-3: oklch(0.439 0 0);
    --chart-4: oklch(0.371 0 0);
    --chart-5: oklch(0.269 0 0);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
    * {
        @apply border-border outline-ring/50;
    }
    html,
    body {
        height: 100%;
        overflow: hidden;
    }
    body {
        @apply bg-background text-foreground;
    }
    textarea {
        resize: none;
    }
    textarea::-webkit-resizer {
        display: none;
    }
    html {
        @apply font-sans;
    }
}

@layer utilities {
    .ai-title-aurora {
        background: linear-gradient(90deg, #111827 0%, #111827 36%, #6b7280 54%, #111827 72%, #111827 100%);
        background-size: 220% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: ai-title-aurora 7s ease-in-out infinite;
    }

    .dark .ai-title-aurora {
        background: linear-gradient(90deg, #fafaf9 0%, #fafaf9 36%, #a8a29e 54%, #fafaf9 72%, #fafaf9 100%);
        background-size: 220% 100%;
        -webkit-background-clip: text;
        background-clip: text;
    }

    @keyframes ai-title-aurora {
        0%,
        100% {
            background-position: 0% 50%;
            filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
        }
        50% {
            background-position: 100% 50%;
            filter: drop-shadow(0 12px 28px rgba(28, 25, 23, 0.08));
        }
    }

    .hide-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }

    .prompt-filter-tag.ant-tag-checkable {
        margin: 0;
        border: 1px solid transparent;
        border-radius: 6px;
        padding: 5px 10px;
        color: #57534e;
        font-size: 14px;
        line-height: 1;
        transition:
            background 0.15s ease,
            border-color 0.15s ease,
            box-shadow 0.15s ease,
            color 0.15s ease;
    }

    .prompt-filter-tag.ant-tag-checkable:hover {
        background: rgba(28, 25, 23, 0.06);
        color: #1c1917;
    }

    .prompt-filter-tag.ant-tag-checkable.is-active,
    .prompt-filter-tag.ant-tag-checkable-checked {
        background: #111111;
        border-color: #111111;
        color: #ffffff;
        font-weight: 600;
    }

    .dark .prompt-filter-tag.ant-tag-checkable {
        color: #e7e5e4;
    }

    .dark .prompt-filter-tag.ant-tag-checkable:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .dark .prompt-filter-tag.ant-tag-checkable.is-active,
    .dark .prompt-filter-tag.ant-tag-checkable-checked {
        background: rgba(250, 250, 249, 0.96);
        border-color: rgba(255, 255, 255, 0.88);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.18),
            0 6px 18px rgba(0, 0, 0, 0.22);
        color: #0c0a09 !important;
        font-weight: 700;
    }

    .thin-scrollbar {
        scrollbar-color: rgba(120, 113, 108, 0.45) transparent;
        scrollbar-width: thin;
    }

    .thin-scrollbar::-webkit-scrollbar {
        height: 4px;
        width: 4px;
    }

    .thin-scrollbar::-webkit-scrollbar-thumb {
        background: rgba(120, 113, 108, 0.45);
        border-radius: 999px;
    }

    .hover-scrollbar {
        scrollbar-color: transparent transparent;
        scrollbar-width: thin;
    }

    .hover-scrollbar:hover {
        scrollbar-color: rgba(120, 113, 108, 0.5) transparent;
    }

    .hover-scrollbar::-webkit-scrollbar {
        height: 6px;
        width: 6px;
    }

    .hover-scrollbar::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 999px;
    }

    .hover-scrollbar:hover::-webkit-scrollbar-track {
        background: rgba(120, 113, 108, 0.12);
        border-radius: 999px;
    }

    .hover-scrollbar:hover::-webkit-scrollbar-thumb {
        background: rgba(120, 113, 108, 0.5);
    }

    .hover-scrollbar-hint {
        position: relative;
    }

    .hover-scrollbar-hint::after {
        background: rgba(120, 113, 108, 0.42);
        border-radius: 999px;
        bottom: 4px;
        content: "";
        height: 3px;
        left: 12px;
        opacity: 0;
        pointer-events: none;
        position: absolute;
        right: 12px;
        transition: opacity 0.18s ease;
    }

    .hover-scrollbar-hint:hover::after {
        opacity: 1;
    }

    .canvas-control-select.ant-select .ant-select-selector,
    .canvas-control-number.ant-input-number {
        border-color: rgba(120, 113, 108, 0.32) !important;
        box-shadow: none !important;
    }

    .canvas-compact-control.canvas-control-select.ant-select {
        height: 100%;
    }

    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selector,
    .canvas-compact-control.canvas-control-number.ant-input-number {
        height: 100% !important;
    }

    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selection-item,
    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selection-placeholder {
        align-items: center;
        display: flex;
    }

    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selection-item,
    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selection-placeholder,
    .canvas-compact-control.canvas-control-select.ant-select .ant-select-selection-search-input,
    .canvas-compact-control.canvas-control-number.ant-input-number .ant-input-number-input {
        height: 100% !important;
        line-height: 1 !important;
    }

    .canvas-composer-icon.ant-btn {
        flex: 0 0 32px;
        width: 32px;
    }

    .canvas-composer-tools {
        container-type: inline-size;
    }

    .canvas-composer-mode-button {
        width: 32px;
    }

    .canvas-composer-tools .canvas-composer-mode-button span,
    .canvas-composer-tools .canvas-model-picker-text,
    .canvas-composer-tools .canvas-select-chevron,
    .canvas-composer-tools .canvas-composer-icon.ant-btn > span:not(.ant-btn-icon) {
        display: none;
    }

    .canvas-composer-tools .canvas-composer-model-picker {
        width: 32px;
        min-width: 32px;
        justify-content: center;
        gap: 0;
        padding-inline: 0;
    }

    @container (min-width: 440px) {
        .canvas-composer-mode-button {
            padding-inline: 8px;
            width: auto;
        }

        .canvas-composer-tools .canvas-composer-mode-button span {
            display: inline;
            font-size: 12px;
            line-height: 1;
        }

        .canvas-composer-icon.ant-btn {
            flex: 0 1 auto;
            max-width: 170px;
            width: auto !important;
        }

        .canvas-composer-tools .canvas-composer-icon.ant-btn > span:not(.ant-btn-icon) {
            display: inline-flex;
            min-width: 0;
        }

        .canvas-composer-tools .canvas-composer-model-picker {
            width: auto;
            min-width: 9rem;
            justify-content: flex-start;
            gap: 0.5rem;
            padding-inline: 0.75rem;
        }

        .canvas-composer-tools .canvas-model-picker-text,
        .canvas-composer-tools .canvas-select-chevron {
            display: inline;
        }
    }

    .canvas-control-select.ant-select-focused .ant-select-selector,
    .canvas-control-number.ant-input-number-focused {
        border-color: #a8a29e !important;
    }

    .dark .canvas-control-select.ant-select .ant-select-selector,
    .dark .canvas-control-number.ant-input-number {
        border-color: rgba(214, 211, 209, 0.2) !important;
    }

    .dark .canvas-control-select.ant-select-focused .ant-select-selector,
    .dark .canvas-control-number.ant-input-number-focused {
        border-color: #78716c !important;
    }

    .canvas-image-settings-popover .ant-popover-inner {
        border-radius: 18px;
        box-shadow: 0 18px 54px rgba(28, 25, 23, 0.16);
        padding: 18px;
    }

    .canvas-image-settings-popover .ant-popover-inner-content {
        max-height: calc(100vh - 96px);
        overflow-y: auto;
    }

    .canvas-image-settings-popover .ant-segmented {
        border-radius: 999px;
        padding: 3px;
    }

    .canvas-image-settings-popover .ant-segmented-item {
        border-radius: 999px;
    }

    .dark .canvas-image-settings-popover .ant-popover-inner {
        box-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
    }

    .canvas-node-info-modal .ant-modal-header {
        padding-right: 0;
    }

    .canvas-node-info-modal .ant-modal-title {
        line-height: 1;
    }

    .canvas-node-info-modal .ant-modal-close {
        top: 21px;
    }

    @keyframes canvas-batch-child-in {
        from {
            opacity: 0;
            transform: translate(var(--batch-from-x), var(--batch-from-y)) rotate(var(--batch-from-rotate)) scale(0.72);
        }

        72% {
            opacity: 1;
            transform: translate(0, 0) rotate(-1deg) scale(1.015);
        }

        to {
            opacity: 1;
            transform: translate(0, 0) rotate(0) scale(1);
        }
    }

}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

.agent-streamdown {
    overflow-wrap: anywhere;
}

.agent-streamdown > :first-child {
    margin-top: 0;
}

.agent-streamdown > :last-child {
    margin-bottom: 0;
}

.agent-streamdown [data-streamdown="code-block"] {
    position: relative;
    display: block;
    contain: none;
    contain-intrinsic-size: none !important;
    width: 100%;
    margin-block: 0.35rem;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0.4rem;
    background: color-mix(in srgb, currentColor 5%, transparent);
}

.agent-streamdown [data-streamdown="code-block-header"] {
    display: none;
}

.agent-streamdown [data-streamdown="code-block"] > div:has(> [data-streamdown="code-block-actions"]) {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    z-index: 1;
    height: auto;
    margin: 0;
}

.agent-streamdown [data-streamdown="code-block-body"] {
    min-height: 0;
    padding: 0.4rem 2rem 0.4rem 0.6rem;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    font-size: 0.75rem;
    line-height: 1.15rem;
}

.agent-streamdown [data-streamdown="code-block-body"] code > span {
    display: block;
}

.agent-streamdown [data-streamdown="code-block-actions"] {
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transition: opacity 150ms ease;
}

.agent-streamdown [data-streamdown="code-block"]:hover [data-streamdown="code-block-actions"],
.agent-streamdown [data-streamdown="code-block-actions"]:focus-within {
    opacity: 0.58;
}

.agent-streamdown [data-streamdown="code-block-actions"] button {
    padding: 0.25rem;
    border-radius: 0.3rem;
}

.agent-streamdown [data-streamdown="code-block-actions"] button:hover {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.agent-streamdown [data-streamdown="inline-code"] {
    padding: 0.12rem 0.35rem;
    border: 0;
    border-radius: 0.3rem;
    background: color-mix(in srgb, currentColor 7%, transparent);
    font-size: 0.88em;
}

.agent-streamdown [data-streamdown="link"] {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 0.2em;
}

[data-streamdown="link-safety-modal"] {
    padding: 1rem;
    background: rgb(28 25 23 / 24%);
    backdrop-filter: blur(8px);
}

[data-streamdown="link-safety-modal"] > div {
    max-width: 24rem;
    gap: 1rem;
    padding: 1.25rem;
    border-color: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgb(28 25 23 / 18%);
}

[data-streamdown="link-safety-modal"] > div > button {
    top: 0.9rem;
    right: 0.9rem;
}

[data-streamdown="link-safety-modal"] > div > div:first-of-type {
    gap: 0.25rem;
    padding-right: 2rem;
}

[data-streamdown="link-safety-modal"] > div > div:first-of-type > div {
    gap: 0.5rem;
    font-size: 1rem;
}

[data-streamdown="link-safety-modal"] > div > div:nth-of-type(2) {
    max-height: 7rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, currentColor 9%, transparent);
    background: color-mix(in srgb, currentColor 4%, transparent);
    font-size: 0.7rem;
    line-height: 1.15rem;
    overflow-wrap: anywhere;
}

[data-streamdown="link-safety-modal"] > div > div:last-child {
    justify-content: flex-end;
}

[data-streamdown="link-safety-modal"] > div > div:last-child button {
    flex: none;
    min-width: 7rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
}
