/* =============================================================================
 * Analytics drawer (sidebar)
 * -----------------------------------------------------------------------------
 * Slide-in panel used by the Applicant Engagement and Candidate Tiers cards
 * to drill into the underlying applicant list. Mirrors the wallet/holders
 * drawers in vestify-nextjs but tuned to coin-careers' light theme.
 * =============================================================================
 */

.an-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--black-color-rgb), 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.an-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.an-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 100vw;
  background: var(--white-color);
  border-left: 1px solid rgba(var(--black-color-rgb), 0.08);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s 0.35s;
  box-shadow: -10px 0 40px rgba(var(--black-color-rgb), 0.08);
}

.an-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s 0s;
}

/* Header --------------------------------------------------------------------*/

.an-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(var(--black-color-rgb), 0.08);
  flex-shrink: 0;
}

.an-drawer-title {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.an-drawer-sub {
  font-size: 0.82rem;
  color: var(--color-gray-400);
  margin-top: 3px;
}

.an-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  background: var(--color-neutral-off-white);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  color: var(--color-gray-400);
  cursor: pointer;
  transition: all 0.2s ease;
}

.an-drawer-close:hover {
  color: var(--text-color);
  border-color: rgba(var(--black-color-rgb), 0.2);
}

/* Search --------------------------------------------------------------------*/

.an-drawer-search {
  position: relative;
  padding: 1rem 1.75rem;
  flex-shrink: 0;
}

.an-drawer-search-icon {
  position: absolute;
  left: 2.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.an-drawer-search-input {
  width: 100%;
  background: var(--color-neutral-off-white);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.an-drawer-search-input::placeholder {
  color: var(--color-gray-400);
}

.an-drawer-search-input:focus {
  border-color: rgba(var(--primary-color-rgb), 0.4);
  background: var(--white-color);
}

/* Tabs ----------------------------------------------------------------------*/

.an-drawer-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0 1.75rem 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.an-drawer-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-400);
  background: transparent;
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.an-drawer-tab:hover {
  color: var(--color-gray-700);
  border-color: rgba(var(--black-color-rgb), 0.18);
}

.an-drawer-tab.is-active {
  color: var(--tab-color, var(--primary-color-dark));
  border-color: var(--tab-color, var(--primary-color));
  background: rgba(var(--primary-color-rgb), 0.06);
}

.an-drawer-tab-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
}

/* List ----------------------------------------------------------------------*/

.an-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.75rem 1.75rem;
}

.an-drawer-list::-webkit-scrollbar {
  width: 4px;
}

.an-drawer-list::-webkit-scrollbar-track {
  background: transparent;
}

.an-drawer-list::-webkit-scrollbar-thumb {
  background: var(--color-gray-200);
  border-radius: 2px;
}

.an-drawer-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* Row -----------------------------------------------------------------------*/

.an-drawer-row {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.125rem;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.07);
  border-radius: 0.75rem;
  margin-bottom: 0.625rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.an-drawer-row-clickable {
  cursor: pointer;
}

.an-drawer-row-clickable:focus-visible {
  outline: 2px solid rgba(var(--primary-color-rgb), 0.55);
  outline-offset: 2px;
}

.an-drawer-row:hover {
  border-color: rgba(var(--primary-color-rgb), 0.35);
  box-shadow: 0 6px 20px rgba(var(--black-color-rgb), 0.05);
}

.an-drawer-row-clickable:hover {
  transform: translateY(-1px);
}

/* Header row: badges + status (+ match) on left, date on right */
.an-drawer-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.an-drawer-row-header-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

.an-drawer-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--color-gray-400);
  flex-shrink: 0;
}

.an-drawer-date i {
  opacity: 0.7;
}

.an-drawer-row-body {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  min-width: 0;
}

.an-drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-gray-100);
  position: relative;
}

.an-drawer-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.an-drawer-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--white-color);
  letter-spacing: -0.01em;
  background: #1a1a2e;
}

.an-drawer-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.an-drawer-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.an-drawer-row-clickable:hover .an-drawer-name {
  color: var(--primary-color-dark);
}

.an-drawer-email {
  font-size: 0.78rem;
  color: var(--color-gray-400);
  font-family: "JetBrains Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Applied for {Job Name}" inline line ------------------------------------*/

.an-drawer-applied-line {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-gray-500);
  line-height: 1.4;
}

.an-drawer-job-link {
  all: unset;
  font-weight: 700;
  color: var(--color-gray-900);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
  line-height: 1.4;
}

.an-drawer-job-link:hover {
  color: var(--primary-color-dark);
  border-bottom-color: rgba(var(--primary-color-rgb), 0.5);
}

.an-drawer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.an-drawer-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.an-drawer-meta-label {
  font-size: 0.68rem;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.an-drawer-meta-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

.an-drawer-meta-value-accent {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-color-dark);
}

.an-drawer-meta-divider {
  width: 1px;
  height: 12px;
  background: rgba(var(--black-color-rgb), 0.1);
}

/* Match score chip (tier explorer) ------------------------------------------*/

.an-drawer-score {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.an-drawer-score i {
  flex-shrink: 0;
  opacity: 0.85;
}

.an-drawer-score-value {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

.an-drawer-score-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.85;
}

/* Badge ---------------------------------------------------------------------*/

.an-drawer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.an-drawer-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Empty state ---------------------------------------------------------------*/

.an-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--color-gray-400);
}

.an-drawer-empty p {
  font-size: 0.9rem;
  color: var(--color-gray-400);
}

/* Explore button ------------------------------------------------------------*/

.an-explore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: var(--an-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-color);
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.an-explore-btn:hover {
  border-color: rgba(var(--primary-color-rgb), 0.5);
  color: var(--primary-color-dark);
  background: rgba(var(--primary-color-rgb), 0.06);
}

/* Click affordance for the existing stat / tier blocks ----------------------*/

.an-dormancy-stat,
.an-pyr-tier {
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.an-dormancy-stat:hover {
  border-color: rgba(var(--black-color-rgb), 0.18) !important;
  box-shadow: 0 4px 14px rgba(var(--black-color-rgb), 0.04);
}

.an-pyr-tier-inner {
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.an-pyr-tier-inner:hover {
  box-shadow:
    0 0 0 1px rgba(var(--primary-color-rgb), 0.35),
    0 6px 20px rgba(var(--black-color-rgb), 0.04);
}

.an-stat-arrow {
  color: var(--color-gray-400);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.an-dormancy-stat:hover .an-stat-arrow,
.an-pyr-tier-inner:hover .an-stat-arrow {
  color: var(--text-color);
  transform: translateX(2px);
}

/* =============================================================================
 * Job analytics drawer (per-job)
 * =============================================================================
 */

.an-job-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.an-job-head .an-drawer-title {
  margin: 0;
}

.an-job-head-status:empty {
  display: none;
}

.an-job-head-details,
.an-job-head-date {
  margin-top: 0;
}

.an-job-head-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}

#an-job-body {
  padding-top: 1.25rem;
}

/* KPI grid -------------------------------------------------------------------*/

.an-job-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.an-job-kpi {
  position: relative;
  padding: 1rem 1.1rem;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.07);
  border-radius: 0.85rem;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.an-job-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--kpi-accent) 6%, transparent),
    transparent 65%
  );
  pointer-events: none;
}

.an-job-kpi:hover {
  border-color: color-mix(in srgb, var(--kpi-accent) 35%, transparent);
  box-shadow: 0 6px 18px rgba(var(--black-color-rgb), 0.05);
}

.an-job-kpi-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--kpi-accent) 10%, transparent);
  color: var(--kpi-accent);
  margin-bottom: 0.65rem;
}

.an-job-kpi-label {
  position: relative;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-400);
  margin-bottom: 0.3rem;
}

.an-job-kpi-value {
  position: relative;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-color);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}

.an-job-kpi-suffix {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gray-400);
}

/* Sections -------------------------------------------------------------------*/

.an-job-section {
  padding: 1.1rem 1.15rem 1.25rem;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.07);
  border-radius: 0.85rem;
  margin-bottom: 1rem;
}

.an-job-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.an-job-section-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.an-job-section-sub {
  font-size: 0.74rem;
  color: var(--color-gray-400);
}

/* Funnel ---------------------------------------------------------------------*/

.an-job-funnel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.an-job-funnel-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  align-items: center;
  gap: 0.75rem;
}

.an-job-funnel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

.an-job-funnel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.an-job-funnel-bar {
  height: 8px;
  background: var(--color-neutral-off-white);
  border-radius: 999px;
  overflow: hidden;
}

.an-job-funnel-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.an-job-funnel-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
}

.an-job-funnel-pct {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-gray-400);
}

/* Tier mix bar ---------------------------------------------------------------*/

.an-job-tier-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-neutral-off-white);
  margin-bottom: 0.85rem;
}

.an-job-tier-seg {
  height: 100%;
  transition: width 0.35s ease;
}

.an-job-tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.an-job-tier-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-gray-700);
}

.an-job-tier-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.an-job-tier-legend-label {
  font-weight: 600;
}

.an-job-tier-legend-value {
  font-weight: 600;
  color: var(--color-gray-400);
}

/* Top applicants list --------------------------------------------------------*/

.an-job-cand-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.an-job-cand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--color-neutral-off-white);
  border: 1px solid transparent;
  border-radius: 0.7rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease;
}

.an-job-cand:hover {
  background: var(--white-color);
  border-color: rgba(var(--primary-color-rgb), 0.35);
  transform: translateY(-1px);
}

.an-job-cand:focus-visible {
  outline: 2px solid rgba(var(--primary-color-rgb), 0.55);
  outline-offset: 2px;
}

.an-job-cand .an-drawer-avatar {
  width: 36px;
  height: 36px;
}

.an-job-cand-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.an-job-cand-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-job-cand-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.an-job-cand-applied {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--color-gray-400);
  font-weight: 500;
}

.an-job-cand-score {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-color);
  flex-shrink: 0;
  padding-left: 0.5rem;
}

/* CTA ------------------------------------------------------------------------*/

.an-job-open-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white-color);
  background: var(--text-color);
  border: 1px solid var(--text-color);
  border-radius: 0.7rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.an-job-open-cta:hover {
  background: var(--primary-color-dark);
  border-color: var(--primary-color-dark);
  transform: translateY(-1px);
}
