/* ===== Base Styles ===== */
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

/* ===== Search Bar - Redesigned ===== */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9eef2;
}

.search-bar input,
.search-bar select {
  flex: 1 1 auto;
  min-width: 160px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d9e6;
  background-color: #f9fbfd;
  font-size: 0.95rem;
  color: #1e293b;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.search-bar input:focus,
.search-bar select:focus {
  border-color: #0f172a;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.search-bar input::placeholder {
  color: #94a3b8;
  font-weight: 300;
}

.search-bar select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

.search-bar button {
  flex: 0 0 auto;
  padding: 0.75rem 1.8rem;
  border-radius: 0.75rem;
  border: none;
  background-color: #0f172a;
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.15);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.search-bar button:hover {
  background-color: #1e293b;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

.search-bar button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

/* Responsive adjustments for search bar */
@media (max-width: 640px) {
  .search-bar {
    padding: 1rem;
    gap: 0.6rem;
  }
  .search-bar input,
  .search-bar select {
    min-width: 120px;
    flex: 1 1 calc(50% - 0.6rem);
  }
  .search-bar button {
    flex: 1 1 100%;
    margin-top: 0.25rem;
    padding: 0.75rem;
  }
}

/* ===== Jobs Container ===== */
.jobs-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.page-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: #0f172a;
}

/* ===== Single‑Column Grid ===== */
.jobs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* ===== Job Card ===== */
.job-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e9eef2;
}

.job-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

/* ===== Card Header (Title + Compensation) ===== */
.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.job-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  flex: 1;
}

.job-compensation {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  background-color: #e9eef2;
  padding: 0.2rem 0.8rem;
  border-radius: 2rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* ===== Job Details ===== */
.job-company {
  font-size: 1.1rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.5rem;
}

.job-location {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.job-category {
  display: inline-block;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

/* Optional location icon */
.job-location::before {
  content: "📍";
  margin-right: 0.25rem;
  font-size: 0.9rem;
}

.job-description {
  font-size: 1rem;
  color: #475569;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ===== Action Buttons Container ===== */
.job-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ===== Base Button Styles (shared) ===== */
.job-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

/* ===== Primary Button (Apply) ===== */
.apply-btn {
  background-color: #0f172a;
  color: white;
}

.apply-btn:hover {
  background-color: #1e293b;
  transform: scale(1.02);
}

/* ===== Secondary Button (View Job) ===== */
.view-btn {
  background-color: transparent;
  color: #0f172a;
  border-color: #cbd5e1;
}

.view-btn:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  transform: scale(1.02);
}

/* Loading spinner */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #e9eef2;
  border-top: 5px solid #0f172a;
  border-radius: 50%;
  margin: 2rem auto;
  animation: spin 1s linear infinite;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.page-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 0.4rem;
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
}

.page-btn.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

.page-btn:hover {
  background: #f1f5f9;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 600px) {
  .jobs-container {
    padding: 0 1rem;
  }
  .job-card {
    padding: 1.25rem;
  }
  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .job-compensation {
    margin-left: 0;
    white-space: normal;
  }
}
