/* =========================================================
   ScanWin — Advertiser · Campaign Detail
   Custom back-topbar, hero card, 4 stat cards, reviews
   (customer/staff tabs + rating breakdown + review list).
   ========================================================= */

/* ----- Topbar: back link + campaign title ----- */
.sw-cd-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-cd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet, #6e5ef7);
  text-decoration: none;
}
.sw-cd-back:hover {
  color: #5d4ee6;
}

/* ----- Mobile header (back arrow + title) ----- */
.sw-cd-mobnav {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.sw-cd-backbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #0f1020;
  flex-shrink: 0;
}
.sw-cd-mobnav__title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sw-cd-mobnav__kicker {
  font-size: 12px;
  color: #9ca3af;
}
.sw-cd-mobnav__name {
  font-size: 16px;
  font-weight: 700;
  color: #0f1020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- Stars ----- */
.sw-cd-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.sw-cd-star {
  width: 15px;
  height: 15px;
  fill: #f5b301;
  flex-shrink: 0;
}
.sw-cd-star--off {
  fill: #d8dbe1;
}
.sw-cd-star--sm {
  width: 12px;
  height: 12px;
}
.sw-cd-stars--lg .sw-cd-star {
  width: 20px;
  height: 20px;
}

/* =========================
   Hero card
========================= */
.sw-cd-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.sw-cd-hero__logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}
.sw-cd-hero__info {
  flex: 1;
  min-width: 0;
}
.sw-cd-hero__titlerow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.sw-cd-hero__name {
  font-size: 22px;
  font-weight: 700;
  color: #0f1020;
  margin: 0;
}
.sw-cd-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sw-cd-tag--active {
  background: #d6f5e3;
  color: #057a55;
}
.sw-cd-tag--hot {
  background: #fee2e2;
  color: #b91c1c;
}
.sw-cd-hero__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
.sw-cd-hero__meta b {
  color: #0f1020;
  font-weight: 700;
}
.sw-cd-hero__dot {
  color: #d1d5db;
}
.sw-cd-hero__reviews {
  color: #9ca3af;
}
.sw-cd-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sw-cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sw-cd-btn svg {
  width: 16px;
  height: 16px;
}
.sw-cd-btn--ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #0f1020;
}
.sw-cd-btn--ghost:hover {
  background: #f7f7fa;
}
.sw-cd-btn--primary {
  background: var(--sw-violet, #6e5ef7);
  border: 0;
  color: #fff;
}
.sw-cd-btn--primary:hover {
  background: #5d4ee6;
  color: #fff;
}

/* =========================
   Stat cards (value + label)
========================= */
.sw-cd-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.sw-cd-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 22px;
}
.sw-cd-stat__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f1020;
  margin: 0 0 4px;
}
.sw-cd-stat__label {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

/* =========================
   Reviews
========================= */
.sw-cd-reviews {
  margin-bottom: 8px;
}
.sw-cd-revtabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #f4f5f7;
  border-radius: 12px;
  margin-bottom: 20px;
}
.sw-cd-revtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}
.sw-cd-revtab svg {
  width: 16px;
  height: 16px;
}
.sw-cd-revtab.is-active {
  background: #fff;
  color: var(--sw-violet, #6e5ef7);
  box-shadow: 0 1px 2px rgba(16, 16, 32, 0.06);
}
.sw-cd-revtab__count {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #ece9fe;
  color: #6d5ef7;
  font-size: 11px;
  font-weight: 700;
}
.sw-cd-revtab:not(.is-active) .sw-cd-revtab__count {
  background: #e5e7eb;
  color: #6b7280;
}

.sw-cd-revbody {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* Summary panel */
.sw-cd-summary {
  flex: 0 0 248px;
  background: #f9fafb;
  border: 1px solid #f0f1f4;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}
.sw-cd-summary__score {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #0f1020;
  margin: 0 0 6px;
}
.sw-cd-summary .sw-cd-stars {
  justify-content: center;
  margin-bottom: 8px;
}
.sw-cd-summary__count {
  font-size: 13px;
  color: #9ca3af;
  margin: 0 0 18px;
}
.sw-cd-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sw-cd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw-cd-bar__label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 22px;
  font-size: 12px;
  color: #6b7280;
}
.sw-cd-bar__track {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}
.sw-cd-bar__fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #f5a623;
}
.sw-cd-bar__pct {
  width: 34px;
  text-align: right;
  font-size: 12px;
  color: #6b7280;
}

/* Review list */
.sw-cd-revlist {
  flex: 1;
  min-width: 0;
}
.sw-cd-review {
  padding: 4px 0 18px;
  border-bottom: 1px solid #f0f1f4;
  margin-bottom: 18px;
}
.sw-cd-review:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.sw-cd-review__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.sw-cd-review__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #ece9fe;
  color: #6d5ef7;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sw-cd-review__id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sw-cd-review__name {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-cd-review__store {
  font-size: 12px;
  color: #9ca3af;
}
.sw-cd-review__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.sw-cd-review__time {
  font-size: 12px;
  color: #9ca3af;
}
.sw-cd-review__body {
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
  margin: 0;
}

/* =========================
   Responsive
========================= */
@media (max-width: 991.98px) {
  .sw-cd-hero__actions {
    gap: 8px;
  }
}

@media (max-width: 767.98px) {
  /* swap topbar for the back-arrow mobile header */
  .sw-cd-mobnav {
    display: flex;
  }
  .sw-app__content {
    padding: 16px;
  }

  /* Hero: logo + info on top, then actions stacked */
  .sw-cd-hero {
    flex-wrap: wrap;
    padding: 18px;
    gap: 14px;
  }
  .sw-cd-hero__logo {
    width: 56px;
    height: 56px;
  }
  .sw-cd-hero__info {
    flex: 1 1 calc(100% - 70px);
  }
  .sw-cd-hero__name {
    font-size: 19px;
  }
  .sw-cd-hero__actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .sw-cd-btn {
    flex: 1;
  }
  /* View report (primary, last in DOM) goes full-width first */
  .sw-cd-btn--primary {
    order: -1;
    flex: 1 1 100%;
  }

  .sw-cd-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .sw-cd-stat {
    padding: 16px;
  }
  .sw-cd-stat__value {
    font-size: 24px;
  }

  .sw-cd-revtabs {
    display: flex;
    width: 100%;
  }
  .sw-cd-revtab {
    flex: 1;
    justify-content: center;
    padding: 9px 10px;
    gap: 6px;
  }
  /* Hide the leading icon on mobile so both tabs fit on one line */
  .sw-cd-revtab svg {
    display: none;
  }

  /* Reviews: summary on top, list below */
  .sw-cd-revbody {
    flex-direction: column;
    gap: 16px;
  }
  .sw-cd-summary {
    flex: 1 1 auto;
    width: 100%;
  }

  /* Footer centered on mobile */
  .sw-app-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .sw-cd-revtab {
    padding: 9px 8px;
    gap: 5px;
  }
}
