/* Create4Less.com shared Studio dropdowns ------------------------------------
   Matches the Create Project dropdown treatment while keeping the native
   select in the form for validation and submission. */

.studio-dropdown {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  font: inherit;
}

.studio-dropdown-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  white-space: nowrap !important;
}

.studio-dropdown-trigger {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: var(--studio-dropdown-height, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  padding: 0 40px 0 13px;
  border: 1px solid #ded6e5;
  border-radius: 11px;
  color: #282330;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.studio-dropdown-trigger::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.7px solid #706977;
  border-bottom: 1.7px solid #706977;
  transform: rotate(45deg);
  transition: transform .16s ease, margin-top .16s ease;
}

.studio-dropdown.is-open .studio-dropdown-trigger::after {
  margin-top: -1px;
  transform: rotate(225deg);
}

.studio-dropdown-trigger:hover {
  border-color: #d3c5e1;
  background: #fff;
}

.studio-dropdown-trigger:focus-visible,
.studio-dropdown.is-open .studio-dropdown-trigger {
  outline: 0;
  border-color: rgba(103, 40, 232, .66);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(103, 40, 232, .105);
}

.studio-dropdown.is-invalid .studio-dropdown-trigger {
  border-color: #d24a59;
  box-shadow: 0 0 0 3px rgba(210, 74, 89, .09);
}

.studio-dropdown.is-disabled .studio-dropdown-trigger {
  color: #9b949f;
  background: #f4f1f5;
  cursor: not-allowed;
  opacity: .76;
}

.studio-dropdown-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.studio-dropdown-menu {
  position: fixed;
  z-index: 5000;
  display: none;
  max-height: min(300px, calc(100vh - 28px));
  overflow-y: auto;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid #e0d7e7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(43, 29, 54, .18);
  overscroll-behavior: contain;
}

.studio-dropdown-menu.is-open {
  display: grid;
  gap: 2px;
}

.studio-dropdown-option {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #3d3741;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.studio-dropdown-option:hover,
.studio-dropdown-option:focus-visible {
  outline: 0;
  color: #5721bf;
  background: #f4effc;
}

.studio-dropdown-option.is-selected {
  color: #5721bf;
  background: #eee6fb;
  font-weight: 750;
}

.studio-dropdown-option.is-selected::after {
  content: '✓';
  margin-left: auto;
  color: #6728e8;
  font-weight: 900;
}

.studio-dropdown-option:disabled,
.studio-dropdown-option.is-disabled {
  color: #aaa3ae;
  background: transparent;
  cursor: not-allowed;
}

/* The original page chevron is replaced by the shared dropdown chevron. */
.has-studio-dropdown > [data-lucide="chevron-down"],
.has-studio-dropdown > [data-lucide="chevron-up"] {
  display: none !important;
}

/* Existing filter shells should not clip the body-ported menu or trigger ring. */
.has-studio-dropdown {
  overflow: visible !important;
}

/* Compact filters retain their existing footprint. */
.projects-sort-field .studio-dropdown-trigger,
.assets-sort-field .studio-dropdown-trigger,
.wallet-range-field .studio-dropdown-trigger,
.insights-period-select .studio-dropdown-trigger,
.result-review-card .studio-dropdown-trigger {
  min-height: var(--studio-dropdown-height, 40px);
}

.wallet-range-field .studio-dropdown-trigger {
  min-height: 28px;
  padding-left: 0;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  background: transparent;
  font-size: 12px;
}

.wallet-range-field .studio-dropdown-trigger:hover,
.wallet-range-field .studio-dropdown-trigger:focus-visible,
.wallet-range-field .studio-dropdown.is-open .studio-dropdown-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.insights-period-select .studio-dropdown-trigger {
  min-height: 44px;
  padding-left: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-weight: 700;
}

.insights-period-select .studio-dropdown-trigger:hover,
.insights-period-select .studio-dropdown-trigger:focus-visible,
.insights-period-select .studio-dropdown.is-open .studio-dropdown-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.result-review-card .studio-dropdown-trigger {
  min-height: 40px;
  border-radius: 9px;
  font-size: 10px;
}

/* Dark surfaces use the same geometry and interaction with a matching palette. */
.studio-dropdown[data-theme="dark"] .studio-dropdown-trigger {
  color: #f5f3fa;
  border-color: rgba(255, 255, 255, .13);
  background: rgba(7, 12, 18, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.studio-dropdown[data-theme="dark"] .studio-dropdown-trigger::after {
  border-color: rgba(245, 243, 250, .68);
}

.studio-dropdown[data-theme="dark"] .studio-dropdown-trigger:hover {
  border-color: rgba(166, 126, 255, .46);
  background: rgba(12, 18, 26, .98);
}

.studio-dropdown[data-theme="dark"] .studio-dropdown-trigger:focus-visible,
.studio-dropdown[data-theme="dark"].is-open .studio-dropdown-trigger {
  border-color: #9d72ff;
  background: rgba(12, 18, 26, .98);
  box-shadow: 0 0 0 3px rgba(143, 94, 255, .15);
}

.studio-dropdown-menu[data-theme="dark"] {
  border-color: rgba(164, 121, 255, .26);
  background: linear-gradient(180deg, #111923, #090f16);
  box-shadow: 0 20px 52px rgba(0, 0, 0, .5);
}

.studio-dropdown-menu[data-theme="dark"] .studio-dropdown-option {
  color: rgba(245, 243, 250, .82);
}

.studio-dropdown-menu[data-theme="dark"] .studio-dropdown-option:hover,
.studio-dropdown-menu[data-theme="dark"] .studio-dropdown-option:focus-visible {
  color: #fff;
  background: rgba(142, 89, 255, .16);
}

.studio-dropdown-menu[data-theme="dark"] .studio-dropdown-option.is-selected {
  color: #dacbff;
  background: rgba(142, 89, 255, .22);
}

.studio-dropdown-menu[data-theme="dark"] .studio-dropdown-option.is-selected::after {
  color: #b792ff;
}

@media (max-width: 700px) {
  .studio-dropdown-menu {
    max-width: calc(100vw - 20px);
  }
}

/* Existing light filter shells already provide the outer border. */
.projects-select-field .studio-dropdown-trigger,
.projects-sort-field .studio-dropdown-trigger,
.assets-select-field .studio-dropdown-trigger,
.assets-sort-field .studio-dropdown-trigger {
  min-height: 46px;
  padding-left: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.projects-select-field .studio-dropdown-trigger,
.projects-sort-field .studio-dropdown-trigger {
  color: #211d2c;
  font-size: 13.5px;
}

.projects-sort-field .studio-dropdown-trigger {
  min-height: 48px;
  font-size: 12.5px;
  font-weight: 760;
}

.assets-select-field .studio-dropdown-trigger,
.assets-sort-field .studio-dropdown-trigger {
  color: #171426;
  font-size: 13.5px;
}

.projects-select-field .studio-dropdown-trigger:hover,
.projects-select-field .studio-dropdown-trigger:focus-visible,
.projects-select-field .studio-dropdown.is-open .studio-dropdown-trigger,
.projects-sort-field .studio-dropdown-trigger:hover,
.projects-sort-field .studio-dropdown-trigger:focus-visible,
.projects-sort-field .studio-dropdown.is-open .studio-dropdown-trigger,
.assets-select-field .studio-dropdown-trigger:hover,
.assets-select-field .studio-dropdown-trigger:focus-visible,
.assets-select-field .studio-dropdown.is-open .studio-dropdown-trigger,
.assets-sort-field .studio-dropdown-trigger:hover,
.assets-sort-field .studio-dropdown-trigger:focus-visible,
.assets-sort-field .studio-dropdown.is-open .studio-dropdown-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.has-studio-dropdown > .lucide-chevron-down,
.has-studio-dropdown > .lucide-chevron-up {
  display: none !important;
}
