/*
 * ui-select.css — 커스텀 셀렉트 (ui-select.js 짝)
 * 색·라운드·그림자는 analytics.html / management-dashboard.css 의 기존 토큰만 쓴다.
 */

/* 원본 select 는 값의 진실 소스로 DOM 에 남되 화면에서만 사라진다.
   display:none 대신 clip 을 쓰는 이유: 레이아웃에서 빠지되 폼 참조·label[for] 은 유지. */
select.ui-select-native {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ── 트리거 ─────────────────────────────────────────────
   원본 select 의 클래스(.filter-select / .mgmt-select / .ppt-filter-select …)를
   그대로 물려받으므로 크기·색은 그 규칙이 정한다. 여기선 버튼 기본값 제거와
   쉐브론 배치만 얹는다. */
.ui-select-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer; font: inherit;
  appearance: none; -webkit-appearance: none;
  background-image: none; /* .ppt-filter-select 의 화살표 그라디언트 무력화 */
  min-width: 0; max-width: 100%;
}
.ui-select-trigger .ui-select-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.ui-select-trigger .ui-select-chevron {
  flex: none; width: 8px; height: 8px; margin-left: 2px;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55; transition: transform 0.16s ease, opacity 0.16s ease;
}
.ui-select-trigger:hover .ui-select-chevron { opacity: 0.9; }
.ui-select-trigger[aria-expanded="true"] {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--action-soft);
}
.ui-select-trigger[aria-expanded="true"] .ui-select-chevron {
  transform: translateY(1px) rotate(-135deg); opacity: 0.9;
}
.ui-select-trigger:focus-visible {
  outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-soft);
}
.ui-select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }

/* .ppt-filter-select 는 화살표 자리로 오른쪽 패딩 24px 를 잡아 뒀다.
   우리 쉐브론은 flex 로 놓이므로 그 여백을 정상 패딩으로 되돌린다. */
.ui-select-trigger.ppt-filter-select { padding-right: 9px; }

/* ── 패널 (body 포털 · fixed) ───────────────────────────── */
.ui-select-panel {
  position: fixed; z-index: 4000;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  overflow-y: auto; overscroll-behavior: contain;
  font-size: 13px;
  animation: ui-select-in 0.12s ease-out;
}
.ui-select-panel.is-flipped { transform-origin: bottom center; }
@keyframes ui-select-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ui-select-panel { animation: none; }
  .ui-select-trigger .ui-select-chevron { transition: none; }
}

.ui-select-group {
  padding: 9px 10px 5px;
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 850;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ui-select-group:first-child { padding-top: 4px; }

.ui-select-option {
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--text-dim);
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.ui-select-option.is-active { background: var(--surface-2); color: var(--text); }
.ui-select-option.is-selected {
  background: var(--action-soft); color: var(--action); font-weight: 900;
}
.ui-select-option.is-selected.is-active {
  background: color-mix(in srgb, var(--action) 22%, var(--surface));
}
.ui-select-option.is-disabled { opacity: 0.42; cursor: not-allowed; }

/* ── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ui-select-panel { font-size: 14px; }
  .ui-select-option { padding: 10px 12px; }
}

/* ── 인쇄 — 패널은 감추고 트리거의 현재 값 텍스트만 남긴다 ───── */
@media print {
  .ui-select-panel { display: none !important; }
  .ui-select-trigger .ui-select-chevron { display: none; }
  .ui-select-trigger { box-shadow: none; }
}
