/* ── PAGE HEADER ── */
/* The tab is its own container, so the header reflows by the space it actually has (the sidebar
   takes a slice of the viewport) instead of by the viewport width. */
.founders_dashboard_matches_browse {
  container-type: inline-size;
  container-name: matches-browse;
}

/* One flex row: "Your Matches" on the left, the category pills in the middle, and Sort + Location
   together in their container on the right. The title and the tools take an equal share of the
   free space, so the pills sit on the page's centre line whether or not the location search is
   unlocked. */
.matches-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.matches-page-title {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--gf-text-section);
  font-weight: var(--gf-weight-bold);
  color: var(--dark, #0a0a0a);
  line-height: var(--gf-leading-section);
  letter-spacing: -0.5px;
}

/* The pills sit between the two flex sides. */
.matches-filter-categories {
  flex: 0 0 auto;
  max-width: 100%;
  margin-inline: 0;
}

/* Sort and the location search stay together in one container on the right. */
.matches-page-header .founders_dashboard_matches_tools {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.matches-sort-box {
  box-sizing: border-box;
  display: flex;
  flex: 0 1 auto;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
  width: 100%;
  max-width: 262px;
  min-width: min(220px, 100%);
  height: 57px;
  background: #f2f4f7;
  border-radius: 32px;
  border: none;
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
  position: relative;
}
.matches-sort-box:hover {
  background: #e4e7eb;
}

/* Location filter — the shared filter-select dropdown (components/filter-select/select.html)
   the Collaboration tab also mounts, sitting right after the Sort menu. */
.matches-location-filter {
  flex: 0 1 220px;
  width: 100%;
  max-width: 262px;
  min-width: min(220px, 100%);
}

.matches-location-filter .gf-filter-select,
.matches-location-filter .gf-filter-select__trigger,
.matches-location-filter .gf-filter-select__text {
  min-width: 0;
  max-width: 100%;
}

.matches-location-filter .gf-filter-select__text {
  flex: 1 1 auto;
}

.matches-location-filter .gf-filter-select__value {
  min-width: 0;
  white-space: nowrap;
}

.matches-location-filter .gf-filter-select__trigger {
  box-sizing: border-box;
  height: 57px;
  min-height: 57px;
  padding: 6px 16px;
  border-radius: 32px;
  background: #f2f4f7;
}

.matches-location-filter .gf-filter-select__trigger:hover {
  background: #e4e7eb;
}

.matches-sort-label {
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  color: var(--g500, #667085);
}
.matches-sort-value {
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  color: var(--dark, #0a0a0a);
}

/* ── GRID ── */
/* Four cards while the tab has the width for it, stepping down by the tab's own width: the sidebar
   eats into the card row, so viewport breakpoints would leave four cramped cards behind. */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* ── CARD ── */
.matches-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0px 0px 24px;
  gap: 24px;
  isolation: isolate;
  width: 100%;
  max-width: 402px;
  height: 484px;
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 24px;
  flex: none;
  order: 0;
  flex-grow: 0;
  overflow: visible;
  position: relative;
  cursor: pointer;
  transition:
    box-shadow 160ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
}
.matches-card:hover {
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.matches-hero {
  width: 100%;
  height: 140px;
  position: relative;
}

.matches-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  border-top-left-radius: 23px;
  border-top-right-radius: 23px;
  overflow: hidden;
}

/* Gradient/Noise Cover Banners */
.c-laptop {
  background: linear-gradient(135deg, #153e90, #54e346);
}
.c-hands {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}
.c-keyboard {
  background: linear-gradient(135deg, #8a2387, #e94057, #f27121);
}
.c-collab {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}
.c-dark {
  background: linear-gradient(135deg, #141e30, #243b55);
}
.c-green {
  background: linear-gradient(135deg, #1d976c, #93f9b9);
}
.c-blue {
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
}
.c-warm {
  background: linear-gradient(135deg, #ee9ca7, #ffdde1);
}
.c-slate {
  background: linear-gradient(135deg, #2966f4, #3a6073);
}
.c-rose {
  background: linear-gradient(135deg, #fbd3e9, #bb377d);
}
.c-teal {
  background: linear-gradient(135deg, #4ac1f7, #134e5e);
}
.c-purple {
  background: linear-gradient(135deg, #7f00ff, #e100ff);
}

.matches-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.15) 1px,
    transparent 0
  );
  background-size: 8px 8px;
  pointer-events: none;
  opacity: 0.7;
}

.matches-avatar-anchor {
  position: absolute;
  bottom: -32px;
  left: 24px;
  width: 72px;
  height: 72px;
}

.matches-av {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--white, #ffffff);
  background: #ffe4e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--gf-text-card);
  font-weight: var(--gf-weight-semibold);
  color: #9f1239;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.matches-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--white, #ffffff);
  background: var(--white, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.matches-badge svg {
  width: 100%;
  height: 100%;
}

.matches-body {
  width: 100%;
  padding: 16px 24px 0 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.matches-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.matches-name {
  font-size: var(--gf-text-card);
  font-weight: var(--gf-weight-semibold);
  color: var(--dark, #0a0a0a);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MUTUAL CONNECTIONS ── */
.matches-mutuals {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.matches-mut-count {
  font-size: var(--gf-text-body-strong);
  font-weight: var(--gf-weight-medium);
  color: var(--g500, #667085);
}

.matches-mut-stack {
  display: flex;
  align-items: center;
}

.matches-mav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--white, #ffffff);
  margin-left: -10px;
  font-size: var(--gf-text-body-strong);
  font-weight: var(--gf-weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.matches-mav:first-child {
  margin-left: 0;
}

.matches-desc {
  font-size: var(--gf-text-body);
  color: var(--g500, #667085);
  line-height: var(--gf-leading-body);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 45px;
}

.matches-info {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.matches-irow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--gf-text-body);
}

.matches-ik {
  color: var(--g500, #667085);
}
.matches-iv {
  font-weight: var(--gf-weight-medium);
  color: var(--dark, #0a0a0a);
}

.matches-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  margin-bottom: 24px;
}

.matches-ci {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--gf-text-body);
  color: var(--dark, #0a0a0a);
  font-weight: var(--gf-weight-regular);
}
.matches-ci svg {
  color: var(--main, #2966f4);
  flex-shrink: 0;
}

.matches-foot {
  width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.matches-btn-msg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--main, #2966f4);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  color: var(--white, #ffffff);
}
.matches-btn-msg:hover {
  background: #2054cc;
  transform: scale(1.04);
}

.matches-btn-more {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--g100, #f2f4f7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.2, 0, 0, 1);
  color: var(--dark, #0a0a0a);
  flex-shrink: 0;
}
.matches-btn-more:hover {
  background: var(--g200, #eef1f5);
}

.matches-ago {
  margin-left: auto;
  font-size: var(--gf-text-body);
  color: var(--g500, #667085);
  white-space: nowrap;
}

/* ── LOAD MORE ── */
.matches-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.matches-load-more {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 36px;
  border: 1px solid var(--g200, #eef1f5);
  border-radius: 32px;
  background: var(--white, #ffffff);
  font-family: inherit;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-medium);
  color: var(--dark, #0a0a0a);
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    border-color 160ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
}
.matches-load-more:hover {
  background: var(--g100, #f2f4f7);
  border-color: var(--g400, #98a2b3);
  transform: translateY(-1px);
}

/* ── RESPONSIVE ── */
@container matches-browse (max-width: 1130px) {
  .matches-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container matches-browse (max-width: 880px) {
  .matches-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container matches-browse (max-width: 560px) {
  .matches-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── MORE DROPDOWN OVERRIDES FOR VISUAL CONSISTENCY WITH COLLABORATION & EVENTS ── */
.founders_dashboard_matches_more_menu {
  min-width: 270px;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--g200, #eef1f5);
  background: #ffffff;
}

.founders_dashboard_matches_more_item {
  min-height: 44px;
  padding: 10px 16px;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-regular);
  font-family: inherit;
  border-radius: 30px;
  color: var(--dark, #0a0a0a);
  gap: 12px;
  display: flex;
  align-items: center;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: 2px;
  width: 100%;
}

.founders_dashboard_matches_more_item:last-child {
  margin-bottom: 0;
}

.founders_dashboard_matches_more_item svg {
  width: 20px;
  height: 20px;
  color: var(--dark, #0a0a0a);
  flex-shrink: 0;
}

.founders_dashboard_matches_more_item:hover {
  background: var(--g100, #f2f4f7);
}

.founders_dashboard_matches_more_item.is-danger {
  color: #d92d20;
}

.founders_dashboard_matches_more_item.is-danger svg {
  color: #d92d20;
  stroke: #d92d20;
}

/* Submenu/List menu overrides */
.founders_dashboard_matches_list_menu {
  min-width: 270px !important;
}

.founders_dashboard_matches_list_menu_head {
  padding: 8px 12px;
}

.founders_dashboard_matches_list_menu_head strong {
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
}

.founders_dashboard_matches_list_menu_new {
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-medium);
}

.founders_dashboard_matches_list_menu_new svg {
  width: 20px;
  height: 20px;
}

.matches-request-verifiers-btn {
  width: 100%;
  background: var(--main, #2966f4);
  color: var(--white, #ffffff);
  border-radius: 20px;
  padding: 14px 0;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  border: none;
  cursor: pointer;
  transition: opacity 160ms cubic-bezier(0.2, 0, 0, 1);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.matches-request-verifiers-btn:hover {
  opacity: 0.9;
}

/* ── CANCEL MATCH MODAL ── */
.matches-cancel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(4px);
}

.matches-cancel-modal {
  width: min(600px, calc(100vw - 48px));
  background: #ffffff;
  border-radius: 24px;
  box-shadow:
    0 20px 24px -4px rgba(16, 24, 40, 0.08),
    0 8px 8px -4px rgba(16, 24, 40, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.matches-cancel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
}

.matches-cancel-title {
  font-size: var(--gf-text-section);
  font-weight: var(--gf-weight-bold);
  color: #0a0a0a;
}

.matches-cancel-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f2f4f7;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #667085;
  transition: background 160ms cubic-bezier(0.2, 0, 0, 1);
}
.matches-cancel-close:hover {
  background: #e4e7eb;
}

.matches-cancel-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 32px 40px 32px;
}

.matches-cancel-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.matches-cancel-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.matches-cancel-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--gf-text-section);
  font-weight: var(--gf-weight-bold);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.matches-cancel-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.matches-cancel-body-title {
  font-size: var(--gf-text-section);
  font-weight: var(--gf-weight-bold);
  color: #f04438;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.matches-cancel-body-title span {
  color: #fda29b;
}

.matches-cancel-body-text {
  font-size: var(--gf-text-body);
  line-height: var(--gf-leading-body);
  color: #667085;
  max-width: 460px;
}

.matches-cancel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  border-top: 1px solid #eef1f5;
  background: #ffffff;
}

.matches-cancel-btn-keep {
  background: #2966f4;
  color: #ffffff;
  border-radius: 30px;
  padding: 12px 28px;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  border: none;
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.2, 0, 0, 1);
}
.matches-cancel-btn-keep:hover {
  background: #2054cc;
}

.matches-cancel-btn-remove {
  background: #f2f4f7;
  color: #344054;
  border-radius: 30px;
  padding: 12px 28px;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  border: none;
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    color 160ms cubic-bezier(0.2, 0, 0, 1);
  margin-left: 12px;
}
.matches-cancel-btn-remove:hover {
  background: #e4e7eb;
  color: #101828;
}

/* ── CATEGORY FILTERS ── */
.matches-filter-categories {
  display: inline-flex;
  align-items: center;
  background: #f2f4f7;
  padding: 4px;
  border-radius: 32px;
  gap: 4px;
  user-select: none;
}

.matches-filter-btn {
  font-family: inherit;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  color: var(--g500, #667085);
  border: none;
  background: transparent;
  padding: 8px 16px;
  height: 48px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.matches-filter-btn:hover {
  color: var(--dark, #0a0a0a);
  background: rgba(0, 0, 0, 0.03);
}

.matches-filter-btn.is-active {
  color: var(--dark, #0a0a0a);
  background: #ffffff;
  box-shadow:
    0px 4px 10px rgba(0, 0, 0, 0.04),
    0px 1px 2px rgba(0, 0, 0, 0.02);
  font-weight: var(--gf-weight-semibold);
}

.matches-filter-btn svg {
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.matches-filter-btn.is-active svg {
  color: var(--main, #2966f4);
  transform: scale(1.05);
}

/* The same toolbar reflows by the tab's own width. It keeps one row for as long as the three
   groups can share it, tightening the pills and the Sort/Location container on the way down, and
   only stacks once the tab is genuinely too narrow. */
@container matches-browse (max-width: 1120px) {
  .matches-page-header {
    gap: 16px;
  }

  .matches-filter-btn {
    padding: 8px 12px;
  }

  .matches-sort-box,
  .matches-location-filter {
    min-width: min(180px, 100%);
    max-width: 220px;
  }
}

@container matches-browse (max-width: 900px) {
  .matches-page-header {
    gap: 12px;
  }

  .matches-filter-btn {
    padding: 8px 10px;
    gap: 4px;
  }

  .matches-sort-box,
  .matches-location-filter {
    min-width: min(160px, 100%);
    max-width: none;
  }
}

@container matches-browse (max-width: 760px) {
  .matches-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .matches-filter-categories {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }

  .matches-filter-btn {
    justify-content: center;
    flex: 0 1 auto;
    white-space: nowrap;
  }

  .matches-page-header .founders_dashboard_matches_tools {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .matches-sort-box,
  .matches-location-filter {
    flex: 1 1 220px;
    width: 100%;
    max-width: none;
  }
}

@container matches-browse (max-width: 460px) {
  .matches-filter-categories {
    flex-wrap: wrap;
  }

  .matches-sort-box,
  .matches-location-filter {
    flex-basis: 100%;
    max-width: none;
  }
}

/* ═══════════════════════════════
   MATCHES EMPTY STATE
   ═══════════════════════════════ */
.page-empty-state {
  width: 100%;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
  box-sizing: border-box;
}

.page-empty-state--large {
  min-height: 520px;
}

.page-empty-state svg {
  width: 104px !important;
  height: 104px !important;
  max-width: 104px;
  max-height: 104px;
  flex: 0 0 104px;
}

.page-empty-state h3 {
  margin: 8px 0 0;
  color: #101828;
  font-size: var(--gf-text-card);
  font-weight: var(--gf-weight-semibold);
  line-height: var(--gf-leading-card);
}

.page-empty-state p {
  margin: 0;
  color: #475467;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-regular);
  line-height: var(--gf-leading-body);
  max-width: 440px;
}

.page-empty-state .page-empty-btn,
.page-empty-btn {
  border: 0;
  border-radius: 999px;
  background: #2966f4;
  color: #ffffff;
  cursor: pointer;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  line-height: 1;
  min-height: 44px;
  padding: 0 24px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.page-empty-state .page-empty-btn:hover,
.page-empty-btn:hover {
  background: #2054cc;
  transform: translateY(-1px);
}

.matches-api-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.matches-empty-state {
  color: #475467;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-regular);
  text-align: center;
  margin: 8px 0;
}

.matches-empty-state-error {
  color: #d92d20;
}

@media (max-width: 767px) {
  .page-empty-state,
  .page-empty-state--large {
    min-height: 420px;
    padding: 24px 16px;
  }

  .page-empty-state svg {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px;
    max-height: 88px;
    flex-basis: 88px;
  }

  .page-empty-state h3 {
    font-size: var(--gf-text-body);
  }

  .page-empty-state p {
    font-size: var(--gf-text-body-strong);
  }
}
