:root {
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --border: #e5e7f0;
  --text: #14161a;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-bg: #eeecfd;
  --hiring: #15803d;
  --hiring-bg: #e6f6ec;
  --wanted: #b45309;
  --wanted-bg: #fdf1e0;
  --negative: #dc2626;
  --negative-bg: #fde8e8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.05), 0 1px 1px rgba(20, 22, 26, 0.04);
  --shadow-md: 0 12px 28px -10px rgba(20, 22, 26, 0.16), 0 4px 10px -4px rgba(20, 22, 26, 0.08);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Top bar */
.topbar {
  position: relative;
  background: radial-gradient(120% 180% at 15% 0%, #6a5cf5 0%, var(--accent) 45%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 20px -6px rgba(79, 70, 229, 0.45);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.brand-link:hover { opacity: 0.85; }

.topbar h1 span {
  font-weight: 500;
  opacity: 0.82;
}

.info-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.info-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: #fff; }

.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 13, 17, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: overlayFadeIn 0.15s ease;
}

.info-overlay[hidden] { display: none; }

@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPopIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.info-modal {
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  animation: modalPopIn 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.info-modal p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.info-modal a { color: var(--accent); font-weight: 600; }

.info-close {
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.info-close:hover { background: var(--accent-dark); }
.info-close:active { transform: scale(0.97); }

/* Filter bar */
.filter-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.filter-toggle {
  display: none;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter-toggle .chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.filter-toggle[aria-expanded="false"] .chevron { transform: rotate(-90deg); }

.filter-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-inner input,
.filter-inner select {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-inner input::placeholder { color: var(--muted); opacity: 0.8; }

.filter-inner input:focus,
.filter-inner select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-bg);
  color: var(--text);
}

.filter-inner input[type="text"] { flex: 1 1 160px; min-width: 120px; }
.filter-inner input[type="number"] { flex: 0 1 110px; }
.filter-inner select { flex: 0 1 170px; }

.filter-inner button {
  flex: 0 0 auto;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.5);
  transition: background 0.15s ease, transform 0.1s ease;
}

.filter-inner button:hover { background: var(--accent-dark); }
.filter-inner button:active { transform: scale(0.97); }
.filter-inner button:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Main content */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin: 4px 4px 16px;
}

/* Results list */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card.status-applied,
.card.status-up {
  border-color: var(--hiring);
  box-shadow: 0 0 0 1.5px var(--hiring) inset, var(--shadow-sm);
}

.card.status-down {
  border-color: var(--negative);
  box-shadow: 0 0 0 1.5px var(--negative) inset, var(--shadow-sm);
}

.card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar-wrap { display: inline-flex; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--border);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #8b7ef7);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--border);
}

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.badge.hiring { background: var(--hiring-bg); color: var(--hiring); border-color: color-mix(in srgb, var(--hiring) 25%, transparent); }
.badge.wanted { background: var(--wanted-bg); color: var(--wanted); border-color: color-mix(in srgb, var(--wanted) 25%, transparent); }

.card .meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}

.card .pay {
  font-weight: 700;
  color: var(--hiring);
}

.card .content {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}

.card .contact {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.action-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.action-btn:hover { filter: brightness(1.08); }
.action-btn:active { transform: scale(0.96); }
.action-btn.call { background: var(--accent); }
.action-btn.sms { background: #6b7280; }
.action-btn.whatsapp { background: #22c55e; }

.share-btn,
.status-trigger,
.details-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.share-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.share-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.share-btn:active, .details-btn:active, .status-trigger:active { transform: scale(0.96); }
.share-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

.status-trigger:hover,
.details-btn:hover { border-color: var(--accent); color: var(--accent); }

.status-trigger.applied,
.status-trigger.up {
  background: var(--hiring-bg);
  border-color: var(--hiring);
  color: var(--hiring);
}

.status-trigger.down {
  background: var(--negative-bg);
  border-color: var(--negative);
  color: var(--negative);
}

.status-dropdown { position: relative; display: inline-flex; }

.status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 190px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: modalPopIn 0.12s ease;
}

.status-menu[hidden] { display: none; }

.status-option {
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}

.status-option:hover { background: var(--bg); }
.status-option.applied:hover,
.status-option.up:hover { color: var(--hiring); }
.status-option.down:hover { color: var(--negative); }

.status-option.clear {
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 9px;
  border-radius: 0 0 8px 8px;
}

.shared-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--hiring-bg);
  color: var(--hiring);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.shared-banner button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

#sentinel { height: 1px; }

.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  padding: 24px;
  font-size: 13px;
  font-weight: 600;
}

.loading-more:not(:empty)::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Label chips shown on a card when the employer has labels applied */
.label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.label-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Job detail modal */
.detail-modal {
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0;
}

.detail-modal::-webkit-scrollbar { width: 8px; }
.detail-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 16px;
}

.detail-header h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.detail-phone { color: var(--muted); font-size: 13px; font-weight: 600; }

.detail-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.detail-close::before {
  content: "×";
  font-size: 20px;
  line-height: 1;
}

.detail-close:hover { background: var(--negative-bg); color: var(--negative); border-color: transparent; }

.detail-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 22px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.detail-privacy-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }

.detail-head-status { padding: 16px 22px 0; margin-bottom: 4px; }

.detail-section {
  border-top: 1px solid var(--border);
  padding: 16px 22px 0;
  margin-top: 16px;
}

.detail-section:last-child { padding-bottom: 22px; }

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-empty { color: var(--muted); font-size: 13px; margin: 0; }

.detail-inline-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.detail-inline-form input[type="text"],
.detail-inline-form textarea {
  flex: 1;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

.detail-inline-form textarea { min-height: 54px; resize: vertical; }
.detail-inline-form input:focus, .detail-inline-form textarea:focus { outline: none; border-color: var(--accent); }

.detail-inline-form button {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s ease, transform 0.1s ease;
}

.detail-inline-form button:hover { background: var(--accent-dark); }
.detail-inline-form button:active { transform: scale(0.96); }

.label-toggle-list { display: flex; flex-wrap: wrap; gap: 6px; }

.label-toggle {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid var(--label-color, var(--border));
  background: transparent;
  color: var(--label-color, var(--muted));
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.label-toggle.active { background: var(--label-color, var(--accent)); color: #fff; border-color: transparent; }

.comments-list, .checklist-list { display: flex; flex-direction: column; gap: 8px; }

.comment-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.comment-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; margin-bottom: 5px; }

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.comment-delete, .checklist-delete {
  border: none;
  background: none;
  color: var(--negative);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}

.checklist-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.checklist-item.done span { text-decoration: line-through; color: var(--muted); }
.checklist-item .checklist-delete { margin-left: auto; font-size: 17px; line-height: 1; }

.other-posts-list { display: flex; flex-direction: column; gap: 8px; }

.other-post {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 13.5px;
}

.other-post-meta { color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.other-post-content { white-space: pre-wrap; }

/* Wider, roomier detail modal on desktop, with labels + checklist side by side */
@media (min-width: 641px) {
  .detail-modal { max-width: 640px; }
  .detail-header { padding: 26px 28px 18px; }
  .detail-privacy-note { margin: 14px 28px 0; }
  .detail-head-status { padding: 18px 28px 0; }
  .detail-section { padding: 18px 28px 0; }
  .detail-section:last-child { padding-bottom: 28px; }

  .detail-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .detail-two-col > .detail-section {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .topbar h1 { font-size: 19px; }
  .filter-toggle { display: flex; }
  .filter-inner { gap: 8px; padding-top: 0; }
  .filter-inner.collapsed { display: none; }
  .filter-inner input[type="text"],
  .filter-inner input[type="number"],
  .filter-inner select,
  .filter-inner button {
    flex: 1 1 100%;
  }

  .card { padding: 16px; }

  #detailOverlay { padding: 0; }
  .detail-modal {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card-bg: #181b21;
    --border: #2a2e37;
    --text: #eef0f3;
    --muted: #8b92a0;
    --accent-bg: #211f3d;
    --hiring-bg: #113322;
    --wanted-bg: #362509;
    --negative-bg: #3a1518;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 32px -12px rgba(0, 0, 0, 0.55), 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  }
  .filter-inner input,
  .filter-inner select {
    background: var(--bg);
    color: var(--text);
  }
  .avatar, .avatar-fallback {
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--border);
  }
  .detail-privacy-note { color: #b3aefc; }
}
