/* =========================
  ScanWin — links.css
========================= */

/* =========================
  1. Toolbar (search pill + Generate button) Start
========================= */
.sw-links-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sw-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #ece9e0;
  border-radius: 10px;
  width: 280px;
  max-width: 100%;
  color: #9ca3af;
}
.sw-search-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.sw-search-pill input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  color: #0f1020;
}
.sw-search-pill input::placeholder {
  color: #9ca3af;
}

.sw-btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: var(--sw-violet);
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.sw-btn-generate:hover {
  background: var(--sw-violet-600);
  color: #fff;
}
.sw-btn-generate svg {
  width: 16px;
  height: 16px;
}
/* =========================
  1. Toolbar End
========================= */

/* =========================
  2. Stats Summary (4-up combined card) Start
========================= */
.sw-links-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid #ece9e0;
  border-radius: 16px;
  padding: 16px 0;
  margin-bottom: 24px;
}
.sw-links-stats__cell {
  padding: 0 32px;
  border-right: 1px solid #ece9e0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sw-links-stats__cell:last-child {
  border-right: 0;
}
.sw-links-stats__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
}
.sw-links-stats__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.sw-links-stats__value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: #0f1020;
  line-height: 32px;
}
.sw-links-stats__meta {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}
.sw-links-stats__meta--up {
  color: #047857;
}
.sw-links-stats__meta--down {
  color: #dc2626;
}
/* =========================
  2. Stats Summary End
========================= */

/* =========================
  3. Filter Tab Pills Start
========================= */
.sw-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.sw-toolbar__tabs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sw-tab {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
}
.sw-tab:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 16px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}
.sw-tab.is-active {
  background: #0f1020;
  color: #fff;
  border-color: #0f1020;
}
.sw-tab.is-active:hover {
  color: #fff;
  background: #1a1a2e;
}
.sw-tab.is-active .sw-tab__count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
/* =========================
  3. Filter Tab Pills End
========================= */

/* =========================
  4. Tracking Links Card Start
========================= */
.sw-links-card {
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 20px;
  overflow: hidden;
}

.sw-links-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  flex-wrap: wrap;
}
.sw-links-head__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sw-links-head__title h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.08px;
  color: #1a1232;
  margin: 0;
}
.sw-links-head__title p {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  margin: 0;
}
.sw-links-head__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-search-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 10px;
  color: #9ca3af;
  font-size: 12px;
  width: 280px;
  max-width: 100%;
}
.sw-search-inline svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sw-search-inline input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  color: #0f1020;
}
.sw-search-inline input::placeholder {
  color: #9ca3af;
}

.sw-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 10px;
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
}
.sw-sort:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-sort strong {
  color: #0f1020;
  font-weight: 600;
}
.sw-sort svg {
  width: 14px;
  height: 14px;
}

/* Table head + rows */
.sw-links-table {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
}

.sw-links-table__head {
  min-width: 1000px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr) /* CAMPAIGN */
    minmax(220px, 1.4fr) /* TRACKING URL */
    80px /* SCANS */
    72px /* CTR */
    96px /* EARNED */
    176px; /* ACTIONS — fits 4 × 36px icons + 3 × 8px gaps */
  gap: 16px;
  padding: 10px 28px;
  background: #F3F4F6;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
}

.sw-link-row {
  min-width: 1000px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(220px, 1.4fr)
    80px
    72px
    96px
    176px;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid #ECE9E0;
  align-items: center;
}
.sw-link-row:last-child {
  border-bottom: 0;
}
.sw-link-row:hover {
  background: #fafafb;
}

.sw-link-row__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sw-link-row__logo {
  width: 48px;
  height: 48px;
  border: 1px solid #ece9e0;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.sw-link-row__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-brand-caps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #9ca3af;
  text-transform: uppercase;
}
.sw-brand-caps__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sw-brand-caps__dot--red {
  background: #ef4444;
}
.sw-brand-caps__dot--green {
  background: #10b981;
}
.sw-brand-caps__dot--violet {
  background: #8b5cf6;
}
.sw-brand-caps__dot--blue {
  background: #3b82f6;
}
.sw-brand-caps__dot--yellow {
  background: #f59e0b;
}
.sw-brand-caps__dot--orange {
  background: #f97316;
}
.sw-link-row__title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1232;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status pill (Link active / Pending review / Paused) */
.sw-link-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 100%;
  white-space: nowrap;
}
.sw-link-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
  background: currentColor;
}
.sw-link-status--active {
  background: #d1fae5;
  color: #047857;
}
.sw-link-status--pending {
  background: #fef3c7;
  color: #b45309;
}
.sw-link-status--paused {
  background: #f3f4f6;
  color: #6b7280;
}

/* Highlighted row (e.g. pending review) */
.sw-link-row--highlighted {
  background: #f5f4fe;
}
.sw-link-row--highlighted:hover {
  background: #efedfd;
}

.sw-link-row__stat {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-link-row__stat--earned {
  color: #6b2bff;
}
.sw-link-row__stat--ctr {
  color: #6b6f7b;
}
/* =========================
  4. Tracking Links Card End
========================= */

/* =========================
  5. URL Chip Start
========================= */
.sw-url-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 5px 5px 5px 12px;
  background: #f5f4fe;
  border: 1px solid #ddd9fc;
  border-radius: 8px;
  min-width: 0;
}
.sw-url-chip__url {
  font-size: 11px;
  font-weight: 500;
  color: var(--sw-violet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-url-chip__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  background: var(--sw-violet);
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}
.sw-url-chip__copy:hover {
  background: var(--sw-violet-600);
}
.sw-url-chip__copy.is-copied {
  background: #047857;
}
/* =========================
  5. URL Chip End
========================= */

/* =========================
  6. Icon-square Action Buttons + Mobile Card Actions Start
========================= */
.sw-link-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.sw-icon-square {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
}
.sw-icon-square:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-icon-square svg {
  width: 14px;
  height: 14px;
}

.sw-link-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  height: 40px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
  text-decoration: none;
}
.sw-link-card-action:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-link-card-action svg {
  width: 14px;
  height: 14px;
}
/* =========================
  6. Icon-square + Mobile Card Actions End
========================= */

/* =========================
  7. Responsive Start
========================= */

/* Tablet (≤991.98px) */
@media (max-width: 991.98px) {
  .sw-links-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 40px;
  }
  .sw-search-pill {
    width: 100%;
  }
  .sw-btn-generate {
    margin-left: 0;
    justify-content: center;
    height: 44px;
  }

  .sw-links-stats {
    grid-template-columns: 1fr 1fr;
    padding: 0;
    gap: 16px;
    border: 0;
    background: transparent;
    margin-bottom: 40px;
  }
  .sw-links-stats__cell {
    padding: 14px;
    border: 1px solid #ece9e0;
    border-radius: 12px;
  }

  .sw-links-stats__row {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }
  .sw-links-stats__value {
    font-size: 20px;
  }

  .sw-links-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .sw-links-head__tools {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mobile sort header (TRACKING LINKS · Sort) — hidden on desktop */
.sw-links-mobile-sort {
  display: none;
}

/* Phone (≤767.98px) */
@media (max-width: 767.98px) {
  .sw-links-card {
    overflow: visible;
  }
  .sw-links-head {
    padding: 18px 16px 14px;
  }
  /* Hide desktop search + sort inside the card head on mobile */
  .sw-links-head__tools {
    display: none;
  }
  /* Show the mobile-only TRACKING LINKS · Sort bar */
  .sw-links-mobile-sort {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 16px;
    background: #f3f4f6;
  }
  .sw-links-mobile-sort__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.66px;
    color: #9ca3af;
    text-transform: uppercase;
  }
  .sw-links-mobile-sort .sw-sort {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
  }

  .sw-links-table {
    gap: 12px;
    padding: 4px 0;
  }
  .sw-links-table__head {
    display: none;
  }

  .sw-link-row {
    min-width: 0px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    border: 0;
  }

  .sw-link-row__brand {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .sw-link-row__brand-trail {
    margin-left: auto;
  }

  .sw-url-chip {
    width: 100%;
  }

  .sw-link-row__stats-mobile {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }
  .sw-link-row__stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    /* flex: 1; */
  }
  .sw-link-row__stat-item .sw-stat-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: #9ca3af;
    text-transform: uppercase;
  }
  .sw-link-row__stat-item .sw-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1232;
  }
  .sw-link-row__stat-item .sw-stat-value--earned {
    color: #6b2bff;
  }

  .sw-link-row__actions {
    width: 100%;
    gap: 8px;
    justify-content: stretch;
  }

  /* Hide the desktop-only stat cells */
  .sw-link-row > .sw-link-row__stat,
  .sw-link-row > .sw-link-row__stat--ctr,
  .sw-link-row > .sw-link-row__stat--earned {
    display: none;
  }
}

/* Phone (<576px) */
@media (max-width: 575.98px) {
  .sw-search-inline {
    width: 100%;
  }
  .sw-sort {
    /* width: 100%; */
    justify-content: space-between;
  }
}
/* =========================
  7. Responsive End
========================= */
