/* Atomic CSS Utilities */

/*
 * DBMN's names for the theme's colours: each is the VS Code theme colour of the same name
 * (--dbmn-foreground is --vscode-foreground). Nothing about theming changes: a theme is still
 * given as VS Code's colours (VS Code sets them itself, the web and desktop apps set them from the
 * theme picked, the Hub copies them into each tab), and these only point at them, so a theme
 * change reaches every one with nothing else to do.
 *
 * The design system's components (shared/dbmn-*.css) use these names; the rest of the app still
 * uses the --vscode- names, which mean the same. A colour a theme leaves out is left out here
 * too, so `var(--dbmn-panel-border, <fallback>)` falls back exactly as the --vscode- name does.
 *
 * (On the body as well as the root: buttons.css changes two hover colours on the body, and the
 * names must follow them there.)
 */
:root,
body {
    --dbmn-badge-background: var(--vscode-badge-background);
    --dbmn-badge-foreground: var(--vscode-badge-foreground);
    --dbmn-button-background: var(--vscode-button-background);
    --dbmn-button-border: var(--vscode-button-border);
    --dbmn-button-foreground: var(--vscode-button-foreground);
    --dbmn-button-hoverBackground: var(--vscode-button-hoverBackground);
    --dbmn-button-secondaryBackground: var(--vscode-button-secondaryBackground);
    --dbmn-button-secondaryForeground: var(--vscode-button-secondaryForeground);
    --dbmn-button-secondaryHoverBackground: var(--vscode-button-secondaryHoverBackground);
    --dbmn-charts-blue: var(--vscode-charts-blue);
    --dbmn-charts-green: var(--vscode-charts-green);
    --dbmn-charts-orange: var(--vscode-charts-orange);
    --dbmn-charts-purple: var(--vscode-charts-purple);
    --dbmn-charts-red: var(--vscode-charts-red);
    --dbmn-charts-yellow: var(--vscode-charts-yellow);
    --dbmn-checkbox-foreground: var(--vscode-checkbox-foreground);
    --dbmn-contrastBorder: var(--vscode-contrastBorder);
    --dbmn-debugTokenExpression-name: var(--vscode-debugTokenExpression-name);
    --dbmn-debugTokenExpression-value: var(--vscode-debugTokenExpression-value);
    --dbmn-descriptionForeground: var(--vscode-descriptionForeground);
    --dbmn-diffEditor-insertedLineBackground: var(--vscode-diffEditor-insertedLineBackground);
    --dbmn-diffEditor-insertedTextBackground: var(--vscode-diffEditor-insertedTextBackground);
    --dbmn-disabledForeground: var(--vscode-disabledForeground);
    --dbmn-dropdown-background: var(--vscode-dropdown-background);
    --dbmn-dropdown-border: var(--vscode-dropdown-border);
    --dbmn-dropdown-foreground: var(--vscode-dropdown-foreground);
    --dbmn-editor-background: var(--vscode-editor-background);
    --dbmn-editor-findMatchHighlightBackground: var(--vscode-editor-findMatchHighlightBackground);
    --dbmn-editor-findMatchHighlightBorder: var(--vscode-editor-findMatchHighlightBorder);
    --dbmn-editor-font-family: var(--vscode-editor-font-family);
    --dbmn-editor-font-size: var(--vscode-editor-font-size);
    --dbmn-editor-foreground: var(--vscode-editor-foreground);
    --dbmn-editor-hoverHighlightBackground: var(--vscode-editor-hoverHighlightBackground);
    --dbmn-editor-inactiveSelectionBackground: var(--vscode-editor-inactiveSelectionBackground);
    --dbmn-editor-selectionHighlightBackground: var(--vscode-editor-selectionHighlightBackground);
    --dbmn-editorGroupHeader-tabsBackground: var(--vscode-editorGroupHeader-tabsBackground);
    --dbmn-editorHoverWidget-background: var(--vscode-editorHoverWidget-background);
    --dbmn-editorHoverWidget-border: var(--vscode-editorHoverWidget-border);
    --dbmn-editorHoverWidget-foreground: var(--vscode-editorHoverWidget-foreground);
    --dbmn-editorInfo-background: var(--vscode-editorInfo-background);
    --dbmn-editorLineNumber-foreground: var(--vscode-editorLineNumber-foreground);
    --dbmn-editorSuggestWidget-background: var(--vscode-editorSuggestWidget-background);
    --dbmn-editorSuggestWidget-border: var(--vscode-editorSuggestWidget-border);
    --dbmn-editorSuggestWidget-foreground: var(--vscode-editorSuggestWidget-foreground);
    --dbmn-editorSuggestWidget-selectedBackground: var(--vscode-editorSuggestWidget-selectedBackground);
    --dbmn-editorSuggestWidget-selectedForeground: var(--vscode-editorSuggestWidget-selectedForeground);
    --dbmn-editorWarning-background: var(--vscode-editorWarning-background);
    --dbmn-editorWarning-border: var(--vscode-editorWarning-border);
    --dbmn-editorWarning-foreground: var(--vscode-editorWarning-foreground);
    --dbmn-editorWidget-background: var(--vscode-editorWidget-background);
    --dbmn-editorWidget-border: var(--vscode-editorWidget-border);
    --dbmn-errorBackground: var(--vscode-errorBackground);
    --dbmn-errorBorder: var(--vscode-errorBorder);
    --dbmn-errorForeground: var(--vscode-errorForeground);
    --dbmn-errorList-errorForeground: var(--vscode-errorList-errorForeground);
    --dbmn-focusBorder: var(--vscode-focusBorder);
    --dbmn-font-family: var(--vscode-font-family);
    --dbmn-font-size: var(--vscode-font-size);
    --dbmn-foreground: var(--vscode-foreground);
    --dbmn-icon-foreground: var(--vscode-icon-foreground);
    --dbmn-input-background: var(--vscode-input-background);
    --dbmn-input-border: var(--vscode-input-border);
    --dbmn-input-foreground: var(--vscode-input-foreground);
    --dbmn-input-placeholderForeground: var(--vscode-input-placeholderForeground);
    --dbmn-inputValidation-errorBackground: var(--vscode-inputValidation-errorBackground);
    --dbmn-inputValidation-errorBorder: var(--vscode-inputValidation-errorBorder);
    --dbmn-inputValidation-errorForeground: var(--vscode-inputValidation-errorForeground);
    --dbmn-inputValidation-infoBackground: var(--vscode-inputValidation-infoBackground);
    --dbmn-inputValidation-infoBorder: var(--vscode-inputValidation-infoBorder);
    --dbmn-inputValidation-infoForeground: var(--vscode-inputValidation-infoForeground);
    --dbmn-inputValidation-warningBackground: var(--vscode-inputValidation-warningBackground);
    --dbmn-inputValidation-warningBorder: var(--vscode-inputValidation-warningBorder);
    --dbmn-inputValidation-warningForeground: var(--vscode-inputValidation-warningForeground);
    --dbmn-list-activeSelectionBackground: var(--vscode-list-activeSelectionBackground);
    --dbmn-list-activeSelectionForeground: var(--vscode-list-activeSelectionForeground);
    --dbmn-list-dropBackground: var(--vscode-list-dropBackground);
    --dbmn-list-headerBackground: var(--vscode-list-headerBackground);
    --dbmn-list-headerForeground: var(--vscode-list-headerForeground);
    --dbmn-list-hoverBackground: var(--vscode-list-hoverBackground);
    --dbmn-list-inactiveSelectionBackground: var(--vscode-list-inactiveSelectionBackground);
    --dbmn-menu-background: var(--vscode-menu-background);
    --dbmn-menu-border: var(--vscode-menu-border);
    --dbmn-menu-foreground: var(--vscode-menu-foreground);
    --dbmn-menu-selectionBackground: var(--vscode-menu-selectionBackground);
    --dbmn-menu-selectionForeground: var(--vscode-menu-selectionForeground);
    --dbmn-menu-separatorBackground: var(--vscode-menu-separatorBackground);
    --dbmn-merge-incomingHeaderBackground: var(--vscode-merge-incomingHeaderBackground);
    --dbmn-notifications-background: var(--vscode-notifications-background);
    --dbmn-notifications-border: var(--vscode-notifications-border);
    --dbmn-notifications-foreground: var(--vscode-notifications-foreground);
    --dbmn-notificationsErrorIcon-foreground: var(--vscode-notificationsErrorIcon-foreground);
    --dbmn-notificationsInfoIcon-foreground: var(--vscode-notificationsInfoIcon-foreground);
    --dbmn-notificationsWarningIcon-foreground: var(--vscode-notificationsWarningIcon-foreground);
    --dbmn-panel-border: var(--vscode-panel-border);
    --dbmn-progressBar-background: var(--vscode-progressBar-background);
    --dbmn-sash-hoverBorder: var(--vscode-sash-hoverBorder);
    --dbmn-scrollbarSlider-activeBackground: var(--vscode-scrollbarSlider-activeBackground);
    --dbmn-scrollbarSlider-background: var(--vscode-scrollbarSlider-background);
    --dbmn-scrollbarSlider-hoverBackground: var(--vscode-scrollbarSlider-hoverBackground);
    --dbmn-sideBar-background: var(--vscode-sideBar-background);
    --dbmn-sideBar-foreground: var(--vscode-sideBar-foreground);
    --dbmn-statusBarItem-errorBackground: var(--vscode-statusBarItem-errorBackground);
    --dbmn-statusBarItem-errorForeground: var(--vscode-statusBarItem-errorForeground);
    --dbmn-symbolIcon-booleanForeground: var(--vscode-symbolIcon-booleanForeground);
    --dbmn-symbolIcon-fileForeground: var(--vscode-symbolIcon-fileForeground);
    --dbmn-symbolIcon-keyForeground: var(--vscode-symbolIcon-keyForeground);
    --dbmn-symbolIcon-nullForeground: var(--vscode-symbolIcon-nullForeground);
    --dbmn-symbolIcon-numberForeground: var(--vscode-symbolIcon-numberForeground);
    --dbmn-symbolIcon-propertyForeground: var(--vscode-symbolIcon-propertyForeground);
    --dbmn-symbolIcon-stringForeground: var(--vscode-symbolIcon-stringForeground);
    --dbmn-tab-activeBackground: var(--vscode-tab-activeBackground);
    --dbmn-tab-activeForeground: var(--vscode-tab-activeForeground);
    --dbmn-tab-border: var(--vscode-tab-border);
    --dbmn-tab-hoverBackground: var(--vscode-tab-hoverBackground);
    --dbmn-tab-hoverForeground: var(--vscode-tab-hoverForeground);
    --dbmn-tab-inactiveBackground: var(--vscode-tab-inactiveBackground);
    --dbmn-tab-inactiveForeground: var(--vscode-tab-inactiveForeground);
    --dbmn-terminal-ansiBlack: var(--vscode-terminal-ansiBlack);
    --dbmn-terminal-ansiGreen: var(--vscode-terminal-ansiGreen);
    --dbmn-testing-iconFailed: var(--vscode-testing-iconFailed);
    --dbmn-testing-iconPassed: var(--vscode-testing-iconPassed);
    --dbmn-testing-iconQueued: var(--vscode-testing-iconQueued);
    --dbmn-textBlockQuote-background: var(--vscode-textBlockQuote-background);
    --dbmn-textBlockQuote-border: var(--vscode-textBlockQuote-border);
    --dbmn-textCodeBlock-background: var(--vscode-textCodeBlock-background);
    --dbmn-textLink-activeForeground: var(--vscode-textLink-activeForeground);
    --dbmn-textLink-foreground: var(--vscode-textLink-foreground);
    --dbmn-textPreformat-foreground: var(--vscode-textPreformat-foreground);
    --dbmn-toolbar-hoverBackground: var(--vscode-toolbar-hoverBackground);
    --dbmn-widget-border: var(--vscode-widget-border);
    --dbmn-widget-shadow: var(--vscode-widget-shadow);
}

/* Heading styles - Consistent across all webviews */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--vscode-textLink-foreground);
    font-weight: 600;
    line-height: 1.4;
    margin-top: 0;
    text-transform: capitalize;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

h4 {
    font-size: 16px;
    margin-bottom: 14px;
}

h5 {
    font-size: 14px;
    margin-bottom: 12px;
}

h6 {
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Text utilities */
.break-word {
    word-break: break-word;
}

.font-bold {
    font-weight: bold;
}

.font-mono {
    font-family: var(--vscode-editor-font-family, monospace);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.font-size-10 {
    font-size: 10px;
}

.font-size-12 {
    font-size: 12px;
}

.font-size-13 {
    font-size: 13px;
}

.font-size-14 {
    font-size: 14px;
}

.font-size-16 {
    font-size: 16px;
}

.user-select-none {
    user-select: none;
}

.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-link {
    color: var(--vscode-textLink-foreground);
}

/* Colors */
.color-success {
    color: var(--vscode-terminal-ansiGreen);
}

.color-error {
    color: var(--vscode-errorForeground);
}

.color-description {
    color: var(--vscode-descriptionForeground);
}

.color-foreground {
    color: var(--vscode-foreground);
}

.bg-input {
    background-color: var(--vscode-input-background);
}

.bg-header {
    background-color: var(--vscode-list-headerBackground);
}

.bg-menu {
    background-color: var(--vscode-menu-background);
}

/* Display utilities */
.flex {
    display: flex;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

.block {
    display: block;
}

.hidden {
    display: none !important;
}

/* Position utilities */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.right-0 {
    right: 0;
}

.top-100 {
    top: 100%;
}

/* Flex utilities */
.flex-1 {
    flex: 1;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.flex-col {
    flex-direction: column;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Composite flex utilities for common patterns */
.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-end-center {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Gap utilities */
.gap-4 {
    gap: 4px;
}

.gap-8 {
    gap: 8px;
}

.gap-10 {
    gap: 10px;
}

.gap-12 {
    gap: 12px;
}

.gap-20 {
    gap: 20px;
}

/* Padding utilities */
.p-0 {
    padding: 0;
}

.p-2 {
    padding: 2px;
}

.p-4 {
    padding: 4px;
}

.p-5 {
    padding: 5px;
}

.p-8 {
    padding: 8px;
}

.p-10 {
    padding: 10px;
}

.p-12 {
    padding: 12px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-50 {
    padding: 50px;
}

.px-8 {
    padding-left: 8px;
    padding-right: 8px;
}

.px-12 {
    padding-left: 12px;
    padding-right: 12px;
}

.py-8 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.pt-15 {
    padding-top: 15px;
}

/* Margin utilities */
.m-0 {
    margin: 0;
}

.m-4 {
    margin: 4px;
}

.m-8 {
    margin: 8px;
}

.m-20 {
    margin: 20px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.ml-2 {
    margin-left: 2px;
}

.ml-4 {
    margin-left: 4px;
}

.ml-8 {
    margin-left: 8px;
}

.ml-20 {
    margin-left: 20px;
}

.mr-6 {
    margin-right: 6px;
}

/* Sizing utilities */
.w-full {
    width: 100%;
}

.w-14 {
    width: 14px;
}

.h-14 {
    height: 14px;
}

.min-w-120 {
    min-width: 120px;
}

.min-w-200 {
    min-width: 200px;
}

.max-w-300 {
    max-width: 300px;
}

.max-h-70vh {
    max-height: 70vh;
}

.max-h-300 {
    max-height: 300px;
}

/* Border utilities */
.border {
    border: 1px solid var(--vscode-panel-border);
}

.border-none {
    border: none;
}

.border-radius-2 {
    border-radius: 2px;
}

.border-radius-3 {
    border-radius: 3px;
}

.border-radius-4 {
    border-radius: 4px;
}

.border-top {
    border-top: 1px solid var(--vscode-panel-border);
}

.border-bottom {
    border-bottom: 1px solid var(--vscode-panel-border);
}

.border-bottom-2 {
    border-bottom: 2px solid var(--vscode-panel-border);
}

.border-right {
    border-right: 1px solid var(--vscode-panel-border);
}

/* Effects */
.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

.opacity-70 {
    opacity: 0.7;
}

.cursor-pointer {
    cursor: pointer;
}

.transition {
    transition: all 0.2s ease;
}

.transition-opacity {
    transition: opacity 0.2s ease;
}

.overflow-auto {
    overflow: auto;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* Z-index */
.z-10 {
    z-index: 10;
}

.z-1000 {
    z-index: 1000;
}

/* Box shadow */
.shadow-dropdown {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Vertical align */
.vertical-top {
    vertical-align: top;
}

/* Animation utilities */
.red-pulse {
    display: inline-block;
    color: var(--vscode-charts-red);
    animation: pulse-red 1.5s ease-in-out infinite;
    font-size: 18px;
}

/* Preserve space when hidden to prevent layout shift */
.red-pulse.hidden {
    visibility: hidden;
}

@keyframes pulse-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}
/* Beta: a feature that is new and still settling (Compare). One small pill beside its name */
.dbmn-beta {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    background: var(--vscode-textLink-foreground);
    color: var(--vscode-editor-background);
}
