// ---------------------------------------------------------------------------
// Referrals: free vs paid split, goals per campaign and per source, Search Console quick wins.
// PHP: views/components/objects/channel-switch.php, views/components/tables/referrers.php (Type column),
// Marketing views: conversion-cells.php, source-goals-cell.php, search-queries.php, top-contents.php.
// ---------------------------------------------------------------------------

$wps-quick-win: #b45309;
$wps-quick-win-bg: #fff7ed;

// Free search / Paid ads / All, above the Search Engines chart
.wps-channel-switch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px 0;
}

.wps-channel-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border-radius: 8px;
  background: #f0f1f2;
  box-sizing: border-box;

  a#{&}__item,
  button#{&}__item,
  &__item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 5px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: $wps-text-muted;
    font-family: inherit;
    font-size: 13px;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;

    &:hover,
    &:focus {
      color: $wps-text-strong;
      text-decoration: none;
    }

    // Keyboard focus only: no blue box on click
    &:focus {
      outline: 0;
      box-shadow: none;
    }

    &:focus-visible {
      outline: 2px solid $wps-brand;
      outline-offset: 1px;
    }

    &.is-current {
      background: #fff;
      color: $wps-text-strong;
      font-weight: 600;
      box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    }
  }

  &__total {
    color: $wps-text-muted;
    font-size: 13px;

    strong {
      color: $wps-text-strong;
      font-weight: 600;
    }
  }

  &__total-label::after {
    content: ":";
  }
}

// Organic / Paid label in the referrers table
.wps-traffic-type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;

  &--organic {
    background: #e6f4ea;
    color: #1e6b34;
  }

  &--paid {
    background: #fdecef;
    color: #a3264b;
  }
}

// Conversions and Conv. rate (Campaigns, UTM Performance), Goal reached (Source Categories)
.wps-new-table {
  .wps-col-conversions--none,
  .wps-col-goals__rate,
  .wps-col-goals__none {
    color: $wps-text-subtle;
  }

  .wps-col-goals__rate {
    margin-inline-start: 2px;
    font-size: 12px;
  }
}

.wps-no-goals-hint {
  margin: 12px 16px 4px;
  color: $wps-text-muted;
  font-size: 13px;

  a {
    margin-inline-start: 4px;
    font-weight: 500;
  }
}

.wps-source-goals-locked {
  margin-top: 16px;
}

// Search Console: position 5 to 20 with a low click rate
.wps-gsc-table tr.wps-gsc-quick-win td {
  background: $wps-quick-win-bg;

  &.wps-gsc-ctr,
  &.wps-gsc-position {
    color: $wps-quick-win;
    font-weight: 600;
  }
}

.wps-gsc-quick-win-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 16px 4px;
  color: $wps-text-muted;
  font-size: 12px;

  &__dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: $wps-quick-win-bg;
    border: 1px solid $wps-quick-win;
  }
}

// Underline tabs (Top Pages type filter, owner pick "A"): quiet text tabs with a brand underline
// on the current one, like the page tabs at the top. The row spans the card with a hairline.
.wps-channel-switch-row--tabs {
  padding: 4px 24px 0; // same left edge as the table text below
  border-bottom: 1px solid $wps-card-rule;
}

.wps-channel-switch--tabs {
  gap: 20px;
  padding: 0;
  border-radius: 0;
  background: none;

  a.wps-channel-switch__item,
  .wps-channel-switch__item {
    padding: 12px 0 10px;
    margin-bottom: -1px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: none;
    box-shadow: none;

    // No box on mouse click; keyboard focus gets a quiet ring.
    &:focus {
      outline: none;
      box-shadow: none;
    }

    &:focus-visible {
      outline: 2px solid $wps-brand;
      outline-offset: 2px;
      border-radius: 2px;
    }

    &.is-current {
      background: none;
      box-shadow: none;
      color: $wps-text-strong;
      font-weight: 600;
      border-bottom-color: $wps-brand;
    }
  }
}
