/* Client-side NAICS industry picker.
   Colors use MudBlazor palette variables so the widget follows the app's light/dark theme
   automatically (no IsDarkMode / .mud-theme-dark needed). */

.naics-picker {
    position: relative;
    width: 100%;
}

.naics-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 32px;
    cursor: text;
}

/* The control (input + chips) sits inside the MudField on the host page, whose text
   color is theme-correct there (e.g. the wizard forces white on its dark card while
   MudBlazor's palette is light). Inherit that color instead of a palette variable that
   may not match the visible background. */
.naics-input {
    flex: 1 1 140px;
    min-width: 140px;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 4px 0;
}

.naics-input::placeholder {
    color: inherit;
    opacity: 0.6;
}

.naics-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    /* Neutral translucent fill so the chip is visible on any background (light or dark). */
    background: rgba(128, 128, 128, 0.25);
    color: inherit;
    border-radius: 16px;
    padding: 2px 6px 2px 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.naics-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.naics-chip-x,
.naics-clear {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.naics-chip-x {
    font-size: 1rem;
}

.naics-chip-x:hover,
.naics-clear:hover {
    opacity: 1;
}

.naics-clear {
    margin-left: auto;
    font-size: 1.15rem;
    align-self: center;
}

.naics-panel {
    display: none;
    /* position: fixed so it escapes any ancestor overflow:hidden (e.g. the wizard card).
       left / top / width / max-height are set inline by naics-picker.js. */
    position: fixed;
    z-index: 1300;
    overflow-y: auto;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs, rgba(0, 0, 0, 0.2));
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.20);
}

.naics-panel.open {
    display: block;
}

.naics-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    font-size: 0.875rem;
}

.naics-option:hover,
.naics-option.highlight {
    background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.06));
}

.naics-option.selected {
    color: var(--mud-palette-primary);
    font-weight: 500;
}

.naics-check {
    flex: 0 0 14px;
    display: inline-flex;
    justify-content: center;
    color: var(--mud-palette-primary);
    font-size: 0.8rem;
}

.naics-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.naics-more,
.naics-none {
    padding: 8px 12px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.8125rem;
    font-style: italic;
}
