/* presence.css — Creator Presence strips and tiles for Live People Layer (LEE-7).
   TikTok-native dark theme. Uses CSS vars from theme.css. */

/* ── Creator Strip Container ─────────────────────────────────────────────── */
.presence-strip {
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border, #222);
}
.presence-strip__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}
.presence-strip__title {
  font-family: var(--ff-head, 'Montserrat', sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gray, #ededed);
  letter-spacing: 0.02em;
}
.presence-strip__see-all {
  font-size: 13px;
  color: var(--teal, #00c2c7);
  text-decoration: none;
  font-weight: 600;
}

/* ── Horizontal Scroll Row ───────────────────────────────────────────────── */
.presence-strip__row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.presence-strip__row::-webkit-scrollbar { display: none; }

/* ── Creator Tile (80×140 portrait) ──────────────────────────────────────── */
.presence-tile {
  flex: 0 0 80px;
  width: 80px;
  scroll-snap-align: start;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.presence-tile__video-wrap {
  width: 80px;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--surface, #141414);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.presence-tile:hover .presence-tile__video-wrap {
  border-color: var(--teal, #00c2c7);
}
.presence-tile--live .presence-tile__video-wrap {
  border-color: var(--coral, #FF4D6D);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.3);
}
.presence-tile__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.presence-tile__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* LIVE badge on tile */
.presence-tile__live-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--coral, #FF4D6D);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  z-index: 2;
}
.presence-tile__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: presencePulse 1.4s ease-in-out infinite;
}
@keyframes presencePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Creator name under tile */
.presence-tile__name {
  font-size: 11px;
  color: var(--text, #aaa);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.2;
}

/* ── Product Tile Creator Avatar (small corner overlay) ─────────────────── */
.product-creator-avatar {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface, #141414);
  object-fit: cover;
  z-index: 2;
  cursor: pointer;
  transition: transform 0.2s;
}
.product-creator-avatar:hover {
  transform: scale(1.15);
}

/* ── Mini Creator Card Popup (hover on product avatar) ──────────────────── */
.creator-mini-card {
  display: none;
  position: absolute;
  bottom: 40px;
  left: 0;
  background: var(--surface-2, #1a1a1a);
  border: 1px solid var(--border, #222);
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.creator-mini-card.active { display: block; }
.creator-mini-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.creator-mini-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.creator-mini-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray, #ededed);
}
.creator-mini-card__followers {
  font-size: 11px;
  color: var(--text-muted, #666);
}
.creator-mini-card__bio {
  font-size: 12px;
  color: var(--text, #aaa);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.creator-mini-card__follow-btn {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-radius: 6px;
  background: var(--teal, #00c2c7);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.creator-mini-card__follow-btn:hover { opacity: 0.85; }

/* ── Product Page Creator Section ────────────────────────────────────────── */
.product-creator-section {
  background: #161823;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}
.product-creator-section__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.product-creator-section__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal, #00c2c7);
}
.product-creator-section__info { flex: 1; }
.product-creator-section__label {
  font-size: 11px;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.product-creator-section__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--coral, #FF4D6D);
}
.product-creator-section__follow {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: var(--teal, #00c2c7);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.product-creator-section__live-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--coral, #FF4D6D);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin-top: 6px;
}

/* ── "More from [creator]" row ───────────────────────────────────────────── */
.more-from-row {
  margin-top: 16px;
}
.more-from-row__title {
  font-family: var(--ff-head, 'Montserrat', sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray, #ededed);
  margin-bottom: 10px;
}
.more-from-row__grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.more-from-row__grid::-webkit-scrollbar { display: none; }
.more-from-row__item {
  flex: 0 0 120px;
  background: var(--surface, #141414);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
}
.more-from-row__img {
  width: 120px;
  height: 80px;
  object-fit: cover;
}
.more-from-row__name {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text, #aaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.more-from-row__price {
  padding: 0 8px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal, #00c2c7);
}

/* ── DM Video Avatar ─────────────────────────────────────────────────────── */
.dm-video-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.dm-video-avatar video,
.dm-video-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dm-video-avatar__active-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f0;
  border: 2px solid var(--bg, #0a0a0a);
}

/* ── Notification Presence ───────────────────────────────────────────────── */
.notif-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.notif-live-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral, #FF4D6D);
  animation: presencePulse 1.4s ease-in-out infinite;
}

/* ── Search Creator Card ─────────────────────────────────────────────────── */
.search-creator-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface, #141414);
  border-radius: 12px;
  align-items: center;
  text-decoration: none;
  transition: background 0.2s;
}
.search-creator-card:hover {
  background: var(--surface-2, #1a1a1a);
}
.search-creator-card__video-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border, #222);
}
.search-creator-card--live .search-creator-card__video-wrap {
  border-color: var(--coral, #FF4D6D);
}
.search-creator-card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-creator-card__info { flex: 1; min-width: 0; }
.search-creator-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray, #ededed);
}
.search-creator-card__niche {
  display: inline-block;
  font-size: 11px;
  color: var(--teal, #00c2c7);
  background: var(--teal-dim, rgba(0,194,199,0.12));
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 2px;
}
.search-creator-card__follow-btn {
  padding: 6px 14px;
  border: 1px solid var(--teal, #00c2c7);
  border-radius: 6px;
  background: transparent;
  color: var(--teal, #00c2c7);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.search-creator-card__follow-btn:hover {
  background: var(--teal-dim, rgba(0,194,199,0.12));
}

/* ── Skeleton loading ────────────────────────────────────────────────────── */
.presence-tile--skeleton .presence-tile__video-wrap {
  background: linear-gradient(90deg, var(--surface, #141414) 25%, var(--surface-2, #1a1a1a) 50%, var(--surface, #141414) 75%);
  background-size: 200% 100%;
  animation: presenceShimmer 1.5s infinite;
}
.presence-tile--skeleton .presence-tile__name {
  width: 60px;
  height: 10px;
  background: var(--surface, #141414);
  border-radius: 4px;
}
@keyframes presenceShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
