body {
  margin: 0;
  font-family: Tahoma,sans-serif;
  background: url('assets/bg.png') center/cover no-repeat fixed;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
.legend-panel {
  position: fixed;
  top: 180px;
  left: 0;
  right: auto;
  width: min(180px, calc(18vw));
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 0;
  pointer-events: none;
  z-index: 120;
}

.mobile-legend-wrapper,
.legend-toggle-button,
.filter-toggle-button {
  display: none;
}

.report-btn {
  max-width: 140px;
  width: auto;
  height: auto;
}

.report-popup {
  z-index: 220;
}
/* frame */
.container {
  width: min(1200px, calc(100% - 48px));
  margin: 80px auto;
  padding: 40px 20px 20px;
  position: relative;

  backdrop-filter: blur(6px);

  border-width: 10px;
  border-style: solid;
  border-image: url('assets/top-border.png') 5 fill round;
  box-shadow: 0 10px 30px rgb(251, 248, 237);
}

.logout-btn {
  position: fixed;
  top: 16px;
  right: 18px;
  background: none;
  border: 1px solid rgb(233, 77, 137);
  color: rgb(233, 77, 137);
  cursor: pointer;
  font-size: 11px;
  font-family: Tahoma, sans-serif;
  padding: 4px 12px;
  border-radius: 999px;
  z-index: 250;
}
.logout-btn:hover { background: rgba(237, 171, 205, 0.4); }

.header {
  display: block;
  margin: -130px auto 15px;
  width: 100%;
  max-width: 60%;
  height: auto;
  position: relative;
  z-index: 2;
}

.sub-header img {
  width: 100%;
  margin: -80px auto 15px;
  max-width: 75%;
  transform: translateX(15%);
}

/* floating container */
.search-wrap {
  position: relative;
  top: -40px;
  z-index: 10;
}

/* input field */
.search-wrap input {
  width: min(280px, calc(100% - 24px));
  padding: 12px 50px 12px 18px;
  border: none;
  outline: none;

  border-radius: 999px;

  background: #dccfbd; /* soft beige */
  color: #f630dc;

  font-size: 16px;

  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* right button bubble */
.search-btn {
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);

  width: 40px;
  height: 40px;

  border-radius: 50%;
  border: 2px solid rgb(233, 77, 137);

  background: #957562; /* soft brown */
  color: white;

  cursor: pointer;
}

/* table */
.table-shell {
  overflow-x: auto;
}

.row {
  display: grid;
  grid-template-columns: .8fr .7fr 1.2fr 2.4fr .9fr 1.4fr .7fr;
  gap: 10px;
  padding: 8px 0 8px 34px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
  min-width: 980px;
  overflow: visible;
}

.row > div {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid rgb(233, 77, 137);
  background: rgba(237, 171, 205, 0.685);
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.row.headerRow {
  grid-template-columns: .8fr .7fr 1.2fr 2.4fr .9fr 1.4fr .7fr;
}

.row.headerRow > div {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 0;
  color: #7a4b5f;
}

.headerRow {
  font-weight: bold;
  color: #7a4b5f;
}
.jobs::-webkit-scrollbar {
  width: 8px;
}
.jobs::-webkit-scrollbar-track {
  background: transparent;
}
.jobs::-webkit-scrollbar-thumb {
  background: #e8a3b3;
  border-radius: 10px;
}
/* jobs scroll */
.jobs {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e8a3b3 transparent;
}

.tier-badge {
  width: 20px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.date-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  z-index: 60;
}

.date-text {
  display: block;
}

.date-column {
  z-index: 90;
}

.new-badge {
  width: 38px;
  height: auto;
  position: absolute;
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 120;
}

.title-cell {
  display: block;
  width: 100%;
  min-width: 0;
}

.truncate {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.exp-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(122, 75, 95, 0.3);
  background: linear-gradient(180deg, rgba(255, 241, 247, 0.95), rgba(237, 218, 224, 0.95));

  color: #fa49e5;
  font-size: 12px;
  white-space: nowrap;
}

.apply-link {
  color: #7a4b5f;
  font-weight: bold;
}

.apply-link.disabled {
  opacity: 0.6;
  text-decoration: none;
  cursor: default;
}

/* soft hover */
.row:hover {
  background: rgba(255, 200, 220, 0.3);
}

.report-wrapper {
  position: relative;
  text-align: right;
  margin: -120px auto 15px;
  right: -90px;        /* negative pushes it outside the box */
  margin-bottom: 10px;
}

.filter-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  color: #7a4b5f;
  font-size: 13px;
}

.filter-control {
  position: relative;
}

.filter-control::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7a4b5f;
  pointer-events: none;
  font-size: 14px;
}

.filter-group select {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 10px 36px 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(233, 77, 137, 0.35);
  background: linear-gradient(180deg, rgba(255, 241, 247, 0.95), rgba(237, 218, 224, 0.95));
  color: #7a4b5f;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
}

.filter-group.category-filter select {
  border-color: rgba(233, 77, 137, 0.35);
}

.pill-dropdown {
  color: #7a4b5f;
  font-weight: 600;
}

.header-sort {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.header-sort:hover {
  color: #a1446b;
}

.sort-indicator {
  min-width: 12px;
  font-size: 11px;
  color: #a1446b;
}

/* button */
.report-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
}

/* popup container */
.report-popup {
  position: absolute;
  right: 0;
  top: 40px;
  width: 320px;
  min-width: 260px;
  max-width: 360px;
  display: none;
  border-radius: 12px;
  z-index: 30;
}

.report-btn {
  display: inline-block;
  max-width: 140px;
  width: auto;
  height: auto;
}

/* your custom PNG shape */
.popup-bg {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* content sits ON TOP of your shape */
.popup-content {
  position: absolute;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  z-index: 20;
  width: 64%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}

/* inputs */
.popup-content input,
.popup-content select {
  width: 100%;
  margin: 0;
  padding: 8px 8px;
  border-radius: 12px;
  border: none;
  box-sizing: border-box;
  font-size: 13px;
  color: #f630dc;
}

.reason-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.reason-row select {
  flex: 1;
}

#reasonOther {
  flex: 1;
  margin: 0;
  display: none;
}

#reasonOther.show {
  display: block;
}

/* send button */
.popup-content button {
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: 8px;
  background: #d98fa0;
  cursor: pointer;
  font-size: 14px;
}

.footer {
  display: block;
  margin: -160px auto 15px;
  width: 100%;
  max-width: 65%;
  height: auto;
  bottom: -190px;        /* negative pushes it outside the box */
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .container {
    width: calc(100% - 24px);
    margin: 56px auto;
    padding: 28px 12px 12px;
  }

  .header {
    max-width: 78%;
    margin-top: -92px;
  }

  .sub-header img {
    max-width: 88%;
    margin-top: -52px;
    transform: translateX(8%);
  }

  .report-wrapper {
    right: 0;
    margin-top: -72px;
    z-index: 100;
  }

  .report-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100% - 18px));
    max-width: 360px;
    min-width: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    z-index: 1000;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .popup-bg {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .popup-content {
    position: absolute;
    left: 50%;
    bottom: 58px;
    transform: translateX(-50%);
    width: 64%;
  }

  .footer {
    max-width: 78%;
    margin-top: -96px;
    bottom: -112px;
  }
}

@media (max-width: 768px) {
  .legend-panel { display: none; }
  .mobile-legend-wrapper {
    display: block;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(360px, calc(100% - 16px));
    max-width: 320px;
    pointer-events: auto;
    z-index: 140;
  }

  .mobile-legend-panel {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-110%);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .mobile-legend-wrapper.show .mobile-legend-panel {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-legend-wrapper .legend-toggle-button {
    display: block;
    position: fixed;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: transform 180ms ease;
    pointer-events: auto;
  }

  .mobile-legend-wrapper.show .legend-toggle-button {
    position: absolute;
    top: auto;
    bottom: -18px;
  }

  .legend-toggle-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 180ms ease;
  }

  .legend-toggle-button.open img {
    transform: rotate(180deg);
  }

  .filter-toggle-button {
    display: block;
    position: absolute;
    top: 130px;
    left: 10px;
    z-index: 150;
    width: 74px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    box-shadow: none;
  }

  .filter-toggle-button img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .filter-bar {
    display: none;
  }

  .filter-bar.open {
    display: flex;
  }

  .row.headerRow { display: none; }
  .row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "title title title"
      "tier  pay   exp  "
      "date  date  link "
      "loc   loc   loc  ";
    min-width: 0;
    gap: 4px 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .row > div {
    border: none !important;
    background: rgba(237, 171, 205, 0.685) !important;
    padding: 2px 0;
    font-size: 13px;
    min-width: 0;
    border-radius: 10px;
    padding-inline: 8px;
  }

  .row > div:nth-child(1) { grid-area: date; align-self: center; font-size: 11px; }
  .row > div:nth-child(2) { grid-area: tier; justify-self: start; align-self: center; }
  .row > div:nth-child(3) { grid-area: pay; align-self: center; font-size: 12px; font-weight: 600; }
  .row > div:nth-child(4) { grid-area: title; font-weight: 600; }
  .row > div:nth-child(5) { grid-area: exp; justify-self: end; align-self: center; }
  .row > div:nth-child(6) { grid-area: loc; font-size: 11px; }
  .row > div:nth-child(7) { grid-area: link; align-self: center; justify-self: end; }

  .new-badge {
    position: static;
    transform: none;
    width: 24px;
    margin-right: 4px;
    vertical-align: middle;
  }

  .search-wrap {
    top: 0;
    margin: 8px 0 6px;
    width: calc(100% - 20px);
    max-width: 100%;
  }

  .table-shell {
    margin-top: 0;
  }

  .search-wrap input {
    width: 100%;
  }

  .search-btn {
    left: auto;
    right: 10px;
  }

  .report-wrapper {
    right: 0;
    margin-top: 8px;
    z-index: 100;
  }

  .logout-btn {
    position: fixed;
    top: 1px;
    right: 20px;
    z-index: 180;
  }

  .report-btn {
    max-width: 90px;
    position: relative;
    z-index: 101;
  }

  .report-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100% - 16px));
    max-width: 360px;
    min-width: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    z-index: 1000;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .popup-bg {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .popup-content {
    position: absolute;
    left: 50%;
    bottom: 58px;
    transform: translateX(-50%);
    width: 64%;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 12px);
    margin: 40px auto;
    padding: 18px 10px 10px;
  }

  .header {
    max-width: 90%;
    margin-top: -72px;
  }

  .sub-header img {
    max-width: 96%;
    margin-top: -44px;
    transform: translateX(3%);
  }

    .report-wrapper {
      right: 0;
      margin-top: 0;
      z-index: 100;
    }
  
    .report-btn {
      max-width: 90px;
      position: relative;
      z-index: 101;
    }

  .footer {
    max-width: 90%;
    margin-top: -80px;
    bottom: -90px;
  }

  /* stacked filters */
  .filter-bar {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .filter-group {
    min-width: 0;
    width: 100%;
  }

  /* full-width search */
  .search-wrap input {
    width: calc(100% - 24px);
  }

  /* taller card list */
  .jobs {
    max-height: 65vh;
  }

  /* hide desktop header row; rows become cards */
  .row.headerRow { display: none; }

  .row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "title title title"
      "tier  pay   exp  "
      "date  date  link "
      "loc   loc   loc  ";
    min-width: 0;
    gap: 4px 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .row > div {
    border: none !important;
    background: rgba(237, 171, 205, 0.685) !important;
    padding: 2px 0;
    font-size: 13px;
    min-width: 0;
    border-radius: 10px;
    padding-inline: 8px;
  }

  .row > div:nth-child(1) { grid-area: date; align-self: center; font-size: 11px; }
  .row > div:nth-child(2) { grid-area: tier; justify-self: start; align-self: center; }
  .row > div:nth-child(3) { grid-area: pay; align-self: center; font-size: 12px; font-weight: 600; }
  .row > div:nth-child(4) { grid-area: title; font-weight: 600; }
  .row > div:nth-child(5) { grid-area: exp; justify-self: end; align-self: center; }
  .row > div:nth-child(6) { grid-area: loc; font-size: 11px; }
  .row > div:nth-child(7) { grid-area: link; align-self: center; justify-self: end; }

  /* inline new badge inside card */
  .new-badge {
    position: static;
    transform: none;
    width: 24px;
    margin-right: 4px;
    vertical-align: middle;
  }

  /* report popup as bottom sheet */
  .report-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(340px, calc(100% - 14px));
    max-width: 340px;
    min-width: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    z-index: 1000;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .popup-bg {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .popup-content {
    position: absolute;
    left: 50%;
    bottom: 54px;
    transform: translateX(-50%);
    width: 64%;
  }
}

@media (max-width: 480px) {
  .header {
    max-width: 95%;
    margin-top: -55px;
  }

  .sub-header img {
    max-width: 100%;
    transform: none;
  }
}
