﻿/* #region WC Component styling */

.lookup-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.5em;
    width: clamp(16em, 24vw, 600px);
    margin: 0 auto;
    border: 1px solid var(--border-lines, rgba(0 0 0 / .1));
    box-shadow: 0 4px 8px rgba(0 0 0 / .02);
    border-radius: 4px;
    padding: 0 1em;
    background: var(--grey-100);
}

.lookup-filters:focus-within {
    outline: 2px solid #5bbd8a;
    outline-offset: 2px;
}

/*.lookup-dialog div {
    padding: 0.2em;
}*/

.lookup-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lookup-dialog .dataTables_info {
    text-align: left;
}

.lookup-dialog .table-wrapper {
    max-height: 71.3vh;
    height: auto;
    border: none !important;
}

.lookup-dialog .table-overflow-wrapper {
    border: 1px solid var(--border-lines, rgba(0 0 0 / .1));
    border-radius: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

.lookup-dialog .action-footer {
    padding: 8px 0;
}

.lookup-table {
    max-height: none !important;
}

/*  #endregion WC Component styling */

.search-box {
    display: flex;
    align-items: center;
    flex: 1;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.search-box .search-input {
    background: transparent;
}

.search-field::before {
    content: '\E089';
    font-family: 'prompt-icons';
    /* position: absolute; */
    left: 1em;
    font-size: 16px;
    color: var(--gray-600);
    z-index: 1;
    pointer-events: none;
}

.search-box .search-input::placeholder {
    color: #000;
}

.button-group {
    display: flex;
    align-items: center;
    gap: var(--gap-small);
}

.button-group .btn-reset {
    --_padding: 8px 12px;
    border-radius: 6px;
    --btn-bg: var(--color-grey-25);
}

.button-group .btn-apply {
    --_padding: 8px 12px;
    border-radius: 6px;
/*    --btn-bg: var(--color-grey-25);*/
}

div.dataTables_wrapper div.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    margin-left: -100px;
    margin-top: -26px;
    text-align: center;
    padding: 1em 0;
    height: auto;
}

tr.disabled-lookup-row td {
    background-color: #a3a3a3 !important;
    color: #666 !important;
    opacity: 0.5 !important;
}

tr.disabled-lookup-row {
    cursor: not-allowed !important;
}

/* Legacy Lookup styling */
#OrganizationLookupFilters, #EventLookupFilters, #UNLOCOLookupFilters, #UnlocoLookupFilters, #BranchLookupFilters, #ChargeCodeLookupFilters, #CommodityLookupFilters,
#ContainerTypeLookupFilters, #CurrencyLookupFilters, #DepartmentLookupFilters, #PackTypeLookupFilters, #ServiceLevelLookupFilters, #StaffLookupFilters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.5em;
    width: clamp(16em, 24vw, 600px);
    margin: 0 auto;
    margin-bottom: 1em;
    border: 1px solid var(--border-lines, rgba(0 0 0 / .1));
    box-shadow: 0 4px 8px rgba(0 0 0 / .02);
    border-radius: 4px;
    padding: 0 1em;
    background: var(--grey-100);
}

#OrganizationLookupFilters:focus-within,
#EventLookupFilters:focus-within,
#UNLOCOLookupFilters:focus-within {
    outline: 2px solid #5bbd8a;
    outline-offset: 2px;
}

#OrganizationLookup > div {
    padding: 0;
}

#UNLOCOLookup > div {
    padding: 0;
}

.org-lookup-header, event-lookup-header {
    margin-bottom: 1em;
}

.org-lookup-table {
    max-height: none !important;
}
/* #endregion Legacy Lookup styling */

/* #region Datagrid Lookup Styling*/

.inline-lookup-wrapper input.text-field {
    flex: 1;
    border: none;
    background: transparent;
    height: 100%;
    font-size: 14px;
    outline: none;
    border-radius: 25px;
}

.inline-lookup-wrapper:focus-within {
    --_border: 1px solid var(--outline-color) !important;
    outline: var(--_border);
    filter: brightness(.97);
}

.inline-lookup-wrapper button.lookup-trigger {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 0 6px;
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inline-lookup-wrapper button.lookup-trigger:hover {
    color: var(--btn-primary-bg);
}

/* #endregion Datagrid Lookup Styling*/

.table-wrapper {
    position: relative;
}

.lookup-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-brand-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.lookup-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.3);
/*    backdrop-filter: blur(1px);*/
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    display: none !important;
    content: "" !important;
}

.lookup-dialog table.dataTable td,
.lookup-dialog table.dataTable th {
    border-right: 1px solid rgba(255,255,255,0.2) !important;
}

.lookup-dialog table.dataTable thead th {
    border-right: 1px solid rgba(0,0,0,0.08);
    cursor: default;
}

.lookup-dialog table {
    width: 100% !important;
    table-layout: fixed;
}

.lookup-dialog table.dataTable tbody tr {
    cursor: pointer;
}

.lookup-dialog table thead th {
    padding: 14px 10px !important;
}

.lookup-dialog table.dataTable {
    margin-top: 0 !important;
}

.lookup-dialog table.dataTable {
    width: 100% !important;
    table-layout: fixed;
}

.lookup-dialog table.dataTable th,
.lookup-dialog table.dataTable td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lookup-dialog .dt-body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.lookup-dialog .dt-footer {
    padding: 6px 0;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: #fff;
}

.lookup-dialog .dataTables_wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lookup-dialog .table-wrapper :is(th, td, .table-cell) {
    width: auto !important;
    max-width: none !important;
}

.lookup-dialog .dataTables_empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 210%);
    padding: 15px 0;
    font-size: 15px;
    color: #4b5563;
    background: #f9fafb;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.lookup-dialog table.dataTable tbody tr:has(td.dataTables_empty) {
    pointer-events: none;
    background: transparent !important;
}

.lookup-dialog .table-wrapper table.dataTable tbody tr td.dataTables_empty {
    width: 100% !important;
    max-width: 100% !important;
}

.lookup-dialog .no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
}

.lookup-dialog .no-results .icon {
    font-size: 24px;
    opacity: 0.6;
}

.lookup-dialog .icon-button.p-cross {
    width: 36px;
    height: 36px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lookup-dialog .lookup-header {
    display: flex;
    align-items: center;
}

.lookup-dialog .lookup-header h5 {
    margin: 0;
}

.lookup-dialog .lookup-header .left,
.lookup-dialog .lookup-header .center,
.lookup-dialog .lookup-header .right {
    flex: 1;
    display: flex;
    align-items: center;
}

.lookup-dialog .lookup-header .left {
    justify-content: flex-start;
}

.lookup-dialog .lookup-header .center {
    justify-content: center;
}

.lookup-dialog .lookup-header .right {
    justify-content: flex-end;
}

.lookup-dialog table.dataTable tbody tr:nth-child(odd):not(.ui-state-highlight) {
    background: rgba(0, 0, 0, 0.03);
}

.lookup-dialog table.dataTable tbody tr:hover:not(.ui-state-highlight):not(.disabled-lookup-row) {
    background: rgba(0, 0, 0, 0.08);
}

.lookup-dialog table.dataTable tbody tr {
    transition: background 0.12s ease;
}

.lookup-dialog table.dataTable tbody tr.disabled-lookup-row * {
    filter: none !important;
}

.lookup-dialog table.dataTable td,
.lookup-dialog table.dataTable th {
    border: none !important;
}

.lookup-dialog table.dataTable tbody tr td {
    border-top: 1px solid rgba(255,255,255,0.2) !important;
}

.lookup-dialog table.dataTable tbody tr:first-child td {
    border-top: none !important;
}

.lookup-dialog table.dataTable td,
.lookup-dialog table.dataTable th {
    border-right: 1px solid rgba(0,0,0,0.08) !important;
}

.lookup-dialog table.dataTable tbody tr.ui-state-highlight td {
    border-right: 1px solid rgba(255,255,255,0.2) !important;
}

/* #region Lookup Input/Button Style */

.lookup-input-group {
    column-gap: 7px;
}

.lookup-actions {
    gap: 8px;
}

.lookup-actions .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
}

/* #endregion Lookup Input/Button Style */