/* core/static/css/core/base/lc-select.css */
/* Global custom select (lc-select-list). */

.lc-select {
  --lc-select-bg: var(--color-neutral-0, #ffffff);
  --lc-select-border: var(--bs-border-color, #e5e7eb);
  --lc-select-text: var(--bs-body-color, #111827);
  --lc-select-radius: 10px;
  --lc-select-padding: 0.6rem 0.75rem;
  --lc-select-shadow: none;
  --lc-select-focus-border: var(--color-primary-600, #21286C);
  --lc-select-focus-ring: rgba(var(--bs-primary-rgb, 33, 40, 108), 0.18);
  --lc-select-list-bg: var(--color-neutral-0, #ffffff);
  --lc-select-list-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  --lc-select-z: 12000;
  --lc-select-portal-bg: var(--lc-select-list-bg, #ffffff);
  --lc-select-portal-shadow: 0 20px 50px rgba(17, 24, 39, 0.16);

  position: relative;
  width: 100%;
  min-width: 0;
  isolation: isolate;
}

.lc-select,
.lc-select * {
  box-sizing: border-box;
}

.lc-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lc-select-toggle {
  width: 100%;
  min-height: 42px;
  border-radius: var(--lc-select-radius);
  border: 1px solid var(--lc-select-border);
  padding: var(--lc-select-padding);
  background: var(--lc-select-bg);
  color: var(--lc-select-text);
  box-shadow: var(--lc-select-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lc-select-toggle:focus-visible {
  outline: 3px solid var(--lc-select-focus-ring);
  outline-offset: 2px;
  border-color: var(--lc-select-focus-border);
}

.lc-select.is-open .lc-select-toggle {
  border-color: var(--lc-select-focus-border);
  box-shadow: 0 0 0 3px var(--lc-select-focus-ring);
}

.lc-select-toggle:disabled {
  background: var(--color-neutral-100, #f3f4f6);
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.lc-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-select-caret {
  font-size: 0.8rem;
  opacity: 0.7;
  transform: translateY(1px);
}

.lc-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--lc-select-list-bg);
  color: var(--lc-select-text);
  border: 1px solid var(--lc-select-border);
  border-radius: calc(var(--lc-select-radius) + 2px);
  padding: 6px;
  margin: 0;
  list-style: none;
  box-shadow: var(--lc-select-list-shadow);
  max-height: min(280px, 40vh);
  overflow: auto;
  overflow-x: hidden;
  display: none;
  z-index: var(--lc-select-z, 1400);
  width: 100%;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lc-select.is-open .lc-select-list {
  display: block;
}

.lc-select-list.is-open {
  display: block;
}

.lc-select-list[data-portal="true"] {
  position: fixed;
  left: 0;
  right: auto;
  top: 0;
  width: auto;
  min-width: 160px;
  max-width: min(420px, calc(100vw - 16px));
  background: var(--lc-select-portal-bg);
  border: 1px solid var(--lc-select-border);
  box-shadow: var(--lc-select-portal-shadow);
  padding: 8px;
  border-radius: calc(var(--lc-select-radius) + 4px);
  opacity: 1;
  color: var(--lc-select-text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lc-select-list[data-portal="true"].is-open {
  display: block;
}

.lc-select-list[data-portal="true"][data-placement="up"] {
  transform-origin: bottom;
}

.lc-select-list[data-portal="true"][data-placement="down"] {
  transform-origin: top;
}

.lc-select-option {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  line-height: 1.1;
}

.lc-select-option + .lc-select-option {
  margin-top: 4px;
}

.lc-select-option.is-highlight {
  background: rgba(15, 23, 42, 0.04);
}

.lc-select-option.is-selected {
  background: rgba(var(--bs-primary-rgb, 33, 40, 108), 0.1);
  color: var(--color-primary-700, #1B214F);
  font-weight: 600;
}

.lc-select-option.is-disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.lc-select--financeiro {
  --lc-select-border: #e2e8f0;
  --lc-select-radius: 12px;
  --lc-select-padding: 0.875rem 1.25rem;
  --lc-select-focus-border: #667eea;
  --lc-select-focus-ring: rgba(102, 126, 234, 0.1);
  --lc-select-list-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.lc-select--calc {
  --lc-select-border: rgba(15, 23, 42, 0.15);
  --lc-select-radius: 12px;
  --lc-select-padding: 0.8rem 0.9rem;
  --lc-select-focus-border: transparent;
  --lc-select-focus-ring: rgba(33, 40, 108, 0.35);
}
