/* Pakstoor :: pks-select.css :: v1.0-000002 :: 2026-04-22 */

/* Hide the native select but keep it accessible in the DOM for forms. */
.pks-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
  opacity: 0;
}

.pks-select {
  position: relative;
  display: block;
  width: 100%;
  font-family: var(--font-sans);
}

/* ---- Trigger ---- */
.pks-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-1, #1A1A1A);
  border: 1px solid var(--line-2, #2F2F2F);
  border-radius: var(--r-2, 10px);
  font-family: var(--font-sans);
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-500, 500);
  color: var(--ink, #EDEDED);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}
.pks-select-trigger:hover {
  border-color: var(--line-bright, #3D3D3D);
  background: var(--bg-2, #202227);
}
.pks-select.is-open .pks-select-trigger,
.pks-select-trigger:focus-visible {
  outline: none;
  border-color: var(--gold, #C9A24A);
  background: var(--bg-2, #202227);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.12);
}
.pks-select.is-disabled .pks-select-trigger {
  opacity: 0.5;
  cursor: not-allowed;
}

.pks-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pks-select-value.is-placeholder {
  color: var(--ink-dim, #8A8A8A);
  font-weight: 400;
}

.pks-select-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-dim, #8A8A8A);
  transition: transform 180ms cubic-bezier(0.2, 0, 0.2, 1), color 140ms ease;
}
.pks-select-caret svg { width: 100%; height: 100%; }
.pks-select.is-open .pks-select-caret {
  transform: rotate(180deg);
  color: var(--gold, #C9A24A);
}
.pks-select-trigger:hover .pks-select-caret { color: var(--ink, #EDEDED); }

/* ---- Panel ---- */
.pks-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #14161B;
  border: 1px solid var(--line-2, #2F2F2F);
  border-radius: var(--r-3, 12px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 24px 48px -12px rgba(0, 0, 0, 0.7),
    0 8px 20px -6px rgba(0, 0, 0, 0.5);
  z-index: 60;
  overflow: hidden;
  transform-origin: top center;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 160ms cubic-bezier(0.2, 0, 0.2, 1),
    transform 160ms cubic-bezier(0.2, 0, 0.2, 1),
    visibility 0s linear 160ms;
}
.pks-select-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity 160ms cubic-bezier(0.2, 0, 0.2, 1),
    transform 160ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* Inner gold hairline — subtle premium accent */
.pks-select-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 74, 0.25), transparent);
  pointer-events: none;
}

/* ---- List ---- */
.pks-select-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2, #2F2F2F) transparent;
}
.pks-select-list::-webkit-scrollbar { width: 6px; }
.pks-select-list::-webkit-scrollbar-track { background: transparent; }
.pks-select-list::-webkit-scrollbar-thumb {
  background: var(--line-2, #2F2F2F);
  border-radius: 3px;
}
.pks-select-list::-webkit-scrollbar-thumb:hover { background: var(--line-bright, #3D3D3D); }

/* ---- Option row ---- */
.pks-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 10px;
  border-radius: var(--r-2, 8px);
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-500, 500);
  color: var(--ink, #EDEDED);
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: background 100ms ease, color 100ms ease;
  outline: none;
}
.pks-select-option:hover,
.pks-select-option:focus {
  background: rgba(255, 255, 255, 0.04);
}
.pks-select-option.is-placeholder .pks-select-option-label {
  color: var(--ink-dim, #8A8A8A);
  font-weight: 400;
}
.pks-select-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pks-select-option.is-disabled:hover { background: transparent; }

/* Selected state — restrained: gold tint on check + text, subtle left accent */
.pks-select-option.is-selected {
  background: rgba(201, 162, 74, 0.06);
  color: var(--ink, #EDEDED);
  position: relative;
}
.pks-select-option.is-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gold, #C9A24A);
  border-radius: 2px;
}
.pks-select-option.is-selected .pks-select-option-check {
  opacity: 1;
  color: var(--gold, #C9A24A);
}

/* Check icon placeholder — reserves space so text aligns */
.pks-select-option-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0;
  color: var(--ink-dim, #8A8A8A);
  transition: opacity 120ms ease, color 120ms ease;
}
.pks-select-option-check svg { width: 100%; height: 100%; }

.pks-select-option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   SIZE VARIANTS — optional, drop .pks-select--sm class on root
   ============================================================ */
.pks-select--sm .pks-select-trigger {
  padding: 9px 12px;
  font-size: 13px;
}
.pks-select--sm .pks-select-caret { width: 14px; height: 14px; }
.pks-select--sm .pks-select-option {
  padding: 9px 10px 9px 8px;
  font-size: 13px;
}

/* ============================================================
   INLINE VARIANT — for searchbar contexts where the select
   sits flush with other controls (no standalone border)
   ============================================================ */
.pks-select--inline .pks-select-trigger {
  background: transparent;
  border: 0;
  padding: 12px 16px;
  border-radius: 0;
}
.pks-select--inline .pks-select-trigger:hover {
  background: rgba(255, 255, 255, 0.02);
}
.pks-select--inline.is-open .pks-select-trigger,
.pks-select--inline .pks-select-trigger:focus-visible {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.03);
  border: 0;
}

/* Align panel to trigger, not container, in inline mode */
.pks-select--inline .pks-select-panel {
  top: calc(100% + 8px);
  min-width: 220px;
}

/* ============================================================
   MOBILE — keep panel anchored cleanly
   ============================================================ */
@media (max-width: 560px) {
  .pks-select-panel {
    min-width: 180px;
  }
  .pks-select-list { max-height: 260px; }
}

/* ============================================================
   OFFER-QUICK VARIANT — sits right above note textarea in modals
   ============================================================ */
.pks-select.pks-select--sm + textarea.modal-textarea,
.pks-select.pks-select--sm + textarea.modal-input {
  margin-top: 8px;
}

/* When used as quick-question pill above textareas, keep it tight */
.pks-offer-quick + * { /* reserved hook */ }

/* ============================================================
   SETTINGS PAGE — match settings-input visual style
   ============================================================ */
.settings-field .pks-select-trigger {
  background: var(--bg-2);
  font-size: var(--fs-14);
  padding: 12px 14px;
}
.settings-field .pks-select.is-open .pks-select-trigger,
.settings-field .pks-select-trigger:focus-visible {
  background: var(--bg-3);
}
