/* ═══════════════════════════════════════════════
   PHS Jobs Board — styles (forms palette)
   Depends on: forms.css (hire-form__*, phs-popup, phs-form-error, btn-new)
   ═══════════════════════════════════════════════ */

/* ── Layout: sidebar + main ── */
.phs-jobs__layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.phs-jobs__sidebar {
  flex: 0 0 210px;
  width: 210px;
}

.phs-jobs__main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1000px) {
  .phs-jobs__layout       { flex-direction: column; }
  .phs-jobs__sidebar      { width: 100%; flex: none; }
}

/* ── Sidebar filter sections ── */
.phs-jobs__filter-section {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.phs-jobs__filter-heading {
  font-family: Tahoma, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2d3142;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #d0d6de;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.phs-jobs__filter-heading::after {
  content: '\25B2';
  font-size: 0.65rem;
  color: #9aa5b4;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.phs-jobs__filter-section--collapsed .phs-jobs__filter-heading::after {
  transform: rotate(180deg);
}

.phs-jobs__filter-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 400px;
  opacity: 1;
}

.phs-jobs__filter-section--collapsed .phs-jobs__filter-body {
  max-height: 0;
  opacity: 0;
}

.phs-jobs__filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.phs-jobs__filter-item {
  margin-bottom: 1px;
}

.phs-jobs__filter-item label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 5px;
  font-family: Tahoma, sans-serif;
  font-size: 0.95rem;
  color: #1f1f1f;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
}

.phs-jobs__filter-item label:hover {
  background: #eef1f5;
}

.phs-jobs__filter-item input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #4f5d75;
}

.phs-jobs__filter-name {
  flex: 1;
  line-height: 1.3;
}

.phs-jobs__filter-count {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: #4f5d75;
  background: #e4e8ed;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}

.phs-jobs__filter-item--zero {
  opacity: 0.35;
}

/* ── Location inputs inside sidebar ── */
.phs-jobs__filter-section .phs-jobs__location-inputs {
  flex-direction: column;
  flex-wrap: wrap;
}

.phs-jobs__filter-section .phs-jobs__postcode-input,
.phs-jobs__filter-section .phs-jobs__location-apply-btn,
.phs-jobs__filter-section .phs-jobs__location-clear-btn {
  width: 100%;
  box-sizing: border-box;
}

.phs-jobs__filter-section .phs-jobs__distance-wrap {
  max-width: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.phs-jobs__filter-section .phs-jobs__distance-slider {
  width: 100%;
}

.phs-jobs__location-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.phs-jobs__location-inputs--disabled {
  opacity: 0.4;
  pointer-events: none;
}

.phs-jobs__relocate-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: Tahoma, sans-serif;
  font-size: 0.95rem;
  color: #1f1f1f;
  cursor: pointer;
  user-select: none;
}

.phs-jobs__relocate-label input[type="checkbox"] {
  margin: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.phs-jobs__postcode-input {
  width: 160px;
  min-width: 0;
  height: 36px;
}

.phs-jobs__location-apply-btn {
  white-space: nowrap;
  min-height: 36px;
  padding: 0 20px;
  font-size: 0.85rem;
  font-family: Tahoma, sans-serif;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.phs-jobs__location-apply-btn:hover {
  opacity: 0.85;
}

.phs-jobs__location-clear-btn {
  white-space: nowrap;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-family: Tahoma, sans-serif;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

.phs-jobs__location-clear-btn:hover {
  background: #f0f0f0;
}

.phs-jobs__distance-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f0f4f8;
  border-radius: 6px;
  max-width: 420px;
}

.phs-jobs__distance-label {
  font-family: Tahoma, sans-serif;
  font-size: 0.875rem;
  color: #4f5d75;
  white-space: nowrap;
  min-width: 110px;
}

.phs-jobs__distance-slider {
  flex: 1;
  accent-color: #4f5d75;
  cursor: pointer;
  height: 4px;
}


/* ── Table ── */
.phs-jobs__table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.phs-jobs__table {
  width: 100%;
  border-collapse: collapse;
  font-family: Tahoma, sans-serif;
  font-size: 17px;
  color: #1f1f1f;
}

.phs-jobs__td-title {
  font-size: 17px;
  min-width: 200px;
  max-width: 340px;
  font-weight: 600;
}

.phs-jobs__th {
  text-align: left;
  padding: 9px 12px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f5d75;
  border: 1px solid #c8cdd4;
  background: #f8f9fa;
  white-space: nowrap;
}
.phs-jobs__th:last-child {
  text-align: center;
}
.phs-jobs__table tbody tr {
  transition: background 0.12s;
}

.phs-jobs__table tbody tr:hover {
  background: #f8f9fa;
}

.phs-jobs__table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
  border: 1px solid #d8dde4;
}

.phs-jobs__loading {
  text-align: center;
  padding: 2rem 1rem !important;
  color: #6c757d;
  font-size: 1rem;
}

.phs-jobs__dots::after {
  content: '.';
  animation: phsDots 1.2s steps(3, end) infinite;
}

@keyframes phsDots {
  0%   { content: '.';   }
  33%  { content: '..';  }
  66%  { content: '...'; }
  100% { content: '.';   }
}

.phs-jobs__td-keyreq {
  min-width: 220px;
}

.phs-jobs__req-item {
  display: inline-block;
  margin: 2px 6px 2px 0;
  font-size: 0.8rem;
  background: #f0f4f8;
  border: 1px solid #d0d5dc;
  border-radius: 3px;
  padding: 2px 7px;
  white-space: nowrap;
}

.phs-jobs__req-label {
  font-weight: 700;
  color: #4f5d75;
}

.phs-jobs__req-recruiter {
  display: inline-block;
  margin: 6px 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 3px;
  background: #1a3d5c;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid #122b42;
  transition: background 0.15s;
}

.phs-jobs__req-recruiter:hover {
  background: #122b42;
  color: #fff;
}

.phs-jobs__td-apply {
  white-space: nowrap;
  vertical-align: middle;
}

.phs-jobs__action-btn {
  display: block;
  width: 100%;
  padding: 5px 10px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.18s, box-shadow 0.18s;
}

.phs-jobs__action-btn:last-child {
  margin-bottom: 0;
}

.phs-jobs__action-btn--view,
.phs-jobs__action-btn--download,
.phs-jobs__action-btn--apply {
  background: #f0f4f8;
  border: 1px solid #c8cdd4;
  color: #4f5d75;
  text-align: center;
}

.phs-jobs__action-btn--view:hover:not(:disabled),
.phs-jobs__action-btn--download:hover:not(:disabled),
.phs-jobs__action-btn--apply:hover:not(:disabled) {
  background: #e2e8ef;
}

.phs-jobs__action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  display: none;
}

.phs-jobs__action-btn--call {
  display: none;
  text-align: center;
  text-decoration: none;
  background: #1a7a3c;
  border: 1px solid #145e2e;
  color: #fff;
}

.phs-jobs__action-btn--call:hover {
  background: #145e2e;
  color: #fff;
}

@media (max-width: 700px) {
  .phs-jobs__action-btn--call {
    display: block;
  }
}

/* ── Pagination ── */
.phs-jobs__pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}

.phs-jobs__page-btn {
  min-width: 34px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-family: Tahoma, sans-serif;
  font-weight: 600;
  color: #4f5d75;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.phs-jobs__page-btn:hover:not(:disabled) {
  background: #f0f4f8;
  border-color: #888;
  color: #2d3142;
}

.phs-jobs__page-btn--active {
  background: #2d3142;
  border-color: #2d3142;
  color: #fff;
  cursor: default;
}

.phs-jobs__page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Mini board variant ── */
.phs-jobs-module--mini {
  background: rgba(243, 243, 243, 0.7);
  padding: 16px;
  margin-bottom: 20px;
}

.phs-jobs--mini .phs-jobs__layout {
  flex-direction: column;
  gap: 16px;
}

.phs-jobs--mini .phs-jobs__sidebar,
.phs-jobs--mini .phs-jobs__main {
  width: 100%;
  flex: none;
}

.phs-jobs--mini .phs-jobs__filter-section {
  margin-bottom: 10px;
}

.phs-jobs-mini__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phs-jobs-mini__card,
.phs-jobs-mini__loading,
.phs-jobs-mini__empty {
  background: #fff;
  border: 1px solid #d8dde4;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.phs-jobs-mini__loading,
.phs-jobs-mini__empty {
  padding: 18px 14px;
  text-align: center;
  color: #6c757d;
  font-family: Tahoma, sans-serif;
  font-size: 0.95rem;
}

.phs-jobs-mini__title {
  padding: 12px 14px;
  background: #f0f4f8;
  color: #2d3142;
  font-family: Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.phs-jobs-mini__actions {
  padding: 12px 14px 14px;
}

.phs-jobs-mini__view-btn {
  display: block;
  width: 100%;
  margin-bottom: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  text-align: center;
}

.phs-jobs-mini__view-btn:disabled {
  display: block;
}

.phs-jobs--mini .phs-jobs__pagination {
  margin-top: 12px;
}

@media (max-width: 660px) {
  .phs-jobs-module--mini {
    padding: 14px;
  }

  .phs-jobs-mini__title {
    font-size: 0.95rem;
  }

  .phs-jobs-mini__actions {
    padding: 10px 12px 12px;
  }
}

/* ── View Job Description popup ── */
.phs-popup--view {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed !important;
  inset: 0;
  z-index: 99999;
}

.phs-popup--view[hidden] {
  display: none !important;
}

.phs-popup--view .phs-popup__overlay {
  position: fixed !important;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.phs-popup__box--view {
  position: relative;
  z-index: 1;
  max-width: 700px;
  width: 94%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px 36px 28px;
  background: rgba(243, 243, 243, 0.97);
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}

.phs-view-popup__x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #4f5d75;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.phs-view-popup__x:hover {
  background: #f0f0f0;
}

.phs-view__job-title {
  font-family: Tahoma, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2d3142;
  padding-right: 32px;
  margin-bottom: 12px;
}

.phs-view__desc {
  font-family: Tahoma, sans-serif;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.6;
}

.phs-view__desc p  { margin: 0 0 0.7em; }
.phs-view__desc ul { margin: 0 0 0.7em; padding-left: 1.4em; }

/* ── Apply popup overrides ── */
.phs-popup--apply {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed !important;
  inset: 0;
  z-index: 99999;
}

.phs-popup--apply[hidden] {
  display: none !important;
}

.phs-popup--apply .phs-popup__overlay {
  position: fixed !important;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.phs-popup__box--apply {
  text-align: left;
  max-width: 660px;
  width: 94%;
  padding: 28px 32px 24px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  background: rgba(243, 243, 243, 0.97) !important;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}

.phs-apply-popup__x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #4f5d75;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.phs-apply-popup__x:hover {
  background: #f0f0f0;
}

/* ── Inputs / labels inside popup ── */
.phs-popup__box--apply * {
  box-sizing: border-box;
}

.phs-popup__box--apply .hire-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.phs-popup__box--apply .hire-form__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3142;
  margin-bottom: 0;
}

.phs-popup__box--apply .hire-form__input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  font-family: Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #1f1f1f;
  background: #fff;
  border-radius: 0;
  -webkit-appearance: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), inset 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
  display: block;
}

.phs-popup__box--apply .hire-form__input:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 3px rgba(0,0,0,.07), inset 0 1px 2px rgba(0,0,0,.04);
}

.phs-popup__box--apply .hire-form__input[type="file"] {
  padding: 5px 8px;
  box-shadow: none;
  cursor: pointer;
}

.phs-popup__box--apply .hire-form__row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

@media (min-width: 500px) {
  .phs-popup__box--apply .hire-form__row {
    flex-direction: row;
    align-items: flex-start;
  }
  .phs-popup__box--apply .hire-form__row .hire-form__field {
    flex: 1;
    min-width: 0;
  }
}

.phs-apply__job-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  margin-bottom: 4px;
}

.phs-apply__job-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2d3142;
  margin-bottom: 12px;
}

.phs-apply__desc-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e6ea;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #f8f9fa;
}

.phs-apply__desc {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #3a3a3a;
}

.phs-apply__desc p {
  margin: 0 0 0.5em;
}
.phs-apply__desc ul,
.phs-apply__desc ol {
  margin: 0 0 0.5em;
  padding-left: 1.4em;
}

.phs-apply__sep {
  border: none;
  border-top: 1px solid #e2e6ea;
  margin: 16px 0;
}

.phs-apply__intro {
  font-size: 0.875rem;
  color: #4f5d75;
  margin: 0 0 14px;
  line-height: 1.5;
}

.phs-apply__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.phs-apply__btn {
  min-height: 38px;
  padding: 0 28px;
  font-size: 0.875rem;
  font-family: Tahoma, sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition:
    opacity 0.2s,
    box-shadow 0.2s;
}

.phs-apply__btn:hover {
  opacity: 0.88;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.phs-apply__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Responsive: card layout ≤ 660px ── */
@media (max-width: 660px) {

  /* Hide column headers — labels come from card structure */
  .phs-jobs__table thead {
    display: none;
  }

  /* Table → flat block flow */
  .phs-jobs__table,
  .phs-jobs__table tbody,
  .phs-jobs__table tbody tr {
    display: block;
    width: 100%;
  }

  /* Each row = card */
  .phs-jobs__table tbody tr {
    background: #fff;
    border: 1px solid #d8dde4;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .phs-jobs__table tbody tr:hover {
    background: #fff;
  }

  /* All tds block, separator between sections */
  .phs-jobs__table tbody td {
    display: block;
    border: none;
    border-bottom: 1px solid #eef0f3;
    padding: 12px 14px;
    min-width: 0;
    max-width: none;
  }

  .phs-jobs__table tbody td:last-child {
    border-bottom: none;
  }

  /* Position — card header */
  .phs-jobs__td-title {
    font-size: 1rem;
    font-weight: 700;
    background: #f0f4f8;
    min-width: 0;
    max-width: none;
  }

  /* Key Requirements — card body */
  .phs-jobs__td-keyreq {
    min-width: 0;
  }

  /* Applications — card footer: buttons full-width column */
  .phs-jobs__td-apply {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px 14px;
    white-space: normal;
    vertical-align: initial;
  }

  .phs-jobs__td-apply .phs-jobs__action-btn {
    display: block;
    width: 100%;
    margin-bottom: 0;
    text-align: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  /* Hide disabled buttons in card view */
  .phs-jobs__td-apply .phs-jobs__action-btn:disabled {
    display: none;
  }

  /* Loading / empty state row */
  .phs-jobs__table tbody tr:has(.phs-jobs__loading) {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .phs-popup__box--apply {
    padding: 20px 16px 18px;
  }
}
