/* =========================================================
  ScanWin — Advertiser · Our Campaigns
========================================================= */

/* ----- Page header actions ----- */
.sw-oc-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sw-oc-premium-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #f3dca0;
  background: #fffbf0;
  color: #92610e;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.sw-oc-premium-pill svg {
  width: 15px;
  height: 15px;
  color: #f5a623;
}

.sw-oc-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--sw-violet, #6e5ef7);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.sw-oc-btn-create:hover {
  background: #5d4ee6;
  color: #fff;
}
.sw-oc-btn-create svg {
  width: 18px;
  height: 18px;
}
.sw-oc-btn-create__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffe49b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sw-oc-up {
  color: #1f9d57;
  font-weight: 600;
}

/* =========================
  Top performing campaigns strip
========================= */
.sw-oc-tp-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sw-oc-tp-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0edff;
  color: #6d5ef7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.sw-oc-tp {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5e8ed;
  border-radius: 12px;
  background: #fbfbfd;
  height: 100%;
}

.sw-oc-tp__rank {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sw-oc-tp__rank--gold {
  background: #fcf2d1;
  color: #c78c0d;
}

.sw-oc-tp__rank--silver {
  background: #edf0f5;
  color: #808794;
}

.sw-oc-tp__rank--bronze {
  background: #faebd9;
  color: #a66633;
}

.sw-oc-tp .sw-creator__rank {
  flex-shrink: 0;
}
.sw-oc-tp__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-oc-tp__name {
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-oc-tp__roas {
  font-size: 11px;
  font-weight: 500;
  color: #9499a8;
}
.sw-oc-tp__delta {
  display: inline-flex;
  align-items: center;
  padding: 0px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sw-oc-tp__delta--up {
  background: #dbf5e5;
  color: #0f9966;
}
.sw-oc-tp__delta--down {
  background: #fce5e5;
  color: #d13d3d;
}

/* =========================
  Search + filter row
========================= */
.sw-oc-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sw-oc-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 360px;
  min-width: 220px;
}
.sw-oc-search svg {
  position: absolute;
  left: 14px;
  color: #9ca3af;
}
.sw-oc-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 42px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #0f1020;
  outline: none;
}
.sw-oc-search input:focus {
  border-color: #c8c0fb;
  box-shadow: 0 0 0 3px rgba(110, 94, 247, 0.12);
}
.sw-oc-search input::placeholder {
  color: #9ca3af;
}

.sw-oc-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sw-oc-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.sw-oc-filter:hover,
.sw-oc-filter:focus-visible {
  background: #f9fafb;
}
.sw-oc-filter:active {
  background: #f3f4f6;
}
.sw-oc-filter b {
  color: #0f1020;
  font-weight: 600;
}
.sw-oc-filter svg {
  width: 15px;
  height: 15px;
  color: #9ca3af;
}

/* Filter dropdowns */
.sw-oc-filter-dd {
  position: relative;
}
.sw-oc-filter-dd.is-open .sw-oc-filter {
  background: #f3f4f6;
  border-color: #c8c0fb;
}
.sw-oc-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 100%;
  width: max-content;
  padding: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 16, 32, 0.12);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.sw-oc-filter-dd.is-open .sw-oc-filter-menu {
  display: flex;
}
.sw-oc-filter-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.sw-oc-filter-opt:hover {
  background: #f9fafb;
}
.sw-oc-filter-opt.is-active {
  color: #0f1020;
  font-weight: 600;
}
.sw-oc-filter-opt.is-active::after {
  content: "✓";
  color: #6e5ef7;
  font-size: 12px;
}

/* =========================
  Campaign table (9 columns)
========================= */
.sw-oc-table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  overflow-x: auto;
}
.sw-oc-table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  background: #fff;
}

.sw-oc-table thead th {
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-align: left;
  white-space: nowrap;
  padding: 14px 10px;
}
.sw-oc-table thead th:first-child {
  padding-left: 20px;
}
.sw-oc-table thead th:last-child {
  padding-right: 20px;
  text-align: right;
}

.sw-oc-row {
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.sw-oc-row:last-child {
  border-bottom: 0;
}
.sw-oc-row:hover,
.sw-oc-row:focus-visible {
  background: #fafafb;
}

.sw-oc-row:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--sw-violet-500);
}

.sw-oc-row__camp {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sw-oc-row__logo {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}
.sw-oc-row__camp-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sw-oc-row__name {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
  line-height: 1.25;
}
.sw-oc-row__cat {
  font-size: 12px;
  color: #6b7280;
}
.sw-oc-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.sw-oc-badge--hot {
  background: #fee2e2;
  color: #b91c1c;
}
.sw-oc-badge--trending {
  background: #fef3c7;
  color: #b45309;
}
.sw-oc-badge--premium {
  background: #f0edff;
  color: #6d5ef7;
}
.sw-oc-row__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}
.sw-oc-row__rating b {
  color: #0f1020;
  font-weight: 600;
}
.sw-oc-star {
  width: 13px;
  height: 13px;
}

.sw-oc-cell {
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  padding: 14px 10px;
  vertical-align: middle;
  white-space: nowrap;
}
.sw-oc-cell:first-child {
  padding-left: 20px;
}
.sw-oc-cell:last-child {
  padding-right: 20px;
}
.sw-oc-cell--camp {
  white-space: normal;
  min-width: 230px;
}
.sw-oc-cell--muted {
  color: #6b7280;
  font-weight: 400;
}
.sw-oc-row__loc {
  font-weight: 600;
}

.sw-oc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.sw-oc-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
}
.sw-oc-status--active {
  background: #d6f5e3;
  color: #057a55;
}
.sw-oc-status--active::before {
  background: #10b981;
}
.sw-oc-status--pending {
  background: #fef3c7;
  color: #b45309;
}
.sw-oc-status--pending::before {
  background: #f59e0b;
}
.sw-oc-status--completed {
  background: #f0edff;
  color: #6d5ef7;
}
.sw-oc-status--completed::before {
  background: #8b7cf6;
}

.sw-oc-cell--action {
  text-align: right;
}
.sw-oc-view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet, #6e5ef7);
}
.sw-oc-view svg {
  width: 14px;
  height: 14px;
}

/* =========================
  Grid view
========================= */
.sw-oc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sw-oc-gcard {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sw-oc-gcard__top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-oc-gcard__top .sw-oc-row__camp-text {
  flex: 1;
}
.sw-oc-gcard__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sw-oc-gcard__grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-oc-gcard__grid span {
  font-size: 11px;
  color: #9ca3af;
}
.sw-oc-gcard__grid b {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-oc-view--block {
  justify-content: space-between;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid #f0f0f3;
}

/* =========================
  Responsive
========================= */
@media (max-width: 1199px) {
  .sw-oc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991px) {
  .sw-oc-head-actions {
    width: 100%;
  }
  .sw-oc-head-actions .sw-btn-export,
  .sw-oc-btn-create {
    flex: 1;
    justify-content: center;
  }
  .sw-oc-premium-pill {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .sw-oc-filters {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
  .sw-oc-search {
    max-width: none;
    min-width: 0;
  }
  .sw-oc-filter-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
  }

  .sw-oc-filter-group.has-open {
    overflow: visible;
  }
  .sw-oc-filter-group::-webkit-scrollbar {
    display: none;
  }
  .sw-oc-filter {
    flex-shrink: 0;
  }
}

/* Phone: table rows -> cards */
@media (max-width: 767px) {
  .sw-app__main {
    min-width: 0;
    overflow-x: hidden;
  }
  .sw-app__content {
    padding: 16px;
    min-width: 0;
    overflow-x: clip;
  }
  #myCampaignsView,
  .sw-oc-filters,
  .sw-oc-search,
  .sw-oc-filter-group,
  .sw-oc-table-wrap,
  .sw-oc-table,
  .sw-oc-row {
    min-width: 0;
    max-width: 100%;
  }

  .sw-oc-table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .sw-oc-table {
    min-width: 0;
    width: 100%;
    display: block;
  }
  .sw-oc-table thead {
    display: none;
  }
  .sw-oc-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .sw-oc-row {
    display: grid;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 20px;
    gap: 14px 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "camp   camp"
      "loc    budget"
      "scans  conv"
      "roas   upd"
      "action action";
    align-items: start;
    width: 100%;
  }
  .sw-oc-cell {
    min-width: 0;
    padding: 0;
    white-space: normal;
  }

  .sw-oc-cell--camp {
    grid-area: camp;
    padding-right: 88px;
    padding-left: 0 !important;
  }
  .sw-oc-cell--status {
    grid-area: camp;
    justify-self: end;
    align-self: start;
  }
  .sw-oc-row__rating {
    white-space: nowrap;
    display: none;
  }
  .sw-oc-cell[data-label="Location"] {
    grid-area: loc;
  }
  .sw-oc-cell[data-label="Budget"] {
    grid-area: budget;
  }
  .sw-oc-cell[data-label="Scans"] {
    grid-area: scans;
  }
  .sw-oc-cell[data-label="Conversion"] {
    grid-area: conv;
  }
  .sw-oc-cell[data-label="ROAS"] {
    grid-area: roas;
  }
  .sw-oc-cell[data-label="Last Updated"] {
    grid-area: upd;
  }

  .sw-oc-cell[data-label] {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  /* .sw-oc-cell[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
  } */
  
  .sw-oc-cell--camp::before,
  .sw-oc-cell--status::before,
  .sw-oc-cell--action::before {
    content: none;
  }
  .sw-oc-cell--action {
    grid-area: action;
    text-align: left;
    border-top: 1px solid #f0f0f3;
    padding-top: 12px;
  }
  .sw-oc-cell--action .sw-oc-view {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  .sw-oc-grid {
    grid-template-columns: 1fr;
  }
}
