/* ============================================================
   Job detail page
   ============================================================ */

/* ---------- Hero ---------- */
.job-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 20%, rgba(255, 122, 0, 0.16), transparent 42%),
    linear-gradient(120deg, #031425, #082741 55%, #0d3552);
  padding: 48px 20px 56px;
  color: var(--white);
}

.job-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0.55), transparent 62%);
  pointer-events: none;
}

.job-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
}

.job-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.82fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}

.job-hero-grid.no-media {
  grid-template-columns: minmax(0, 980px);
}

.job-hero-copy {
  min-width: 0;
}

/* ---------- Hero media ---------- */
.job-hero-media {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(3, 20, 37, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}

.job-hero-media[hidden] {
  display: none;
}

.job-hero-imgwrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0b2136;
}

.job-hero-imgwrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-hero-imgwrap::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(3, 15, 28, 0.72));
  pointer-events: none;
}

.job-hero-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  max-width: calc(100% - 28px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(3, 20, 37, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
  font: 600 0.78rem/1.2 "Poppins", sans-serif;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.job-hero-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(3, 20, 37, 0.86);
  overflow-x: auto;
  scrollbar-width: thin;
}

.job-hero-thumbs[hidden] {
  display: none;
}

.job-hero-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #0b2136;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.job-hero-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-hero-thumb:hover,
.job-hero-thumb.is-active {
  opacity: 1;
  border-color: var(--brand-orange-500, #ff7a00);
}

.job-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.job-chip {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.job-chip.exp {
  background: rgba(31, 191, 117, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  color: #6ee7a0;
}

.job-chip.reg {
  background: rgba(47, 128, 237, 0.16);
  border-color: rgba(96, 165, 250, 0.5);
  color: #93c5fd;
}

.job-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--white);
  overflow-wrap: anywhere;
}

.job-company {
  margin: 14px 0 0;
  color: var(--brand-orange-200, #ffb463);
  font-size: 1.35rem;
  font-weight: 600;
}

.job-salary {
  margin-top: 16px;
  display: inline-block;
  padding: 14px 26px;
  border-radius: 14px;
  background: rgba(255, 122, 0, 0.18);
  border: 1px solid rgba(255, 154, 61, 0.55);
  color: #ffd9ac;
  font-weight: 700;
  font-size: 1.4rem;
}

.job-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.job-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 17px 36px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-orange-500, var(--brand-orange-500));
  color: #1a0d00;
  font: 700 1rem/1 "Poppins", sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 122, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: oletra-glow 2.4s ease-in-out infinite;
}

.job-apply-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.job-apply-btn.done {
  background: linear-gradient(135deg, #0d9e63, #10b981);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
  animation: none;
  cursor: default;
}

.job-report-btn {
  padding: 17px 26px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font: 600 1.05rem/1 "Poppins", sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.job-report-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.55);
}

/* ---------- Body ---------- */
.job-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  align-items: start;
}

.job-main {
  min-width: 0;
}

.job-section {
  margin-bottom: 0;
}

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

.job-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
  margin: 0 0 16px;
}

.job-section h2::before {
  content: "";
  flex: none;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand-orange-500, #ff7a00);
}

.job-desc {
  color: #33475c;
  font-size: 1.15rem;
  line-height: 1.85;
  white-space: pre-line;
}

.job-reqs {
  margin: 0;
  padding-left: 24px;
  color: #33475c;
  font-size: 1.1rem;
  line-height: 1.95;
}

.job-reqs li::marker {
  color: var(--brand-orange-500, var(--brand-orange-500));
}

.job-howto {
  color: #44596e;
  font-size: 1.1rem;
  line-height: 1.8;
}

.job-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.job-contact a {
  padding: 13px 18px;
  border-radius: 12px;
  background: rgba(255, 127, 17, 0.08);
  border: 1.5px solid rgba(255, 127, 17, 0.3);
  color: #b45309;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.job-contact a:hover {
  background: rgba(255, 127, 17, 0.16);
  border-color: var(--brand-orange-500, var(--brand-orange-500));
}

.job-contact span {
  color: #8a9db0;
  font-size: 0.9rem;
}

/* ---------- Sidebar ---------- */
.job-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.job-card-side {
  background: var(--white);
  border: 1px solid rgba(13, 43, 66, 0.1);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 22px rgba(2, 42, 70, 0.08);
}

.job-card-side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(13, 43, 66, 0.1);
}

.job-card-side-head:last-child {
  border-bottom: 0;
}

.job-card-side-label {
  color: #8a9db0;
  font-size: 0.9rem;
}

.job-card-side-head b {
  color: var(--brand-navy-700, var(--brand-navy-700));
  font-size: 1.06rem;
  text-align: right;
}

.job-owner-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--white);
  border: 1px solid rgba(13, 43, 66, 0.1);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 22px rgba(2, 42, 70, 0.08);
}

.inst-owner-avatar img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.job-owner-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.job-owner-id b {
  color: var(--brand-navy-700, var(--brand-navy-700));
  font-size: 1.18rem;
}

.job-profile-link {
  margin-top: 4px;
  color: var(--brand-orange-500, var(--brand-orange-500));
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
}

.job-profile-link:hover {
  text-decoration: underline;
}

.job-side .caution {
  margin: 0;
}

/* ---------- Similar ---------- */
.job-similar {
  flex: 1 0 100%;
  width: 100%;
  padding: 20px 0 60px;
}

.job-similar .mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .job-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .job-hero-media {
    order: -1;
    max-width: 640px;
  }
  .job-hero-imgwrap {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 860px) {
  .job-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .job-hero {
    padding: 34px 16px 40px;
  }
  .job-hero-media {
    border-radius: 16px;
  }
  .job-body {
    padding: 26px 16px 44px;
    gap: 20px;
  }
  .job-section h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .job-hero-actions {
    flex-direction: column;
  }
  .job-apply-btn,
  .job-report-btn {
    justify-content: center;
    width: 100%;
  }
  .job-hero h1 {
    font-size: 1.85rem;
  }
}

/* Dark mode surfaces */
[data-theme="dark"] .job-card-side,
[data-theme="dark"] .job-owner-card {
  background: #111b2c;
  border-color: rgba(148, 170, 199, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .job-section h2,
[data-theme="dark"] .job-card-side-head b,
[data-theme="dark"] .job-owner-id b {
  color: #eef4fb;
}

[data-theme="dark"] .job-desc,
[data-theme="dark"] .job-reqs,
[data-theme="dark"] .job-howto {
  color: #c3d2e3;
}

[data-theme="dark"] .job-card-side-head {
  border-bottom-color: rgba(148, 170, 199, 0.14);
}

[data-theme="dark"] .job-card-side-label {
  color: #8fa3ba;
}

[data-theme="dark"] .job-contact a {
  background: rgba(255, 127, 17, 0.12);
  border-color: rgba(255, 127, 17, 0.32);
  color: #ffb463;
}
/* ---------- Admin preview banner (staff previewing a non-live listing) ---------- */
.preview-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1240px;
  margin: 20px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(217, 119, 6, 0.4);
  background: linear-gradient(135deg, var(--warning-tint), #fde68a);
  color: #78350f;
  box-shadow: 0 10px 24px rgba(180, 83, 9, 0.14);
}
.preview-banner .pb-ic {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(217, 119, 6, 0.18);
  color: #b45309;
}
.preview-banner .pb-txt {
  flex: 1 1 auto;
  min-width: 220px;
}
.preview-banner .pb-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font: 700 1rem/1.25 "Poppins", sans-serif;
}
.preview-banner .pb-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.45);
  color: #92400e;
  font: 700 0.7rem/1 "Poppins", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.preview-banner .pb-note {
  margin: 5px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(120, 53, 15, 0.85);
}
.preview-banner .pb-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(120, 53, 15, 0.35);
  background: rgba(255, 255, 255, 0.6);
  color: #78350f;
  font: 600 0.84rem/1 "Poppins", sans-serif;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.preview-banner .pb-back:hover {
  background: var(--white);
  transform: translateY(-1px);
}
[data-theme="dark"] .preview-banner {
  background: linear-gradient(135deg, #3f2c05, #533a07);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .preview-banner .pb-ic {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
}
[data-theme="dark"] .preview-banner .pb-status {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}
[data-theme="dark"] .preview-banner .pb-note {
  color: rgba(253, 230, 138, 0.85);
}
[data-theme="dark"] .preview-banner .pb-back {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}
[data-theme="dark"] .preview-banner .pb-back:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* ===================== APPLY / REPORT MODALS =====================
   Dedicated, self-contained dialog styles for the job page. These use
   unique .job-modal* classes with no dependency on instDetail.css or any
   shared stylesheet, so the dialogs always render correctly. Dark mode is
   handled via the site's [data-theme] attribute (set by theme.js). */
.job-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(4, 16, 30, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: jobModalFade 0.22s ease;
}

.job-modal[hidden] {
  display: none !important;
}

@keyframes jobModalFade {
  from {
    opacity: 0;
  }
}

.job-modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid rgba(13, 43, 66, 0.12);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  animation: jobModalPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes jobModalPop {
  from {
    transform: translateY(16px) scale(0.97);
    opacity: 0;
  }
}

.job-modal-card h3 {
  margin: 0 0 6px;
  color: var(--brand-navy-700, var(--brand-navy-700));
  font-size: 1.3rem;
}

.job-modal-sub {
  margin: 0 0 18px;
  color: #7b90a5;
  font-size: 0.88rem;
}

.job-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 43, 66, 0.05);
  color: #33475c;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.job-modal-close:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger-600, var(--danger-600));
  transform: rotate(90deg);
}

.job-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.job-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-field > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #7b90a5;
}

.job-field input,
.job-field select,
.job-modal-card textarea {
  padding: 11px 13px;
  border: 1.5px solid rgba(13, 43, 66, 0.12);
  border-radius: 13px;
  font: 500 0.9rem/1.3 "Poppins", sans-serif;
  color: var(--brand-navy-700, var(--brand-navy-700));
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.job-field input:focus,
.job-field select:focus,
.job-modal-card textarea:focus {
  outline: none;
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.job-modal-card textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  box-sizing: border-box;
}

.job-modal-submit {
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-orange-500, var(--brand-orange-500));
  color: #1a0d00;
  font: 700 1rem/1 "Poppins", sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.job-modal-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 14px 30px rgba(255, 122, 0, 0.4);
}

.job-modal-submit.danger {
  background: linear-gradient(135deg, var(--danger-600, var(--danger-600)), #ef4444);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.3);
}

.job-modal-submit.danger:hover {
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.42);
}

.job-modal-note {
  margin: 12px 0 0;
  color: #7b90a5;
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Required documents shown in the job body + the apply modal uploads */
.job-docs-note {
  color: #7b90a5;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

.job-field-hint {
  margin: 0 0 4px;
  color: #8a99ad;
  font-size: 0.75rem;
  line-height: 1.5;
}

.job-req-flag {
  color: var(--danger-600, var(--danger-600));
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.job-doc-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.job-doc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px dashed rgba(13, 43, 66, 0.22);
  border-radius: 12px;
  background: rgba(255, 122, 0, 0.04);
}

.job-doc-field > b {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-navy-700, var(--brand-navy-700));
}

.job-doc-field .job-doc-file {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-doc-field .job-doc-name {
  font-size: 0.78rem;
  color: #0d9e63;
  font-weight: 600;
  word-break: break-all;
}

.job-doc-field .job-doc-name.bad {
  color: var(--danger-600, var(--danger-600));
}

.job-doc-field input[type='file'] {
  font-size: 0.78rem;
  color: #33506b;
}

.job-doc-field input[type='file']::file-selector-button {
  padding: 7px 12px;
  border: 1px solid rgba(13, 43, 66, 0.2);
  border-radius: 8px;
  background: var(--white);
  color: var(--brand-navy-700, var(--brand-navy-700));
  font: 600 0.75rem/1 "Poppins", sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.job-doc-field input[type='file']::file-selector-button:hover {
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  background: rgba(255, 122, 0, 0.08);
}

.job-doc-field.has-file {
  border-color: rgba(13, 158, 99, 0.45);
  background: rgba(13, 158, 99, 0.05);
}

/* Dark mode for the document fields */
[data-theme="dark"] .job-doc-field {
  border-color: rgba(148, 170, 199, 0.2);
  background: rgba(255, 122, 0, 0.05);
}

[data-theme="dark"] .job-doc-field > b {
  color: #eef4fb;
}

[data-theme="dark"] .job-doc-field input[type='file'] {
  color: #c7d4e4;
}

[data-theme="dark"] .job-doc-field input[type='file']::file-selector-button {
  background: #1b2740;
  border-color: rgba(148, 170, 199, 0.25);
  color: #eef4fb;
}

[data-theme="dark"] .job-doc-field.has-file {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.06);
}

@media (max-width: 520px) {
  .job-field-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark mode */
[data-theme="dark"] .job-modal {
  background: rgba(2, 8, 18, 0.72);
}

[data-theme="dark"] .job-modal-card {
  background: #141d30;
  border-color: rgba(148, 170, 199, 0.16);
}

[data-theme="dark"] .job-modal-card h3 {
  color: #eef4fb;
}

[data-theme="dark"] .job-modal-sub,
[data-theme="dark"] .job-modal-note {
  color: #8fa3ba;
}

[data-theme="dark"] .job-modal-close {
  background: rgba(148, 170, 199, 0.08);
  color: #c3d2e3;
}

[data-theme="dark"] .job-field > span {
  color: #8fa3ba;
}

[data-theme="dark"] .job-field input,
[data-theme="dark"] .job-field select,
[data-theme="dark"] .job-modal-card textarea {
  color: #eef4fb;
  background: #141d30;
  border-color: rgba(148, 170, 199, 0.16);
}
