@import url('./../../../../../../projects/gbhost/public/gbstyle/gbcommonstyle.scss');
@import url('./../../gbcombobox/gbcombobox.component.scss');

.picklist-title-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 27px;
  margin-top: 8px;
}

.PicklistTitle {
  font-size: calc(var(--font-size-md) *1px);
  font-weight: var(--font-weight-semiBold);
  line-height: calc(var(--font-lineHeight-l) * 1px);
  color: var(--text-primary);
}

.Titlecontainer {
  display: flex;
  //align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.Picklistgridcloseicon {
  cursor: pointer;
  color: #818181;
  width: auto !important;
  height: 27px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; // 👈 spacing between refresh & close
}

.restart_alt {
  display: grid !important;
  align-content: center !important;
  justify-content: center !important;
  transition: transform 0.6s ease-in-out !important;
}

.restart_alt:hover {
  transform: rotate(-360deg) !important;
}

.Container {
  display: inline-block;
  height: 77vh;
  width: 100%;
  padding-top: calc(var(--space-l) *1px);
  padding-right: calc(var(--space-xl) *1px);
  padding-bottom: calc(var(--space-l) *1px);
  padding-left: calc(var(--space-xl) *1px);
  // overflow-y: auto !important;
  // overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--action-primary-default, #834dd0) rgba(26, 26, 26, 0.32);

  // Webkit browsers (Chrome, Safari, Edge) scrollbar styling
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.32);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--action-primary-default, #834dd0);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: #6b3ab0;
  }
}

.clear {
  position: relative;
  cursor: pointer;
  color: var(--button-secondary-text-disabled);
  width: calc(var(--font-size-key) *1px);
  height: calc(var(--font-size-key) *1px);
  font-size: calc(var(--font-size-key) *1px);
}


.PicklistsearchBar {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: calc(var(--font-size-sm) *1px);
  font-weight: var(--font-weight-semiBold);
  line-height: calc(var(--font-lineHeight-sm) * 1px);
  letter-spacing: calc(var(--font-letterSpacing-md) * 1px);
  color: var(--field-text-default);

  &::placeholder {
    color: var(--field-text-placeholder);
    //opacity: 1;
  }
}

.PicklistsearchBar::placeholder {
  color: var(--field-text-placeholder) !important;
  opacity: 1 !important;
  font-weight: 400;
}

.archive-toggle-container {
  display: flex;
  align-items: center;
  min-width: 140px;
  margin-left: 16px;
  font: helvetica;
  font-weight: 400;
  font-size: 12px;
  color: #1a1a1a;
  line-height: 150%;
  letter-spacing: 0%;
  width: 116px;
  height: 24px;
  gap: 16px;
  vertical-align: middle;
}

.searchIcon {
  width: calc(var(--space-xl) *1px);
  height: calc(var(--space-xl) *1px);
  font-size: calc(var(--space-xl) *1px);
  color: var(--field-text-default);
  display: flex;
  align-items: center;
}

.search-archive-row {
  // display: flex;
  // align-items: center;
  // justify-content: space-between;
  // gap: calc(var(--space-2xl) *1px);
  width: calc(var(--size-field-min-xl) *1px);
  // max-width: var(--picklist-width);
  // height: 32px;
}

.show-archive-toggle {
  display: flex;
  align-items: center;
  min-width: 140px;
  margin-left: 16px;
  gap: 8px;
}

.picklist-action-btn {
  width: 120px;
  height: 28px;
  border: 2px solid;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  margin-left: 4px;
  margin-right: 0;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.select-btn {
  float: right;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--action-primary-default);
  color: #ffffff;
  margin-right: 20px;
  width: 120px;
  height: 28px;
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--action-primary-default);
  gap: 2px;
  border-radius: 8px;
}

.invert-btn {
  float: right;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ffffff;
  color: var(--action-primary-default);
  margin-right: 20px;
  width: 120px;
  height: 28px;
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--action-primary-default);
  gap: 2px;
  border-radius: 8px;
}

::ng-deep.gridcontainer {
  overflow: visible !important;
  position: relative;
}

::ng-deep .ag-header-viewport {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

::ng-deep .mat-slide-toggle {
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  height: 32px;
  line-height: 32px;
}

::ng-deep .mat-slide-toggle-bar {
  height: 20px !important;
  width: 36px !important;
  border-radius: 20px;
  background: #d6d5d9 !important;
}

::ng-deep .mat-slide-toggle-thumb {
  width: 14px !important;
  height: 14px !important;
  top: 3px !important;
  left: 3px !important;
  background: var(--action-primary-default) !important;
}

::ng-deep .mat-slide-toggle-checked .mat-slide-toggle-bar {
  background: var(--action-primary-default) !important;
}

::ng-deep .mat-slide-toggle-checked .mat-slide-toggle-thumb {
  background: var(--action-primary-default) !important;
}

::ng-deep .mat-slide-toggle-label {
  font-size: 15px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: #323134;
  margin-left: 8px;
  margin-right: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

::ng-deep .mdc-switch.mdc-switch--selected {
  --mdc-switch-selected-track-color: rgba(206, 185, 237, 0.57);
  --mdc-switch-selected-hover-track-color: rgba(174, 145, 213, 0.601);
  --mdc-switch-selected-focus-track-color: rgba(131, 77, 208, 0.2);
  --mdc-switch-selected-pressed-track-color: rgba(131, 77, 208, 0.3);
}

::ng-deep .mat-mdc-slide-toggle.mat-accent .mdc-switch--checked .mdc-switch__track {
  background-color: #b9a1dbac !important;
}

::ng-deep .mat-mdc-slide-toggle.mat-accent .mdc-switch--checked .mdc-switch__handle {
  background-color: var(--action-primary-default) !important;
}

::ng-deep .mat-mdc-slide-toggle.mat-accent .mdc-switch--checked .mdc-switch__icon {
  color: #bca7da !important;
  border-radius: 3px;
}

::ng-deep .mat-mdc-slide-toggle .mdc-switch--checked .mdc-switch__track {
  border-color: var(--action-primary-default) !important;
}

::ng-deep .mat-mdc-slide-toggle .mdc-switch--checked .mdc-switch__icon {
  color: #fff !important;
}

::ng-deep .mat-mdc-slide-toggle .mdc-switch--checked .mdc-switch__icons {
  background-color: var(--action-primary-default) !important;
  border-radius: 10px;
}

::ng-deep .mat-mdc-dialog-component-host {
  display: unset;
  height: 100%;
}

::ng-deep.ag-theme-material .ag-checkbox-input-wrapper.ag-checked::after {
  color: var(--radio-checked-dot) !important;
}

::ng-deep .ag-theme-material .ag-header-cell {
  background-color: var(--action-primary-default) !important;
}

::ng-deep .ag-header-cell-sortable .ag-header-cell-label {
  color: var(--text-secondary) !important;
  font-size: calc(var(--font-size-sm) *1px);
  font-weight: var(--font-weight-medium);
  line-height: calc(var(--font-lineHeight-sm) * 1px);
  letter-spacing: calc(var(--font-letterSpacing-lg) * 1px);
  // overflow: hidden !important;
  // margin-left: 0px !important;
  // margin-top: 0px !important;
}

::ng-deep .ag-header-cell-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

::ng-deep #PicklistGrid .ag-header-cell,
.ag-header-group-cell {
  //padding: 0 !important;
}

::ng-deep #PicklistGrid .ag-cell,
.ag-full-width-row .ag-cell-wrapper.ag-row-group {
  border-bottom: 1px solid var(--border-subtle) !important;
  //border-top: 1px solid var(--border-subtle) !important;
}

::ng-deep .cdk-overlay-pane.mat-mdc-dialog-panel {
  max-width: 95vw;
}

::ng-deep .ag-icon-asc {
  color: rgba(26, 26, 26, 0.38) !important;
  fill: rgba(26, 26, 26, 0.38) !important;
  width: 21px !important;
  height: 21px !important;
}

::ng-deep .ag-icon-desc {
  color: rgba(26, 26, 26, 0.38) !important;
  fill: rgba(26, 26, 26, 0.38) !important;
  width: 21px !important;
  height: 21px !important;
}

::ng-deep #PicklistGrid .ag-header {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-default) !important;
  height: calc(var(--field-height-m) *1px) !important;
  width: 100% !important;
  padding-left: calc(var(--space-m) *1px) !important;
  padding-right: calc(var(--space-m) *1px) !important;
}

::ng-deep #PicklistGrid .ag-header-row {
  background: transparent !important;
  height: auto !important;
  font-size: calc(var(--font-size-sm) *1px);
  font-weight: var(--font-weight-medium);
  line-height: calc(var(--font-lineHeight-sm) * 1px);
  letter-spacing: calc(var(--font-letterSpacing-lg) * 1px);
  color: var(--text-secondary);
  //vertical-align: middle !important;
}

::ng-deep #PicklistGrid .ag-header-cell,
::ng-deep #PicklistGrid .ag-header-group-cell {
  background: transparent !important;
  height: calc(var(--button-height-m) *1px) !important;
  width: auto !important;
  align-items: center !important;
}

::ng-deep #PicklistGrid .ag-row-selected {
  border-radius: 8px !important;
}

::ng-deep .ag-header-cell-text {
  font-family: Helvetica;
  font-weight: 700;
  font-style: normal;
  font-size: 14px;
  line-height: 150%;
  letter-spacing: 0%;
  color: var(--text-secondary) !important;
}

::ng-deep #PicklistGrid .ag-root-wrapper,
::ng-deep #PicklistGrid .ag-root {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: calc(var(--size-radius-m) *1px) !important;
  width: 100% !important;
}

::ng-deep #PicklistGrid .ag-row,
::ng-deep #PicklistGrid .ag-row-odd,
::ng-deep #PicklistGrid .ag-row-even,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-odd,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-even {
  background: unset !important;
  width: 100% !important;
}

::ng-deep .mat-mdc-dialog-container {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: scroll !important;
}

::ng-deep .mdc-switch__track {
  width: 40px !important;
  height: 24px !important;
  border-radius: 30px !important;
  border: 1px !important;
  color: #1a1a1a !important;
}

::ng-deep #PicklistGrid .ag-root-wrapper {
  max-height: 426px;
  overflow: visible !important;
}

::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-odd,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-even {
  background: transparent !important;
}

::ng-deep .ag-body-vertical-scroll-viewport {
  overflow-y: auto !important;
}

::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-odd,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row-even,
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row:nth-child(odd),
::ng-deep #PicklistGrid .ag-center-cols-container .ag-row:nth-child(even) {
  // background-color: var(--bg-surface) !important;
  // border-bottom: 1px solid var(--border-subtle) !important;
  // width: 100% !important;
  // height: 36px !important;
  // padding-left: calc(var(--space-m) *1px) !important;
  // padding-right: calc(var(--space-m) *1px) !important;
  // padding-top: calc(var(--space-s) *1px) !important;
  // padding-bottom: calc(var(--space-s) *1px) !important;
  // gap: calc(var(--space-s) *1px) !important;
}

::ng-deep #PicklistGrid .ag-center-cols-container .ag-row {
  background: var(--bg-surface) !important;
  height: auto !important;
  display: flex !important;
}

::ng-deep #PicklistGrid .ag-body-viewport {
  overflow-x: auto !important;
  overflow-y: auto !important;
  width: 100% !important;
  // max-width: var(--picklist-width);
  // height: 394px !important;
  // max-height: 394px !important;
  // background-color: #ffffff !important;
  scrollbar-width: thin;
  scrollbar-color: var(--action-primary-default, #834dd0) rgba(26, 26, 26, 0.32);
}

::ng-deep #PicklistGrid .ag-center-cols-viewport {
  overflow: visible !important;
  // width: 720px !important;
  // height: auto !important;
  // min-height: 100% !important;
  // background-color: #ffffff !important;
}

::ng-deep #PicklistGrid .ag-center-cols-container {
  overflow: visible !important;
  // width: 720px !important;
  height: auto !important;
  //min-height: 100% !important;
  // background-color: #ffffff !important;
  // margin-top: 6px !important;
}

::ng-deep #PicklistGrid #cdk-overlay-1 {
  width: 730px !important;
  height: 560px !important;
  position: static !important;
}

::ng-deep .ag-cell.first-col {
  border-top-left-radius: 5px !important;
  border-bottom-left-radius: 5px !important;
}

::ng-deep .ag-cell.last-col {
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}

::ng-deep .ag-cell.middle-col {
  border-radius: 0 !important;
}

::ng-deep .ag-theme-material .ag-cell {
  background-color: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  height: 48px !important;
  border: none !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 8px !important;
}

// ::ng-deep .ag-checkbox .ag-input-wrapper{
//   overflow: visible;
//   margin-bottom: 1px;
//   padding-bottom: 20px;
// }
::ng-deep .mat-mdc-dialog-inner-container .mdc-dialog__container {
  width: 768px !important;
  height: 600px !important;
}

::ng-deep .ag-cell-label-container {
  //margin-right: 170px !important;
}

::ng-deep .ag-header-cell-comp-wrapper {
  //margin-right: 144px !important;
}

::ng-deep .--ag-line-height {
  height: 28px !important;
}



::ng-deep .mat-mdc-dialog-container {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  display: block !important;
}

::ng-deep .mat-mdc-dialog-surface {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--size-radius-l) *1px);
  width: 720px !important;
  height: 85vh !important;
  max-width: 90vw !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow-y: hidden !important; 
}

::ng-deep #PicklistGrid .ag-center-cols-container .ag-row:hover {
  background: var(--bg-surface) !important;
}

::ng-deep #PicklistGrid .ag-cell[col-id="code"] {
  text-align: left !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 50% !important;
}

::ng-deep #PicklistGrid .ag-cell[col-id="name"] {
  text-align: left !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 50% !important;
}

::ng-deep #PicklistGrid .ag-row {
  // display: flex !important;
  // width: 720px !important;
}

::ng-deep #PicklistGrid .ag-center-cols-container .ag-row {
  // background: #ffffff !important;
  // border-radius: 8px !important;
  // box-shadow: 0 1px 4px 0 rgba(130, 89, 247, 0.06);
  // margin-bottom: 8px;
  // width: 100% !important;
  // max-width: calc(var(--picklist-width) - 16px);
  // height: 48px !important;
  // display: flex !important;
}

::ng-deep #PicklistGrid .ag-cell {
  // background-color: #F3EDFA !important;
  color: var(--text-primary) !important;
  height: 36px !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  padding-left: calc(var(--space-m) *1px) !important;
  padding-right: calc(var(--space-m) *1px) !important;
  width: 100% !important;
  //border-radius: 8px;
}

::ng-deep #PicklistGrid .ag-row:hover .ag-cell {
  background-color: var(--bg-hover) !important;
}

::ng-deep #PicklistGrid .ag-row-selected .ag-cell {
  background-color: var(--bg-hover) !important;
}

// ::ng-deep #PicklistGrid .ag-row:hover .ag-cell:first-child,
// ::ng-deep #PicklistGrid .ag-row-selected .ag-cell:first-child {
//   border-left: 1px solid #834dd0 !important;
//   border-top-left-radius: 8px !important;
//   border-bottom-left-radius: 8px !important;


/* Last cell gets right border */
// ::ng-deep #PicklistGrid .ag-row:hover .ag-cell:last-child,
// ::ng-deep #PicklistGrid .ag-row-selected .ag-cell:last-child {
//   border-right: 1px solid #834dd0 !important;
//   border-top-right-radius: 8px !important;
//   border-bottom-right-radius: 8px !important;
// }
::ng-deep #PicklistGrid .ag-cell[col-id="code"]:hover {
  background: linear-gradient(90deg, #e8dcf7 0%, #F3EDFA 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(131, 77, 208, 0.2);
  transition: all 0.2s ease-in-out;
}

::ng-deep .ag-theme-material .ag-checkbox-input-wrapper::after {
  color: var(--radio-unchecked-border) !important;
  width: calc(var(--space-2xl) *1px) !important;
  height: calc(var(--space-2xl) *1px) !important;
  font-size: calc(var(--font-size-md) *1px) !important;
}

// Remove checkbox overlay/ripple effect
::ng-deep .ag-checkbox-input-wrapper::before {
  display: none !important;
}

::ng-deep .ag-checkbox-input-wrapper {
  background: transparent !important;
}

::ng-deep .ag-checkbox .ag-input-wrapper {
  background: transparent !important;
  overflow: visible !important;
}



::ng-deep .ag-center-cols-viewport {
  background-color: var(--bg-surface) !important;
}

::ng-deep .ag-pinned-left-cols-container,
::ng-deep .ag-pinned-right-cols-container,
::ng-deep .ag-full-width-container {
  height: auto !important;
}

::ng-deep #PicklistGrid .ag-cell:first-child {
  //border-radius: 8px 0 0 8px !important;

}

::ng-deep #PicklistGrid .ag-cell:last-child {
  //border-radius: 0 8px 8px 0 !important;
}

::ng-deep #PicklistGrid .ag-cell:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
  left: 50px;
  width: 669px;
}

:host ::ng-deep #PicklistGrid .ag-row {
  // border-radius: 16px !important;
  // --picklist-width: 768px;
}

// Add this new rule for single column
::ng-deep .ag-cell.single-col {
  border-radius: 8px !important;
}

// Single column with checkbox - apply border radius only to right side
::ng-deep #PicklistGrid .ag-row .ag-cell.single-col:not(:first-child) {
  border-radius: 0 8px 8px 0 !important;
}

// Keep existing rules
::ng-deep .ag-cell.first-col {
  border-top-left-radius: 5px !important;
  border-bottom-left-radius: 5px !important;
}

::ng-deep .ag-cell.last-col {
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}

::ng-deep .ag-cell.middle-col {
  border-radius: 0 !important;
}

::ng-deep #PicklistGrid .ag-cell:first-child:last-child {
  border-radius: 8px !important;
}

::ng-deep #PicklistGrid .ag-cell:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
  left: 50px;
  width: 669px;
}

::ng-deep #PicklistGrid .ag-body-horizontal-scroll-viewport {
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

::ng-deep #PicklistGrid .ag-horizontal-left-spacer,
::ng-deep #PicklistGrid .ag-horizontal-right-spacer {
  display: none !important;
}

::ng-deep .ag-theme-material {
  .ag-row.inactive-row {
    background-color: var(--category-bg-violet) !important; // Light red background
    color: #c62828 !important; // Dark red text

    &:hover {
      background-color: var(--bg-surface) !important; // Slightly darker red on hover
    }

    &.ag-row-selected {
      background-color: #ef9a9a !important; // Red variant for selected inactive rows
    }
  }

  .ag-cell.inactive-row {
    color: #c62828 !important; // Dark red text for cells
    font-weight: 500; // Make text slightly bolder
  }
}

::ng-deep .mat-mdc-dialog-inner-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center !important;
  box-sizing: border-box;
  height: 100%;
  max-height: inherit;
  min-height: inherit;
  min-width: inherit;
  max-width: inherit;
}

// added for number to be right alligned in picklist grid
:host ::ng-deep .ag-right-aligned-cell {
  display: flex !important;
  justify-content: flex-end !important;
  margin-left: -16px !important;
}

.closeicon {
  cursor: pointer;
  color: var(--button-secondary-text-disabled);
}

.closeicon mat-icon {
  font-size: calc(var(--font-lineHeight-l) *1px);
  vertical-align: middle;
}

.closebutton {
  cursor: pointer !important;
}