/* ==============================
   Jobs List Page — Modern Style
   ============================== */

.jobs-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
}

/* ----- Hero ----- */
.jobs-hero {
  position: relative;
  padding: 64px 20px;
  text-align: center;
  color: white;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.jobs-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-dark) 0%, #302b63 50%, #24243e 100%);
  z-index: 0;
}

.jobs-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(102, 126, 234, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 60%);
  z-index: 1;
}

.jobs-hero-content {
  position: relative;
  z-index: 2;
}

.jobs-hero-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.jobs-hero-content p {
  font-size: 1.1rem;
  opacity: 0.75;
  max-width: 450px;
  margin: 0 auto;
}

/* ----- Toolbar ----- */
.jobs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 0 24px 28px;
  padding: 20px 24px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  position: relative;
  z-index: 10;
  margin-top: -28px;
  flex-wrap: wrap;
}

.filter-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
}

.filter-group select,
.filter-group input[type="text"] {
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fafafa;
  min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Jobs autocomplete wrapper & dropdown */
.jobs-autocomplete-wrapper {
  position: relative;
}

.jobs-autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.jobs-autocomplete-dropdown .autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  color: #333;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.jobs-autocomplete-dropdown .autocomplete-item:hover {
  background: #f0f2ff;
  color: var(--brand-primary);
}

.jobs-autocomplete-dropdown .autocomplete-item.empty-result {
  color: #999;
  cursor: default;
}

.jobs-autocomplete-dropdown .autocomplete-loader {
  padding: 12px;
  text-align: center;
}

.jobs-autocomplete-dropdown .loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: jobs-spin 0.6s linear infinite;
  margin: 0 auto;
}

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

/* ----- Results Section ----- */
.jobs-results {
  padding: 0 24px 40px;
}

.jobs-results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.jobs-results-header h2 {
  font-size: 1.3rem;
  color: #222;
  font-weight: 700;
}

.j-count {
  font-weight: 400;
  color: #aaa;
  font-size: 0.95rem;
}

.j-filter-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: #eef0ff;
  padding: 4px 14px;
  border-radius: 20px;
}

/* ----- Empty State ----- */
.jobs-empty {
  text-align: center;
  padding: 72px 24px;
  background: white;
  border-radius: 16px;
  border: 2px dashed #e5e7eb;
  transition: border-color 0.3s;
}

.jobs-empty:hover {
  border-color: #c7d2fe;
}

.jobs-empty-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.jobs-empty h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 8px;
}

.jobs-empty p {
  color: #888;
  margin-bottom: 28px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Job Cards ----- */
.jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card {
  background: white;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0f0f0;
  transition: all 0.25s ease;
  overflow: hidden;
}

.job-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  border-color: #e0e3ff;
}

.job-card-body {
  padding: 22px 24px 14px;
}

.job-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.job-card-top h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #222;
  font-weight: 700;
}

.job-price {
  background: #dcfce7;
  color: #166534;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.job-desc {
  color: #888;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-tag {
  font-size: 0.8rem;
  color: #666;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 8px;
}

/* Card Footer */
.job-card-footer {
  padding: 10px 24px;
  border-top: 1px solid #f5f5f5;
  display: flex;
  justify-content: flex-end;
}

.job-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.job-link:hover {
  background: #f0f2ff;
  gap: 10px;
}

.job-link svg {
  transition: transform 0.2s;
}

.job-link:hover svg {
  transform: translateX(2px);
}

/* ----- Pagination ----- */
.jobs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.page-info {
  color: #888;
  font-size: 0.9rem;
}

/* ----- CTA ----- */
.jobs-cta {
  padding: 0 24px 56px;
}

.jobs-cta-card {
  background: var(--brand-gradient);
  border-radius: 20px;
  padding: 52px 40px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.jobs-cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.jobs-cta-card h2 {
  position: relative;
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.jobs-cta-card p {
  position: relative;
  opacity: 0.85;
  margin-bottom: 28px;
  font-size: 1rem;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .jobs-hero {
    padding: 48px 24px;
  }

  .jobs-hero-content h1 {
    font-size: 1.8rem;
  }

  .jobs-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-left: 16px;
    margin-right: 16px;
    padding: 16px;
  }

  .filter-form {
    flex-direction: column;
  }

  .filter-group select {
    min-width: 100%;
  }

  .jobs-results {
    padding-left: 16px;
    padding-right: 16px;
  }

  .jobs-cta {
    padding-left: 16px;
    padding-right: 16px;
  }

  .jobs-cta-card {
    padding: 40px 24px;
  }
}
