/* ============================================================
   Jobs Board – Design System
   Scoped to .jb-page so variables don't bleed into other pages
   ============================================================ */

.jb-page {
  --bg-primary:       #e1eaf0;
  --bg-white:         #ffffff;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f5f8fa;
  --border-color:     #d1dce5;
  --border-light:     #e8eef3;
  --text-primary:     #1a1a1a;
  --text-secondary:   #5a6a7a;
  --text-muted:       #8a96a3;
  --accent-primary:   #2a6496;
  --accent-hover:     #1d4e7a;
  --accent-danger:    #d9534f;
  --favorite-active:  #f0c040;
  --favorite-inactive:#ccc;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
  --shadow-md:        0 2px 8px rgba(0,0,0,.10);
  --radius-sm:        0;
  --radius-md:        0;
  --radius-lg:        0;

  background: var(--bg-primary);
  min-height: calc(100vh - 70px);
  font-size: 15px;
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
.jb-page ::-webkit-scrollbar        { width: 6px; height: 6px; }
.jb-page ::-webkit-scrollbar-track  { background: transparent; }
.jb-page ::-webkit-scrollbar-thumb  { background: var(--border-color); }


/* ================================================================
   TOP BANNER
   ================================================================ */
.jb-banner {
  background: var(--bg-primary);
  padding: 24px 24px 0;
}

.jb-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.jb-banner-card {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  width: 100%;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px 36px;
}

.jb-banner-logo {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.jb-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jb-banner-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.jb-banner-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.jb-banner-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
}
.jb-banner-cta:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.jb-banner-right {
  flex-shrink: 0;
}

.jb-banner-shortcut {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
}
.jb-banner-shortcut:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}


/* ================================================================
   THREE-COLUMN BODY
   ================================================================ */
.jb-body {
  padding: 24px;
}

.jb-body-inner {
  display: grid;
  grid-template-columns: 380px 1fr 320px;
  gap: 24px;
  align-items: start;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Responsive collapse */
@media (max-width: 1023px) {
  .jb-body-inner {
    grid-template-columns: 1fr;
  }
  .jb-sidebar-left  { order: 1; }
  .jb-sidebar-right { order: 2; }
  .jb-main          { order: 3; }
}

@media (max-width: 767px) {
  .jb-banner { padding: 16px 16px 0; }
  .jb-banner-card { flex-wrap: nowrap; gap: 16px; padding: 16px 20px; }
  .jb-banner-logo { width: 100px; height: 100px; flex-shrink: 0; }
  .jb-banner-name { font-size: 1.2rem; }
  .jb-body { padding: 16px; }
  .jb-body-inner { gap: 16px; }
}


/* ================================================================
   LEFT SIDEBAR – FILTERS
   ================================================================ */
.jb-sidebar-left {
  position: sticky;
  top: 24px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  overflow: hidden;
}

/* Search box */
.jb-search-box {
  position: relative;
  margin-bottom: 20px;
}

.jb-search-input {
  width: 100%;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color 0.2s ease;
  outline: none;
}
.jb-search-input::placeholder { color: var(--text-muted); }
.jb-search-input:focus { border-color: var(--accent-primary); }

.jb-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Section headings (Filter by: / Sort by:) */
.jb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.jb-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.jb-reset-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s ease;
  border-radius: var(--radius-sm);
}
.jb-reset-btn:hover { color: var(--accent-primary); }
.jb-reset-btn.is-spinning { animation: jb-reset-spin 0.45s ease; }

@keyframes jb-reset-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Filter accordion groups */
.jb-filter-list {
  margin-bottom: 20px;
}

.jb-filter-group {
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--bg-white, #fff);
}
.jb-filter-group:first-child { border-top: 1px solid var(--border-light); }

.jb-filter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
  font-size: 0.93rem;
  color: var(--text-primary);
}
.jb-filter-label:hover,
.jb-filter-group.open .jb-filter-label { color: var(--accent-primary); }

.jb-filter-label .jb-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.jb-filter-group.open .jb-chevron { transform: rotate(180deg); }

.jb-filter-content {
  display: none;
  padding: 0;
}
.jb-filter-group.open .jb-filter-content { display: block; }

/* Hide the redundant "Any" btn — the label row is the trigger now */
.jb-filter-content .ms-root > .form-select {
  display: none !important;
}

/* Allow the dropdown panel to overflow the sidebar */
.jb-sidebar-left { overflow: visible; }
.jb-filter-content .ms-root { position: static; }
.jb-filter-content .ms-menu {
  width: 100%;
  left: 0;
  right: 0;
}

/* Checkbox inside filter content */
.jb-favs-row {
  padding: 4px 0 6px;
}
.jb-favs-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Sort list */
.jb-sort-section {
  padding-top: 16px;
}

.jb-sort-list {
  margin-top: 0;
}

.jb-sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.93rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
}
.jb-sort-item:first-child { border-top: 1px solid var(--border-light); }
.jb-sort-item:hover { color: var(--accent-primary); }
.jb-sort-item.active { font-weight: 600; color: var(--accent-primary); }
.jb-sort-item .jb-sort-check {
  font-size: 0.8rem;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.jb-sort-item.active .jb-sort-check { opacity: 1; }


/* ================================================================
   MAIN COLUMN – JOB LISTINGS
   ================================================================ */
.jb-main {}

.jb-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.jb-result-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.jb-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.jb-active-filter-chip {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jb-active-filter-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.jb-active-filter-chip:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.jb-active-filter-text {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px 0 11px;
  background: var(--accent-primary);
  color: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  max-width: min(100%, 24rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jb-active-filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0 6px;
  background: var(--);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.jb-active-filter-remove .bi {
  font-size: 0.82rem;
  line-height: 1;
}

@media (max-width: 767px) {
  .jb-active-filters {
    gap: 6px 8px;
  }

  .jb-active-filter-text {
    min-height: 28px;
    padding: 0 8px 0 9px;
    font-size: 0.78rem;
  }

  .jb-active-filter-remove {
    min-width: 24px;
    padding: 0 5px;
  }
}

.jb-clear-btn {
  font-size: 0.8rem;
  color: var(--accent-danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.jb-clear-btn:hover { background: rgba(217,83,79,.08); }

/* Job cards list */
.jb-job-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual job row */
.jb-job-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.jb-job-row:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.jb-job-row:hover .jb-job-logo {
  background: var(--bg-card-hover);
}

.jb-job-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-card);
  transition: background 0.2s ease;
}

.jb-job-center {
  flex: 1;
  min-width: 0;
}

.jb-job-company {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jb-job-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jb-job-deadline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Favorite button */
.jb-fav-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--favorite-inactive);
  transition: color 0.2s ease, transform 0.15s ease;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.jb-fav-btn:hover { transform: scale(1.2); color: var(--text-primary); }
.jb-fav-btn.active { color: var(--favorite-active); }
.jb-fav-btn .fav-icon {
  pointer-events: none;
  font-size: 1.4rem;
  color: inherit;
  transition: color 0.2s ease, font-variation-settings 0.2s ease;
}
.jb-fav-btn .fav-icon.active {
  color: var(--favorite-active);
  font-variation-settings: 'BORDER' 1;
}

/* Last-chance ribbon */
.jb-job-row .ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  overflow: hidden;
  pointer-events: none;
}
.jb-job-row .ribbon span {
  position: absolute;
  top: 14px;
  left: -22px;
  width: 90px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
  transform: rotate(-45deg);
  letter-spacing: .04em;
}

/* Empty state */
.jb-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
}
.jb-empty-state i { font-size: 2.5rem; display: block; margin-bottom: 12px; }

/* Load more / manage listing */
.jb-manage-bar {
  padding-bottom: 12px;
  margin-bottom: 12px;
  text-align: right;
}

.jb-manage-link {
  font-size: 0.82rem;
  color: var(--accent-primary);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.jb-manage-link:hover {
  background: var(--accent-primary);
  color: #fff;
}


/* ================================================================
   RIGHT SIDEBAR – PROMOTED JOBS
   ================================================================ */
.jb-sidebar-right {
  position: sticky;
  top: 24px;
}

.jb-promoted-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.jb-promoted-heading i { color: var(--favorite-active); font-size: 0.75rem; }

.jb-promoted-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.jb-promoted-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.jb-promoted-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.jb-promoted-img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #f5f6f7;
  display: block;
  padding: 12px;
}

.jb-promoted-body {
  padding: 12px 14px;
}

.jb-promoted-company {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.jb-promoted-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.jb-promoted-deadline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.jb-promoted-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   MOBILE FILTER TOGGLE
   ================================================================ */
.jb-filter-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
  align-items: center;
  gap: 6px;
}
.jb-filter-toggle-btn:hover { background: var(--bg-card-hover); }

@media (max-width: 1023px) {
  .jb-filter-toggle-btn { display: inline-flex; }
  .jb-sidebar-left { position: static; }
  .jb-sidebar-right { position: static; }
}
