@use '../../scss/base/variables' as var;

.selectedText {
  white-space: nowrap;
  font-size: var(--font-size-12);
  display: flex;
  align-items: center;
  font-weight: var(--font-weight-regular);
  color: var(--dark-purple);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
  @media only screen and (max-width: var.$breakpoint-sm-max) {
    /* CSS specific to iOS devices */
    @supports (-webkit-touch-callout: none) {
      font-size: 16px;
    }
  }
  .placeholder {
    color: var(--purple);
  }
}

.flip {
  transform: rotate(180deg);
}

.selectBox {
  // updated to match prototype design
  height: 22px;
  border: 1px solid var(--medium-purple);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  gap: 16px;
  &.open {
    border-color: var(--blue);
  }
}

.multiSelect {
  border: 1px solid var(--medium-purple);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  // UX design requirements determined the max-height
  max-height: 300px;
  border-radius: 4px;
  position: relative;
  padding-top: 8px;
  max-width: 100%;
  &.noBorder {
    border: none;
  }
  &.noOverflow {
    max-height: none;
  }
  &.addGap {
    gap: 8px;
  }
  &.noSelectAll {
    padding-bottom: 8px;
  }
}

.searchContainerPadding {
  padding: 0 8px;
}

.stickyHeader {
  position: sticky;
  z-index: 1;
  top: 0;
  &.hasGradient {
    top: 16px;
  }
  &:first-of-type:before {
    content: '';
    height: 16px;
    width: 100%;
    background-color: var(--white);
    position: absolute;
    top: -16px;
  }
}

.list {
  margin-bottom: auto;
  padding: 0 8px;
}

.listItem {
  word-break: break-word;
  &:first-of-type {
    margin-top: 0;
  }
  &:last-of-type {
    margin-bottom: 0;
  }
}
.selectAll {
  padding: 8px;
  background-color: var(--lighter-gray);
  border-radius: 0 0 4px 4px;
  position: relative;
  z-index: 10;
  button {
    font-size: var(--font-size-12);
    font-weight: var(--font-weight-regular);
  }
}

.popoverToggle {
  cursor: pointer;
  &.disabled {
    cursor: not-allowed;
    background: var(--faint-gray);
    .selectBox {
      opacity: 0.6;
    }
  }
}

.tippyContainer {
  padding: 0;
}

.exposed {
  min-width: 240px;
  background-color: var(--white);
}

.multiselectionRow {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 12px 0;
  &:first-of-type {
    margin-top: 0;
  }
  &:last-of-type {
    margin-bottom: 0;
  }
}

.secondaryValue {
  // added magic number 70px if primary text gets longer
  // secondary text should occupy the space to look consistent
  min-width: 70px;
  display: flex;
  justify-content: right;
  color: var(--medium-gray);
  font-size: var(--font-size-10);
  line-height: 12px;
  text-transform: uppercase;
  position: relative;
  top: 2px;
  cursor: default;
}

.valueTextInNormalCase {
  text-transform: none;
}

.secondaryValueHeaderTitle {
  text-transform: uppercase;
}

.selectedRowsWrapper {
  margin: 12px 0;
}

.checkboxListRow {
  &:global(.sticky-table-row) {
    display: flex;
    justify-content: space-between;
    line-height: normal;
    align-items: center;
  }
}

.rightAlignedRowItems {
  display: flex;
  align-items: center;
  gap: 8px;
}
