/* pmg-auto-boost.css — Auto-Boost button + clarifying card.
   Also bumps Send-to-AI buttons so they pop on the dark theme. */

/* ----- Auto-Boost button --------------------------------------- */
.pmg-ab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  border: 1px solid #00c896;
  border-radius: 999px;
  background: linear-gradient(135deg, #00c896 0%, #3ee0a0 100%);
  color: #052a1f;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 200, 150, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.pmg-ab-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(0, 200, 150, 0.42);
}
.pmg-ab-btn:active:not(:disabled) {
  transform: translateY(0);
}
.pmg-ab-btn:disabled {
  cursor: progress;
  opacity: 0.85;
  filter: saturate(0.7);
}
.pmg-ab-btn .pmg-ab-spark {
  font-size: 16px;
  display: inline-block;
  animation: pmgAbSparkle 2.4s ease-in-out infinite;
}
.pmg-ab-btn[data-pmg-ab-state="thinking"] .pmg-ab-spark {
  animation: pmgAbSparkleFast 0.9s linear infinite;
}
@keyframes pmgAbSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50%      { transform: scale(1.15) rotate(12deg); opacity: 0.85; }
}
@keyframes pmgAbSparkleFast {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ----- Clarifying-question card -------------------------------- */
.pmg-ab-card {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, #00c896 35%, transparent);
  border-left: 3px solid #00c896;
  border-radius: 12px;
  background: color-mix(in srgb, #00c896 8%, #0d2b1e);
  color: #e6f3ee;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  animation: pmgAbCardIn 220ms ease-out;
}
@keyframes pmgAbCardIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pmg-ab-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: #3ee0a0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pmg-ab-field {
  display: block;
  margin-bottom: 10px;
}
.pmg-ab-q {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #d6efe3;
  line-height: 1.4;
}
.pmg-ab-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, #00c896 25%, transparent);
  border-radius: 8px;
  background: rgba(5, 30, 22, 0.6);
  color: #f0fbf5;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.pmg-ab-input:focus {
  outline: none;
  border-color: #3ee0a0;
  box-shadow: 0 0 0 3px color-mix(in srgb, #00c896 25%, transparent);
}
.pmg-ab-card-helper {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: color-mix(in srgb, #d6efe3 65%, transparent);
}
.pmg-ab-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pmg-ab-card-go,
.pmg-ab-card-skip {
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: filter 160ms ease, transform 160ms ease, background 160ms ease;
}
/* Primary CTA — larger, filled mint, shadow lift, weightier type. */
.pmg-ab-card-go {
  padding: 11px 20px;
  min-height: 44px;
  font-weight: 800;
  font-size: 14px;
  background: linear-gradient(135deg, #00c896 0%, #3ee0a0 100%);
  color: #052a1f;
  border: 1px solid #00c896;
  box-shadow: 0 4px 14px rgba(0, 200, 150, 0.28);
}
.pmg-ab-card-go:hover { filter: brightness(1.06); transform: translateY(-1px); }
/* Secondary — subdued text-button style so it reads as "skip" not as
   a competing action. No border, no shadow, smaller weight. */
.pmg-ab-card-skip {
  padding: 8px 12px;
  min-height: 36px;
  font-weight: 500;
  font-size: 13px;
  background: transparent;
  color: color-mix(in srgb, #c8e8da 75%, transparent);
  border: 1px solid transparent;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, #c8e8da 25%, transparent);
  text-underline-offset: 3px;
}
.pmg-ab-card-skip:hover {
  color: #f0fbf5;
  text-decoration-color: color-mix(in srgb, #c8e8da 60%, transparent);
}

/* ----- Strength card payoff pulse ------------------------------ */
.pmg-ab-pulse {
  animation: pmgAbPulse 0.9s ease-out 1;
}
@keyframes pmgAbPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.55); }
  60%  { box-shadow: 0 0 0 14px rgba(0, 200, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

/* ----- Toast --------------------------------------------------- */
.pmg-ab-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00c896 0%, #3ee0a0 100%);
  color: #052a1f;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

/* =================================================================
   Send-to-AI buttons — visually demoted to ghost/outline so they
   read as alternative destinations beneath the primary
   "▶ Run with AI" CTA, instead of competing with it. Targets the
   pmg-send-to-shell classes added by pmg-send-to.js without
   touching its JS.
   ================================================================= */
.pmg-send-to-shell {
  box-shadow: none !important;
  opacity: 0.92;
}
.pmg-send-to-shell button.pmg-send-to-main-btn,
.pmg-send-to-shell button.pmg-send-to-caret-btn {
  background: transparent !important;
  color: rgba(0, 200, 150, 0.85) !important;
  border-color: rgba(0, 200, 150, 0.35) !important;
  font-weight: 600 !important;
}
.pmg-send-to-shell button.pmg-send-to-main-btn:hover,
.pmg-send-to-shell button.pmg-send-to-caret-btn:hover {
  background: rgba(0, 200, 150, 0.08) !important;
  color: #3ee0a0 !important;
  border-color: rgba(0, 200, 150, 0.55) !important;
  filter: none;
}
.pmg-send-to-shell .pmg-send-to-caret-btn {
  border-left: 1px solid rgba(0, 200, 150, 0.25) !important;
}
.pmg-send-to-shell .pmg-send-to-icon {
  opacity: 0.85 !important;
}

/* Auto-Boost button: ab-5-always-show — per UX feedback the button must
   be visible BEFORE generation too, so users discover it when shaping
   their first idea. Removed the prior `body:not(.pmg-has-result)` hide
   rule. The button still respects an explicit [hidden] attribute.
   We also lift the button out of the parent .output-box.is-collapsed
   visibility constraint by promoting its display state inline-block
   regardless of the wrapper's collapsed state. */
.pmg-ab-btn[hidden] { display: none !important; }
html.pmg-chassis-v3 #pmg-ab-btn-text {
  display: inline-flex !important;
  visibility: visible !important;
}
/* The auto-boost button is mounted as a sibling of #pmgv3-strength-slot
   inside .output-box, which gets `is-collapsed` (display:none on its
   children) until a result exists. Pull the text auto-boost button OUT
   of that collapse by absolute-positioning it to its own row above the
   collapsed wrapper — done via wrapping the button in its own block
   with relative positioning. Simpler: defeat the parent collapse for
   the button only. */
html.pmg-chassis-v3 .output-box.is-collapsed #pmg-ab-btn-text {
  display: inline-flex !important;
  margin: 8px 0 4px;
}

/* ----- Mobile tweaks ------------------------------------------- */
@media (max-width: 640px) {
  .pmg-ab-btn {
    width: 100%;
    justify-content: center;
  }
  .pmg-ab-card-actions {
    flex-direction: column-reverse;
  }
  .pmg-ab-card-go,
  .pmg-ab-card-skip {
    width: 100%;
  }
}
