// vf-chatbot-selector

@import 'package.variables.scss';

.vf-chatbot-selector {
  position: relative;
  display: block;
  width: 100%;
}

.vf-chatbot-selector__title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;

  &--expanded {
    .vf-chatbot-selector__chevron svg{
      transform: rotate(180deg);
    }
  }
}


.vf-chatbot-selector__title img {
  margin: 10px;
  vertical-align: middle;
}

.vf-chatbot-selector__title-content {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}

.vf-chatbot-selector__main-text {
  @include set-type(text-heading--5);
  margin-bottom: 0;
}

.vf-chatbot-selector__title-text {
  @include set-type(text-body--5);
  margin-bottom: 0;
  min-width: 120px;
}

.vf-chatbot-selector__chevron svg{
  transition: transform 0.2s ease;
}

.vf-chatbot-selector__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 275px;
  max-width: 300px;
  background: var(--vf-color--neutral--0);
  box-shadow: 0 4px 6px var(--vf-color--grey--light);
  margin-top: 4px;

  &--expanded {
    display: block;
  }
}


// If inside vf-chatbot-modal, override some styles
.vf-chatbot-modal-container .vf-chatbot-selector__dropdown {
  z-index: 1000;
  width: 95vw;
  max-width: 385px;
}

.vf-chatbot-selector__header {
  @include set-type(text-body--5);
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--vf-color--grey--light);
}

.vf-chatbot-selector__clear {
  color: var(--vf-color--grey--dark);
  text-decoration: none;
  pointer-events: none;
  opacity: 0.5;

  &--active {
    color: $vf-link--color;
    pointer-events: auto;
    opacity: 1;
  }
}

.vf-chatbot-selector__search {
  input {
    @include set-type(text-body--3);
    margin-bottom: 0;
    width: 93%;
    padding: 8px 16px;
    padding-right: 0px;
    border: 2px solid #333;
  }
}

.vf-chatbot-modal-container .vf-chatbot-selector__search {
  input {
    width: 95%;
  }
}

.vf-chatbot-selector__list {
  max-height: 30vh;
  overflow-y: auto;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

.vf-chatbot-selector__item {
  @include set-type(text-body--3);
  margin-bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;

  &--selected {
    .vf-chatbot-selector__tick {
      opacity: 1;
    }
  }
}

.vf-chatbot-selector__item-content {
  flex: 1;
  padding-right: 16px;
}

.vf-chatbot-selector__item-title {
  @include set-type(text-body--3);
  margin-bottom: 0;
}

.vf-chatbot-selector__item-description {
  @include set-type(text-body--5);
  margin-bottom: 0;
}

.vf-chatbot-selector__tick {
  opacity: 0;
}
