/* ============================================================
   Creator directory — v2 filter bar (port of D1 redesign)

   Scoped under body.oohgc-page-directory-v2 so it can't bleed into
   other pages. Hides the legacy `.directory_page_header` and
   `.directory_filters` blocks and replaces them with the new
   structure: picker pill + unlock meter, search row, chip row,
   results bar with sort. Cards/grid below stay untouched.
   ============================================================ */

body.oohgc-page-directory-v2 .directory_page .directory_page_header,
body.oohgc-page-directory-v2 .directory_page .directory_filters,
body.oohgc-page-directory-v2 .directory_page .directory_meta { display: none !important; }

.dxv2 {
  /* Color tokens (matched to admin-dashboard-v2 / directory) */
  --dx-cream:        #FFF8DD;
  --dx-amber:        #DF992E;
  --dx-amber-deep:   #B47A20;
  --dx-coral-bright: #FE773F;
  --dx-fg-1:         #FFF8DD;
  --dx-fg-2:         #E2E2E2;
  --dx-fg-3:         #9E9E9E;
  --dx-fg-muted:     #695E5E;
  --dx-border-1:     #2F2F2F;
  --dx-border-2:     #545454;
  --dx-surface-1:    #060606;
  --dx-surface-2:    #0F0F0F;
  --dx-surface-3:    #131313;
  --dx-surface-4:    #1F1F1F;
  --dx-ff-display:   'Bageki Luxury', 'Playfair Display', Georgia, serif;
  --dx-ff-mono:      ui-monospace, 'SF Mono', Menlo, monospace;
  --dx-shadow-amber: 0 18px 40px -12px rgba(180,122,32,0.45);

  font-size: 14px;
  color: var(--dx-cream);
  margin-bottom: 28px;
}
.dxv2 *,
.dxv2 *::before,
.dxv2 *::after { box-sizing: border-box; }
.dxv2 button { cursor: pointer; border: 0; background: transparent; font-family: inherit; color: inherit; }
.dxv2 input { outline: none; font-family: inherit; }
.dxv2 a { color: inherit; text-decoration: none; }

/* ===========================================================
   Title row — title + saved-search picker + unlock meter
   =========================================================== */
.dxv2_titlerow {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 14px 22px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.dxv2_title_left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dxv2_title_eyebrow {
  font-family: var(--dx-ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dx-fg-muted);
  font-weight: 700;
}
.dxv2_title {
  font-family: var(--dx-ff-display);
  font-size: 52px;
  line-height: 1;
  color: var(--dx-cream);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}

.dxv2_ss {
  display: flex;
  align-items: center;
  gap: 14px 18px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

/* Saved-search / campaign picker pill */
.dxv2_picker_wrap { position: relative; }
.dxv2_picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  border-radius: 999px;
  color: var(--dx-cream);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 140ms;
}
.dxv2_picker:hover { border-color: var(--dx-border-2); }
.dxv2_picker.is-open { border-color: var(--dx-amber); }
.dxv2_picker_bm {
  color: var(--dx-amber);
  display: inline-flex;
  width: 14px; height: 14px;
}
.dxv2_picker_label {
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dxv2_picker_count {
  background: var(--dx-amber);
  color: #1a120d;
  font-weight: 700;
  border-radius: 999px;
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0 6px;
}
.dxv2_picker_chev {
  display: inline-flex;
  width: 14px; height: 14px;
  color: var(--dx-fg-3);
}

/* Picker dropdown menu */
.dxv2_picker_menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: var(--dx-surface-1);
  border: 1px solid var(--dx-border-1);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  z-index: 25;
  animation: dxv2PopIn 140ms ease-out;
}
.dxv2_picker_menu[hidden] { display: none; }
.dxv2_picker_item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
}
.dxv2_picker_item:hover { background: var(--dx-surface-3); }
.dxv2_picker_item.is-active { background: rgba(223,153,46,0.08); }
.dxv2_picker_item_top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dxv2_picker_item_name {
  color: var(--dx-cream);
  font-size: 13px;
  font-weight: 600;
}
.dxv2_picker_item_count {
  background: rgba(255,255,255,0.06);
  color: var(--dx-fg-2);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
}
.dxv2_picker_item.is-active .dxv2_picker_item_count {
  background: var(--dx-amber);
  color: #1a120d;
}
.dxv2_picker_item_meta {
  color: var(--dx-fg-3);
  font-size: 11px;
}
.dxv2_picker_divider {
  height: 1px;
  background: var(--dx-border-1);
  margin: 6px;
}
.dxv2_picker_link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--dx-amber);
  font-weight: 600;
  width: 100%;
  text-align: left;
}
.dxv2_picker_link:hover { background: rgba(223,153,46,0.08); }
.dxv2_picker_empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--dx-fg-3);
  text-align: center;
}

/* Unlock meter — pushed to the right edge of the title row */
.dxv2_meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--dx-fg-3);
  flex-wrap: wrap;
  margin-left: auto;
}
.dxv2_meter_text { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dxv2_meter_text b { color: var(--dx-cream); font-weight: 600; }
.dxv2_meter_dot { color: var(--dx-fg-muted); }

/* ===========================================================
   Search row
   =========================================================== */
.dxv2_search {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.dxv2_search_box {
  flex: 1; min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  border-radius: 14px;
  padding: 0 16px;
  height: 56px;
  gap: 12px;
  color: var(--dx-fg-3);
  transition: border-color 160ms;
}
.dxv2_search_box:focus-within {
  border-color: var(--dx-border-2);
}
.dxv2_search_box svg { flex-shrink: 0; }
.dxv2_search_box input {
  flex: 1; height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  color: var(--dx-cream);
  font-size: 15px;
}
.dxv2_search_box input:focus,
.dxv2_search_box input:focus-visible {
  outline: none;
  box-shadow: none;
}
.dxv2_search_box input::placeholder { color: var(--dx-fg-muted); }
.dxv2_search_clear {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--dx-surface-3);
  display: grid;
  place-items: center;
  color: var(--dx-fg-2);
  border: 0;
}
.dxv2_search_clear:hover { background: var(--dx-surface-4); }
.dxv2_search_clear[hidden] { display: none; }

/* Selectors are deliberately prefixed with `.dxv2` so they beat the
   `.dxv2 button` reset above (specificity 0,1,1). Without the prefix
   the amber gradient and primary text color silently lose to the
   reset and the button rendered as transparent + inherited cream. */
.dxv2 .dxv2_btn {
  height: 56px;
  padding: 0 36px;
  min-width: 168px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  text-decoration: none;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.dxv2 .dxv2_btn--primary {
  background: linear-gradient(180deg, #f5c25e 0%, #df992e 60%, #b47a20 100%);
  color: #1a120d;
  box-shadow: var(--dx-shadow-amber);
  position: relative;
}
.dxv2 .dxv2_btn--primary:hover { filter: brightness(1.05); }

/* When chip changes are staged but not yet applied, the Aplică
   button pulses softly so the user knows clicking it commits.
   The chiprow also gets a subtle staged-state cue. */
.dxv2 .dxv2_btn--primary.is-pending {
  animation: dxv2ApplyPulse 2.4s ease-in-out infinite;
}
.dxv2 .dxv2_btn--primary.is-pending::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #1a120d;
  box-shadow: 0 0 0 0 rgba(26, 18, 13, 0.6);
  animation: dxv2ApplyDot 1.6s infinite;
}
@keyframes dxv2ApplyPulse {
  0%, 100% { box-shadow: var(--dx-shadow-amber); }
  50% { box-shadow: 0 18px 40px -12px rgba(180,122,32,0.7), 0 0 0 4px rgba(223,153,46,0.2); }
}
@keyframes dxv2ApplyDot {
  0% { box-shadow: 0 0 0 0 rgba(26, 18, 13, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(26, 18, 13, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 18, 13, 0); }
}
.dxv2 .dxv2_btn--ghost {
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  color: var(--dx-cream);
}
.dxv2 .dxv2_btn--ghost:hover { background: var(--dx-surface-3); }

/* ===========================================================
   Chip row
   =========================================================== */
.dxv2_chiprow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--dx-border-1);
  position: relative;
}
.dxv2_chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  border-radius: 999px;
  color: var(--dx-fg-3);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  transition: all 140ms;
  font-family: inherit;
}
.dxv2_chip:hover {
  border-color: var(--dx-border-2);
  color: var(--dx-cream);
}
.dxv2_chip b { color: var(--dx-cream); font-weight: 600; }
.dxv2_chip.is-active {
  border-color: rgba(223,153,46,0.5);
  background: rgba(223,153,46,0.08);
  color: var(--dx-amber);
}
.dxv2_chip.is-active:hover {
  border-color: var(--dx-amber);
  background: rgba(223,153,46,0.12);
}
.dxv2_chip.is-active b { color: var(--dx-cream); }
.dxv2_chip.is-open {
  border-color: var(--dx-amber) !important;
  background: rgba(223,153,46,0.14);
}
.dxv2_chip_x {
  display: inline-flex;
  width: 16px; height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--dx-cream);
  margin-left: 2px;
  border: 0;
  cursor: pointer;
}
.dxv2_chip_x:hover { background: rgba(255,255,255,0.18); }
.dxv2_chip--add {
  border-style: dashed;
  border-color: var(--dx-border-2);
  color: var(--dx-cream);
}
.dxv2_chip--add:hover {
  border-color: var(--dx-amber);
  color: var(--dx-amber);
  background: rgba(223,153,46,0.06);
}
.dxv2_chip_sep { flex: 1; min-width: 12px; }
.dxv2_chip--reset {
  color: var(--dx-coral-bright);
  border-style: dashed;
  background: transparent;
}
.dxv2_chip--reset:hover { color: #ff8a5a; }
.dxv2_chip[hidden] { display: none; }

/* ===========================================================
   Popover (chip dropdown / +Add chooser)
   =========================================================== */
.dxv2_pop {
  position: absolute;
  top: calc(100% + 6px);
  background: var(--dx-surface-1);
  border: 1px solid var(--dx-border-1);
  border-radius: 14px;
  padding: 14px;
  width: 280px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  z-index: 30;
  animation: dxv2PopIn 140ms ease-out;
}
.dxv2_pop[hidden] { display: none; }
.dxv2_pop.is-wide { width: 360px; }
@keyframes dxv2PopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dxv2_pop_head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--dx-border-1);
  margin-bottom: 10px;
}
.dxv2_pop_eyebrow {
  font-family: var(--dx-ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dx-fg-muted);
  font-weight: 700;
}
.dxv2_pop_clear {
  font-size: 11px;
  color: var(--dx-coral-bright);
  font-weight: 600;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dxv2_pop_clear:disabled { color: var(--dx-fg-muted); cursor: not-allowed; }
.dxv2_pop_search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--dx-surface-3);
  border: 1px solid var(--dx-border-1);
  border-radius: 10px;
  color: var(--dx-fg-3);
  margin-bottom: 8px;
}
.dxv2_pop_search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--dx-cream);
  font-size: 13px;
}
.dxv2_pop_search input::placeholder { color: var(--dx-fg-muted); }
.dxv2_pop_list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dxv2_pop_list::-webkit-scrollbar { width: 6px; }
.dxv2_pop_list::-webkit-scrollbar-thumb { background: var(--dx-border-2); border-radius: 999px; }
.dxv2_pop_opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--dx-fg-2);
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dxv2_pop_opt:hover { background: var(--dx-surface-3); }
.dxv2_pop_opt_check {
  width: 16px; height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--dx-border-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #1a120d;
}
.dxv2_pop_opt.is-on { color: var(--dx-cream); }
.dxv2_pop_opt.is-on .dxv2_pop_opt_check {
  background: var(--dx-amber);
  border-color: var(--dx-amber);
}
.dxv2_pop_opt_count {
  margin-left: auto;
  font-family: var(--dx-ff-mono);
  font-size: 10px;
  color: var(--dx-fg-muted);
}
.dxv2_pop_opt.is-on .dxv2_pop_opt_count {
  color: var(--dx-amber);
}
.dxv2_pop_empty {
  padding: 20px;
  text-align: center;
  color: var(--dx-fg-muted);
  font-size: 12px;
}

/* +Adaugă filtru chooser */
.dxv2_pop--add { width: 320px; }
.dxv2_pop_add_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dxv2_pop_add_item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  border-radius: 10px;
  color: var(--dx-cream);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 140ms;
}
.dxv2_pop_add_item:hover {
  border-color: var(--dx-amber);
  background: rgba(223,153,46,0.06);
}
.dxv2_pop_add_item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
}
.dxv2_pop_add_item:disabled:hover {
  border-color: var(--dx-border-1);
  background: var(--dx-surface-2);
}
.dxv2_pop_add_meta {
  font-size: 10px;
  font-weight: 400;
  color: var(--dx-fg-3);
  font-family: var(--dx-ff-mono);
  letter-spacing: 0.04em;
}

/* Toggle for binary facets (e.g. barter) */
.dxv2_pop_toggle_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
}
.dxv2_pop_toggle_row > div { flex: 1; min-width: 0; }
.dxv2_pop_toggle_row strong {
  display: block;
  font-size: 13px;
  color: var(--dx-cream);
  font-weight: 600;
}
.dxv2_pop_toggle_row small {
  font-size: 11px;
  color: var(--dx-fg-3);
}
.dxv2_toggle {
  width: 36px; height: 20px;
  background: var(--dx-surface-3);
  border: 1px solid var(--dx-border-1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 160ms;
}
.dxv2_toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--dx-fg-3);
  border-radius: 999px;
  transition: all 160ms;
}
.dxv2_toggle.is-on {
  background: rgba(223,153,46,0.2);
  border-color: var(--dx-amber);
}
.dxv2_toggle.is-on::after {
  left: 18px;
  background: var(--dx-amber);
}

/* ===========================================================
   Results bar (count + sort)
   =========================================================== */
.dxv2_resultsbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 18px;
  font-size: 13px;
  color: var(--dx-fg-3);
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.dxv2_resultsbar_left { display: inline-flex; align-items: center; gap: 14px; }
.dxv2_resultsbar_count b {
  color: var(--dx-cream);
  font-weight: 700;
  font-size: 14px;
}
.dxv2_resultsbar_pulse {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--dx-amber);
  box-shadow: 0 0 0 0 rgba(223,153,46,0.6);
  animation: dxv2Pulse 1.6s infinite;
}
@keyframes dxv2Pulse {
  0% { box-shadow: 0 0 0 0 rgba(223,153,46,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(223,153,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(223,153,46,0); }
}
.dxv2_resultsbar_right { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.dxv2_resultsbar_sort_label { color: var(--dx-fg-3); font-size: 12px; }
.dxv2_resultsbar_sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--dx-surface-2);
  border: 1px solid var(--dx-border-1);
  border-radius: 10px;
  color: var(--dx-cream);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
}

/* ===========================================================
   Mobile (≤ 720px)
   =========================================================== */
@media (max-width: 720px) {
  .dxv2_titlerow { flex-direction: column; align-items: flex-start; }
  .dxv2_title { font-size: 38px; }
  .dxv2_picker_label { max-width: 180px; }

  .dxv2_search { flex-wrap: wrap; }
  .dxv2_search_box { flex: 1 1 100%; }
  .dxv2 .dxv2_btn { flex: 1; }
  .dxv2 .dxv2_btn--ghost { flex: 0 0 auto; padding: 0 16px; }

  .dxv2_chiprow {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 14px;
  }
  .dxv2_chiprow::-webkit-scrollbar { display: none; }

  /* Popovers become bottom sheets on mobile */
  .dxv2_pop {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 18px;
    z-index: 9999;
    animation: dxv2SheetIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes dxv2SheetIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .dxv2_pop_scrim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
  }
}
@media (min-width: 721px) {
  .dxv2_pop_scrim { display: none; }
}
