/* ============================================================================
   ActionButton — shared pill-style action button.
   See components/ui/ActionButton.js for the JS API. Variants here apply to any
   <button class="v-action-btn v-action-btn--<variant>"> markup, regardless of
   surrounding context (candidate sidebar, admin sidebar, etc.).
   ========================================================================= */

.v-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  background: transparent;
  font-family: "Outfit", sans-serif;
  font-size: var(--st-subhead);
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.1;
  white-space: nowrap;
}

.v-action-btn:hover {
  transform: translateY(-1px);
}

.v-action-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v-action-btn-icon iconify-icon {
  font-size: 1.1rem;
}

.v-action-btn-icon svg,
.v-action-btn-icon i {
  width: 1rem;
  height: 1rem;
}

/* ---- Variants ----------------------------------------------------------
   Each visual variant exposes both a *semantic* name (e.g. `primary`,
   `danger`) and the *legacy domain* names that pre-date the semantic
   system (e.g. `shortlist`, `close`). Prefer semantic names in new code;
   the domain names remain valid aliases for existing call sites.
   ----------------------------------------------------------------------- */

/* Primary tint — Shortlist, Transfer Ownership */
.v-action-btn--primary,
.v-action-btn--shortlist {
  background: rgba(var(--primary-color-rgb), 0.08);
  border-color: rgba(var(--primary-color-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--primary:hover,
.v-action-btn--shortlist:hover {
  background: rgba(var(--primary-color-rgb), 0.2);
  border-color: rgba(var(--primary-color-rgb), 0.55);
}

/* Info / blue tint — Schedule Interview */
.v-action-btn--info,
.v-action-btn--interview {
  background: rgba(var(--info-color-rgb), 0.08);
  border-color: rgba(var(--info-color-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--info:hover,
.v-action-btn--interview:hover {
  background: rgba(var(--info-color-rgb), 0.2);
  border-color: rgba(var(--info-color-rgb), 0.55);
}

/* Purple tint — Mark Completed */
.v-action-btn--completed {
  background: rgba(var(--purple-color-rgb), 0.08);
  border-color: rgba(var(--purple-color-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--completed:hover {
  background: rgba(var(--purple-color-rgb), 0.2);
  border-color: rgba(var(--purple-color-rgb), 0.55);
}

/* Danger / red tint — Close Application, Remove Admin */
.v-action-btn--danger,
.v-action-btn--close {
  background: rgba(var(--danger-color-light-rgb), 0.08);
  border-color: rgba(var(--danger-color-light-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--danger:hover,
.v-action-btn--close:hover {
  background: rgba(var(--danger-color-light-rgb), 0.2);
  border-color: rgba(var(--danger-color-light-rgb), 0.55);
}

/* Secondary / neutral ghost — Mark as New Application */
.v-action-btn--secondary,
.v-action-btn--ghost {
  background: rgba(var(--black-color-rgb), 0.04);
  border-color: rgba(var(--black-color-rgb), 0.1);
  color: var(--color-gray-700);
}
.v-action-btn--secondary:hover,
.v-action-btn--ghost:hover {
  background: rgba(var(--black-color-rgb), 0.07);
  border-color: rgba(var(--black-color-rgb), 0.16);
  color: var(--text-color);
}

/* Message <name> — neutral, hovers to brand green */
.v-action-btn--message {
  background: rgba(var(--black-color-rgb), 0.04);
  border-color: rgba(var(--black-color-rgb), 0.1);
  color: var(--text-color);
}
.v-action-btn--message:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  border-color: rgba(var(--primary-color-rgb), 0.4);
}

/* Success / emerald tint — Team Notes (internal-team feel) */
.v-action-btn--success,
.v-action-btn--notes {
  background: rgba(var(--color-brand-green-ink-2a-rgb, 16, 185, 129), 0.07);
  border-color: rgba(var(--color-brand-green-ink-2a-rgb, 16, 185, 129), 0.3);
  color: var(--text-color);
}
.v-action-btn--success:hover,
.v-action-btn--notes:hover {
  background: rgba(var(--color-brand-green-ink-2a-rgb, 16, 185, 129), 0.18);
  border-color: rgba(var(--color-brand-green-ink-2a-rgb, 16, 185, 129), 0.5);
}
.v-action-btn--success iconify-icon,
.v-action-btn--notes iconify-icon {
  color: var(--color-brand-green-ink-2a);
}

/* Profile / info-tint linkish — View Public Profile */
.v-action-btn--profile {
  background: rgba(var(--info-color-rgb), 0.06);
  border-color: rgba(var(--info-color-rgb), 0.3);
  color: var(--text-color);
}
.v-action-btn--profile:hover {
  background: rgba(var(--info-color-rgb), 0.16);
  border-color: rgba(var(--info-color-rgb), 0.5);
}

/* Warning tint — caution / pre-destructive actions */
.v-action-btn--warning {
  background: rgba(var(--warning-color-rgb), 0.08);
  border-color: rgba(var(--warning-color-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--warning:hover {
  background: rgba(var(--warning-color-rgb), 0.2);
  border-color: rgba(var(--warning-color-rgb), 0.55);
}

/* Disabled — used by View Public Profile when profile is private */
.v-action-btn--disabled,
.v-action-btn--disabled:hover {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  background: rgba(var(--black-color-rgb), 0.04);
  border-color: rgba(var(--black-color-rgb), 0.08);
  color: var(--color-gray-500);
}

/* Count badge inside an action button (e.g. unread message count) */
.v-action-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--text-color);
  color: var(--white-color);
  font-size: 0.65rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  margin-left: 0.15rem;
}

/* ---- Size modifiers --------------------------------------------------- *
   Override padding + font size for compact (`sm`) or prominent (`lg`)
   buttons. Default size is `md` (no class needed). */
.v-action-btn--size-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 0.5rem;
  gap: 0.4rem;
}
.v-action-btn--size-sm .v-action-btn-icon iconify-icon {
  font-size: 0.95rem;
}
.v-action-btn--size-sm .v-action-btn-icon svg,
.v-action-btn--size-sm .v-action-btn-icon i {
  width: 0.85rem;
  height: 0.85rem;
}

.v-action-btn--size-lg {
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  border-radius: 0.75rem;
  gap: 0.6rem;
}
.v-action-btn--size-lg .v-action-btn-icon iconify-icon {
  font-size: 1.25rem;
}
.v-action-btn--size-lg .v-action-btn-icon svg,
.v-action-btn--size-lg .v-action-btn-icon i {
  width: 1.15rem;
  height: 1.15rem;
}

/* ---- Shape modifiers ------------------------------------------------- *
   Override the default rounded `border-radius` for square / pill / circle
   silhouettes. Used together with `iconOnly` for distinctive icon buttons
   (e.g. circular tour close, square chat composer send). */
.v-action-btn--shape-square { border-radius: 0.4rem; }
.v-action-btn--shape-pill { border-radius: 9999px; }
.v-action-btn--shape-circle { border-radius: 50%; }

/* ---- Icon-only modifier --------------------------------------------- *
   `iconOnly: true` hides the label, makes the button square (1:1), and
   collapses internal padding so the icon is centered. The label text is
   preserved as `aria-label` + `title` for accessibility. */
.v-action-btn--icon-only {
  width: 2rem;
  height: 2rem;
  padding: 0;
  flex-shrink: 0;
}
.v-action-btn--icon-only.v-action-btn--size-sm {
  width: 1.75rem;
  height: 1.75rem;
}
.v-action-btn--icon-only.v-action-btn--size-lg {
  width: 2.5rem;
  height: 2.5rem;
}
.v-action-btn--icon-only .v-action-btn-label {
  display: none;
}

/* ---- Style modifier: text ------------------------------------------- *
   `style: "text"` strips the background/border so the button reads as a
   text link. Use for "Skip", "Cancel", "Restore Default" type actions. */
.v-action-btn--style-text {
  background: transparent !important;
  border-color: transparent !important;
  padding-left: 0;
  padding-right: 0;
}
.v-action-btn--style-text:hover {
  background: transparent !important;
  border-color: transparent !important;
}
.v-action-btn--style-text.v-action-btn--danger {
  color: var(--danger-color);
}
.v-action-btn--style-text.v-action-btn--danger:hover {
  color: var(--danger-color-dark);
}

/* ---- Active state (tab-like buttons) -------------------------------- *
   `active: true` indicates the currently-selected option among a group
   (time-range pills, tabs). Boosts the variant's tinted background. */
.v-action-btn--active {
  font-weight: 700;
}
.v-action-btn--active.v-action-btn--primary,
.v-action-btn--active.v-action-btn--shortlist {
  background: rgba(var(--primary-color-rgb), 0.28);
  border-color: rgba(var(--primary-color-rgb), 0.6);
  color: var(--text-color);
}
.v-action-btn--active.v-action-btn--secondary,
.v-action-btn--active.v-action-btn--ghost {
  background: rgba(var(--black-color-rgb), 0.1);
  border-color: rgba(var(--black-color-rgb), 0.2);
  color: var(--text-color);
}
.v-action-btn--active.v-action-btn--info,
.v-action-btn--active.v-action-btn--interview {
  background: rgba(var(--info-color-rgb), 0.28);
  border-color: rgba(var(--info-color-rgb), 0.6);
}

/* ---- Open state (dropdown trigger with menu open) ------------------- */
.v-action-btn--open {
  background: rgba(var(--primary-color-rgb), 0.18);
  border-color: rgba(var(--primary-color-rgb), 0.5);
}
.v-action-btn--open .v-action-btn-icon--trailing {
  transform: rotate(180deg);
}

/* ---- Inline layout modifier ------------------------------------------ *
   `inline: true` switches the button from full-width to inline-flex with
   auto width. Within a flex container (e.g. the job-detail action row),
   this makes paired buttons share the available width via `flex: 1 1 0`
   while still allowing solo buttons to span full width. */
.v-action-btn--inline {
  width: auto;
  display: inline-flex;
  padding: 0.55rem 1.1rem;
}
.hd-edit-wrap > .v-action-btn--inline {
  flex: 1 1 0;
  min-width: 0;
}
main[data-detail-mode="draft"] #hero-detail-content
  .hd-edit-wrap > .v-action-btn--inline {
  flex: 0 0 auto;
  width: auto;
}
.hd-edit-wrap > .v-action-btn--inline:only-child {
  flex: 1 1 auto;
  width: 100%;
}

/* ---- Job-action variants (used in DetailPanel hero) ------------------ */

/* Edit Job Details — primary tint (default action across job statuses) */
.v-action-btn--primary-tinted {
  background: rgba(var(--primary-color-rgb), 0.15);
  border-color: rgba(var(--primary-color-rgb), 0.35);
  color: var(--text-color);
}
.v-action-btn--primary-tinted:hover {
  background: rgba(var(--primary-color-rgb), 0.25);
  border-color: rgba(var(--primary-color-rgb), 0.55);
}

/* Post Job / Mark as Active Job — solid gradient call-to-action */
.v-action-btn--primary-solid {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
  border-color: transparent;
  color: var(--black-color);
}
.v-action-btn--primary-solid:hover {
  background: linear-gradient(135deg, var(--primary-color-hover), var(--color-brand-green-3dcc4e));
  box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.35);
}

/* Preview Application / View Full Profile (messages thread) — flat primary
   call-to-action (solid color, no gradient). Used in inline action rows. */
.v-action-btn--primary-flat {
  background: var(--primary-color);
  border-color: rgba(var(--primary-color-rgb), 0.55);
  color: var(--color-brand-green-ink-2);
  box-shadow: 0 1px 2px rgba(var(--primary-color-rgb), 0.18);
}
.v-action-btn--primary-flat:hover {
  background: var(--primary-color-hover);
  border-color: rgba(var(--primary-color-rgb), 0.7);
  box-shadow: 0 2px 6px rgba(var(--primary-color-rgb), 0.28);
}
.v-action-btn--primary-flat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.35);
}

/* Mark as Closed / Delete Job — rose-tinted danger row action */
.v-action-btn--danger-rose {
  background: rgba(var(--rose-color-rgb), 0.08);
  border-color: rgba(var(--rose-color-rgb), 0.3);
  color: var(--rose-color-dark);
}
.v-action-btn--danger-rose:hover {
  background: rgba(var(--rose-color-rgb), 0.15);
  border-color: rgba(var(--rose-color-rgb), 0.5);
}

/* Solid danger — modal "Delete / Discard / Hide profile" confirms */
.v-action-btn--danger-solid {
  background-color: rgba(var(--danger-color-light-rgb), 0.9);
  border-color: transparent;
  color: var(--text-color);
  box-shadow: 0 4px 12px -2px rgba(var(--danger-color-light-rgb), 0.25);
}
.v-action-btn--danger-solid:hover {
  background-color: var(--danger-color);
}

/* ---- Branded AI / Upgrade variants ----------------------------------- */

/* Assess with AI — gradient call-to-action with subtle hover lift */
.v-action-btn--ai {
  width: auto;
  display: inline-flex;
  margin-top: 0.7rem;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
  color: var(--color-brand-green-ink-2);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 0.7rem;
  border: 1px solid rgba(var(--primary-color-rgb), 0.6);
  box-shadow:
    0 4px 14px -4px rgba(var(--primary-color-rgb), 0.5),
    0 1px 2px rgba(var(--black-color-rgb), 0.05);
  position: relative;
  overflow: hidden;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.1s ease;
  z-index: 1;
}
.v-action-btn--ai:hover {
  background: linear-gradient(135deg, var(--primary-color-hover), var(--primary-color-hover));
  border-color: rgba(var(--primary-color-rgb), 0.75);
  box-shadow:
    0 8px 22px -6px rgba(var(--primary-color-rgb), 0.55),
    0 2px 4px rgba(var(--black-color-rgb), 0.06);
  transform: translateY(-1px);
}
.v-action-btn--ai:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.35);
}
.v-action-btn--ai:active {
  transform: scale(0.97);
}

/* Upgrade to Pro (Pro-gated AI). Same primary gradient as --ai but with a
   stronger shadow stack and a brighter ink color. Scoped overrides inside
   .cd-ai-locked-overlay (see ProGating.css) shrink it for the overlay
   placement. */
.v-action-btn--ai-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.7rem;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
  color: var(--color-brand-green-ink-3d);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 0.7rem;
  border: none;
  box-shadow:
    0 8px 22px -10px rgba(var(--primary-color-rgb), 0.55),
    0 1px 0 rgba(var(--white-color-rgb), 0.4) inset;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.1s ease;
}
.v-action-btn--ai-locked:hover {
  background: linear-gradient(135deg, var(--color-brand-green-56e066), var(--color-brand-green-45ce55));
  color: var(--color-brand-green-ink-3d);
  box-shadow:
    0 12px 28px -10px rgba(var(--primary-color-rgb), 0.65),
    0 1px 0 rgba(var(--white-color-rgb), 0.4) inset;
  transform: translateY(-1px);
}
.v-action-btn--ai-locked iconify-icon {
  font-size: 14px;
  color: var(--color-brand-green-ink-3d);
}

/* Re-assess with AI — dark zinc footer button */
.v-action-btn--ai-secondary {
  padding: 0.625rem 1rem;
  background: var(--color-zinc-900);
  color: var(--white-color);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 1px 2px rgba(var(--black-color-rgb), 0.06);
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}
.v-action-btn--ai-secondary:hover {
  background: var(--color-zinc-800);
  transform: none;
}
.v-action-btn--ai-secondary:active {
  transform: scale(0.98);
}

/* Upgrade to Pro (search/message-limit context) — primary gradient pill */
.v-action-btn--upgrade {
  width: auto;
  display: inline-flex;
  margin-top: 0.7rem;
  padding: 0.55rem 1.15rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
  color: var(--color-brand-green-ink-3d);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0.6rem;
  border-color: transparent;
  box-shadow:
    0 4px 12px -3px rgba(var(--primary-color-rgb), 0.45),
    0 1px 0 rgba(var(--white-color-rgb), 0.35) inset;
}
.v-action-btn--upgrade:hover {
  background: linear-gradient(135deg, var(--primary-color-hover), var(--primary-color-dark));
  box-shadow:
    0 8px 18px -5px rgba(var(--primary-color-rgb), 0.55),
    0 1px 0 rgba(var(--white-color-rgb), 0.35) inset;
}
.v-action-btn--upgrade:active {
  transform: translateY(0);
}
.v-action-btn--upgrade iconify-icon { font-size: 0.95rem; }

/* ---- Disabled state (final overrides) ------------------------------- *
   Greyed-out look that wins over every variant. Anchored by both the
   `disabled: true` flag (which sets .v-action-btn--disabled +
   aria-disabled) and the `block: true` flag (which sets the HTML
   disabled attribute). Stacked with .v-action-btn for two-class
   specificity so we beat every single-class variant + variant:hover. */
.v-action-btn.v-action-btn--disabled,
.v-action-btn.v-action-btn--disabled:hover,
.v-action-btn[disabled],
.v-action-btn[disabled]:hover,
.v-action-btn[aria-disabled="true"],
.v-action-btn[aria-disabled="true"]:hover {
  cursor: not-allowed;
  background: rgba(var(--black-color-rgb), 0.05);
  border-color: rgba(var(--black-color-rgb), 0.1);
  color: var(--color-gray-400);
  box-shadow: none;
  filter: grayscale(0.4);
  opacity: 0.65;
  transform: none;
}
.v-action-btn.v-action-btn--disabled .v-action-btn-icon,
.v-action-btn[disabled] .v-action-btn-icon,
.v-action-btn[aria-disabled="true"] .v-action-btn-icon {
  color: var(--color-gray-400);
}
