@import './button';
@import './inputtext';
@import './iconfield';

.p-select {
  @apply relative inline-flex cursor-pointer select-none rounded-md border border-surface-300 bg-surface-0 shadow-[0_1px_2px_0_rgba(18,18,23,0.05)] transition-colors duration-200 dark:border-surface-700 dark:bg-surface-950;
}

.p-select:not(.p-disabled):hover {
  @apply border-surface-400 dark:border-surface-600;
}

.p-select:not(.p-disabled).p-focus {
  @apply border-primary;
}

.p-select.p-variant-filled {
  @apply bg-surface-50 dark:bg-surface-800;
}

.p-select.p-invalid {
  @apply border-red-400 dark:border-red-300;
}

.p-select.p-disabled {
  @apply cursor-default bg-surface-200 text-surface-500 opacity-100 dark:bg-surface-700 dark:text-surface-400;
}

.p-select-clear-icon {
  @apply absolute end-10 top-1/2 -mt-2 text-surface-500 dark:text-surface-400;
}

.p-select-dropdown {
  @apply flex w-10 shrink-0 items-center justify-center rounded-e-md bg-transparent text-surface-500 dark:text-surface-400;
}

.p-select-label {
  @apply block w-[1%] flex-auto overflow-hidden overflow-ellipsis whitespace-nowrap border-none bg-transparent px-3 py-2 text-surface-700 outline-none dark:text-surface-0;
}

.p-select-label.p-placeholder {
  @apply text-surface-500 dark:text-surface-400;
}

.p-select:has(.p-select-clear-icon) .p-select-label {
  @apply pe-7;
}

.p-select.p-disabled .p-select-label {
  @apply text-surface-500 dark:text-surface-400;
}

.p-select-label-empty {
  @apply overflow-hidden opacity-0;
}

input.p-select-label {
  @apply cursor-default;
}

.p-select .p-select-overlay {
  @apply min-w-full;
}

.p-select-overlay {
  @apply absolute left-0 top-0 rounded-md border border-surface-200 bg-surface-0 text-surface-700 shadow-[0_4px_6px_-1px_rgba(0,0,0,0.1),0_2px_4px_-2px_rgba(0,0,0,0.1)] dark:border-surface-700 dark:bg-surface-900 dark:text-surface-0;
}

.p-select-header {
  @apply px-4 pb-1 pt-2;
}

.p-select-filter {
  @apply w-full;
}

.p-select-list-container {
  @apply overflow-auto;
}

.p-select-option-group {
  @apply m-0 bg-transparent px-3 py-2 font-semibold text-surface-500 dark:text-surface-400;
}

.p-select-list {
  @apply m-0 flex list-none flex-col gap-[2px] p-1;
}

.p-select-option {
  @apply relative flex cursor-pointer items-center overflow-hidden whitespace-nowrap rounded-sm border-none bg-transparent px-3 py-2 font-normal text-surface-700 transition-colors duration-200 dark:text-surface-0;
}

.p-select-option:not(.p-select-option-selected):not(.p-disabled).p-focus {
  @apply bg-surface-100 text-surface-800 dark:bg-surface-800 dark:text-surface-0;
}

.p-select-option.p-select-option-selected {
  @apply bg-highlight;
}

.p-select-option.p-select-option-selected.p-focus {
  @apply bg-highlight-emphasis;
}

.p-select-option-check-icon {
  @apply relative -ms-[0.375rem] me-[0.375rem] text-surface-700 dark:text-surface-0;
}

.p-select-empty-message {
  @apply px-3 py-2;
}

.p-select-fluid {
  @apply flex;
}

.p-select-sm .p-select-label {
  @apply px-[0.625rem] py-[0.375rem] text-sm;
}

.p-select-sm .p-select-dropdown .p-icon {
  @apply h-[0.875rem] w-[0.875rem] text-sm;
}

.p-select-lg .p-select-label {
  @apply px-[0.875rem] py-[0.625rem] text-lg;
}

.p-select-lg .p-select-dropdown .p-icon {
  @apply h-[1.125rem] w-[1.125rem] text-lg;
}
