/**
 * TaskBuilder Duplicate Project add-on - Duplicate Project dialog, SaaS theme
 * Content is scoped to .wppm-dup (#frm_edit_duplicate_project_name). The shared
 * popup frame is only restyled while it holds that form, so every other dialog
 * keeps its current look. Appearance colors applied inline (modal header/body/
 * footer, action button) are never overridden.
 */

/* ===================== Popup frame ===================== */
#wppm_popup:has(.wppm-dup) {
  left: 0;
  right: 0;
  width: min(480px, calc(100% - 32px)) !important;
  max-width: none;
  height: auto !important;
  margin: 0 auto !important;
  float: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px -12px rgba(15,23,42,.35), 0 2px 8px rgba(15,23,42,.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
#wppm_popup:has(.wppm-dup) #wppm_popup_title {
  margin: 0;
  padding: 18px 24px !important;
  border-bottom: 1px solid #e5e7eb;
}
#wppm_popup:has(.wppm-dup) #wppm_popup_title h3 {
  margin: 0;
  font: 700 17px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}
#wppm_popup:has(.wppm-dup) #wppm_popup_body {
  min-height: 0;
  max-height: calc(100vh - 210px);
  margin: 0;
  padding: 20px 24px 16px !important;
  overflow-y: auto;
}
#wppm_popup:has(.wppm-dup) #wppm_popup_footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 14px 24px !important;
  border-top: 1px solid #e5e7eb;
}
#wppm_popup:has(.wppm-dup) #wppm_popup_footer button {
  width: auto;
  min-width: 96px;
  height: 38px;
  margin: 0;
  padding: 0 18px;
  border-radius: 9px !important;
  box-shadow: none;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
#wppm_popup:has(.wppm-dup) .wppm_popup_close {
  border: 1px solid #e5e7eb;
}
#wppm_popup:has(.wppm-dup) .wppm_popup_action:hover {
  filter: brightness(.94);
}

/* ===================== Content ===================== */
.wppm-dup {
  --dup-primary: #4f46e5;
  --dup-primary-light: #eef2ff;
  --dup-ink: #111827;
  --dup-muted: #6b7280;
  --dup-border: #e5e7eb;
  --dup-soft: #f8fafc;
  color: var(--dup-ink);
  font-size: 13.5px;
  line-height: 1.5;
}
.wppm-dup *,
.wppm-dup *::before,
.wppm-dup *::after {
  box-sizing: border-box;
}

/* Source project */
.wppm-dup-source {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e0e7ff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--dup-primary-light), #fff);
}
.wppm-dup-source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--dup-primary);
  box-shadow: 0 6px 14px -6px rgba(79,70,229,.55);
}
.wppm-dup-source-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wppm-dup-source-text {
  min-width: 0;
}
#wppm_popup_body .wppm-dup-source-label {
  display: block;
  color: var(--dup-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
#wppm_popup_body .wppm-dup-source-name {
  display: block;
  overflow: hidden;
  color: var(--dup-ink);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Name field */
.wppm-dup .wppm-dup-field {
  margin: 0 0 18px;
}
.wppm-dup .wppm-dup-field label {
  display: block;
  margin: 0 0 6px;
  color: #374151;
  font: 600 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.wppm-dup #project_name {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--dup-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.wppm-dup #project_name:focus {
  outline: none;
  border-color: var(--dup-primary);
  box-shadow: 0 0 0 3px var(--dup-primary-light);
}
.wppm-dup .wppm-dup-hint {
  margin: 6px 0 0;
  color: var(--dup-muted);
  font-size: 12px;
}

/* What will be copied */
.wppm-dup-copies {
  margin: 0 0 14px;
  border: 1px solid var(--dup-border);
  border-radius: 12px;
  overflow: hidden;
}
#wppm_popup_body .wppm-dup-copies-title {
  display: block;
  padding: 9px 14px;
  border-bottom: 1px solid var(--dup-border);
  background: var(--dup-soft);
  color: var(--dup-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.wppm-dup-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}
.wppm-dup-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 14px;
  font-size: 13px;
}
.wppm-dup-list li > span:nth-child(2) {
  color: var(--dup-ink);
  font-weight: 500;
}
.wppm-dup-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
#wppm_popup_body .wppm-dup-count {
  min-width: 26px;
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#wppm_popup_body .wppm-dup-meta {
  margin-left: auto;
  overflow: hidden;
  color: var(--dup-muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-dup .wppm-dup-note {
  margin: 0;
  color: var(--dup-muted);
  font-size: 12px;
}

@media (max-width: 600px) {
  #wppm_popup:has(.wppm-dup) #wppm_popup_body {
    padding: 16px 14px 12px !important;
  }
  #wppm_popup_body .wppm-dup-meta {
    display: none;
  }
}
