/* Custom Choices.js styling for PAHI */

.choices {
  position: relative;
  margin-bottom: 0;
  font-size: 1rem;
}

.choices__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  min-height: 3rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.choices.is-focused .choices__inner {
  border-color: #0b1679;
  box-shadow: 0 0 0 0.2rem rgba(11, 22, 121, 0.25);
}

.choices__input {
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  flex: 1;
  min-width: 150px;
  outline: none;
}

.choices__input::placeholder {
  color: #6c757d;
  opacity: 1;
}

.choices__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.choices__list--multiple {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choices__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #e7f1ff;
  color: #0b1679;
  border: 1px solid #0b1679;
  border-radius: 0.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.choices__item--deletable {
  padding-right: 0.5rem;
}

.choices__button {
  background: none;
  border: none;
  color: #0b1679;
  cursor: pointer;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  transition: color 0.15s ease-in-out;
}

.choices__button:hover {
  color: #d32f2f;
}

.choices__list--dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: -1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.choices.is-open .choices__list--dropdown {
  display: block;
}

.choices__list--dropdown .choices__list {
  display: block;
}

.choices__item--choice {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.choices__item--choice:hover,
.choices__item--choice.is-highlighted {
  background-color: #f0f4ff;
  color: #0b1679;
}

.choices__item--choice.is-selected {
  background-color: #e7f1ff;
  color: #0b1679;
  font-weight: 500;
}

.choices__group {
  padding: 0;
}

.choices__heading {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
  text-transform: uppercase;
  border-bottom: 1px solid #dee2e6;
}

.choices__placeholder {
  color: #6c757d;
  opacity: 1;
}

.choices.is-disabled .choices__inner {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.choices.is-disabled .choices__input {
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .choices__inner {
    padding: 0.5rem 0.75rem;
    min-height: 2.75rem;
  }

  .choices__input {
    min-width: 100px;
    font-size: 0.95rem;
  }

  .choices__item {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .choices__list--dropdown {
    max-height: 250px;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .choices__inner {
    background-color: #2d2d2d;
    border-color: #444;
  }

  .choices.is-focused .choices__inner {
    border-color: #5a7cff;
    box-shadow: 0 0 0 0.2rem rgba(90, 124, 255, 0.25);
  }

  .choices__item {
    background-color: #1a3a52;
    color: #5a7cff;
    border-color: #5a7cff;
  }

  .choices__list--dropdown {
    background-color: #2d2d2d;
    border-color: #444;
  }

  .choices__item--choice:hover,
  .choices__item--choice.is-highlighted {
    background-color: #1a3a52;
  }

  .choices__item--choice.is-selected {
    background-color: #1a3a52;
    color: #5a7cff;
  }

  .choices__heading {
    color: #aaa;
    border-bottom-color: #444;
  }

  .choices.is-disabled .choices__inner {
    background-color: #1a1a1a;
  }
}
