/* Job details modal */
.job-details-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}
.job-details-content {
  background: #fff;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.35);
}
.job-details-close {
  float: right;
  background: transparent;
  border: 1px solid #ddd;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.job-details-content h2 {
  margin-top: 6px;
  margin-bottom: 6px;
}
.job-details-company {
  color: #374151;
  margin-bottom: 10px;
  font-weight: 600;
}
.job-details-meta {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px 0;
  color: #374151;
}
.job-details-meta li {
  margin-bottom: 6px;
}
.job-details-description {
  white-space: pre-wrap;
  background: #fafafa;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.job-details-apply {
  display: inline-block;
  margin: 8px 0;
  color: #0b61ff;
}
.job-details-json {
  background: #111;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  overflow: auto;
  max-height: 240px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  background: #f5f6f8;
  color: #111827;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #ececec;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: #1550ff;
  color: #fff;
  border-radius: 10px;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.brand-title {
  font-weight: 700;
  font-size: 20px;
}

.tagline {
  color: #6b7280;
  font-size: 15px;
}

.hero {
  padding: 28px 0 64px;
}

.search-card {
  background: #fff;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 2px 0 rgba(16, 24, 40, 0.03), 0 6px 18px rgba(16, 24, 40, 0.06);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 14px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.input-with-icon .input-icon svg {
  width: 18px;
  height: 18px;
  stroke: #9ca3af;
}

.input-with-icon input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  border-radius: 10px;
  border: 1px solid #e6e6e8;
  background: #fff;
  font-size: 15px;
  color: #111827;
}

.input-with-icon input::placeholder {
  color: #9ca3af;
}

.actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: linear-gradient(180deg, #174cff, #0f4efc);
  color: #fff;
  flex: 1 1 auto;
  min-width: 200px;
}

.btn.secondary {
  background: transparent;
  border: 1px solid #e6e6e8;
  color: #111827;
  padding: 12px 18px;
}

/* Align the actions to the right on wide layouts */
@media (min-width: 880px) {
  .actions {
    justify-content: flex-start;
  }
  .actions .primary {
    flex: 1 1 auto;
  }
  .actions .secondary {
    margin-left: auto;
  }
}

/* Responsive: stack fields */
@media (max-width: 760px) {
  .container {
    padding: 16px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn.secondary {
    width: 100%;
  }
}

/* ===== Results / job list ===== */
.results {
  padding: 18px 0 80px;
}

.tabs ul {
  list-style: none;
  display: flex;
  gap: 28px;
  padding: 0 0 14px 0;
  border-bottom: 1px solid #ececec;
  align-items: center;
}

.tabs li {
  color: #6b7280;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: 0;
  color: #6b7280;
  font: inherit;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
}

.tab-btn:focus {
  outline: 2px solid rgba(21, 80, 255, 0.12);
}

.tab-btn.active {
  color: #111827;
  border-bottom: 3px solid #1550ff;
  padding-bottom: 6px;
}

/* Tab panels (only active panel shown) */
.tab-panel {
  display: none;
  padding-top: 12px;
}
.tab-panel.active {
  display: block;
}

/* Filters panel */
.filters-panel {
  display: none;
}
.filters-panel.open {
  display: block;
}
.filters-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.filter-group h4 {
  margin-bottom: 10px;
  color: #0f1724;
}
.filter-group label {
  display: block;
  margin: 0;
  color: #374151;
}
.salary-range .range-values {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  margin-bottom: 8px;
}
.range-inputs {
  display: flex;
  gap: 6px;
}
.range-inputs input[type="range"] {
  width: 100%;
}

.salary-range .salary-inputs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.salary-range .salary-input {
  flex: 1 1 0;
}
.salary-range .salary-input input[type="number"] {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6e6e8;
  background: #fff;
  font-size: 15px;
  color: #111827;
}
.filters-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Pagination controls — centered and polished */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding: 8px;
}
.pagination-controls .pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e6e6e8;
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}
.pagination-controls .page-info {
  color: #374151;
  font-size: 14px;
  padding: 6px 10px;
}
.pagination-controls .pagination .btn {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.pagination-controls .pagination .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .pagination-controls .pagination {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }
  .pagination-controls .page-info {
    order: 2;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.results-controls {
  display: flex;
  gap: 18px;
  margin: 18px 0 20px;
  align-items: center;
}

.search-in-results {
  flex: 1 1 auto;
  height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ececec;
  background: #fff;
  color: #111827;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-select {
  height: 40px;
  border-radius: 8px;
  border: 1px solid #e6e6e8;
  padding: 6px 10px;
  background: #fff;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.job-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.03);
}

.job-left {
  flex: 1 1 auto;
}
.job-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.job-title {
  font-size: 18px;
  color: #0f1724;
  margin-bottom: 6px;
}
.company {
  color: #6b7280;
  margin-bottom: 10px;
}

.job-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #6b7280;
  font-size: 14px;
}
.job-meta .meta-item {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.job-meta .meta-item svg {
  width: 16px;
  height: 16px;
  stroke: #9ca3af;
}

.tag-pill {
  background: #f3f4f6;
  color: #374151;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.timestamp {
  color: #9ca3af;
  font-size: 13px;
}
.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.view-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 820px) {
  .results-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .sort-wrap {
    justify-content: space-between;
  }
  .job-card {
    flex-direction: column;
    align-items: stretch;
  }
  .job-right {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }
}

.key-insights {
  margin-top: 22px;
  background: #ffffff;
  padding: 18px;
  border-radius: 12px;
}
.key-insights h4 {
  margin: 0 0 10px 0;
}
.key-insights ul {
  list-style: none;
  padding-left: 0;
  color: #475569;
}
.key-insights ul li {
  margin: 8px 0;
}

@media (max-width: 980px) {
  .skill-name {
    width: 160px;
  }
  .skill-meta {
    width: 110px;
  }
}

@media (max-width: 640px) {
  .skill-row {
    flex-direction: column;
    align-items: stretch;
  }
  .skill-name {
    width: auto;
    margin-bottom: 8px;
  }
  .skill-meta {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}
