:root {
  --bg: #f3f6f4;
  --card: #ffffff;
  --muted: #566272;
  --border: #e3e8ee;
  --primary: #133880;
  --primary-dark: #0f2b66;
  --accent: #ED1D26;
  --success-bg: #eaf8f1;
  --success-text: #1f7a53;
  --radius: 16px;
  --dark-text: #0b1f2a;
  --label-gray: #7b8794;
  --shadow: 0 16px 40px rgba(11, 31, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, #f3f6f4 55%, #eef1ef 100%);
  color: var(--dark-text);
  overflow-x: hidden;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  padding-top: calc(var(--nav-height) + 40px);
  width: 100%;
}

/* --- Hero --- */
.page-hero {
  position: relative;
  border-radius: 22px;
  background: linear-gradient(120deg, #ffffff 0%, #f7f7fb 55%, #f2f6ff 100%);
  border: 1px solid #e6ecff;
  padding: 28px;
  display: grid;
  gap: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18), transparent 65%);
}

.hero-copy .title {
  margin: 6px 0;
  font-family: inherit;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.hero-copy .subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  border: 1px solid #e0e7ff;
  background: #fff;
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(19, 56, 128, 0.08);
  flex: 1;
  min-width: 260px;
}

.search input {
  border: 0;
  outline: 0;
  padding: 10px 8px;
  font-size: 15px;
  width: 100%;
  font-weight: 600;
  color: var(--dark-text);
}

.search input[type="search"]::-webkit-search-cancel-button,
.search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search button {
  background: transparent;
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.filter-btn {
  background: #fff;
  border: 1px solid #e0e7ff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.filter-btn .icon { width: 18px; height: 18px; }

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  background: #fff;
  border: 1px dashed #f7b2b6;
  color: #ED1D26;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

/* --- Layout --- */
.layout { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.detail-panel { display: none; }

.detail-open .detail-panel,
.detail-ready .detail-panel {
  display: block;
}

.detail-empty {
  display: grid;
  place-items: center;
  background: #f8fafc;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 32px 20px;
  min-height: 360px;
}

.detail-empty-card {
  text-align: center;
  color: #475569;
}

.detail-empty-card h3 {
  margin: 16px 0 6px;
  font-size: 1.25rem;
  color: #0f172a;
}

.detail-empty-card p {
  margin: 0;
  font-size: 0.98rem;
}

.detail-empty-icon svg {
  width: 120px;
  height: 120px;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.sidebar-inner { display: flex; flex-direction: column; gap: 12px; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f1f1; padding-bottom: 10px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 700; font-size: 14px; }
.filter-group { margin-top: 10px; }
.filter-group h4 { margin: 0 0 10px 0; font-size: 14px; font-weight: 700; color: #333; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1.4; }
.opt input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.filter-count { color: #888; font-size: 13px; margin-left: 4px; font-weight: normal; }
.apply { background: var(--primary); border: 0; color: #fff; padding: 12px; border-radius: 12px; cursor: pointer; font-weight: 800; width: 100%; margin-top: 15px; }

/* --- Content Area --- */
.content { display: flex; flex-direction: column; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  gap: 10px;
}

.results-count { color: var(--muted); font-size: 14px; }
.active-filters {
  color: var(--muted);
  font-size: 14px;
  background: #f4f8f6;
  border: 1px solid #e1ece7;
  padding: 6px 10px;
  border-radius: 999px;
}

/* --- Job Card Styles --- */
.jobs-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-left: 4px solid var(--accent);
}

.job-card:hover {
  transform: translateY(-5px) scale(1.005);
  box-shadow: 0 16px 30px rgba(11, 31, 42, 0.1);
  border-color: #cbd5e1;
  z-index: 10;
}

.job-card:active { transform: translateY(-2px) scale(1); transition: transform 0.1s; }

.job-card-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

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

.job-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-title { font-weight: 700; margin: 0; font-size: 1.2rem; color: var(--dark-text); flex: 1; }
.job-main,
.job-title,
.job-company-row,
.job-meta {
  min-width: 0;
}
.type-badge {
  background-color: var(--success-bg);
  color: var(--success-text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.job-company-row { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.job-company-row .dot { color: #c1c7cf; }
.job-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.detail-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.detail-item .icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: #70757a; opacity: 0.8; }
.job-side { display: flex; align-items: flex-end; justify-content: flex-end; }

.job-card-footer {
  background-color: #f8faf9;
  padding: 10px 20px;
  border-top: 1px solid #eef1f2;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.job-cta {
  background: #fff1f2;
  color: var(--accent);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #f7b2b6;
  font-size: 13px;
}

.job-footer-meta {
  color: var(--primary);
  font-weight: 700;
}

/* --- Job Detail View --- */
#jobDetailView {
  animation: fadeIn 0.3s ease-in-out;
  padding-bottom: 80px;
}

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

.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#backToJobs {
  cursor: pointer;
  font-weight: 700;
}

#backToJobs:hover {
  color: var(--primary);
  text-decoration: underline;
}

.chevron { color: #94a3b8; }
#breadcrumbTitle { color: #4b5563; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  margin-top: 20px;
  gap: 24px;
}

#detailTitle {
  font-family: inherit;
  font-size: 2.6rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: var(--dark-text);
  letter-spacing: -0.02em;
}

.detail-subtitle {
  color: #5b6773;
  font-size: 1.1rem;
  margin: 0;
}

.apply-btn-large {
  background-color: var(--dark-text);
  color: white;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.apply-btn-large:hover {
  background-color: #111827;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}


.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  background: transparent;
  padding: 20px 0;
  margin-bottom: 40px;
  border: none;
}

.info-box {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.location-bg { background-color: #eef2ff; color: var(--primary); }
.dept-bg     { background-color: #e8f0fe; color: var(--primary); }
.salary-bg   { background-color: #eef2ff; color: var(--primary); }
.type-bg     { background-color: #fff1f2; color: var(--accent); }
.apps-bg     { background-color: #fff1f2; color: var(--accent); }

.info-box small {
  display: block;
  color: var(--label-gray);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.info-box p {
  color: var(--dark-text);
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}

.rich-text-content {
  color: #374151;
  line-height: 1.8;
  font-size: 1.1rem;
}

/* --- Mobile Drawer --- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.backdrop.active { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background: #fff;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.open { transform: translateX(0); }
.drawer-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

.drawer-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
}

.drawer-actions .clear { background: #f1f1f1; color: #333; border: 0; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.drawer-actions .apply { background: var(--primary); color: #fff; border: 0; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; margin: 0; }

/* --- Responsive Layout --- */
@media(max-width: 1024px) {
  .page-hero { padding: 22px; }
  .hero-copy .title { font-size: 32px; }
}

@media(min-width: 901px) {
  .detail-open .layout,
  .detail-ready .layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  }

  .detail-panel {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    align-self: start;
    height: calc(100vh - (var(--nav-height) + 40px));
    max-height: calc(100vh - (var(--nav-height) + 40px));
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .detail-panel::-webkit-scrollbar {
    width: 10px;
  }

  .detail-panel::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 999px;
  }

  .detail-panel::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 999px;
    border: 2px solid #f3f4f6;
  }

  .detail-panel {
    scrollbar-width: thin;
    scrollbar-color: #cbd5f5 #f3f4f6;
  }

  .detail-panel #jobDetailView {
    padding-bottom: 40px;
  }

  .detail-panel .breadcrumb {
    display: none;
  }

  .detail-ready .content,
  .detail-open .content {
    overflow: visible;
    padding-right: 6px;
  }

  .detail-ready .detail-panel,
  .detail-open .detail-panel {
    overflow-y: auto;
    padding-right: 4px;
  }

  .detail-ready .detail-panel #jobDetailView {
    display: none;
  }
}

@media(max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .filter-btn { display: inline-flex; }
  .hero-actions { flex: 1; }
  .search { max-width: none; }
  .detail-panel {
    max-height: none;
    overflow: visible;
  }

  .detail-header {
    flex-direction: column;
    gap: 20px;
  }

  .apply-btn-large {
    width: 100%;
  }

  .detail-actions {
    width: 100%;
  }


  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .job-card-body {
    grid-template-columns: 1fr;
  }

  .job-side {
    align-items: flex-start;
  }

  .job-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .detail-open .content {
    display: none;
  }

  .detail-open .detail-panel {
    display: block;
  }
}

@media(max-width: 600px) {
  .page-hero { padding: 18px; }
  .hero-copy .title { font-size: 28px; }
  .hero-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .filter-btn { width: 100%; justify-content: center; }
  .search { min-width: 0; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .active-filters { width: fit-content; }
  .job-card-body { grid-template-columns: 1fr; }
  .job-side { align-items: flex-start; }
}

@media(max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }

  #detailTitle {
    font-size: 1.6rem;
  }

  .info-box p {
    font-size: 0.95rem;
  }

  .rich-text-content {
    font-size: 1rem;
    line-height: 1.7;
    word-wrap: break-word;
  }
}
