/* Save a job: heart button, toast, saved page */
.job-card {
  position: relative;
}

.ipd-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.job-card > .ipd-save {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

.ipd-save:hover {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
}

.ipd-save:active {
  transform: scale(0.92);
}

.ipd-save:focus-visible {
  outline: 3px solid #f2c215;
  outline-offset: 2px;
}

.ipd-save.is-saved {
  --ipd-heart-fill: currentColor;
  color: #e11d48;
}

.ipd-save--labelled {
  width: auto;
  min-height: 44px;
  height: auto;
  padding: 0.5rem 1rem;
  border-color: currentColor;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.jd-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.jd-apply-card .ipd-save--labelled {
  display: flex;
  width: 100%;
  margin-top: 0.6rem;
  border-radius: 12px;
}

.ipd-saved-count {
  display: inline-block;
  min-width: 1.35em;
  margin-left: 0.35rem;
  padding: 0 0.3em;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.35em;
  text-align: center;
}

.ipd-save-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #151a16;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ipd-save-toast.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.ipd-save-toast-action {
  flex: none;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: #f2c215;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ipd-save-toast-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.saved-account-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.35));
  border-radius: 16px;
  background: var(--surface, transparent);
}

.saved-account-banner--ok {
  border-color: #1f7a4a;
}

.saved-account-banner--warn {
  border-color: #d59f00;
}

.saved-account-banner strong,
.saved-account-banner p {
  background: none;
}

.saved-account-who {
  flex-basis: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line, rgba(148, 163, 184, 0.35));
  font-size: 0.88rem !important;
}

.saved-account-who a,
.saved-account-who button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.saved-account-banner p {
  margin: 0.25rem 0 0;
  max-width: 62ch;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.85;
}

.saved-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.saved-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.saved-toolbar[hidden] {
  display: none;
}

.saved-sort {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.35));
  border-radius: 999px;
}

.saved-sort button,
.saved-clear {
  min-height: 38px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.saved-sort button.is-active {
  background: #f2c215;
  color: #151a16;
}

.saved-clear {
  border: 1px solid var(--line, rgba(148, 163, 184, 0.35));
}

.saved-clear:hover {
  border-color: #e11d48;
  color: #e11d48;
}

.saved-clear[hidden] {
  display: none;
}

.saved-summary {
  font-weight: 600;
}

.saved-account-banner--loading {
  justify-content: flex-start;
}

.saved-spinner {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(148, 163, 184, 0.35);
  border-top-color: #f2c215;
  border-radius: 50%;
  animation: saved-spin 0.8s linear infinite;
}

@keyframes saved-spin {
  to {
    transform: rotate(360deg);
  }
}

.saved-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.12);
  color: #e11d48;
}

.saved-empty .saved-empty-actions .btn-primary,
.saved-empty .saved-empty-actions .btn-primary:hover {
  color: #151a16;
}

.saved-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.saved-empty {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 3rem 1.25rem;
  border: 1px dashed var(--line, rgba(148, 163, 184, 0.35));
  border-radius: 20px;
  text-align: center;
}

.saved-empty[hidden] {
  display: none;
}

.saved-empty strong {
  font-size: 1.15rem;
}

.saved-empty p {
  margin: 0 0 0.4rem;
}

/* The saved page is a list, not a search board. */
.saved-jobs-page .ej-search-bar,
.saved-jobs-page .ej-metrics,
.saved-jobs-page .ej-quick-cats,
.saved-jobs-page .jobs-today-promo,
.saved-jobs-page .ej-filter-open-btn,
.saved-jobs-page .ej-filters,
.saved-jobs-page .jobs-controls-section,
.saved-jobs-page .ej-section--secondary,
.saved-jobs-page .jobs-companies-section,
.saved-jobs-page .jobs-cta-banner,
.saved-jobs-page .jobs-alerts-card,
.saved-jobs-page .jobs-ad,
.saved-jobs-page #jobs-recent,
.saved-jobs-page .ej-listings-head,
.saved-jobs-page #jobs-load-more,
.saved-jobs-page #jobs-expired-banner {
  display: none !important;
}

.saved-jobs-page .ej-board {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .saved-spinner {
    animation-duration: 2.4s;
  }

  .ipd-save,
  .ipd-save-toast {
    transition: none;
  }
}

/* Share a job: card icon, share sheet, detail panel */
.ipd-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.job-card > .ipd-share {
  position: absolute;
  top: 8px;
  right: 54px;
  z-index: 3;
}

.job-card:has(> .ipd-share) .job-card-head {
  padding-right: 92px;
}

.ipd-share:hover {
  background: rgba(37, 211, 102, 0.12);
  color: #128c4b;
}

.ipd-share:active {
  transform: scale(0.92);
}

.ipd-share:focus-visible,
.ipd-share-opt:focus-visible,
.ipd-share-close:focus-visible {
  outline: 3px solid #f2c215;
  outline-offset: 2px;
}

.ipd-share-sheet {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ipd-share-sheet[hidden] {
  display: none;
}

.ipd-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 10, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ipd-share-panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  padding: 1.1rem 1.1rem 1.25rem;
  border-radius: 18px;
  background: #fff;
  color: #151a16;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ipd-share-sheet.is-open .ipd-share-backdrop,
.ipd-share-sheet.is-open .ipd-share-panel {
  opacity: 1;
  transform: none;
}

body.dark .ipd-share-panel {
  background: #151a16;
  color: #f2f4f1;
}

.ipd-share-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ipd-share-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.ipd-share-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.ipd-share-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.14);
  color: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.ipd-share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.ipd-share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-height: 76px;
  padding: 0.7rem 0.25rem;
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.ipd-share-opt[hidden] {
  display: none;
}

.ipd-share-opt:hover {
  background: rgba(127, 127, 127, 0.1);
}

.ipd-share-opt--wa svg {
  color: #25d366;
}

.ipd-share-opt--ig svg {
  color: #e1306c;
}

.job-share-note {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  opacity: 0.75;
}

.job-share-actions .job-share-btn--wa {
  background: #25d366;
  border-color: #25d366;
  color: #062b14;
}

.job-share-actions .job-share-btn--ig {
  background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 520px) {
  .ipd-share-sheet {
    align-items: flex-end;
    padding: 0;
  }

  .ipd-share-panel {
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .job-share-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ipd-share,
  .ipd-share-backdrop,
  .ipd-share-panel {
    transition: none;
  }
}
