/* Dropdown List Item Component Styles */

:root {
    color-scheme: light;

    /* Dropdown List Item System Variables */
    --nexus-sys-dropdown-list-item-width: 240px;
    --nexus-sys-dropdown-list-item-padding-x: var(--nexus-ref-spacing-14);
    --nexus-sys-dropdown-list-item-padding-y: var(--nexus-ref-spacing-10);
    --nexus-sys-dropdown-list-item-gap: var(--nexus-ref-spacing-12);
    --nexus-sys-dropdown-list-item-transition-duration: 0.15s;
    --nexus-sys-dropdown-list-item-font-size: var(--nexus-sys-typescale-text-sm-font-size);
    --nexus-sys-dropdown-list-item-line-height: var(--nexus-sys-typescale-text-sm-line-height);


    /* Dropdown List Item Colors */
    --nexus-sys-color-dropdown-list-item-default-background: transparent;
    --nexus-sys-color-dropdown-list-item-default-text: var(--nexus-ref-neutral-30);
    --nexus-sys-color-dropdown-list-item-hover-background: var(--nexus-ref-neutral-100);
    --nexus-sys-color-dropdown-list-item-hover-text: var(--nexus-ref-neutral-30);
    --nexus-sys-color-dropdown-list-item-focus-background: var(--nexus-ref-primary-90);
    --nexus-sys-color-dropdown-list-item-focus-text: var(--nexus-ref-neutral-20);
    --nexus-sys-color-dropdown-list-item-disabled-background: transparent;
    --nexus-sys-color-dropdown-list-item-disabled-text: var(--nexus-ref-neutral-80);

    /* Icon Sizes */
    --nexus-sys-dropdown-list-item-icon-size: 24px;
    --nexus-sys-dropdown-list-item-checkbox-size: 16px;
    --nexus-sys-dropdown-list-item-shortcut-text-size: var(--nexus-ref-text-font-size-xs);
    --nexus-sys-input-dropdown-avatar-icon-size: 24px;


    /* checkBox variant */
    --nexus-sys-color-dropdown-list-item-checkbox-default-background: transparent;
    --nexus-sys-color-dropdown-list-item-checkbox-hover-background: var(--nexus-ref-primary-90);
    --nexus-sys-color-dropdown-list-item-checkbox-checked-background: var(--nexus-ref-primary-90);
    --nexus-sys-color-dropdown-list-item-checkbox-focus-background: transparent;
    --nexus-sys-color-dropdown-list-item-checkbox-disabled-background: var(--nexus-ref-neutral-100);

    --nexus-sys-color-dropdown-list-item-checkbox-default-border: var(--nexus-ref-neutral-90);
    --nexus-sys-color-dropdown-list-item-checkbox-hover-border: var(--nexus-ref-primary-20);
    --nexus-sys-color-dropdown-list-item-checkbox-checked-border: var(--nexus-ref-primary-20);
    --nexus-sys-color-dropdown-list-item-checkbox-checked-text-color: var(--nexus-ref-primary-20);
    --nexus-sys-color-dropdown-list-item-checkbox-disabled-text-color: var(--nexus-ref-primary-90);

    --nexus-sys-color-dropdown-list-item-checkbox-focus-border-color: var(--nexus-ref-primary-80);
    --nexus-sys-color-dropdown-list-item-checkbox-focus-shadow-color: var(--nexus-ref-primary-90);

    --nexus-sys-color-dropdown-list-item-checkbox-disabled-border-color: var(--nexus-ref-primary-90);

    /* shortcut */
    --nexus-sys-color-dropdown-list-item-shortcut-default-color: var(--nexus-ref-neutral-80);
    --nexus-sys-color-dropdown-list-item-shortcut-disabled-color: var(--nexus-ref-primary-90);

    /* Dropdown List Header System Variables */
    --nexus-sys-dropdown-list-header-gap: var(--nexus-ref-spacing-12);
    --nexus-sys-dropdown-list-header-icon-size: 40px;
    --nexus-sys-dropdown-list-header-active-dot-size: 12px;
    --nexus-sys-dropdown-list-header-active-dot-border-width: 2px;
    --nexus-sys-dropdown-list-header-active-dot-border-radius: 50%;

    /* Dropdown List Header Colors */
    --nexus-sys-color-dropdown-list-header-active-dot-background: var(--nexus-ref-success-50);
    --nexus-sys-color-dropdown-list-header-inactive-dot-background: var(--nexus-ref-neutral-90);
    --nexus-sys-color-dropdown-list-header-active-dot-border: var(--nexus-ref-primary-100);
    --nexus-sys-color-dropdown-list-header-title-text: var(--nexus-ref-neutral-30);
    --nexus-sys-color-dropdown-list-header-description-text: var(--nexus-ref-neutral-80);

    /* Dropdown List Header Typography */
    --nexus-sys-dropdown-list-header-title-font-size: var(--nexus-sys-typescale-text-sm-font-size);
    --nexus-sys-dropdown-list-header-title-font-weight: var(--nexus-sys-typescale-font-weight-semibold);
    --nexus-sys-dropdown-list-header-description-font-size: var(--nexus-sys-typescale-text-sm-font-size);
    --nexus-sys-dropdown-list-header-description-font-weight: var(--nexus-sys-typescale-font-weight-regular);

    /* Input Dropdown Menu System Variables */
    --nexus-sys-input-dropdown-width: 320px;
    --nexus-sys-input-dropdown-padding-x: var(--nexus-ref-spacing-14);
    --nexus-sys-input-dropdown-padding-y: var(--nexus-ref-spacing-10);
    --nexus-sys-input-dropdown-border-radius: 8px;
    --nexus-sys-input-dropdown-transition-duration: 0.15s;
    --nexus-sys-color-input-dropdown-shadow: 0 0 0 3px var(--nexus-ref-primary-90);
    --nexus-sys-color-input-dropdown-focused-border: var(--nexus-ref-primary-80);



    /* Input Dropdown Menu Colors */
    --nexus-sys-color-input-dropdown-background: var(--nexus-ref-primary-100);
    --nexus-sys-color-input-dropdown-border: var(--nexus-ref-neutral-90);
    --nexus-sys-color-input-dropdown-menu-border: var(--nexus-ref-neutral-100);
    --nexus-sys-color-input-dropdown-item-background: transparent;
    --nexus-sys-color-input-dropdown-item-hover-background: var(--nexus-ref-neutral-100);
    --nexus-sys-color-input-dropdown-item-selected-background: var(--nexus-ref-neutral-100);
    --nexus-sys-color-input-dropdown-item-text: var(--nexus-ref-neutral-20);
    --nexus-sys-color-input-dropdown-item-selected-text: var(--nexus-ref-neutral-30);
    --nexus-sys-color-input-dropdown-checkmark: var(--nexus-ref-primary-20);
    --nexus-sys-color-input-dropdown-supporting-text: var(--nexus-ref-neutral-80);

    /* Input Dropdown Menu Typography */
    --nexus-sys-input-dropdown-font-size: var(--nexus-sys-typescale-text-sm-font-size);
    --nexus-sys-input-dropdown-line-height: var(--nexus-sys-typescale-text-sm-line-height);
    --nexus-sys-input-dropdown-font-weight: var(--nexus-sys-typescale-font-weight-medium);
    --nexus-sys-input-dropdown-supporting-text-font-weight: var(--nexus-sys-typescale-font-weight-regular);


    /*  Dropdown Menu  */
    --nexus-sys-dropdown-menu-button-border-radius: var(--nexus-ref-shape-corner-small);
    --nexus-sys-dropdown-menu-button-padding: var(--nexus-ref-spacing-12) var(--nexus-ref-spacing-16);
    --nexus-sys-dropdown-menu-button-gap: var(--nexus-ref-spacing-8);

    --nexus-sys-dropdown-menu-list-border-radius: var(--nexus-ref-shape-corner-small);
    --nexus-sys-dropdown-menu-list-padding: var(--nexus-ref-spacing-4) 0;
    --nexus-sys-dropdown-menu-list-margin-top: 8px;
    --nexus-sys-dropdown-menu-list-opacity: 0;
    --nexus-sys-dropdown-menu-list-transform: translateY(-10px) scale(0.95);
    --nexus-sys-dropdown-menu-list-max-width: 240px;
    --nexus-sys-dropdown-menu-list-width: 100%;



    /*  Dropdown Menu Colors */
    --nexus-sys-color-dropdown-menu-button-background: var(--nexus-ref-primary-100);
    --nexus-sys-color-dropdown-menu-button-text: var(--nexus-ref-neutral-30);
    --nexus-sys-color-dropdown-menu-button-focus-visible-outline: var(--nexus-ref-primary-80);
    --nexus-sys-dropdown-menu-button-focus-visible-outline-width: 2px;
    --nexus-sys-dropdown-menu-button-focus-visible-outline-offset: 2px;
    --nexus-sys-color-dropdown-menu-list-background: var(--nexus-ref-primary-100);
    --nexus-sys-color-dropdown-menu-list-box-shadow: var(--nexus-ref-neutral-90);

    /*  Dropdown Menu typography */
    --nexus-sys-dropdown-menu-button-font-size: var(--nexus-sys-typescale-text-sm-font-size);
    --nexus-sys-dropdown-menu-button-font-weight: var(--nexus-sys-typescale-font-weight-medium);


        /* input Dropdown Menu search input */
        --nexus-sys-input-dropdown-search-input-border-radius: var(--nexus-ref-shape-corner-small);
        --nexus-sys-input-dropdown-search-input-border: var(--nexus-ref-neutral-90);
        --nexus-sys-input-dropdown-search-input-background: var(--nexus-ref-primary-100);
        --nexus-sys-input-dropdown-search-input-text: var(--nexus-ref-neutral-30);
        --nexus-sys-input-dropdown-search-input-placeholder: var(--nexus-ref-neutral-80);
        --nexus-sys-input-dropdown-search-input-placeholder-font-size: var(--nexus-sys-typescale-text-sm-font-size);
        --nexus-sys-input-dropdown-search-input-placeholder-font-weight: var(--nexus-sys-typescale-font-weight-regular);
        --nexus-sys-input-dropdown-search-input-placeholder-line-height: var(--nexus-sys-typescale-text-sm-line-height);
        --nexus-sys-input-dropdown-search-input-padding-y: var(--nexus-ref-spacing-10);
        --nexus-sys-input-dropdown-search-input-padding-x: var(--nexus-ref-spacing-14);
     
}



* {
    font-family: Manrope;
}

/* Utility: hidden via class instead of inline styles */
.is-hidden {
    display: none !important;
}

/* RTL-specific improvements */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* Ensure proper text alignment for dropdown items */
.nexus-dropdown-list-item {
    text-align: start;
}

.nexus-input-dropdown-trigger {
    text-align: start;
}

.nexus-input-dropdown-item {
    text-align: start;
}

/* Dropdown List Item Base */
.nexus-dropdown-list-item {
    padding: var(--nexus-sys-dropdown-list-item-padding-y) var(--nexus-sys-dropdown-list-item-padding-x);
    cursor: pointer;
    color: var(--nexus-sys-color-dropdown-list-item-default-text);
    font-size: var(--nexus-sys-dropdown-list-item-font-size);
    line-height: var(--nexus-sys-dropdown-list-item-line-height);
    display: flex;
    align-items: center;
    background: var(--nexus-sys-color-dropdown-list-item-default-background);
    width: 100%;
    /* max-width: var(--nexus-sys-dropdown-list-item-width); */
    box-sizing: border-box;
    gap: var(--nexus-sys-dropdown-list-item-gap);
    overflow: visible; /* Allow content to expand naturally */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words when necessary */
    overflow-wrap: break-word; /* Modern property for word wrapping */
    align-items: flex-start; /* Align to top for multi-line text */
}

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

.item-shortcut {
    flex-shrink: 0;
    /* always visible */
    margin-inline-start: auto;
    color: var(--nexus-ref-neutral-80);
}

/* dropdown list item hover */
.nexus-dropdown-list-item[disabled="true"] .item-shortcut {
    color: var(--nexus-sys-color-dropdown-list-item-checkbox-disabled-text-color) !important;

}

/* dropdown list item hover */
.nexus-dropdown-list-item:hover:not([disabled="true"]) {
    background: var(--nexus-sys-color-dropdown-list-item-hover-background);
    color: var(--nexus-sys-color-dropdown-list-item-hover-text);
    transition: all var(--nexus-sys-dropdown-list-item-transition-duration) ease;

}

/* dropdown list item active */
.nexus-dropdown-list-item:active:not([disabled="true"]) {
    outline: none;
    background: transparent;
    color: var(--nexus-sys-color-dropdown-list-item-focus-text);
    transition: all var(--nexus-sys-dropdown-list-item-transition-duration) ease;

}

/* dropdown list item disabled */
.nexus-dropdown-list-item[disabled="true"] {
    cursor: not-allowed;

}

/* Disabled state for text */
.nexus-dropdown-list-item[disabled="true"] {
    color: var(--nexus-sys-color-dropdown-list-item-checkbox-disabled-text-color);
}

/* Disable checkbox interaction for disabled items */
.nexus-dropdown-list-item[disabled="true"][data-checkbox="true"]::before {
    pointer-events: none;
}



/* Dropdown List Item with Checkbox */
.nexus-dropdown-list-item[data-checkbox="true"]::before {
    content: "";
    width: var(--nexus-sys-dropdown-list-item-checkbox-size);
    height: var(--nexus-sys-dropdown-list-item-checkbox-size);
    flex-shrink: 0;
    border: 1px solid var(--nexus-sys-color-dropdown-list-item-checkbox-default-border);
    background: var(--nexus-sys-color-dropdown-list-item-checkbox-default-background);
    box-sizing: border-box;
    position: relative;
    border-radius: 4px;
    transition: all var(--nexus-sys-dropdown-list-item-transition-duration) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;

}

/* checkbox hover style */
.nexus-dropdown-list-item[data-checkbox="true"]:hover:not([disabled="true"]):before {
    border-color: var(--nexus-sys-color-dropdown-list-item-checkbox-hover-border);
    background: var(--nexus-sys-color-dropdown-list-item-checkbox-hover-background);
}

/* Checkbox checked state */
.nexus-dropdown-list-item[data-checkbox="true"][data-checked="true"]:not([disabled="true"])::before {
    content: "✓";
    color: var(--nexus-sys-color-dropdown-list-item-checkbox-checked-text-color);
    text-align: center;
    line-height: 1;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid var(--nexus-sys-color-dropdown-list-item-checkbox-checked-border);
    background: var(--nexus-sys-color-dropdown-list-item-checkbox-checked-background);
    transition: all 0s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Checkbox checked state disabled */
.nexus-dropdown-list-item[data-checkbox="true"][disabled="true"]::before {
    color: var(--nexus-sys-color-dropdown-list-item-checkbox-disabled-border-color);
    text-align: center;
    line-height: 14px;
    font-size: 14px;
    transition: all 0s ease;
    border-color: var(--nexus-sys-color-dropdown-list-item-checkbox-disabled-border-color);
    background: var(--nexus-sys-color-dropdown-list-item-checkbox-disabled-background);

}

.nexus-dropdown-list-item[data-checkbox="true"][data-checked="true"][disabled="true"]::before {
    content: "✓";
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus state for checkbox */
.nexus-dropdown-list-item[data-checkbox="true"]:active:not([disabled="true"])::before {
    border-color: var(--nexus-sys-color-dropdown-list-item-checkbox-focus-border-color);
    box-shadow: 0 0 0 4px var(--nexus-sys-color-dropdown-list-item-checkbox-focus-shadow-color);
    background-color: var(--nexus-sys-color-dropdown-list-item-checkbox-focus-background) !important;
    transition: all var(--nexus-sys-dropdown-list-item-transition-duration) ease;

}


.nexus-dropdown-list::-webkit-scrollbar {
    width: var(--nexus-sys-date-picker-scrollbar-width);
  }
  
  .nexus-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .nexus-dropdown-list::-webkit-scrollbar-thumb {
    background-color: var(--nexus-sys-date-picker-year-list-scrollbar-color);
    border-radius: var(--nexus-sys-date-picker-scrollbar-thumb-radius);
  }



/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nexus-dropdown-list-item {
        transition: none;
    }
}

/* Input Dropdown Menu */
.nexus-input-dropdown-container {
    position: relative;
    /* max-width: var(--nexus-sys-input-dropdown-width); */
    width: 100%;
    min-height: 44px;
    padding: var(--nexus-sys-input-dropdown-padding-y) var(--nexus-sys-input-dropdown-padding-x);
    border: 1px solid var(--nexus-sys-color-input-dropdown-border);
    border-radius: var(--nexus-sys-input-dropdown-border-radius);
    background: var(--nexus-sys-color-input-dropdown-background);
    font-size: var(--nexus-sys-input-dropdown-font-size);
    line-height: var(--nexus-sys-input-dropdown-line-height);
    color: var(--nexus-sys-color-input-dropdown-item-text);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    gap: 8px;
    align-items: center;
    transition: all 0.3s;
    

}
/* Input Dropdown Menu */
.nexus-input-dropdown-container[multiple] {
    min-height: 60px;
}

/* Default type - no icon */
.nexus-input-dropdown-container[data-type="default"]:before {
    display: none;
}

/* Icon type - shows default icon */
.nexus-input-dropdown-container[data-type="icon"]:before {
    content: "";
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: currentColor;
    background-image: var(--default-icon-url);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: block;
}

/* Avatar type - shows avatar (default or selected item's) */
.nexus-input-dropdown-container[data-type="avatar"]:before {
    content: "";
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background-image: var(--avatar-url, var(--default-avatar-url));
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: block;
}

/* Multiselect avatar display: render tokens and hide single avatar pseudo */
.nexus-input-dropdown-container[multiple][data-type="avatar"]:before {
    display: none;
}

.nexus-input-dropdown-container[multiple][data-type="avatar"] .nexus-input-dropdown-trigger {
    position: absolute;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.nexus-selected-tokens {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.nexus-token {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 4px 8px;
    border: 1px solid var(--nexus-ref-neutral-90);
    background: var(--nexus-ref-primary-100);
    border-radius: 16px;
}

/* +n indicator chip when tokens are limited */
.nexus-token-more {
    pointer-events: none;
}

.nexus-token-remove {
    margin-inline-start: 4px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--nexus-ref-neutral-70, #6b7280);
    cursor: pointer;
    padding: 0;
}

.nexus-token-remove:hover {
    background: var(--nexus-ref-neutral-95, #e5e7eb);
}

.nexus-token-remove:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--nexus-ref-primary-90);
}

.nexus-token + .nexus-token::before {
    content: "";
}

.nexus-token-avatar {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    padding-inline-end: 8px;

}

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

.nexus-token-placeholder {
    color: var(--nexus-ref-neutral-80);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Generic tokens for multiselect across types (keep search input visible) */
.nexus-input-dropdown-container[multiple]:not([data-type="search"]):before {
    display: none;
}

.nexus-input-dropdown-container[multiple]:not([data-type="search"]) .nexus-input-dropdown-trigger {
       position: absolute;
   width: 1px;
   height: 1px;
   opacity: 0;
   pointer-events: none;
}

/* Token visuals for different types */
.nexus-token-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    padding-inline-end: 8px;
}

.nexus-token-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    margin-inline-end: 8px;
}

.nexus-token-dot[data-user-state="active"] {
    background-color: var(--nexus-ref-success-50);
}

.nexus-token-dot[data-user-state="inactive"] {
    background-color: var(--nexus-ref-neutral-90);
}


.nexus-input-dropdown-container[data-type="dot"]:before {
    content: "";
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    background-color: var(--nexus-ref-success-50);
    border-radius: 50%;
    background-size: cover;
    display: block;
}

/* Active state - Green dot */
.nexus-input-dropdown-container[data-type="dot"][data-user-state="active"]:before {
    background-color: var(--nexus-ref-success-50);
}

/* Inactive state - Gray dot */
.nexus-input-dropdown-container[data-type="dot"][data-user-state="inactive"]:before {
    background-color: var(--nexus-ref-neutral-90);
}


/* search type - shows search icon (default or selected item's) */
.nexus-input-dropdown-container[data-type="search"]:before {
    content: "";
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background-image: url('../icons/search.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: block;
}

.nexus-input-dropdown-trigger {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
    margin: 0;
    outline: none;
}

/* Re-enable visible input for search type */
.nexus-input-dropdown-container[data-type="search"] .nexus-input-dropdown-trigger {
    position: static;
    width: 100%;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
}


.nexus-input-dropdown-trigger::placeholder {
    color: var(--nexus-ref-neutral-80);
}

.nexus-input-dropdown-trigger-icon {
    width: 20px;
    height: 20px;
    color: var(--nexus-ref-neutral-80);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.nexus-input-dropdown-trigger-icon img {
    width: 100%;
    height: 100%;
    transition: transform 0.15s ease;
    display: block;
}

/* Rotate arrow when dropdown is open */
.nexus-input-dropdown-container.open .nexus-input-dropdown-trigger-icon img {
    transform: rotate(180deg);
}

/* RTL-specific arrow rotation */
[dir="rtl"] .nexus-input-dropdown-container.open .nexus-input-dropdown-trigger-icon img {
    transform: rotate(-180deg);
}



.nexus-input-dropdown-display {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.nexus-input-dropdown-display.is-placeholder {
    color: var(--nexus-ref-neutral-80);
}

.nexus-input-dropdown-container:focus,
.nexus-input-dropdown-container.open {
    border-color: var(--nexus-sys-color-input-dropdown-focused-border);
    box-shadow: var(--nexus-sys-color-input-dropdown-shadow);
}


.nexus-input-dropdown-container:focus-within {
    border-color: var(--nexus-sys-color-input-dropdown-focused-border);
}

.nexus-input-dropdown-menu {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--nexus-sys-color-input-dropdown-background);
    border: 1px solid var(--nexus-sys-color-input-dropdown-menu-border);
    border-radius: var(--nexus-sys-input-dropdown-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    margin-top: 4px;
    overflow: hidden;
    list-style: none;
    padding: 4px 0px 4px 0px;

    /* Visibility (no open/close animation) */
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    max-height: 320px;
    overflow-y: auto;
    /* For Firefox */
    scrollbar-width: 5px;
    scrollbar-color: var(--nexus-ref-primary-90) transparent;

    /* For IE and legacy Edge */
    -ms-overflow-style: auto;


}





/* Dropdown opens upward when near bottom */
.nexus-input-dropdown-container.open-upward .nexus-input-dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;

}

.nexus-input-dropdown-container.open-upward.open .nexus-input-dropdown-menu {
}

.nexus-input-dropdown-container.open .nexus-input-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.nexus-input-dropdown-item {
    padding: var(--nexus-sys-input-dropdown-padding-y) var(--nexus-sys-input-dropdown-padding-x);
    cursor: pointer;
    color: var(--nexus-sys-color-input-dropdown-item-text);
    font-size: var(--nexus-sys-input-dropdown-font-size);
    line-height: var(--nexus-sys-input-dropdown-line-height);
    font-weight: var(--nexus-sys-input-dropdown-font-weight);
    background: var(--nexus-sys-color-input-dropdown-item-background);
    transition: background-color var(--nexus-sys-input-dropdown-transition-duration) ease;
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    outline: none;

}

.nexus-input-dropdown-item:hover {
    background: var(--nexus-sys-color-input-dropdown-item-hover-background);
}

.nexus-input-dropdown-item:focus {
    outline: none;
    background: var(--nexus-sys-color-input-dropdown-item-hover-background);
}

.nexus-input-dropdown-item.selected {
    background: var(--nexus-sys-color-input-dropdown-item-selected-background);
    color: var(--nexus-sys-color-input-dropdown-item-selected-text);
}

.nexus-input-dropdown-item.selected::after {
    content: "✓";
    color: var(--nexus-sys-color-input-dropdown-checkmark);
    font-weight: bold;
    margin-inline-start: auto;
}

.item-supporting-text {
    color: var(--nexus-ref-neutral-80);
    font-size: var(--nexus-sys-input-dropdown-font-size);
    line-height: var(--nexus-sys-input-dropdown-line-height);
    font-weight: var(--nexus-sys-input-dropdown-supporting-text-font-weight);
    margin: 0;
    display: inline-block;
    /* or block, but not flex */
    max-width: 100%;
    white-space: nowrap;
    /* instead of text-wrap */
}



/* Disabled state for input dropdown items */
.nexus-input-dropdown-item[disabled="true"] {
    color: var(--nexus-ref-primary-90);
    cursor: not-allowed;
    background: transparent;
    pointer-events: none;
}

/* Disabled state for input dropdown items */
.nexus-input-dropdown-item[disabled="true"] .item-supporting-text {
    color: var(--nexus-ref-primary-90);
    cursor: not-allowed;
    background: transparent;
    pointer-events: none;
}

.nexus-input-dropdown-item[data-type="dot"]::before {
    content: "";
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background-size: cover;
    display: block;
    background-color: currentColor
}

.nexus-input-dropdown-item[data-type="dot"][data-user-state="active"]::before {
    background-color: var(--nexus-ref-success-50);
}

.nexus-input-dropdown-item[data-type="dot"][data-user-state="inactive"]::before {
    background-color: var(--nexus-ref-neutral-90);
}

.nexus-input-dropdown-item[data-type="dot"][disabled="true"]::before {
    background-color: currentColor;
}



/* Dropdown List Header */
.nexus-dropdown-list-header {
    display: flex;
    align-items: center;
    gap: var(--nexus-sys-dropdown-list-header-gap);
    box-sizing: border-box;
    padding: 12px 14px;
}

.nexus-dropdown-list-header-icon {
    position: relative;
}

.nexus-dropdown-list-header-icon::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: var(--nexus-sys-dropdown-list-header-active-dot-size);
    height: var(--nexus-sys-dropdown-list-header-active-dot-size);
    border: var(--nexus-sys-dropdown-list-header-active-dot-border-width) solid var(--nexus-sys-color-dropdown-list-header-active-dot-border);
    border-radius: var(--nexus-sys-dropdown-list-header-active-dot-border-radius);
    box-sizing: border-box;
}

/* Active state - Green dot */
.nexus-dropdown-list-header-icon[data-user-state="active"]::after {
    background-color: var(--nexus-sys-color-dropdown-list-header-active-dot-background);
}

/* Inactive state - Gray dot */
.nexus-dropdown-list-header-icon[data-user-state="inactive"]::after {
    background-color: var(--nexus-sys-color-dropdown-list-header-inactive-dot-background);
}

.nexus-dropdown-list-header-icon-img {
    width: var(--nexus-sys-dropdown-list-header-icon-size);
    height: var(--nexus-sys-dropdown-list-header-icon-size);
    display: flex;
    align-items: center;
}

.nexus-dropdown-list-header-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.nexus-dropdown-list-header-title {
    padding: 0;
    margin: 0;
    color: var(--nexus-sys-color-dropdown-list-header-title-text);
    font-size: var(--nexus-sys-dropdown-list-header-title-font-size);
    font-weight: var(--nexus-sys-dropdown-list-header-title-font-weight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexus-dropdown-list-header-description {
    padding: 0;
    margin: 0;
    color: var(--nexus-sys-color-dropdown-list-header-description-text);
    font-size: var(--nexus-sys-dropdown-list-header-description-font-size);
    font-weight: var(--nexus-sys-dropdown-list-header-description-font-weight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* dropdown button menu */
.nexus-dropdown-menu {
    box-sizing: border-box;
    position: relative;
    display: flex;
}



.nexus-dropdown-trigger-btn {
    padding: var(--nexus-sys-dropdown-menu-button-padding);
    border: 1px solid var(--nexus-ref-neutral-90);
    border-radius: var(--nexus-sys-dropdown-menu-button-border-radius);
    background: var(--nexus-sys-color-dropdown-menu-button-background);
    color: var(--nexus-sys-color-dropdown-menu-button-text);
    font-size: var(--nexus-sys-dropdown-menu-button-font-size);
    font-weight: var(--nexus-sys-dropdown-menu-button-font-weight);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexus-sys-dropdown-menu-button-gap);
    box-sizing: border-box;
}

.nexus-dropdown-trigger-btn[data-btn-type="icon"] {
    border: none;
}

.nexus-dropdown-trigger-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--nexus-ref-neutral-90);
}

.nexus-dropdown-trigger-btn:focus-visible {
    outline: var(--nexus-sys-dropdown-menu-button-focus-visible-outline-width) solid var(--nexus-sys-color-dropdown-menu-button-focus-visible-outline);
    outline-offset: var(--nexus-sys-dropdown-menu-button-focus-visible-outline-offset); 
    box-shadow: 0 0 0 3px var(--nexus-ref-neutral-90);
}

.nexus-dropdown-trigger-btn[data-btn-type="icon"]:focus {
    outline: none;
    box-shadow: none;
}

.nexus-dropdown-trigger-btn[data-btn-type="icon"]:focus-visible {
    outline: var(--nexus-sys-dropdown-menu-button-focus-visible-outline-width) solid var(--nexus-sys-color-dropdown-menu-button-focus-visible-outline);
    outline-offset: var(--nexus-sys-dropdown-menu-button-focus-visible-outline-offset);
    box-shadow: none;
}

.nexus-dropdown-arrow {
    transition: transform 0.15s ease;
    color: var(--nexus-ref-neutral-30);
}

.nexus-dropdown-menu.open .nexus-dropdown-arrow {
    transform: rotate(180deg);
}

.nexus-dropdown-menu-list {
    position: absolute;
    top: 100%;
    inset-inline-start: auto;
    inset-inline-end: 0;

    background: var(--nexus-sys-color-dropdown-menu-list-background);
    border-radius: var(--nexus-sys-dropdown-menu-list-border-radius);
    box-shadow: 0 4px 10px var(--nexus-sys-color-dropdown-menu-list-box-shadow);
    z-index: 1000;
    margin-top: var(--nexus-sys-dropdown-menu-list-margin-top);
    list-style: none;
    padding: var(--nexus-sys-dropdown-menu-list-padding);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    width: var(--nexus-sys-dropdown-menu-list-width);
    min-width: max-content;
    max-width: min(var(--nexus-sys-dropdown-menu-list-max-width), 90vw);
    overflow: visible;
    max-height: none;
    will-change: opacity, transform;
}

.nexus-dropdown-menu-list .item-text {
    overflow: visible;
    white-space: nowrap;
    text-overflow: unset;
}

 /* dropdown menu list item for the table */
.nexus-table-actions .nexus-dropdown-menu-list {
    position: absolute;
    top: 100%;
    inset-inline-start: auto;
    inset-inline-end: 0;
    background: var(--nexus-sys-color-dropdown-menu-list-background);
    border-radius: var(--nexus-sys-dropdown-menu-list-border-radius);
    box-shadow: 0 4px 10px var(--nexus-sys-color-dropdown-menu-list-box-shadow);
    /* Ensure table dropdowns render above sticky headers/toolbars (bulk selection bar, table thead, etc.) */
    z-index: 20000;
    margin-top: var(--nexus-sys-dropdown-menu-list-margin-top);
    list-style: none;
    padding: var(--nexus-sys-dropdown-menu-list-padding);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    display: none;
    /*
     * The trigger wrapper is only as wide as the icon; width:auto shrink-to-fits to that
     * narrow containing block and clips icon+text row actions. Size from content instead.
     */
    width: max-content;
    max-width: min(var(--nexus-sys-dropdown-menu-list-max-width), 90vw);
    overflow: visible;
    will-change: opacity, transform;

}

/*
 * Table row menus are moved to document.body while open (see dropdown.js). They then lose the
 * `.nexus-table-actions` ancestor; inline + this class keep width content-based, not 100% viewport.
 */
.nexus-dropdown-menu-list.nexus-dropdown-menu-list--portaled {
    width: max-content;
    max-width: min(var(--nexus-sys-dropdown-menu-list-max-width), 90vw);
    box-sizing: border-box;
}

.nexus-dropdown-menu-list--portaled .nexus-dropdown-list-item .NBC {
    overflow: visible;
}

/* Dropdown opens upward when near bottom */
.nexus-dropdown-menu.open-upward .nexus-dropdown-menu-list {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 8px;
}

.nexus-dropdown-menu.open-upward.open .nexus-dropdown-menu-list {
    display: block;
}

.nexus-dropdown-menu.open .nexus-dropdown-menu-list {
    display: block;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.nexus-line {
    border-bottom: 1px solid var(--nexus-ref-neutral-100);
}

/* Combobox Search Input */
.nexus-combobox-search {
    padding: var(--nexus-sys-input-dropdown-search-input-padding-y) var(--nexus-sys-input-dropdown-search-input-padding-x);
    border-bottom: 1px solid var(--nexus-ref-neutral-100);
    background: var(--nexus-sys-color-input-dropdown-background);
    position: sticky;
    top: 0px;
    z-index: 1;
}

.nexus-combobox-search-input {
    width: 100%;
    padding: var(--nexus-sys-input-dropdown-search-input-padding-y) var(--nexus-sys-input-dropdown-search-input-padding-x);
    border: 1px solid var(--nexus-sys-input-dropdown-search-input-border);
    border-radius: var(--nexus-sys-input-dropdown-search-input-border-radius);
    background: var(--nexus-ref-primary-100);
    color: var(--nexus-sys-input-dropdown-search-input-text);
    font-size: var(--nexus-sys-input-dropdown-search-input-placeholder-font-size);
    line-height: var(--nexus-sys-input-dropdown-search-input-placeholder-line-height);
   font-weight: var(--nexus-sys-input-dropdown-search-input-placeholder-font-weight);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.nexus-combobox-search-input:focus {
    border-color: var(--nexus-sys-color-input-dropdown-focused-border);
    box-shadow: 0 0 0 2px var(--nexus-ref-primary-90);
}

.nexus-combobox-search-input::placeholder {
    color: var(--nexus-sys-input-dropdown-search-input-placeholder);
}

/* Dropdown menu loader (for API-driven options) */
.nexus-dropdown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--nexus-ref-neutral-70, #64748b);
    font-size: 14px;
    pointer-events: none;
    list-style: none;
}
.nexus-dropdown-loading::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: nexus-dropdown-spin 0.7s linear infinite;
}
@keyframes nexus-dropdown-spin {
    to { transform: rotate(360deg); }
}

/* Ensure dynamically added items from combobox search also have word breaking and truncation */
.nexus-input-dropdown-item[data-value] {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    overflow: visible; /* Allow content to expand naturally */
    text-overflow: unset; /* Remove ellipsis for natural wrapping */

  
}