/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Remove setas do input numérico nos campos de custo de serviço */
input[data-cost-value]::-webkit-inner-spin-button,
input[data-cost-value]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
input[data-cost-value] {
  -moz-appearance: textfield;
}

/* Ensure clickable button components show pointer cursor across the app */
[data-component="button"],
.btn,
button[data-component="button"],
a.btn,
a[data-component="button"] {
  cursor: pointer !important;
}

:root {
  --hw-combobox-width: 100%;
  --hw-combobox-width--multiple: 100%;
  --hw-dialog-label-color: var(--foreground);
}

/* Custom styles for hotwire_combobox */
.hw-combobox {
  width: 100% !important;
}

/* Transform the wrapper into the "input" visual */
.hw-combobox__main__wrapper {
  width: 100% !important;
  border-radius: var(--radius) !important;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent) !important;
  background-color: var(--popover) !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  min-height: 2.5rem !important;
  padding: 0 !important;
  color: var(--foreground) !important;
}

.hw-combobox__main__wrapper:focus-within {
  outline: 2px solid transparent !important;
  outline-offset: 2px !important;
  border-color: var(--ring) !important;
  --tw-ring-offset-shadow: inset 0 0 0 0px #fff;
  --tw-ring-shadow: inset 0 0 0 calc(2px + 0px) var(--ring);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 #0000 !important;
}

/* Remove border from actual input to blend into wrapper */
.hw-combobox__input {
  width: 100%;
  border: none !important;
  background-color: transparent !important;
  color: var(--foreground) !important;
  padding-top: 0.375rem !important;
  padding-bottom: 0.375rem !important;
  padding-left: 0.75rem !important;
  box-shadow: none !important;
  flex: 1 1 50% !important;
  min-width: 100px !important;
  font-size: 0.875rem !important;
}

.hw-combobox__input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.hw-combobox__input::placeholder {
  color: var(--muted-foreground) !important;
}

/* Multiselect chips styling */
.hw-combobox__chip {
  background-color: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  font-size: 0.875rem !important;
  margin: 0.25rem 0 0.25rem 0.375rem !important;
  padding: 0.125rem 0.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.hw-combobox__chip__remover {
  cursor: pointer !important;
  opacity: 0.6 !important;
  font-size: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.hw-combobox__chip__remover:hover {
  opacity: 1 !important;
}

/* Listbox and Options (Dark Mode support) */
.hw-combobox__listbox {
  width: 100% !important;
  background-color: var(--popover) !important;
  border-color: var(--border) !important;
  color: var(--popover-foreground) !important;
}

.hw-combobox__option {
  color: var(--popover-foreground) !important;
  background-color: var(--popover) !important;
  font-size: 0.875rem !important;
}

.hw-combobox__option:hover,
.hw-combobox__option--navigated,
.hw-combobox__option--selected {
  background-color: var(--accent) !important;
  color: var(--accent-foreground) !important;
}

.hw-combobox__handle {
  color: var(--muted-foreground) !important;
}

.hw-combobox__dialog {
  background-color: var(--popover) !important;
  color: var(--foreground) !important;
}

.hw-combobox__dialog__input {
  background-color: var(--popover) !important;
  color: var(--foreground) !important;
  border-color: var(--border) !important;
}

.hw-combobox__dialog__listbox {
  background-color: var(--popover) !important;
  color: var(--popover-foreground) !important;
}

.hw-combobox__dialog__label {
  color: var(--foreground) !important;
}

.hw-combobox__dialog__wrapper {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Public layout spinner and loading states */
@keyframes al-spin { to { transform: rotate(360deg); } }
.al-spinner {
  display: inline-block;
  width: 1.1rem; height: 1.1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: al-spin 0.65s linear infinite;
  vertical-align: middle;
}
turbo-frame[aria-busy="true"] {
  position: relative;
  pointer-events: none;
}
turbo-frame[aria-busy="true"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: hsl(var(--background, 0 0% 100%) / 0.75);
  backdrop-filter: blur(1px);
  z-index: 20;
  border-radius: 0.5rem;
}
turbo-frame[aria-busy="true"]::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 1.5rem; height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid transparent;
  border-top-color: hsl(var(--primary, 239 84% 67%));
  border-radius: 50%;
  animation: al-spin 0.65s linear infinite;
  z-index: 21;
}
