/*
 * PCRecruiter Extensions - Job Board Styles
 * Structural/functional only — no site-specific colors or branding.
 * Site styling belongs in the PCR config XML (custom_script_css) or the WP theme.
 */

/* ========================================
   1. SEARCH & FILTERS (BASE)
   ======================================== */

#pcrbox .pcr-sidebar ul.multiselect,
#pcrbox .pcr-sidebar ul.list-group {
  list-style: none;
  padding: 0;
  margin: 0;
}

#pcrbox .pcr-sidebar ul.multiselect li,
#pcrbox .pcr-sidebar ul.list-group li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Filter group header — fallback for non-collapsible lists */
#pcrbox .pcr-sidebar ul.multiselect li.disabled {
  display: block;
  padding: 12px 0 8px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
}

#pcrbox .pcr-sidebar ul.multiselect li.disabled h5 {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

/* Collapsible filter group — native <details>/<summary> */
.pcr-sidebar details.pcr-filter-group {
  border: none;
  margin: 0 0 4px;
  padding: 0;
}

.pcr-sidebar summary.pcr-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  list-style: none;
}

.pcr-sidebar summary.pcr-filter-header::-webkit-details-marker {
  display: none;
}

/* Collapse arrow — down when open, right when collapsed */
.pcr-sidebar summary.pcr-filter-header::after {
  content: '\25BE';
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
  margin-left: 8px;
}

.pcr-sidebar details.pcr-filter-group:not([open]) summary.pcr-filter-header::after {
  content: '\25B8';
}

/* Checkbox items */
#pcrbox .pcr-sidebar li.multiselect-item {
  display: flex;
  align-items: center;
  padding: 5px 0 5px 2px;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
}

/* Hidden by filter-by-typing */
.pcr-sidebar li.multiselect-item.pcr-filter-hidden {
  display: none !important;
}

/* Hidden by View-all truncation */
.pcr-sidebar li.multiselect-item.pcr-truncated-hidden {
  display: none !important;
}

.pcr-sidebar .multiselect-check-icon {
  display: none;
}

#pcrbox .pcr-sidebar input.multiselect-check-box {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

#pcrbox .pcr-sidebar label.multi-select-label {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1.4;
}

/* Filter group wrapper spacing */
.pcr-sidebar > div[data-collapse] {
  padding-bottom: 4px;
  margin-bottom: 4px;
}

#pcrbox .pcr-sidebar > div[data-collapse]:first-child ul.multiselect li.disabled {
  padding-top: 0;
}

/* ========================================
   2. TWO-COLUMN SIDEBAR LAYOUT
   ======================================== */

.pcr-search-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.pcr-sidebar {
  flex: 0 0 230px;
  min-width: 200px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 16px;
}

.pcr-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .pcr-search-layout {
    flex-direction: column;
  }
  .pcr-sidebar {
    flex: none;
    width: 100%;
    position: static;
    max-height: none;
    padding-right: 0;
  }
}

/* ========================================
   3. COLLAPSIBLE FILTER SECTIONS (non-sidebar)
   ======================================== */

.pcr-filter-group {
  border: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.pcr-filter-group > .list-group {
  margin-top: 0;
}

/* ========================================
   4. FILTER-BY-TYPING INPUT
   ======================================== */

#pcrbox .pcr-sidebar .pcr-filter-search-item,
#pcrbox .pcr-sidebar li.pcr-filter-search-item {
  padding: 6px 0 6px 2px;
  display: block;
}

.pcr-sidebar .pcr-filter-search {
  width: 100%;
  padding: 6px 8px 6px 28px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background: #f8f8f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 8px center no-repeat;
  outline: none;
}

.pcr-sidebar .pcr-filter-search::placeholder {
  color: #999;
}

.pcr-sidebar .pcr-filter-search:focus {
  border-color: #999;
  background-color: #fff;
}

/* ========================================
   5. VIEW ALL / SHOW LESS TOGGLE
   ======================================== */

.pcr-sidebar .pcr-view-all {
  display: block;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 6px 0 2px 2px;
  font-weight: 500;
}

.pcr-sidebar .pcr-view-all:hover {
  text-decoration: underline;
}

/* ========================================
   6. ACTIVE FILTER PILLS
   ======================================== */

.pcr-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.pcr-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 16px;
  font-size: 13px;
  background: #f5f5f5;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pcr-filter-pill:hover {
  background: #e8e8e8;
}

.pcr-filter-pill .pcr-pill-remove {
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.6;
}

.pcr-filter-pill:hover .pcr-pill-remove {
  opacity: 1;
}

.pcr-filter-clear {
  font-size: 13px;
  color: #666;
  cursor: pointer;
  text-decoration: underline;
  border: none;
  background: none;
  padding: 4px 6px;
}

.pcr-filter-clear:hover {
  color: #333;
}

/* ========================================
   7. AJAX LOADING STATE
   ======================================== */

.pcr-loading {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ========================================
   8. PAGINATION
   ======================================== */

.pcr-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.pagination-info {
  text-align: center;
  color: #666;
  font-size: 14px;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pcr-page-numbers {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.btn-pagination {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-pagination:hover {
  background: #f5f5f5;
  border-color: #999;
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9f9f9;
}

.pcr-prev-btn,
.pcr-next-btn {
  font-weight: 600;
  background: #f8f9fa;
  border-color: #adb5bd;
}

.pcr-prev-btn:hover,
.pcr-next-btn:hover {
  background: #e9ecef;
  border-color: #6c757d;
}

.pcr-page-btn {
  min-width: 40px;
  text-align: center;
}

.pcr-page-btn.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
  font-weight: 600;
  cursor: default;
}

.pcr-page-btn.active:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.pagination-ellipsis {
  user-select: none;
  color: #999;
  padding: 0 4px;
}

@media (max-width: 768px) {
  .pcr-page-numbers {
    display: none !important;
  }
  .pagination-controls {
    gap: 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .pcr-page-numbers .pcr-page-btn:not(.active) {
    display: none;
  }
  .pcr-page-numbers .pcr-page-btn.active {
    display: inline-flex;
  }
  .pcr-page-numbers .pagination-ellipsis {
    display: none;
  }
}

/* ========================================
   9. EXPIRED JOB BADGES & LISTINGS
   ======================================== */

.pcr-expired-job-badge {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border-left: 5px solid #ffc107;
  border-radius: 8px;
  padding: 20px 25px;
  margin: 0 0 30px 0;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #000;
}

.pcr-badge-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.pcr-badge-content {
  flex: 1;
}

.pcr-badge-content strong {
  display: block;
  font-size: 18px;
  color: #856404;
  margin-bottom: 8px;
  font-weight: 600;
}

.pcr-badge-content p {
  margin: 0;
  color: #856404;
  font-size: 14px;
  line-height: 1.6;
}

.wpsearchresults .pcr-expired-job,
.jobflexitem.pcr-expired-job {
  opacity: 0.7;
  position: relative;
}

.wpsearchresults .pcr-expired-job:hover,
.jobflexitem.pcr-expired-job:hover {
  opacity: 0.85;
}

.wpsearchresults .pcr-expired-job {
  border: 2px solid #ffc107;
}

.pcr-job-link.pcr-expired-job {
  background: rgba(255, 243, 205, 0.2);
}

tr.pcr-expired-job {
  background-color: rgba(255, 243, 205, 0.3) !important;
}

tr.pcr-expired-job td {
  color: #856404;
}

/* ========================================
   10. LOGOS & SOCIAL SHARING
   ======================================== */

.positionlogo,
.companylogo {
  display: block;
  height: 50px;
  width: 50px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#pcrbox .social-widget {
  display: flex;
  gap: 5px;
  max-width: 265px;
}

#pcrbox .social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  padding: 0;
  margin: 0;
  line-height: 1;
}

#pcrbox .social-icon:hover {
  background-color: #ddd;
}

#pcrbox .social-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ========================================
   11. ATTRIBUTION
   ======================================== */

.pcr-attribution {
  text-align: center;
  font-size: 13px;
  color: #777;
  margin-top: 2.5em;
  padding-top: 1em;
}

.pcr-attribution a.pcr-link {
  color: inherit;
  text-decoration: underline;
}

.pcr-attribution a.pcr-link:hover {
  color: #333;
}

/* ========================================
   12. SORT BAR SELECT
   ======================================== */

.pcr-sort-select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  max-width: 100%;
}

.pcr-sort-select:focus {
  border-color: #999;
  outline: none;
}

/* ========================================
   13. ACCESSIBILITY
   ======================================== */

.pcr-expired-job .sr-only,
.pcr-expired-job .screen-reader-text {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pcr-job-link.pcr-expired-job:focus {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
}

/* ========================================
   13. PRINT STYLES
   ======================================== */

@media print {
  .pcr-expired-job-badge {
    border: 2px solid #000;
    background: #fff;
    page-break-inside: avoid;
  }

  .pcr-expired-job::after {
    color: #000;
    border: 1px solid #000;
  }
}

/* ========================================
   14. DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
  .pcr-expired-job-badge {
    background: linear-gradient(135deg, #3d3519 0%, #4d4520 100%);
    border-left-color: #ffc107;
  }

  .pcr-badge-content strong,
  .pcr-badge-content p {
    color: #ffd54f;
  }

  .wpsearchresults .pcr-expired-job {
    opacity: 0.6;
  }
}

/* ==========================================================================
   Radius location autocomplete
   --------------------------------------------------------------------------
   Presentation used to be assigned inline by pcr-frontend.js, including a fixed
   160px panel height that left a tall empty box under a single result and could
   not be overridden from a stylesheet. The JS now only toggles display.

   Everything here is scoped through the panel's id rather than its class. The
   results are <button> elements, and themes routinely style bare buttons inside
   a search form — on one site #home_job_search button set colour:#fff and
   height:45px, which made the results white-on-white and 45px tall. An id in
   the selector outweighs that without needing !important, and still leaves a
   site free to override with its own id-scoped rule.
   ========================================================================== */

#radius-dropdown-panel.pcr-radius-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	max-height: 260px;
	overflow-x: hidden;
	overflow-y: auto;
	margin-top: 2px;
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	text-align: left;
}

#radius-dropdown-panel .pcr-radius-item {
	padding: 0;
	margin: 0;
}

#radius-dropdown-panel .radius-button {
	display: block;
	width: 100%;
	box-sizing: border-box;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 8px 12px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #222;
	font-size: 13px;
	font-weight: normal;
	line-height: 1.35;
	text-align: left;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
}

#radius-dropdown-panel .radius-button:hover,
#radius-dropdown-panel .radius-button:focus {
	background-color: #eef6fa;
	color: #222;
}

#radius-dropdown-panel .pcr-radius-empty,
#radius-dropdown-panel .pcr-radius-error {
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.35;
}

#radius-dropdown-panel .pcr-radius-error {
	color: #b32d2e;
}

/* Radius lookup spinner. Absolutely positioned inside the field's relative
   wrapper so showing it never reflows the search bar (as a plain inline span it
   wrapped to its own empty line below the full-width input, growing the bar by
   one line-height during every lookup). Also gives it an actual appearance —
   it previously had no styling at all, so "loading" showed nothing. */
.pcr-radius-spinner {
	position: absolute;
	top: 50%;
	right: 12px;
	width: 14px;
	height: 14px;
	margin-top: -7px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	pointer-events: none;
	animation: pcr-radius-spin 0.7s linear infinite;
}

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