/*
 * PCRecruiter Extensions - Job Board Styles
 *
 * Table of Contents:
 * 1. Search & Filters (base)
 * 2. Two-Column Sidebar Layout
 * 3. Collapsible Filter Sections
 * 4. Filter-by-Typing Input
 * 5. View All / Show Less Toggle
 * 6. Active Filter Pills
 * 7. AJAX Loading State
 * 8. Pagination
 * 9. Expired Job Badges & Listings
 * 10. Logos & Social Sharing
 * 11. Attribution
 * 12. Accessibility
 * 13. Print Styles
 * 14. Dark Mode
 */

/* ========================================
   1. SEARCH & FILTERS (BASE)
   ======================================== */

ul.multiselect {
  list-style: none;
  padding: 0;
}

ul.multiselect li.disabled {
  display: none;
}

/* ========================================
   2. TWO-COLUMN SIDEBAR LAYOUT
   ======================================== */

.pcr-search-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.pcr-sidebar {
  flex: 0 0 250px;
  min-width: 200px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.pcr-main {
  flex: 1;
  min-width: 0;
}

/* Right sidebar: no CSS needed — HTML source order places main first, sidebar second */

@media (max-width: 768px) {
  .pcr-search-layout {
    flex-direction: column;
  }
  .pcr-sidebar {
    flex: none;
    width: 100%;
    position: static;
    max-height: none;
  }
}

/* ========================================
   3. COLLAPSIBLE FILTER SECTIONS
   ======================================== */

.pcr-filter-group {
  border: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.pcr-filter-group > .list-group {
  margin-top: 0;
}

.pcr-filter-header {
  cursor: pointer;
  font-weight: 600;
  font-size: 1em;
  padding: 8px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pcr-filter-header::-webkit-details-marker {
  display: none;
}

/* Arrow: right-pointing when collapsed, rotates down when expanded */
.pcr-filter-header::after {
  content: '\25B8';
  font-size: 0.75em;
  transition: transform 0.2s ease;
}

.pcr-filter-group[open] .pcr-filter-header::after {
  transform: rotate(90deg);
}

/* ========================================
   4. FILTER-BY-TYPING INPUT
   ======================================== */

.pcr-filter-search-item {
  padding: 4px 8px;
}

.pcr-filter-search {
  width: 100%;
  padding: 4px 8px;
  font-size: 0.85em;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
}

/* ========================================
   5. VIEW ALL / SHOW LESS TOGGLE
   ======================================== */

.pcr-view-all {
  font-size: 0.85em;
  color: #666;
  cursor: pointer;
  text-decoration: underline;
}

.pcr-view-all:hover {
  color: #333;
}

.pcr-view-all:focus {
  outline: none;
}

/* ========================================
   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: 0.85em;
  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: 0.85em;
  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
   ======================================== */

/* Layout container */
.pcr-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

/* Result count info */
.pagination-info {
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* Button container */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Page numbers wrapper */
.pcr-page-numbers {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* All pagination buttons */
.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;
}

/* Previous/Next buttons */
.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;
}

/* Page number buttons */
.pcr-page-btn {
  min-width: 40px;
  text-align: center;
}

/* Active/current page */
.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;
}

/* Ellipsis */
.pagination-ellipsis {
  user-select: none;
  color: #999;
  padding: 0 4px;
}

/* Pagination responsive */
@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
   ======================================== */

/* Badge on single job page */
.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;
}

/* Expired jobs in listings */
.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;
}

/* Grid/card layouts */
.wpsearchresults .pcr-expired-job {
  border: 2px solid #ffc107;
}

/* List layouts */
.pcr-job-link.pcr-expired-job {
  background: rgba(255, 243, 205, 0.2);
}

/* Table/row layouts */
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. 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;
  }
}
