/* =====================================================
   Jobs Page Styles
   Following PMhelp design system
   ===================================================== */

/* ===================
   Jobs Listing Page
   =================== */

/* Fix: Prevent background pattern from blocking filter clicks */
.background-pattern,
.background_image {
  pointer-events: none;
}

/* Hero Section */
.jobs-hero {
  text-align: center;
  padding: 60px 24px 40px;
}

.jobs-hero .h1 {
  font-size: 48px;
  font-weight: 800;
  color: #211f54;
  margin-bottom: 16px;
  line-height: 1.1;
}

.jobs-hero .text-2 {
  font-size: 18px;
  color: #344054;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Filters Section */
.jobs-filters-section {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.jobs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  align-items: center;
}

.jobs-search-wrapper {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.jobs-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
  pointer-events: none;
}

.jobs-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-family: Satoshi, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #211f54;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.jobs-search-input::placeholder {
  color: #9ca3af;
}

.jobs-search-input:focus {
  outline: none;
  border-color: #742194;
  box-shadow: 0 0 0 3px rgba(116, 33, 148, 0.1);
}

.jobs-filter-select {
  padding: 12px 36px 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: Satoshi, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #211f54;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' 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") no-repeat right 12px center;
  background-size: 12px;
  appearance: none;
  cursor: pointer;
  min-width: 150px;
}

.jobs-filter-select:focus {
  outline: none;
  border-color: #742194;
}

.clear-filters-btn {
  padding: 12px 20px;
  background: #f4f4f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: Satoshi, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #636b75;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.clear-filters-btn:hover {
  background: #e5e7eb;
  color: #211f54;
}

/* Jobs Count */
.jobs-results-header {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jobs-count {
  font-size: 14px;
  color: #636b75;
  font-weight: 500;
}

/* Jobs Grid */
.jobs-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Job Card */
.job-card {
  display: block;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.job-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.job-company-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #f4f4f5;
  flex-shrink: 0;
}

.job-card-meta {
  flex: 1;
  min-width: 0;
}

.job-company-name {
  font-size: 14px;
  font-weight: 600;
  color: #211f54;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-posted-date {
  font-size: 12px;
  color: #636b75;
}

.job-card-body {
  flex: 1;
  margin-bottom: 16px;
}

.job-title {
  font-size: 18px;
  font-weight: 700;
  color: #211f54;
  margin: 0 0 10px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #636b75;
}

.job-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.job-card-footer {
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
}

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

.job-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.job-tag-location {
  background: #dcfce7;
  color: #166534;
}

.job-tag-type {
  background: #dbeafe;
  color: #1e40af;
}

.job-tag-seniority {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Load More Button */
/* Pagination */
.jobs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 0 24px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #ffffff;
  color: #211f54;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: Satoshi, -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #742194;
  color: #742194;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
}

.pagination-info {
  font-size: 14px;
  font-weight: 500;
  color: #636b75;
  min-width: 120px;
  text-align: center;
}

.pagination-info strong {
  color: #211f54;
}

/* Loading & Empty States */
.jobs-loading,
.jobs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  color: #636b75;
}

.jobs-loading .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f0f0f0;
  border-top-color: #742194;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.jobs-empty-icon {
  width: 64px;
  height: 64px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.jobs-empty-title {
  font-size: 20px;
  font-weight: 600;
  color: #211f54;
  margin-bottom: 8px;
}

.jobs-empty-text {
  font-size: 15px;
  color: #636b75;
  max-width: 400px;
}

/* ===================
   Job Detail Page
   =================== */

.job-detail-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
}

.job-detail-layout {
  display: flex;
  flex-direction: row;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Left Sidebar */
.job-sidebar {
  flex: 0 0 300px;
  max-width: 300px;
  position: sticky;
  top: 32px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.job-sidebar-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-sidebar-header {
  color: #742194;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

/* Company Info */
.job-company-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.job-company-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-detail-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #f4f4f5;
}

.job-detail-company-name {
  font-size: 18px;
  font-weight: 700;
  color: #211f54;
}

.job-company-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-company-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #636b75;
}

.job-company-meta-item svg {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

.company-website-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #742194;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 8px;
}

.company-website-link:hover {
  text-decoration: underline;
}

/* Apply Button */
.apply-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 28px;
  background: linear-gradient(123.77deg, #742194 10%, #9e2ff4 56%, #de5af9 100%);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 72px;
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}

.apply-button:hover {
  opacity: 0.9;
  color: white;
  transform: translateY(-2px);
}

/* Share Section */
.job-share-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-share-buttons {
  display: flex;
  gap: 12px;
}

.job-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f4f4f5;
  color: #636b75;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-share-btn:hover {
  background: #742194;
  color: white;
}

.job-share-btn.copied {
  background: #22c55e;
  color: white;
}

.share-icon {
  width: 18px;
  height: 18px;
}

/* Right Content Area */
.job-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Job Header Card */
.job-header-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-detail-title {
  font-size: 32px;
  font-weight: 800;
  color: #211f54;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.job-detail-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #636b75;
}

.job-detail-date {
  font-size: 14px;
  color: #636b75;
}

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

.job-salary-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f0fdf4;
  border-radius: 8px;
  color: #166534;
  font-weight: 600;
  margin-top: 16px;
}

/* Job Content Card */
.job-content-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-content-section {
  margin-bottom: 32px;
}

.job-content-section:last-child {
  margin-bottom: 0;
}

.job-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #211f54;
  margin: 0 0 16px 0;
}

/* Force consistent text styling - override Greenhouse inline styles */
.job-description-content {
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.8 !important;
  color: #344054 !important;
}

/* Force all text elements to use consistent styling */
.job-description-content,
.job-description-content p,
.job-description-content div,
.job-description-content span,
.job-description-content li,
.job-description-content td,
.job-description-content th {
  color: #344054 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.8 !important;
  font-family: inherit !important;
}

/* Paragraphs and divs */
.job-description-content p,
.job-description-content div {
  margin-bottom: 1em !important;
}

.job-description-content p:last-child,
.job-description-content div:last-child {
  margin-bottom: 0 !important;
}

/* Headers - maintain distinct styling */
.job-description-content h1,
.job-description-content h2,
.job-description-content h3,
.job-description-content h4,
.job-description-content h5,
.job-description-content h6 {
  color: #211f54 !important;
  margin-top: 1.5em !important;
  margin-bottom: 0.75em !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.job-description-content h1:first-child,
.job-description-content h2:first-child,
.job-description-content h3:first-child,
.job-description-content h4:first-child {
  margin-top: 0 !important;
}

.job-description-content h1 {
  font-size: 24px !important;
}

.job-description-content h2 {
  font-size: 20px !important;
}

.job-description-content h3 {
  font-size: 18px !important;
}

.job-description-content h4 {
  font-size: 16px !important;
}

.job-description-content h5,
.job-description-content h6 {
  font-size: 15px !important;
}

/* Bold and italic */
.job-description-content strong,
.job-description-content b {
  font-weight: 700 !important;
  color: #211f54 !important;
}

.job-description-content em,
.job-description-content i {
  font-style: italic !important;
}

/* Lists */
.job-description-content ul,
.job-description-content ol {
  margin-bottom: 1em !important;
  padding-left: 1.5em !important;
}

.job-description-content ul {
  list-style-type: disc !important;
}

.job-description-content ol {
  list-style-type: decimal !important;
}

.job-description-content li {
  margin-bottom: 0.5em !important;
  padding-left: 0.25em !important;
}

.job-description-content li:last-child {
  margin-bottom: 0 !important;
}

.job-description-content li ul,
.job-description-content li ol {
  margin-top: 0.5em !important;
  margin-bottom: 0.5em !important;
}

/* Links */
.job-description-content a {
  color: #742194 !important;
  text-decoration: underline !important;
  transition: color 0.2s;
}

.job-description-content a:hover {
  color: #5a1873 !important;
}

/* Blockquotes */
.job-description-content blockquote {
  border-left: 4px solid #742194;
  padding-left: 16px;
  margin: 1em 0;
  color: #636b75;
  font-style: italic;
}

/* Code and pre */
.job-description-content code {
  background: #f4f4f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 14px;
}

.job-description-content pre {
  background: #f4f4f5;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}

.job-description-content pre code {
  background: none;
  padding: 0;
}

/* Tables */
.job-description-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.job-description-content th,
.job-description-content td {
  padding: 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.job-description-content th {
  background: #f9fafb;
  font-weight: 600;
  color: #211f54;
}

.job-description-content tr:nth-child(even) {
  background: #f9fafb;
}

/* Horizontal rule */
.job-description-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5em 0;
}

/* Images */
.job-description-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

/* Related Jobs Section */
.related-jobs-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.related-jobs-header {
  font-size: 20px;
  font-weight: 700;
  color: #211f54;
  margin: 0 0 24px 0;
}

.related-jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-job-card {
  display: block;
  padding: 16px 20px;
  background: #f9fafb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.2s;
}

.related-job-card:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

.related-job-title {
  font-size: 15px;
  font-weight: 600;
  color: #211f54;
  margin-bottom: 4px;
}

.related-job-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #636b75;
}

.related-job-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.related-job-type {
  padding: 2px 8px;
  background: #e5e7eb;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* Back to Jobs Link */
.back-to-jobs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #742194;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 0;
}

.back-to-jobs:hover {
  text-decoration: underline;
}

/* Loading & Error States for Detail Page */
.job-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #636b75;
}

.job-loading .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f0f0f0;
  border-top-color: #742194;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.job-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 16px;
  max-width: 500px;
  margin: 40px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-error-title {
  font-size: 24px;
  font-weight: 700;
  color: #211f54;
  margin-bottom: 12px;
}

.job-error-text {
  font-size: 15px;
  color: #636b75;
  margin-bottom: 24px;
}

/* ===================
   Responsive Design
   =================== */

@media (max-width: 991px) {
  .jobs-hero .h1 {
    font-size: 36px;
  }

  .jobs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .job-detail-layout {
    flex-direction: column;
  }

  .job-sidebar {
    position: static;
    flex: none;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .job-sidebar-card {
    flex: 1;
    min-width: 280px;
  }
}

@media (max-width: 767px) {
  .jobs-hero {
    padding: 40px 16px 24px;
  }

  .jobs-hero .h1 {
    font-size: 28px;
  }

  .jobs-hero .text-2 {
    font-size: 16px;
  }

  .jobs-filters {
    flex-direction: column;
    padding: 16px;
  }

  .jobs-search-wrapper,
  .jobs-filter-select {
    width: 100%;
    min-width: unset;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .job-header-card,
  .job-content-card {
    padding: 24px;
  }

  .job-detail-title {
    font-size: 24px;
  }

  .job-sidebar {
    flex-direction: column;
  }

  .job-sidebar-card {
    min-width: 100%;
  }
}

@media (max-width: 479px) {
  .jobs-filters-section,
  .jobs-grid-section,
  .job-detail-layout {
    padding: 0 16px;
  }

  .job-card {
    padding: 20px;
  }

  .job-title {
    font-size: 16px;
  }

  .jobs-pagination {
    gap: 8px;
    flex-wrap: wrap;
  }

  .pagination-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .pagination-info {
    min-width: 100%;
    order: -1;
    margin-bottom: 8px;
  }
}
