/**
 * Studio Hub upgrade modal — Legacy → Studio Hub welcome prompt.
 */

.ysh-upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 24, 0.58);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.ysh-upgrade-overlay.ysh-upgrade-visible {
  opacity: 1;
  visibility: visible;
}

.ysh-upgrade-dialog {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 20px 64px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  transform: translateY(10px) scale(0.985);
  transition:
    transform 0.28s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.ysh-upgrade-overlay.ysh-upgrade-visible .ysh-upgrade-dialog {
  transform: translateY(0) scale(1);
}

.ysh-upgrade-appearance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.05);
  border: 1px solid rgba(15, 18, 24, 0.06);
}

.ysh-upgrade-appearance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #7a8494;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ysh-upgrade-appearance-btn .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.ysh-upgrade-appearance-icon {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ysh-upgrade-appearance-btn:hover,
.ysh-upgrade-appearance-btn:focus-visible {
  color: #4b5563;
  outline: none;
}

.ysh-upgrade-appearance-btn.is-active {
  background: #ffffff;
  color: var(--_yp-primary, #eda934);
  box-shadow: 0 1px 4px rgba(15, 18, 24, 0.1);
}

.ysh-upgrade-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #7a8494;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  transition: color 0.15s ease, background 0.15s ease;
}

.ysh-upgrade-close:hover,
.ysh-upgrade-close:focus-visible {
  color: #3d4654;
  background: #ffffff;
  outline: none;
}

.ysh-upgrade-close .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.ysh-upgrade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  align-items: stretch;
}

.ysh-upgrade-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 28px 24px;
}

.ysh-upgrade-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--_yp-primary, #eda934);
}

.ysh-upgrade-title {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #2a3340;
}

.ysh-upgrade-lead {
  margin: 0 0 12px;
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
  color: #667085;
}

.ysh-upgrade-beta {
  margin: 0 0 14px;
  max-width: 48ch;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #5f6b7c;
  background: linear-gradient(135deg, #fffaf2 0%, #f7f9fc 100%);
  border: 1px solid rgba(237, 169, 52, 0.18);
  border-radius: 10px;
}

.ysh-upgrade-features {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.ysh-upgrade-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 400;
  color: #5f6b7c;
}

.ysh-upgrade-features li:last-child {
  margin-bottom: 0;
}

.ysh-upgrade-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  font-size: 16px;
  color: var(--_yp-primary, #eda934);
  opacity: 0.92;
}

.ysh-upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.ysh-upgrade-footnote {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #a0aabd;
}

.ysh-upgrade-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 24px 24px;
  border-start-end-radius: 16px;
  border-end-end-radius: 16px;
  background:
    radial-gradient(circle at 24% 18%, rgba(237, 169, 52, 0.16), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(237, 169, 52, 0.08), transparent 40%),
    linear-gradient(155deg, #fff9f0 0%, #f5f7fb 52%, #edf1f7 100%);
  transition: background 0.22s ease;
}

.ysh-upgrade-visual-controls {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  inset-inline-end: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.ysh-upgrade-visual-controls > * {
  pointer-events: auto;
}

.ysh-upgrade-image {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 28px rgba(15, 18, 24, 0.1));
  transition: filter 0.22s ease;
}

html[dir="rtl"] .ysh-upgrade-visual {
  padding: 0 24px 32px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-start-start-radius: 16px;
  border-end-start-radius: 16px;
}

/* Dark mode (manual or system via JS) */
.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-dialog {
  background: #1a1d23;
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-appearance {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-appearance-btn {
  color: #9aa5b1;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-appearance-btn:hover,
.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-appearance-btn:focus-visible {
  color: #d8dee8;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-appearance-btn.is-active {
  background: #22262e;
  color: var(--_yp-primary, #eda934);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-close {
  background: rgba(34, 38, 46, 0.94);
  color: #9aa5b1;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.24);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-close:hover,
.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-close:focus-visible {
  background: #22262e;
  color: #e8edf5;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-title {
  color: #e8edf5;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-lead {
  color: #9aa5b1;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-beta {
  color: #b8c0cc;
  background: linear-gradient(135deg, rgba(237, 169, 52, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(237, 169, 52, 0.22);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-features li {
  color: #b8c0cc;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-footnote {
  color: #7d8794;
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-visual {
  background:
    radial-gradient(circle at 24% 18%, rgba(237, 169, 52, 0.14), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(237, 169, 52, 0.06), transparent 40%),
    linear-gradient(155deg, #141820 0%, #171b22 52%, #12151b 100%);
}

.ysh-upgrade-overlay.ysh-upgrade--dark .ysh-upgrade-image {
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.36)) brightness(0.94);
}

@media (max-width: 782px) {
  .ysh-upgrade-dialog {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .ysh-upgrade-layout {
    grid-template-columns: 1fr;
  }

  .ysh-upgrade-visual {
    order: -1;
    min-height: 180px;
    padding: 0 20px 16px;
    border-radius: 16px 16px 0 0;
  }

  .ysh-upgrade-image {
    max-width: 300px;
  }

  .ysh-upgrade-copy {
    padding: 16px 22px 22px;
  }
}

.ysh-upgrade-overlay.ysh-upgrade-busy .ysh-upgrade-activate {
  opacity: 0.72;
  pointer-events: none;
}

.ysh-upgrade-overlay.ysh-upgrade-success .ysh-upgrade-visual-controls,
.ysh-upgrade-overlay.ysh-upgrade-success .ysh-upgrade-dismiss {
  opacity: 0.45;
  pointer-events: none;
}

.ysh-upgrade-activate--success {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.ysh-upgrade-activate--success .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.ysh-upgrade-overlay.ysh-upgrade-leaving {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.ysh-upgrade-overlay.ysh-upgrade-leaving .ysh-upgrade-dialog {
  transform: translateY(-6px) scale(0.985);
  transition: transform 0.28s ease;
}

/* Post-activation dashboard toast */
.ysh-activation-toast {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 100250;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: min(480px, 92vw);
  padding: 12px 16px;
  border-radius: 8px;
  border-inline-start: 4px solid var(--_yp-primary, #eda934);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 18, 24, 0.14);
  opacity: 0;
  transform: translateX(calc(100% + 24px));
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-sizing: border-box;
}

.ysh-activation-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.ysh-activation-toast__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  font-size: 18px;
  color: var(--_yp-primary, #eda934);
}

.ysh-activation-toast__text {
  font-size: 13px;
  line-height: 1.45;
  color: #2a3340;
}

html[dir="rtl"] .ysh-activation-toast {
  transform: translateX(calc(-100% - 24px));
}

html[dir="rtl"] .ysh-activation-toast.is-visible {
  transform: translateX(0);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .ysh-activation-toast,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .ysh-activation-toast {
  background: var(--ysh-card, #1a1d23);
  box-shadow: var(--ysh-elev-2, 0 4px 16px rgba(0, 0, 0, 0.35));
}

html[data-yooadmin-studio-color-mode-effective="dark"] .ysh-activation-toast__text,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .ysh-activation-toast__text {
  color: var(--ysh-text, #e8edf4);
}
