/* #2396 — Follow providers and faculty: the button (tooltip, provider page, faculty cards), the
   pop-up, and the Following tab of the learning hub. Switches come from notifications.css. */

/* ---- The button ---------------------------------------------------------------------- */
.viv-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.viv-follow-btn__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.viv-follow-btn__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* In a tooltip: a quiet outlined pill above the thumbs. */
.viv-follow-btn--tt,
.viv-follow-btn--chip {
  min-height: 32px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--color-grey-80);
  border-radius: 100px;
  background: var(--color-white);
  color: var(--color-teal-deep);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}

.provider-tooltip-content .viv-follow-btn--tt {
  margin: 4px 0 8px;
}

.viv-follow-btn--tt:hover,
.viv-follow-btn--chip:hover {
  border-color: var(--color-teal);
  background: var(--color-wash);
}

.viv-follow-btn:focus-visible {
  outline: 2px solid var(--color-focus, var(--color-teal));
  outline-offset: 2px;
}

.viv-follow-btn.is-following.viv-follow-btn--tt,
.viv-follow-btn.is-following.viv-follow-btn--chip {
  border-color: var(--color-wash-line);
  background: var(--color-wash);
}

.fac-card__foot .viv-follow-btn--chip {
  margin-left: auto;
  min-height: 28px;
  padding: 2px 10px 2px 8px;
  font-size: 13px;
}

.fac-card__foot .viv-follow-btn--chip .viv-follow-btn__icon {
  width: 16px;
  height: 16px;
}

.viv-follow-hero {
  margin-top: var(--space-sm);
}

/* ---- The pop-up ---------------------------------------------------------------------- */
.viv-modal__container.viv-follow-size {
  max-width: 520px;
  padding: var(--space-xl, 24px);
}

.viv-follow-size .viv-modal__content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.viv-follow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  text-align: left;
}

.viv-follow__loading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 120px;
  justify-content: center;
  color: var(--color-grey-50);
}

.viv-follow__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.viv-follow__body[hidden],
.viv-follow__loading[hidden] {
  display: none;
}

.viv-follow__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 32px; /* the close button */
}

.viv-follow__badge {
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-wash);
  color: var(--color-teal-deep);
}

.viv-follow__badge svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.viv-follow__name {
  margin: 0 0 2px;
  line-height: 1.25;
}

.viv-follow__line {
  margin: 0;
  color: var(--color-grey-50);
}

.viv-follow__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--color-grey-90);
}

.viv-follow__section[hidden] {
  display: none;
}

.viv-follow__section > .subtitle,
.viv-follow__text .subtitle {
  margin: 0;
}

.viv-follow__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.viv-follow__what {
  margin: 2px 0 0;
  color: var(--color-grey-50);
}

.viv-follow__toggle {
  flex: 0 0 auto;
  min-width: 118px;
  justify-content: center;
}

.viv-follow__toggle.is-following {
  background: var(--color-white);
  color: var(--color-teal-deep);
  box-shadow: inset 0 0 0 1px var(--color-wash-line);
}

.viv-follow__toggle.is-following:hover {
  box-shadow: inset 0 0 0 1px var(--color-red-40);
  color: var(--color-red-40);
}

.viv-follow__email {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius, 8px);
  background: var(--color-wash);
}

.viv-follow__email[hidden] {
  display: none;
}

.viv-follow__email .notify-switch__text {
  color: var(--color-black-10, #1f2933);
}

.viv-follow__warn {
  margin: 0;
  color: var(--color-grey-40);
}

.viv-follow__warn[hidden] {
  display: none;
}

.viv-follow .link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-teal-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Feed preference: three-way segmented control (same meaning as the tooltip thumbs). */
.viv-follow__seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--color-grey-80);
  border-radius: var(--radius, 8px);
  overflow: hidden;
}

.viv-follow__seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-left: 1px solid var(--color-grey-80);
  background: var(--color-white);
  color: var(--color-grey-40);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.viv-follow__seg button:first-child {
  border-left: 0;
}

.viv-follow__seg button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.viv-follow__seg button:hover {
  background: var(--color-ground, #f6f7f8);
}

.viv-follow__seg button:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: -2px;
}

.viv-follow__seg button[aria-checked="true"][data-f-feed="1"] {
  background: var(--color-teal);
  color: var(--color-white);
}

.viv-follow__seg button[aria-checked="true"][data-f-feed="0"] {
  background: var(--color-wash);
  color: var(--color-teal-deep);
}

.viv-follow__seg button[aria-checked="true"][data-f-feed="-1"] {
  background: var(--color-red-40);
  color: var(--color-white);
}

.viv-follow__note {
  margin: 0;
  color: var(--color-grey-50);
}

.viv-follow__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-grey-90);
}

.viv-follow__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-teal-deep);
}

.viv-follow__link[hidden] {
  display: none;
}

.viv-follow__link::after {
  content: ' →';
}

.viv-follow__status {
  min-height: 1em;
  margin: -8px 0 0;
  color: var(--color-grey-50);
}

@media (max-width: 520px) {
  .viv-follow__row {
    flex-direction: column;
  }

  .viv-follow__toggle {
    width: 100%;
  }
}

/* ---- Learning hub: Following tab ------------------------------------------------------ */
.follow-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 24px);
}

.follow-list__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.follow-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.follow-list__head .h6 {
  margin: 0;
}

.follow-list__items {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-grey-90);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-white);
}

.follow-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--color-grey-90);
}

.follow-item:first-child {
  border-top: 0;
}

.follow-item__text {
  flex: 1 1 auto;
  min-width: 0;
}

.follow-item__name {
  margin: 0;
  font-weight: 600;
}

.follow-item__name a {
  color: var(--color-black-10, #1f2933);
}

.follow-item__line {
  margin: 2px 0 0;
  color: var(--color-grey-50);
}

.follow-item__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.follow-item.is-gone {
  opacity: .55;
}

.follow-empty {
  padding: var(--space-xl, 24px);
  border: 1px dashed var(--color-grey-80);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-white);
}

.follow-empty p {
  margin: 0 0 8px;
}

.follow-paused {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  border-radius: var(--radius, 8px);
  background: var(--color-wash);
}

.follow-paused p {
  margin: 0;
}

@media (max-width: 640px) {
  .follow-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .follow-item__actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---- #2466 Find who to follow ------------------------------------------------------- */
.follow-find-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 18px;
  border: 1px solid var(--color-grey-90);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-white);
}

.follow-find-bar__text {
  margin: 0;
  flex: 1 1 260px;
  color: var(--color-grey-50);
}

.follow-find-bar__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.follow-find-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.follow-find-open svg {
  width: 16px;
  height: 16px;
}

.viv-modal__container.viv-follow-find-size {
  max-width: 620px;
  padding: var(--space-xl, 24px);
}

.viv-follow-find-size .viv-modal__content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.viv-ff {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  text-align: left;
}

.viv-ff__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 32px;
}

.viv-ff__title,
.viv-ff__lede {
  margin: 0;
}

.viv-ff__lede {
  margin-top: 4px;
  color: var(--color-grey-50);
}

.viv-ff__tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-wash);
  overflow-x: auto;
}

.viv-ff__tab {
  flex: 1 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-grey-50);
  cursor: pointer;
  white-space: nowrap;
}

.viv-ff__tab.is-active {
  background: var(--color-white);
  color: var(--color-teal-deep);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.viv-ff__search {
  position: relative;
}

.viv-ff__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--color-grey-50);
}

.viv-ff__search-icon svg {
  width: 18px;
  height: 18px;
}

.viv-ff__input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--color-grey-80);
  border-radius: var(--radius, 8px);
  font-size: 16px;
}

.viv-ff__results {
  min-height: 220px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
}

.viv-ff__heading {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
}

.viv-ff__loading,
.viv-ff__empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--color-grey-50);
}

.viv-ff__loading[hidden],
.viv-ff__empty[hidden] {
  display: none;
}

.viv-ff__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 2px;
  border-top: 1px solid var(--color-grey-90);
}

.ff-row:first-child {
  border-top: 0;
}

.ff-row--topic {
  padding-left: 18px;
}

.ff-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

.ff-row__name {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ff-row__name a {
  color: var(--color-black-10, #1f2933);
}

.ff-row__line {
  margin: 2px 0 0;
  color: var(--color-grey-50);
}

.ff-row .viv-follow-btn {
  flex: 0 0 auto;
}

.viv-ff__foot {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .follow-find-bar__buttons,
  .follow-find-open {
    width: 100%;
  }

  .follow-find-open {
    justify-content: center;
  }
}

.follow-list__head [data-follow-find] {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-teal-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* #2466: a follow toast from inside the Find pop-up shows above the pop-up, not under its dimmer. */
#vivce-toast-container:has(.follow-toast) {
  z-index: 301;
}
