/* src/MonolithAccessControl.Central.Admin.Client/wwwroot/css/select-standard.css */

/* A select owns exactly one 32px boundary; surrounding slots only provide layout. */
html body:has(.mac-shell) #app {
    --mac-standard-select-border: rgb(224, 224, 224);
}

html body:has(.mac-shell) #app .mud-select,
html body:has(.mac-shell) #app .mud-select .mud-input-control,
html body:has(.mac-shell) #app .mud-select .mud-input-control-input-container,
html body:has(.mac-shell) #app .mud-select .mud-input,
html body:has(.mac-shell) #app .mud-select .mud-input-root {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

html body:has(.mac-shell) #app .mud-select,
html body:has(.mac-shell) #app .mud-select .mud-input-control,
html body:has(.mac-shell) #app .mud-select .mud-input-control-input-container,
html body:has(.mac-shell) #app .mud-select .mud-input-root {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html body:has(.mac-shell) #app .mud-input.mud-select,
html body:has(.mac-shell) #app .mud-select .mud-input {
    padding: 0 !important;
    border-radius: 8px !important;
    background: var(--central-control-surface) !important;
    color: var(--central-control-text) !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input-root::before,
html body:has(.mac-shell) #app .mud-select .mud-input-root::after,
html body:has(.mac-shell) #app .mud-select .mud-input-slot::before,
html body:has(.mac-shell) #app .mud-select .mud-input-slot::after {
    display: none !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input-slot,
html body:has(.mac-shell) #app .mud-select .mud-select-input {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 8px 0 10px !important;
    box-sizing: border-box !important;
    line-height: 32px !important;
    overflow: hidden !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input-adornment-end {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 32px !important;
    margin: 0 4px 0 0 !important;
    padding: 0 !important;
    color: var(--central-control-muted) !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input:not(.mud-input-error) .mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-select .mud-input:not(.mud-input-error) fieldset.mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-input.mud-select:not(.mud-input-error) .mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-input.mud-select:not(.mud-input-error) fieldset.mud-input-outlined-border {
    border: 1px solid var(--mac-standard-select-border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input:not(.mud-input-error):focus-within .mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-select .mud-input:not(.mud-input-error):focus-within fieldset.mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-input.mud-select:not(.mud-input-error):focus-within .mud-input-outlined-border,
html body:has(.mac-shell) #app .mud-input.mud-select:not(.mud-input-error):focus-within fieldset.mud-input-outlined-border {
    border-color: var(--central-control-primary) !important;
    outline: 0 !important;
}

html body:has(.mac-shell) #app .mud-select .mud-input:focus-within .mud-input-adornment-end,
html body:has(.mac-shell) #app .mud-input.mud-select:focus-within .mud-input-adornment-end {
    color: var(--central-control-primary) !important;
}

html body:has(.mac-shell) #app select:not([aria-invalid="true"]) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    border: 1px solid var(--mac-standard-select-border) !important;
    border-radius: 8px !important;
    background-color: var(--central-control-surface) !important;
    color: var(--central-control-text) !important;
    box-shadow: none !important;
}

html body:has(.mac-shell) #app select:not([aria-invalid="true"]):focus,
html body:has(.mac-shell) #app select:not([aria-invalid="true"]):focus-visible {
    border-color: var(--central-control-primary) !important;
    outline: 0 !important;
}

/* Adaptive MudSelect dropdowns keep the activator width and grow only for wider item content. */
html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item),
html body .mud-popover.central-status-page-select-popover,
html body .mud-popover.central-card-title-search-popover,
html body .mud-popover.central-searchbar-select-popover {
    width: max-content !important;
    max-width: calc(100vw - 48px) !important;
    border: 1px solid var(--central-control-border) !important;
    border-radius: 14px !important;
    background: var(--central-control-surface) !important;
    color: var(--central-control-text) !important;
    box-shadow: 0 12px 28px rgba(27, 28, 28, .16) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    backdrop-filter: none !important;
}

/* Right-edge overflow shifts only by the clipped width plus the 24px viewport inset. */
html body .mud-popover.mud-popover-adaptive-width[data-mudpopover-flip$="left"]:has(.mud-list > .mud-list-item) {
    left: auto !important;
    right: 24px !important;
}

html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-paper,
html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list,
html body .mud-popover.central-status-page-select-popover :is(.mud-paper, .mud-popover-paper, .mud-list),
html body .mud-popover.central-card-title-search-popover :is(.mud-paper, .mud-popover-paper, .mud-list),
html body .mud-popover.central-searchbar-select-popover :is(.mud-paper, .mud-popover-paper, .mud-list) {
    width: max-content !important;
    min-width: 100% !important;
    max-width: calc(100vw - 48px) !important;
    border: 0 !important;
    background: var(--central-control-surface) !important;
    color: var(--central-control-text) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list {
    padding: 5px !important;
}

html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list-item,
html body .mud-popover.central-status-page-select-popover .mud-list-item,
html body .mud-popover.central-card-title-search-popover .mud-list-item,
html body .mud-popover.central-searchbar-select-popover .mud-list-item {
    width: 100% !important;
    min-width: 100% !important;
    max-width: calc(100vw - 48px) !important;
    min-height: 34px !important;
    padding: 5px 10px !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--central-control-soft) !important;
    font-size: .8rem !important;
    font-weight: 760 !important;
    box-sizing: border-box !important;
}

html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list-item:hover,
html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list-item:focus-visible,
html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) .mud-list-item.mud-selected-item {
    background: var(--central-control-primary-soft) !important;
    color: var(--central-control-primary-strong) !important;
}

html body .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) :is(.mud-list-item-text, .mud-typography),
html body .mud-popover.central-status-page-select-popover :is(.mud-list-item-text, .mud-typography),
html body .mud-popover.central-card-title-search-popover :is(.mud-list-item-text, .mud-typography),
html body .mud-popover.central-searchbar-select-popover :is(.mud-list-item-text, .mud-typography) {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

:is(body.theme-dark, body[data-theme="dark"]) .mud-popover.mud-popover-adaptive-width:has(.mud-list > .mud-list-item) {
    box-shadow: 0 16px 34px rgba(0, 0, 0, .34) !important;
}
