/* Components: Badges */

/* ---- Shared badge base (listing card overlays) ---- */
.badge-showcase,
.badge-company,
.badge-virtual-tour,
.badge-video-tour,
.badge-luxury,
.badge-exclusive {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  color: #fff;
  padding: 0.2em 0.55em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-showcase { background: #7b2ff7; text-transform: uppercase; }
.badge-company { background: var(--color-primary); }
.badge-company i { font-size: 0.9em; }
.badge-virtual-tour { background: var(--color-success); }
.badge-virtual-tour i { font-size: 0.9em; }
.badge-video-tour { background: #e11d48; }
.badge-video-tour i { font-size: 0.9em; }
.badge-luxury {
  background: linear-gradient(135deg, #b8860b, #d4a017);
  text-transform: uppercase;
}
.badge-luxury i { font-size: 0.85em; }
.badge-exclusive {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-office {
  display: inline-block;
  background: var(--color-bg-alt);
  color: var(--color-muted);
  padding: 0.1em 0.5em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
}

/* ---- Listing Badges (Open House / Price Reduced) ---- */
.listing-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.55em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  line-height: 1.2;
}

.listing-badge-openhouse {
  background: #e85d04;
  color: #fff;
}

.listing-badge-pricereduced {
  background: #d62828;
  color: #fff;
}

/* ---- Tour Play Button (listing card overlay) ---- */
.tour-play-btn {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease;
}
.tour-play-btn:hover {
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.05);
}
.tour-play-btn i { font-size: 1.125rem; }

/* ---- Tour Play Card — bottom banner (3D-tour catalog cards) ---- */
/* Whole photo is the tour click target (host is full-bleed transparent —
   positioned in listingCard.js shadow CSS). The visible card lives in
   the bottom strip with a gradient that fades upward so the photo above
   stays readable. Same visual language as the listing-detail gallery
   card: tilted mini-preview (the listing photo, scaled down and rotated
   in 3D space), VR-icon title, animated arrow CTA. */
.tour-play-card {
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.tour-play-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.tour-play-card__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px 14px 14px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.86) 0%,
    rgba(0, 0, 0, 0.62) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: background 160ms ease;
}
.tour-play-card:hover .tour-play-card__inner {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.7)  60%,
    rgba(0, 0, 0, 0)    100%
  );
}

.tour-play-card__stage {
  position: relative;
  width: 72px;
  height: 54px;
  flex-shrink: 0;
  perspective: 700px;
}

.tour-play-card__preview {
  position: absolute;
  inset: 3px 12px 3px 3px;
  width: calc(100% - 15px);
  height: calc(100% - 6px);
  object-fit: cover;
  border-radius: 4px;
  transform: rotateY(-22deg) rotateX(8deg);
  transform-origin: center center;
  /* Stacked offset shadows fake the back/side faces of a cube — same
     trick the listing-detail gallery card uses; no preserve-3d, so no
     Safari backface quirks. */
  box-shadow:
    8px 6px 0 -1px rgba(255, 255, 255, 0.22),
    14px 11px 0 -3px rgba(255, 255, 255, 0.12),
    0 6px 12px rgba(0, 0, 0, 0.5);
  transition: transform 280ms cubic-bezier(.22,.61,.36,1);
}
.tour-play-card:hover .tour-play-card__preview {
  transform: rotateY(-30deg) rotateX(11deg) translateZ(6px);
}
.tour-play-card__preview--placeholder {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.tour-play-card__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
.tour-play-card__title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tour-play-card__title i { font-size: 1em; }
.tour-play-card__cta {
  font-size: 0.8rem;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tour-play-card__cta i {
  display: inline-block;
  animation: tour-play-card-arrow 1.6s ease-in-out infinite;
}
@keyframes tour-play-card-arrow {
  0%, 100% { transform: translateX(0); opacity: 0.85; }
  50%      { transform: translateX(4px); opacity: 1; }
}

.tour-play-card__chevron {
  flex-shrink: 0;
  font-size: 1.85rem;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  transition: transform 200ms ease;
}
.tour-play-card:hover .tour-play-card__chevron {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .tour-play-card__cta i { animation: none; }
  .tour-play-card__preview,
  .tour-play-card:hover .tour-play-card__preview { transition: none; }
}

/* ---- Agent Role Badges (Past Sales) ---- */
.badge-role {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-xs);
  vertical-align: middle;
}

.badge-role-listing { background: var(--color-primary); color: #fff; }
.badge-role-colisting { background: #6c757d; color: #fff; }
.badge-role-buying { background: var(--color-success); color: #fff; }
.badge-role-cobuying { background: #6c757d; color: #fff; }

.badge-team {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.badge-team:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ---- License Badge ---- */
.badge-license {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  background: var(--color-bg-alt);
  color: var(--color-muted);
  padding: 0.15em 0.55em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--color-border);
}
.badge-license i {
  font-size: 0.85em;
  color: var(--color-success);
}

/* ---- Pacesetter Badge ---- */
.badge-pacesetter {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  background: linear-gradient(135deg, #f9a825, #ff6f00);
  color: #fff;
  padding: 0.15em 0.7em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  vertical-align: middle;
  margin-left: var(--space-xs);
}

.badge-pacesetter i { margin-right: 0.2em; }

.badge-pacesetter-sm {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #f9a825, #ff6f00);
  color: #fff;
  padding: 0.1em 0.4em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-xs);
  vertical-align: middle;
}

/* Quarter Pacesetter — secondary tier (≥$25K AGC in a single quarter).
   Visually subordinate to the gold rolling-4Q badge: silver gradient
   instead of gold so the headline pacesetter still reads as the
   primary award when both appear together. */
.badge-pacesetter-quarter {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  background: linear-gradient(135deg, #9ca3af, #4b5563);
  color: #fff;
  padding: 0.15em 0.6em;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  vertical-align: middle;
}

.badge-pacesetter-quarter i { margin-right: 0.2em; }

/* ---- Timeline Event Badges ---- */
.badge-sold {
  background: #6c757d;
  color: #fff;
}

/* Rented uses a teal so the eye sorts rental terminal events from
   sale terminal events without reading the label. */
.badge-rented {
  background: #0d8a8a;
  color: #fff;
}

.badge-price-reduced {
  background: #d62828;
  color: #fff;
}

.badge-price-increased {
  background: var(--color-success);
  color: #fff;
}

.badge-off-market {
  background: #6c757d;
  color: #fff;
}

/* ---- Semantic state badges ----
   Single source of truth for "Active / Inactive / Pending / Warning / etc."
   states across the admin. Always pair with `class="badge"` for the base
   shape (padding, uppercase, radius). Authors were inlining
   `style="background:var(--color-X);color:#fff;"` because these classes
   didn't exist — now they do. */
.badge-active   { background: var(--color-success); color: #fff; }
.badge-inactive { background: var(--color-muted);   color: #fff; }
.badge-success  { background: var(--color-success); color: #fff; }
.badge-danger   { background: var(--color-danger);  color: #fff; }
.badge-warning  { background: var(--color-warning); color: #fff; }
.badge-info     { background: var(--color-info);    color: #fff; }
.badge-pending  { background: var(--color-warning); color: #fff; }
.badge-muted    { background: var(--color-muted);   color: #fff; }
.badge-primary  { background: var(--color-primary); color: #fff; }
.badge-secondary { background: var(--color-bg-alt); color: var(--color-text); border: 1px solid var(--color-border); }
