/**
 * YOOAdmin — breadcrumbs shortcuts editor (trigger + modal).
 */

/* Trigger: only while the dashboard layout editor is open, and kept quiet. */
.yp-toolbar-customize {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--yp-breadcrumbs-icon-hit, 36px);
  height: var(--yp-breadcrumbs-icon-hit, 36px);
  padding: 0;
  margin-inline-start: 0;
  margin-inline-end: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
  /* Always the leading chip in the tools row, even when layout order CSS runs. */
  order: -100;
}

:is(html, body).yp-icon-edit-mode .yp-toolbar-customize {
  display: inline-flex;
}

.yp-toolbar-customize:hover,
.yp-toolbar-customize:focus-visible {
  opacity: 1;
  background: rgba(127, 127, 127, 0.12);
  border-color: rgba(127, 127, 127, 0.2);
}

.yp-toolbar-customize .dashicons {
  font-size: 17px;
  width: 17px;
  height: 17px;
  line-height: 17px;
}

/*
 * Width + search live on the tools row (default places). Studio Hub used to hide
 * them there expecting the overflow strip — override that. Ctrl+K hint stays off
 * so the bar stays compact.
 */
.yp-breadcrumbs-tools:not(.yp-breadcrumbs-tools--shortcuts-swapped) > .ysh-width,
.yp-breadcrumbs-tools:not(.yp-breadcrumbs-tools--shortcuts-swapped) > .yp-command-palette-trigger,
body.yooadmin-theme-yooadmin-studio-hub
  .yp-breadcrumbs-tools:not(.yp-breadcrumbs-tools--shortcuts-swapped)
  > .ysh-width,
body.yooadmin-theme-yooadmin-studio-hub
  .yp-breadcrumbs-tools:not(.yp-breadcrumbs-tools--shortcuts-swapped)
  > .yp-command-palette-trigger {
  display: inline-flex !important;
}

.yp-breadcrumbs-tools .yp-command-palette-trigger .yp-command-palette-trigger__kbd,
body.yooadmin-theme-yooadmin-studio-hub .yp-breadcrumbs-tools .yp-command-palette-trigger .yp-command-palette-trigger__kbd {
  display: none !important;
}

/* ------------------------------ Modal --------------------------------- */

.yp-tbe-overlay {
  position: fixed;
  inset: 0;
  /* Below .yps-layout-icon-modal (100500) so the shared picker stays on top. */
  z-index: 100400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 24, 0.55);
  backdrop-filter: blur(2px);
}

.yp-tbe-dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(78vh, 720px);
  border-radius: 16px;
  background: var(--yp-card-bg, #fff);
  color: var(--yp-text, #1f2329);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.yp-tbe-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
}

.yp-tbe-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.yp-tbe-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}

.yp-tbe-close:hover {
  opacity: 1;
  background: rgba(127, 127, 127, 0.12);
}

.yp-tbe-hint {
  margin: 0;
  padding: 0 20px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: 0.7;
}

.yp-tbe-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  list-style: none;
  /* Native track/arrows stay out; the thin thumb below only shows on hover. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.yp-tbe-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.yp-tbe-scroller {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.yp-tbe-scroller__bar {
  position: absolute;
  inset-block: 4px;
  inset-inline-end: 6px;
  width: 6px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}

.yp-tbe-scroller:hover .yp-tbe-scroller__bar,
.yp-tbe-scroller__bar.is-active {
  opacity: 1;
  pointer-events: auto;
}

.yp-tbe-scroller__thumb {
  position: absolute;
  inset-inline: 0;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.42);
  cursor: grab;
  transition: background 0.16s ease;
}

.yp-tbe-scroller__thumb:hover,
.yp-tbe-scroller__bar.is-dragging .yp-tbe-scroller__thumb {
  background: rgba(127, 127, 127, 0.66);
}

.yp-tbe-scroller__bar.is-dragging .yp-tbe-scroller__thumb {
  cursor: grabbing;
}

.yp-tbe-item__hide {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.yp-tbe-item__hide:hover,
.yp-tbe-item__hide:focus-visible {
  opacity: 1;
  background: rgba(127, 127, 127, 0.12);
}

.yp-tbe-item__hide .dashicons {
  font-size: 17px;
  width: 17px;
  height: 17px;
}

.yp-tbe-item.is-hidden-item {
  opacity: 0.5;
}

.yp-tbe-item.is-hidden-item .yp-tbe-item__hide {
  opacity: 0.9;
}

.yp-tbe-item.is-hidden-item .yp-tbe-item__label {
  text-decoration: line-through;
}

.yp-tbe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: 0 0 6px;
  border: 1px solid rgba(127, 127, 127, 0.16);
  border-radius: 10px;
  background: transparent;
  cursor: grab;
  transition: border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.yp-tbe-item:hover {
  border-color: rgba(127, 127, 127, 0.3);
}

.yp-tbe-item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.yp-tbe-item.is-drop-target {
  border-color: var(--yp-brand, #eda934);
  background: rgba(237, 169, 52, 0.08);
}

.yp-tbe-item__handle {
  display: inline-flex;
  align-items: center;
  opacity: 0.35;
}

.yp-tbe-item__handle .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
}

.yp-tbe-item__index {
  width: 16px;
  font-size: 11px;
  text-align: center;
  opacity: 0.45;
}

.yp-tbe-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.yp-tbe-item__icon:hover {
  border-color: var(--yp-brand, #eda934);
  background: rgba(237, 169, 52, 0.08);
}

.yp-tbe-item__icon.is-locked {
  opacity: 0.55;
  cursor: default;
}

.yp-tbe-item__icon.is-locked:hover {
  border-color: rgba(127, 127, 127, 0.22);
  background: transparent;
}

.yp-tbe-item__tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.14);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  opacity: 0.75;
  white-space: nowrap;
}

.yp-tbe-item__label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer */
/*
 * Expand-all switch: the settings screens scope .yp-toggle-* to their own wrapper,
 * so the same look is re-declared here rather than inherited.
 */
.yp-tbe-expand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 4px;
}

.yp-tbe-expand .yp-toggle-switch {
  position: relative;
  display: inline-block;
  width: var(--yp-set-toggle-w, 34px);
  height: var(--yp-set-toggle-h, 18px);
  flex-shrink: 0;
  vertical-align: middle;
}

.yp-tbe-expand .yp-toggle-switch input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.yp-tbe-expand .yp-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: var(--yp-set-toggle-h, 18px);
  background-color: #ccc;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
  cursor: pointer;
}

.yp-tbe-expand .yp-toggle-slider::before {
  position: absolute;
  content: "";
  width: var(--yp-set-toggle-knob, 12px);
  height: var(--yp-set-toggle-knob, 12px);
  inset-inline-start: 3px;
  bottom: 3px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.yp-tbe-expand .yp-toggle-switch input:checked + .yp-toggle-slider {
  background-color: var(--yooadmin-primary, var(--yp-brand, #eda934));
}

.yp-tbe-expand .yp-toggle-switch input:checked + .yp-toggle-slider::before {
  transform: translateX(var(--yp-set-toggle-travel, 16px));
}

html[dir="rtl"] .yp-tbe-expand .yp-toggle-switch input:checked + .yp-toggle-slider::before {
  transform: translateX(calc(-1 * var(--yp-set-toggle-travel, 16px)));
}

.yp-tbe-expand .yp-toggle-switch:hover .yp-toggle-slider {
  box-shadow: 0 0 0 2px rgba(232, 158, 67, 0.2);
}

.yp-tbe-expand .yp-toggle-switch input:focus-visible + .yp-toggle-slider {
  box-shadow: 0 0 0 2px rgba(232, 158, 67, 0.3);
}

.yp-tbe-expand .yp-toggle-label {
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}

.yp-tbe-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
}

.yp-tbe-foot__spacer {
  flex: 1;
}

.yp-tbe-btn {
  padding: 7px 14px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.yp-tbe-btn:hover:not(:disabled) {
  background: rgba(127, 127, 127, 0.1);
}

.yp-tbe-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.yp-tbe-btn--ghost {
  border-color: transparent;
  opacity: 0.75;
}

.yp-tbe-btn--primary {
  border-color: var(--yp-brand, #eda934);
  background: var(--yp-brand, #eda934);
  color: #fff;
}

.yp-tbe-btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
  background: var(--yp-brand, #eda934);
}

/* Dark mode */
html[data-yooadmin-studio-color-mode-effective="dark"] .yp-tbe-dialog {
  background: #171b22;
  color: #d8d3ce;
}
