/* Tom Select - Custom overrides to match Tailwind design */

/* Main control (the select box itself) */
.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
  background-color: white !important;
  background-image: none !important;
  border: 1px solid rgb(209, 213, 219); /* outline-gray-300 */
  border-radius: 0.375rem; /* rounded-md */
  padding: 0.625rem 2.5rem 0.625rem 0.75rem; /* py-2.5 with extra right padding for arrow */
  font-size: 1rem;
  line-height: 1.5rem;
  color: rgb(17, 24, 39); /* text-gray-900 */
  transition: all 150ms;
  min-height: auto !important;
  box-shadow: none;
}

/* Focus state */
.ts-wrapper.single .ts-control:focus,
.ts-wrapper.single.focus .ts-control,
.ts-wrapper.single.input-active .ts-control {
  outline: 2px solid rgb(13, 148, 136) !important; /* teal-600 - same as other fields */
  outline-offset: -2px !important;
  border-color: transparent !important;
  background-color: white !important;
}

/* Selected item in control */
.ts-wrapper.single .ts-control .item {
  padding-left: 0;
  background-color: transparent !important;
}

/* Input field while searching */
.ts-control input {
  font-size: 1rem !important;
  color: rgb(17, 24, 39) !important;
  background-color: transparent !important;
}

.ts-control input::placeholder {
  color: rgb(156, 163, 175); /* text-gray-400 */
}

/* Dropdown menu */
.ts-dropdown {
  background-color: white;
  border: 1px solid rgb(209, 213, 219);
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  margin-top: 0.25rem;
  z-index: 1000;
}

.ts-dropdown .optgroup-header {
  background-color: rgb(249, 250, 251);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(107, 114, 128);
}

.ts-dropdown .option {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: rgb(17, 24, 39);
  background-color: white;
  cursor: pointer;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background-color: rgb(243, 244, 246); /* gray-100 */
  color: rgb(17, 24, 39); /* gray-900 */
}

.ts-dropdown .option.selected {
  background-color: rgb(229, 231, 235); /* gray-200 */
  color: rgb(17, 24, 39); /* gray-900 */
}

.ts-dropdown .no-results {
  padding: 0.75rem;
  text-align: center;
  color: rgb(107, 114, 128); /* text-gray-500 */
  font-size: 0.875rem;
  background-color: white;
}

/* Clear button styling */
.ts-wrapper .clear-button {
  color: rgb(156, 163, 175);
  transition: color 150ms;
  cursor: pointer;
}

.ts-wrapper .clear-button:hover {
  color: rgb(239, 68, 68); /* red-500 */
}

/* Dropdown arrow - Custom chevron */
.ts-wrapper.single .ts-control::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgb(107, 114, 128); /* gray-500 */
  transition: transform 150ms;
  pointer-events: none;
}

.ts-wrapper.single.dropdown-active .ts-control::after {
  transform: translateY(-50%) rotate(180deg);
}
