/* SiliconBoard — Modern Clean Design System */

html { scroll-behavior: smooth; }

/* ── Design Tokens ── */
:root {
  --ink: #1a1a1a;
  --paper: #fefffe;
  --muted: #f7f8fa;
  --subtle: #f3f4f6;
  --accent: #d6fd61;
  --accent-dark: #b8e04a;
  --teal: #1a3a4a;
  --card-green: #e2f7cd;
  --card-blue: #e4effa;
  --card-warm: #fef3e2;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.04);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
}

/* ── Content Gutter ── */
.gutter {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
@media (min-width: 640px) {
  .gutter { padding-left: 2.5rem; padding-right: 2.5rem; }
}
@media (min-width: 1024px) {
  .gutter { padding-left: 8%; padding-right: 8%; }
}
@media (min-width: 1280px) {
  .gutter { padding-left: 12%; padding-right: 12%; }
}

/* ── Hero cross pattern backdrop (tiled SVG "+" marks) ── */
.hero-crosses {
  position: relative;
}
.hero-crosses::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cline x1='25' y1='30' x2='35' y2='30' stroke='%23b0b3b8' stroke-width='1.2'/%3E%3Cline x1='30' y1='25' x2='30' y2='35' stroke='%23b0b3b8' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 60px;
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}
.hero-crosses > * {
  position: relative;
  z-index: 1;
}

/* ── Modern card styles ── */
.card-modern {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}
.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ── Job card hover ── */
.job-card {
  border-radius: var(--radius-lg);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}
.job-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ── Buttons ── */
.btn-accent {
  background: var(--accent);
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all var(--duration-fast) ease-out;
}
.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all var(--duration-fast) ease-out;
}
.btn-outline:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-apply {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all var(--duration-fast) ease-out;
}
.btn-apply:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Search bar ── */
.search-bar {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 24px;
  gap: 0;
  transition: box-shadow var(--duration-normal) ease, border-color var(--duration-normal) ease;
}
.search-bar:focus-within {
  border-color: var(--gray-400);
  box-shadow: var(--shadow-lg);
}
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.search-bar input::placeholder {
  color: var(--gray-400);
}
.search-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-200);
  margin: 0 16px;
  flex-shrink: 0;
}
.search-btn {
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) ease;
}
.search-btn:hover {
  background: var(--accent-dark);
}

/* ── Category pills ── */
.category-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--gray-200);
  background: white;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}
.category-pill:hover {
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.category-pill--active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.category-pill--active:hover {
  background: #1e4558;
  border-color: #1e4558;
}

/* ── Tags (modern) ── */
.tag-t1 {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-pill);
}
.tag-t2 {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
  border-radius: var(--radius-pill);
}
.tag-t3 {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  border-radius: var(--radius-pill);
}

/* ── Monospace salary ── */
.salary-mono {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ── Form focus ── */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
  border-color: var(--accent) !important;
}
/* No focus ring on search bar inputs — the parent container handles focus state */
.search-bar-wrap input:focus,
.search-bar-wrap input:focus-visible {
  box-shadow: none !important;
  border-color: transparent !important;
  outline: none !important;
  border: none !important;
}

/* ── Transitions ── */
a, button, input, select {
  transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease, opacity var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: var(--radius-md);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Staggered fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) both;
}
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.35s; }
.fade-up-4 { animation-delay: 0.5s; }
.fade-up-5 { animation-delay: 0.65s; }

/* ── Scroll-triggered reveal (CSS-only) ── */
@keyframes reveal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: reveal 0.6s var(--ease-out) both;
  animation-timeline: view();
  animation-range: entry 0% entry 60%;
}

/* ── Filter buttons (modern) ── */
.filter-btn {
  border: 1.5px solid var(--gray-200);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-pill);
  transition: all var(--duration-fast) ease-out;
}
.filter-btn:hover,
.filter-btn--active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ── Filter pill (filter bar trigger) ── */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--gray-200);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-fast) ease-out;
  white-space: nowrap;
}
.filter-pill:hover {
  border-color: var(--gray-400);
}
.filter-pill--active {
  border-color: var(--ink);
  color: var(--ink);
}
.filter-pill--active:hover {
  border-color: var(--ink);
}
.filter-pill .chev {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
  transition: transform var(--duration-fast) ease;
  opacity: 0.55;
}
.filter-pill--open .chev {
  transform: rotate(180deg);
}
.filter-pill .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}
/* Fix: HTML [hidden] on pill children was being overridden by display: inline-flex */
.filter-pill [hidden] {
  display: none !important;
}

/* ── Filter popover ── */
.filter-popover {
  position: absolute;
  z-index: 60;
  min-width: 260px;
  max-width: 320px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popoverIn 140ms var(--ease-out);
}
@keyframes popoverIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.popover-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.popover-search-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  background: var(--muted);
  outline: none;
}
.popover-search-input:focus {
  background: white;
  border-color: var(--gray-400);
  box-shadow: none !important;
}
.popover-section-label {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-400);
}
.popover-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}
.popover-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
  transition: background 100ms ease;
}
.popover-option:hover {
  background: var(--muted);
}
.popover-option input[type="checkbox"],
.popover-option input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.popover-option-label {
  flex: 1;
  font-weight: 500;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popover-option-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}
.popover-empty {
  padding: 20px 14px;
  font-size: 13px;
  color: var(--gray-400);
  text-align: center;
}

/* ── Active filter chip ── */
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
  border: none;
}
.active-chip:hover {
  background: #333;
}
.active-chip .x {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.active-chip:hover .x {
  opacity: 1;
}

/* ── Alternating row backgrounds ── */
.job-list-alt > *:nth-child(even) {
  background: var(--subtle);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── View toggle (For you / All jobs) ──────────────────────────── */
.view-toggle {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.view-toggle.hidden { display: none; }

.view-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(26, 26, 26, 0.55);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
}
.view-pill:hover { color: var(--ink); }
.view-pill.active {
  background: var(--ink);
  color: var(--paper);
}

.view-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00B4D8;
  box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.22);
  flex-shrink: 0;
  transition: all 160ms ease;
}
.view-pill.active .view-dot {
  background: #d6fd61;
  box-shadow: 0 0 0 2px rgba(214, 253, 97, 0.3);
}

/* ── Personalized mode: filters + pagination both work like All Jobs ─── */
/* (no special hiding rules — filter bar and active chips behave the same) */

/* Skeleton placeholder used while job-list fetches are in flight. Animated
   shimmer makes it visually obvious that content is loading. */
.sb-skeleton {
  background: linear-gradient(90deg, #eef0f4 0%, #f7f8fa 50%, #eef0f4 100%);
  background-size: 200% 100%;
  animation: sb-skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes sb-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Match signal dot on personalized job cards */
.match-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 7px;
  background: rgba(0, 180, 216, 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #0078a1;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}
.match-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00B4D8;
  box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2);
}

/* Edit-profile link on results header (personalized mode) */
.edit-profile-link {
  color: rgba(26, 26, 26, 0.5);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 140ms ease;
  margin-left: 12px;
}
.edit-profile-link:hover { color: #00B4D8; }
