/**
 * Foreto Job Offers - Network Jobs Display Styles
 * Dedykowane style dla shortcode'a foreto_all_job_offers
 */

/* Główny kontener */
.fjo-network-jobs-wrapper {
  margin: 0 auto;
  display: flex;
  gap: 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

/* Panel filtrów */
.fjo-filters-panel {
  flex: 0 0 320px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;

  border: 1px solid #e9ecef;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.fjo-filters-header {
  padding-bottom: 16px;
}

.fjo-filters-title {
  margin: 0;
  color: #212529;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Formularz filtrów */
.fjo-filters-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sekcje filtrów */
.fjo-filter-section {
  border-style: solid;
  border-width: 2px 0 0 0;
  border-color: #3ee522;
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
}

.fjo-filter-section:hover {
  border-color: #007bff;
}

.fjo-filter-section.fjo-active {
  border-color: #007bff;
}

.fjo-filter-section-header {
  padding: 16px 20px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fjo-filter-section-header:hover {
  background: #e9ecef;
}

.fjo-filter-section.fjo-active .fjo-filter-section-header {
  background: #007bff;
  color: white;
}

.fjo-filter-section-title {
  margin: 0;
  font-size: 1rem;
  line-height: 19px;
  font-weight: 600;
  color: #000000;
}

.fjo-filter-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  width: 20px;
  height: 20px;
  color: #000000;
}

.fjo-filter-section.fjo-active .fjo-filter-toggle-icon {
  color: white;
}

.fjo-filter-toggle-icon.fjo-rotated {
  transform: rotate(180deg);
}

.fjo-filter-section-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
}

.fjo-filter-section.fjo-active .fjo-filter-section-content {
  padding: 16px 20px;
  max-height: none;
  overflow: visible;
}

/* Checkboxy w filtrach */
.fjo-filter-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 4px;
}

.fjo-filter-checkbox-label:hover {
  background: #f8f9fa;
}

.fjo-filter-checkbox-label:last-child {
  margin-bottom: 0;
}

/* Custom checkboxy */
.filter-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.filter-checkbox-label {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 4px;
  padding-left: 35px;
}

.filter-checkbox-label:hover {
  background: #f8f9fa;
}

.filter-checkbox-label:last-child {
  margin-bottom: 0;
}

/* Custom checkbox */
.filter-checkbox-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #000000;
  border-radius: 0;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

/* Checkmark */
.filter-checkbox-label::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Checked state */
.filter-checkbox:checked + .checkbox-text {
  color: #007bff;
}

.filter-checkbox-label:has(.filter-checkbox:checked)::before {
  background-color: #007bff;
  border-color: #007bff;
}

.filter-checkbox-label:has(.filter-checkbox:checked)::after {
  opacity: 1;
}

/* Hover state */
.filter-checkbox-label:hover::before {
  background-color: #3ee522;
  border-color: #000000;
}
.filter-checkbox-label:hover .checkbox-text {
  color: #000000;
}
.filter-checkbox-label:has(.filter-checkbox:checked)::after {
  opacity: 1;
  border-color: #000000;
}

.fjo-checkbox-text {
  font-size: 1rem;
  line-height: 19px;
  color: #000000;
  font-weight: 500;
}

/* Przycisk filtrowania */
.fjo-filter-submit-btn {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04px;
  background: #3ee522;
  color: #000000;
  border-radius: 0;
  border: none;
  padding: 14px 24px;
  cursor: pointer;
}

.fjo-filter-submit-btn:hover {
  background: #ffffff;
}

/* Panel ofert */
.fjo-jobs-panel {
  flex: 1;
  min-width: 0;
}

.fjo-jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Karty ofert */
.fjo-job-card {
  background: #ffffff;
  border-radius: 0px;
  border: 0px solid #e9ecef;
  overflow: hidden;
}

.fjo-job-card.fjo-active {
  border-color: #007bff;
}

.fjo-job-card.fjo-active .fjo-job-card-header {
  background: #ffffff;
  color: #000000;
}

.fjo-job-card-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.fjo-job-card-header:hover {
  background: #ffffff;
  color: #000000;
}

.fjo-job-card.fjo-active .fjo-job-card-header:hover {
  background: #ffffff;
  color: #000000;
}

.fjo-job-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.fjo-job-title a {
  color: #000000;
  text-decoration: none;
}

.fjo-job-card.fjo-active .fjo-job-title a {
  color: white;
}

.fjo-job-title a:hover {
  color: #007bff;
}

.fjo-bottom-cta a {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 16px;
  letter-spacing: 0.06em;
  background: #51e938;
  color: #000000;
  padding: 15px 40px;
}
.fjo-bottom-cta a:not(.clipped-corner) {
  border-style: none;
}
.fjo-bottom-cta a .fjo-bottom-cta-icon {
  font-size: 26px;
}
.fjo-bottom-cta a .fjo-bottom-cta-icon svg {
  width: 26px;
}
.fjo-bottom-cta {
  margin: 48px 0 48px 0;
}
.fjo-bottom-cta a:hover {
  background: #ffffff;
  color: #000000;
}
.fjo-bottom-cta a:not(.clipped-corner):hover {
  border-style: none;
}

.fjo-bottom-message-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #000000;
  padding: 0;
  margin: 0;
}
.fjo-bottom-message-content {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 0;
  margin: 0;
}
.fjo-bottom-message {
  border-style: none;
  padding: 48px 0 0 0;
}

.fjo-job-location {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.8);
  margin-left: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fjo-job-card.fjo-active .fjo-job-location {
  color: rgba(0, 0, 0, 0.8);
}

.fjo-job-time-to-expiry {
  color: #000000;
  font-size: 12px;
  font-weight: 500;
  margin-left: 16px;
  background: rgba(63, 229, 34, 0.5);
  padding: 6px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  drop-shadow: 0 0 10px rgba(63, 229, 34, 0.8);
}
.fjo-job-toggle-icon {
  width: 20px;
  height: 20px;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  margin-left: 16px;
}

.fjo-job-card.fjo-active .fjo-job-toggle-icon {
  color: #000;
}

.fjo-job-toggle-icon.fjo-rotated {
  transform: rotate(180deg);
}

/* Zawartość karty */
.fjo-job-card-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
}

.fjo-job-card.fjo-active .fjo-job-card-content {
  padding: 24px;
  max-height: none;
}

/* Meta informacje */
.fjo-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
}

.fjo-job-date {
  background: #e3f2fd;
  color: #0d47a1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.fjo-job-salary {
  background: #e8f5e8;
  color: #155724;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.fjo-job-external-url {
  background: #e3f2fd;
  color: #0d47a1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.fjo-job-expiry {
  background: #fff3cd;
  color: #856404;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.fjo-job-external-url a {
  color: inherit;
  text-decoration: none;
}

.fjo-job-external-url a:hover {
  text-decoration: underline;
}

/* Instytuty */
.fjo-job-institutes {
  margin-bottom: 16px;
}

.fjo-institute-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-right: 8px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Wspólne style dla wszystkich sekcji z tytułem i treścią */
.fjo-job-salary-section,
.fjo-job-expiry-section,
.fjo-job-areas,
.fjo-job-cities,
.fjo-job-experience-levels,
.fjo-job-institutes,
.fjo-job-additionals,
.fjo-job-requirements,
.fjo-job-expected-results,
.fjo-job-responsibilities,
.fjo-job-benefits,
.fjo-job-description {
  margin-bottom: 16px;
}

.fjo-job-section-title {
  font-weight: 700;
  font-size: 14px;
  color: #212529;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fjo-job-section-content {
  font-size: 14px;
  line-height: 1.5;
  color: #495057;
}

/* Fragment treści */
.fjo-job-excerpt {
  margin: 16px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #495057;
}

/* Przyciski akcji */
.fjo-job-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
}

.fjo-job-details-btn,
.fjo-job-apply-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.fjo-job-details-btn {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #51e938;
  color: #000000;
  border-radius: 0;
}
.fjo-job-details-btn:not(.clipped-corner) {
  border-style: none;
}
.fjo-job-details-btn:hover {
  background: #ffffff;
}

.fjo-job-apply-btn {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #ffffff;
  color: #000000;
  border-radius: 0;
}
.fjo-job-apply-btn:not(.clipped-corner) {
  border-style: solid;
  border-width: 0 0 2px 0;
  border-color: #ffffff;
}
.fjo-job-apply-btn:hover {
  background: #ffffff;
}
.fjo-job-apply-btn:not(.clipped-corner):hover {
  border-style: solid;
  border-width: 0 0 2px 0;
  border-color: #000000;
}

/* Paginacja */
.fjo-pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.fjo-page-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #ffffff;
  color: #495057;
  text-decoration: none;
  font-weight: 500;
}

.fjo-page-link:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.fjo-page-link.fjo-active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* Komunikat o braku ofert */
.fjo-no-jobs {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 12px;

  border: 1px solid #e9ecef;
}

.fjo-no-jobs p {
  margin: 0;
  font-size: 16px;
  color: #6c757d;
  font-weight: 500;
}

/* Responsywność */
@media (max-width: 1024px) {
  .fjo-network-jobs-wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .fjo-filters-panel {
    flex: none;
    position: static;
  }
}

@media (max-width: 768px) {
  .fjo-network-jobs-wrapper {
    padding: 16px;
    gap: 20px;
  }

  .fjo-filters-panel {
    padding: 20px;
  }

  .fjo-job-card-header {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .fjo-job-time-to-expiry {
    margin-left: 0;
  }

  .fjo-job-toggle-icon {
    align-self: flex-end;
  }

  .fjo-job-title {
    font-size: 16px;
  }

  .fjo-job-location {
    margin-left: 0;
  }

  .fjo-job-card-content {
    padding: 20px;
  }

  .fjo-job-meta {
    flex-direction: column;
    gap: 8px;
  }

  .fjo-job-actions {
    flex-direction: column;
  }

  .fjo-job-details-btn,
  .fjo-job-apply-btn {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .fjo-network-jobs-wrapper {
    padding: 12px;
  }

  .fjo-filters-panel,
  .fjo-job-card-content {
    padding: 16px;
  }

  .fjo-filter-section-header,
  .fjo-job-card-header {
    padding: 12px 16px;
  }

  .fjo-filters-title {
    font-size: 18px;
  }

  .fjo-job-title {
    font-size: 15px;
  }
}

/* Loading state */
.fjo-jobs-grid.fjo-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Dostosowania dla różnych motywów */
.wp-content .fjo-network-jobs-wrapper {
  font-family: inherit;
}

/* --- Bottom CTA clipped-corner styles --- */
.fjo-bottom-cta a.clipped-corner,
.fjo-filter-submit-btn.clipped-corner,
a.fjo-job-details-btn.clipped-corner,
a.fjo-job-apply-btn.clipped-corner {
  position: relative;
  z-index: 2;
  border: unset;
  /* Configurable CSS variables; can be overridden in Elementor custom CSS */
  --fjo-cta-corner: 1em;
  --fjo-cta-notch: 0.5em;
  --fjo-cta-border: 2px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fjo-cta-corner)),
    calc(100% - var(--fjo-cta-notch)) calc(100% - var(--fjo-cta-notch)),
    calc(100% - var(--fjo-cta-corner)) 100%,
    0 100%
  );
}

.fjo-bottom-cta a.clipped-corner:hover::before,
.fjo-filter-submit-btn.clipped-corner:hover::before,
a.fjo-job-details-btn.clipped-corner:hover::before,
a.fjo-job-apply-btn.clipped-corner:hover::before {
  border: unset;
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--celuk-primary, #3ee622);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 1em),
    calc(100% - 0.5em) calc(100% - 0.5em),
    calc(100% - 1em) 100%,
    0 100%,
    0 0,
    2px 2px,
    2px calc(100% - 2px),
    calc(100% - 1em - 1px) calc(100% - 2px),
    calc(100% - 0.5em - 2px) calc(100% - 0.5em - 1px),
    calc(100% - 2px) calc(100% - 1em - 1px),
    calc(100% - 2px) 2px,
    2px 2px
  );
}
