/* ============================================================
   Fabavio — TikTok-style social screens (2026-09-23)
   Page-specific styles for profile / messenger / notifications.
   VIEW-LAYER ONLY. Loaded AFTER the Minify block on each page.
   Tokens live in public/css/tiktok-theme.css (do not redefine
   tokens here — only layout/component rules).
   ============================================================ */

/* ============ PROFILE ============ */

/* Slim cover strip (hidden on small phones to keep the TikTok look) */
.ttsoc-cover {
  position: relative;
  height: 108px;
  overflow: hidden;
  background: var(--tt-surface);
}
.ttsoc-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ttsoc-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5,5,7,.15), var(--tt-bg) 96%);
}
@media (min-width: 768px) {
  .ttsoc-cover { height: 190px; }
}

/* Centered TikTok profile head */
.ttsoc-profile-head {
  padding: 14px 16px 4px;
  text-align: center;
}
.ttsoc-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.ttsoc-avatar-wrap img.profile-avatar-img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--tt-line);
  background: var(--tt-surface-2);
}
/* Story ring (keeps the original JS hook classes untouched) */
.ttsoc-avatar-wrap.profile-has-stories {
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--tt-violet), #B79CFF, var(--tt-violet));
}
.ttsoc-avatar-wrap.profile-stories-seen {
  background: var(--tt-line);
}
.ttsoc-avatar-wrap .online-indicator {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2ECC71;
  border: 3px solid var(--tt-bg);
}
.ttsoc-name {
  font-size: 20px; font-weight: 700;
  color: var(--tt-text);
  display: inline-flex; align-items: center; gap: 6px;
}
.ttsoc-name .ai-generated-label { vertical-align: middle; }
.ttsoc-handle {
  color: var(--tt-text-2);
  font-size: 14px;
  margin-top: 2px;
}
.ttsoc-online {
  color: var(--tt-text-3);
  font-size: 12.5px;
  margin-top: 2px;
}
/* TikTok stats row (posts / followers / likes) */
.ttsoc-stats {
  display: flex; justify-content: center; gap: 30px;
  margin: 12px 0;
}
.ttsoc-stat { text-align: center; min-width: 64px; }
.ttsoc-stat b { display: block; font-size: 17px; color: var(--tt-text); }
.ttsoc-stat span { color: var(--tt-text-3); font-size: 12.5px; }

/* Action row: Follow / Message / Subscribe + icon pills */
.ttsoc-actions {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 0 16px;
}
.ttsoc-actions .tt-btn { flex: 1 1 120px; max-width: 220px; }
.ttsoc-actions .subscription-holder { flex: 1 1 120px; max-width: 220px; display: flex; }
.ttsoc-actions .subscription-holder .btn { flex: 1; }
/* Header subscribe button (legacy subscribe-button-30 markup) → TikTok primary */
.ttsoc-actions .subscription-holder .btn.btn-primary {
  background: var(--tt-violet);
  border: 0;
  border-radius: 10px;
  min-height: 46px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  justify-content: center;
  gap: 8px;
  margin: 0;
}
.ttsoc-actions .subscription-holder .btn.btn-primary:hover { background: #6E2BEA; color: #fff; }
.ttsoc-actions .subscription-holder .btn.btn-primary.disabled,
.ttsoc-actions .subscription-holder .btn.btn-primary:disabled { opacity: .55; }
.ttsoc-icon-row {
  display: flex; gap: 4px; justify-content: center; align-items: center;
  margin-bottom: 10px;
}
/* dark circular icon buttons (replaces old p-pill look) */
.ttsoc-profile-head .p-pill,
.ttsoc-icon-row .p-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tt-surface-2);
  border: 1px solid var(--tt-line);
  color: var(--tt-text-2);
  padding: 0; margin: 0;
}
.ttsoc-profile-head .p-pill:hover,
.ttsoc-icon-row .p-pill:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.ttsoc-profile-head .p-pill ion-icon,
.ttsoc-icon-row .p-pill ion-icon { font-size: 22px; }
.ttsoc-profile-head .p-pill-text {
  width: auto; border-radius: 999px; padding: 0 18px;
  font-weight: 700; font-size: 14px; color: var(--tt-text);
}
.ttsoc-profile-head .p-pill-text ion-icon { font-size: 18px; }

/* Bio block */
.ttsoc-bio {
  padding: 4px 20px 0;
  text-align: center;
  font-size: 14px;
  color: var(--tt-text-2);
  line-height: 1.5;
}
.ttsoc-bio a { color: var(--tt-violet); }
.ttsoc-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  justify-content: center;
  padding: 8px 20px 0;
  color: var(--tt-text-3);
  font-size: 13px;
}
.ttsoc-meta .ttsoc-meta-item {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0;
}
.ttsoc-meta ion-icon { font-size: 16px; }
.ttsoc-meta a { color: var(--tt-text-2); }
.ttsoc-social { padding: 8px 20px 0; display: flex; justify-content: center; }
.ttsoc-tipgoal, .ttsoc-tipmenu { padding: 10px 16px 0; max-width: 560px; margin: 0 auto; }

/* Icon tab bar (TikTok: grid / media / streams / reels) */
.ttsoc-tabs {
  display: flex;
  border-bottom: 1px solid var(--tt-line);
  background: var(--tt-bg);
  position: sticky; top: 0; z-index: 6;
}
.ttsoc-tabs a {
  flex: 1;
  padding: 13px 0 11px;
  color: var(--tt-text-3);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  position: relative;
  text-decoration: none;
  min-height: 48px;
}
.ttsoc-tabs a ion-icon { font-size: 25px; }
.ttsoc-tabs a .ttsoc-tab-count { font-size: 12px; font-weight: 700; }
.ttsoc-tabs a.active { color: #fff; }
.ttsoc-tabs a.active::after {
  content: ""; position: absolute; bottom: 0; left: 28%; right: 28%;
  height: 3px; background: #fff; border-radius: 2px;
}

/* Media filter pills (All / Photos / Videos / Audio) */
.ttsoc-filter-section { padding: 10px 16px 0; }
.ttsoc-filter-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--tt-text-3); text-transform: uppercase;
}
.ttsoc-filter-pills { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; }
.ttsoc-filter-pills .filter-pill {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--tt-surface-2);
  border: 1px solid var(--tt-line);
  color: var(--tt-text-2); font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.ttsoc-filter-pills .filter-pill.active { background: #fff; color: #000; border-color: #fff; }
.ttsoc-view-toggle { display: flex; gap: 4px; }
.ttsoc-view-toggle .profile-media-view-button {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--tt-text-3);
}
.ttsoc-view-toggle .profile-media-view-button.active {
  background: var(--tt-surface-2); color: #fff;
}

/* TikTok 3-col compact grid */
.profile-compact-posts-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding-top: 2px;
}
.profile-compact-post-tile {
  position: relative;
  aspect-ratio: 3/4;
  background: #0a0a0c;
  overflow: hidden;
  display: block;
}
.profile-compact-post-media,
.profile-compact-post-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.profile-compact-post-overlay {
  position: absolute; right: 6px; bottom: 6px;
  color: #fff;
  display: flex; gap: 6px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.7));
}
.profile-compact-post-overlay ion-icon { font-size: 18px; }
.profile-compact-post-tile-locked .profile-compact-post-media img {
  filter: brightness(.55);
}
.profile-compact-posts-empty { grid-column: 1 / -1; }

/* Subscription card → dark */
.ttsoc-subscription {
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  margin: 12px 16px 0;
  padding: 18px;
}
.ttsoc-subscription h6 { color: var(--tt-text); }
.ttsoc-subscription .subscription-tiers-selector label {
  background: var(--tt-surface-2);
  border-color: var(--tt-line) !important;
  border-radius: 12px;
  color: var(--tt-text);
}
.ttsoc-subscription .subscription-tiers-selector label:has(input:checked) {
  border-color: var(--tt-violet) !important;
  background: var(--tt-violet-soft);
}
/* Legacy subscribe buttons inside the subscription card → full-width primary */
.ttsoc-subscription .subscription-holder .btn.btn-primary,
.ttsoc-subscription > .btn.btn-primary {
  background: var(--tt-violet);
  border: 0;
  border-radius: 10px;
  min-height: 46px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  width: 100%;
  margin-left: 0; margin-right: 0;
}
.ttsoc-subscription .btn.btn-primary:hover { background: #6E2BEA; color: #fff; }

/* Sticky subscribe bar → dark bottom sheet */
.sticky-subscribe-bar {
  background: rgba(20,20,26,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--tt-line);
  color: var(--tt-text);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
}
.sticky-subscribe-bar .ssb-name { color: var(--tt-text); font-weight: 700; }
.sticky-subscribe-bar .ssb-price { color: var(--tt-text-2); font-size: 13px; }
.sticky-subscribe-bar .ssb-bundles-label { color: var(--tt-text-3); }
.sticky-subscribe-bar .ssb-bundle { background: var(--tt-surface-2); border: 1px solid var(--tt-line); border-radius: 10px; }
.sticky-subscribe-bar .ssb-avatar {
  width: 44px; height: 44px;
  object-fit: cover;
  flex: 0 0 44px;
}
.sticky-subscribe-bar .ssb-main { display: flex; align-items: center; gap: 12px; }
.sticky-subscribe-bar .ssb-id { flex: 1; min-width: 0; }
.sticky-subscribe-bar .ssb-cta .btn {
  background: var(--tt-violet);
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  min-height: 46px;
  padding-left: 22px; padding-right: 22px;
}
.sticky-subscribe-bar .ssb-bundle { display: inline-block; margin: 4px 4px 0 0; }
.sticky-subscribe-bar .ssb-bundle .btn { border: 0; background: none; color: var(--tt-text); box-shadow: none; }

/* Playlists shelf ("Start here") */
.ttsoc-shelf { padding: 14px 16px 4px; }
.ttsoc-shelf h6 { color: var(--tt-text); }
.ttsoc-shelf .list-group-item {
  background: var(--tt-surface);
  border-color: var(--tt-line);
  color: var(--tt-text);
  border-radius: 12px;
  margin-bottom: 8px;
}
.ttsoc-shelf .badge { background: var(--tt-violet); color: #fff; }
.ttsoc-shelf .ttsoc-shelf-arrow { color: var(--tt-text-3); }

/* ============ MESSENGER ============ */

.ttsoc-messenger-shell {
  background: var(--tt-bg);
}
.ttsoc-conv-search { padding: 10px 12px; }
.ttsoc-conv-search .messenger-search-field {
  background: var(--tt-surface-2);
  border-radius: 999px;
  padding: 4px 14px;
}

/* Conversation list rows */
.ttsoc-conv-row {
  border-bottom: 1px solid var(--tt-line) !important;
  min-height: 76px;
}
.ttsoc-conv-row .contact-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 52px;
}
.ttsoc-conv-row .contact-name { color: var(--tt-text); font-size: 15px; }
.ttsoc-conv-row .contact-time { font-size: 12px; }
.ttsoc-conv-row .contact-message { color: var(--tt-text-3); font-size: 13.5px; }
.ttsoc-conv-row .contact-message.font-weight-bold,
.ttsoc-conv-row .contact-name.font-weight-bold { color: var(--tt-text); }
.ttsoc-conv-row .contact-unread-indicator {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--tt-violet);
  flex: 0 0 9px; margin-right: 7px;
  box-shadow: 0 0 8px rgba(124,60,255,.9);
}
.ttsoc-conv-row.contact-active {
  background: var(--tt-violet-soft);
}

/* Thread header */
.ttsoc-conv-header .details-holder {
  background: rgba(5,5,7,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tt-line);
  padding: 8px 12px;
}
.ttsoc-conv-header .conversation-header-title { color: var(--tt-text); }
.ttsoc-conv-header .conversation-header-username { color: var(--tt-text-3); }
.ttsoc-conv-header .conversation-header-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
}
.ttsoc-conv-header .h-pill {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--tt-surface-2);
  color: var(--tt-text-2);
}
.ttsoc-conv-header .h-pill:hover { color: #fff; }

/* Bubbles (restyle existing alert-based markup; classes kept for JS) */
.conversation-content .message-box { padding: 4px 0; }
.conversation-content .message-bubble.alert {
  border: 0;
  border-radius: 18px;
  max-width: 78%;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  margin-bottom: 0;
}
.conversation-content .message-box-sender .message-bubble.alert-primary {
  background: var(--tt-violet);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.conversation-content .message-box-receiver .message-bubble.alert-default {
  background: var(--tt-surface-2);
  color: var(--tt-text);
  border-bottom-left-radius: 6px;
}
.conversation-content .message-time { font-size: 11px; margin-top: 2px; }
.conversation-content .paid-message-box { border: 1px solid var(--tt-line); }
.conversation-content .message-actions { opacity: 0; transition: opacity .15s ease; }
.conversation-content .message-box:hover .message-actions { opacity: 1; }

/* Composer */
.ttsoc-composer {
  border-top: 1px solid var(--tt-line);
  background: rgba(10,10,12,.98);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}
.ttsoc-composer .messageBoxInput {
  background: var(--tt-surface-2);
  border: 1px solid var(--tt-line);
  border-radius: 22px;
  color: var(--tt-text);
  max-height: 120px;
}
.ttsoc-composer .messageBoxInput:focus {
  border-color: var(--tt-violet);
  box-shadow: 0 0 0 3px rgba(124,60,255,.25);
}
.ttsoc-composer .messenger-button {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.ttsoc-composer .send-message {
  background: var(--tt-violet);
  border-color: var(--tt-violet);
  color: #fff;
}
.ttsoc-composer .send-message:hover { background: #6E2BEA; border-color: #6E2BEA; color: #fff; }
.ttsoc-composer .btn-outline-primary {
  border-color: var(--tt-line);
  color: var(--tt-text-2);
}
.ttsoc-composer .btn-outline-primary:hover {
  background: var(--tt-surface-2);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}

/* ============ NOTIFICATIONS ============ */

.ttsoc-notif-row {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--tt-line);
  position: relative;
}
.ttsoc-notif-row .ttsoc-notif-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 46px;
  background: var(--tt-surface-2);
}
.ttsoc-notif-row .ttsoc-notif-body { flex: 1; min-width: 0; }
.ttsoc-notif-row .ttsoc-notif-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
}
.ttsoc-notif-row .ttsoc-notif-name {
  font-weight: 700; font-size: 14.5px; color: var(--tt-text);
  text-decoration: none;
}
.ttsoc-notif-row .ttsoc-notif-time {
  color: var(--tt-text-3); font-size: 12px; white-space: nowrap;
}
.ttsoc-notif-row .ttsoc-notif-text {
  color: var(--tt-text-2); font-size: 14px; margin-top: 2px;
}
.ttsoc-notif-row .ttsoc-notif-text.unread { color: var(--tt-text); font-weight: 600; }
.ttsoc-notif-row .ttsoc-notif-text a { color: var(--tt-violet); }
.ttsoc-notif-row.unread::before {
  content: "";
  position: absolute;
  left: 5px; top: 22px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tt-violet);
  box-shadow: 0 0 8px rgba(124,60,255,.9);
}
.ttsoc-notif-row .ttsoc-notif-avatar { margin-left: 8px; }
.ttsoc-notif-row:not(.unread) .ttsoc-notif-avatar { margin-left: 0; }

/* Filter tabs as icon pills */
.ttsoc-notif-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 4px;
}
.ttsoc-notif-tabs .nav-link {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--tt-surface-2);
  border: 1px solid var(--tt-line);
  color: var(--tt-text-2); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.ttsoc-notif-tabs .nav-link ion-icon { font-size: 18px; }
.ttsoc-notif-tabs .nav-link.active { background: #fff; color: #000; border-color: #fff; }

/* ============ SHARED ============ */

/* Back button in profile sub-headers (reels etc.) */
.ttsoc-back-row { padding: 10px 12px 0; }

/* 44px touch targets on icon buttons */
.ttsoc-profile-head .p-pill,
.ttsoc-icon-row .p-pill,
.ttsoc-view-toggle .profile-media-view-button,
.ttsoc-conv-header .h-pill,
.ttsoc-composer .messenger-button {
  min-width: 44px; min-height: 44px;
}

/* Desktop: cap content width for the immersive look */
@media (min-width: 768px) {
  .ttsoc-conv-row { min-height: 84px; }
}

/* Profile subscribe button: keep "$5.00 for 30 days" on one line (2026-09-23) */
.ttsoc-actions .subscription-holder .btn span:last-child { white-space: nowrap; }
@media (max-width: 480px) {
  .ttsoc-actions .subscription-holder .btn { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ============================================================
   Profile revamp (2026-09-24, per Fabian)
   Modern header polish + "Communities I started" shelf.
   Appended — overrides above; view-layer only.
   ============================================================ */

/* Taller, richer cover with a deeper fade into the page */
.ttsoc-cover { height: 134px; }
.ttsoc-cover::after {
  background: linear-gradient(to bottom, rgba(5,5,7,.05) 40%, var(--tt-bg) 98%);
}
@media (min-width: 768px) {
  .ttsoc-cover { height: 210px; }
}

/* Avatar: modern gradient ring (story-ring states on the wrapper stay intact) */
.ttsoc-avatar-wrap img.profile-avatar-img {
  width: 104px; height: 104px;
  border: 3px solid transparent;
  background: linear-gradient(#0b0b0d, #0b0b0d) padding-box,
              linear-gradient(135deg, #7C3AED 0%, #EC4899 100%) border-box;
}

/* Sharper type hierarchy */
.ttsoc-name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.ttsoc-handle { font-size: 14.5px; }
.ttsoc-stat { min-width: 72px; }
.ttsoc-stat b { font-size: 19px; font-weight: 800; }

/* Chunkier, friendlier action buttons */
.ttsoc-actions .tt-btn {
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
}

/* Active tab indicator → gradient pill */
.ttsoc-tabs a.active::after {
  left: 32%; right: 32%;
  height: 4px;
  background: linear-gradient(90deg, #7C3AED, #EC4899);
}

/* ============ COMMUNITIES SHELF ============ */
.ttsoc-communities {
  padding: 14px 16px 2px;
  max-width: 560px;
  margin: 0 auto;
}
.ttsoc-communities-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ttsoc-communities-title {
  font-size: 15px; font-weight: 800; color: var(--tt-text);
  letter-spacing: -0.01em;
}
.ttsoc-communities-all {
  font-size: 13px; font-weight: 700; color: var(--tt-violet);
  text-decoration: none;
}
.ttsoc-communities-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ttsoc-communities-row::-webkit-scrollbar { display: none; }
.ttsoc-community-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex; align-items: center; gap: 12px;
  min-width: 228px; max-width: 280px;
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--tt-text);
}
.ttsoc-community-card:hover { border-color: rgba(255,255,255,.22); }
.ttsoc-community-icon {
  width: 46px; height: 46px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
}
.ttsoc-community-info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; flex: 1 1 auto;
}
.ttsoc-community-name {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ttsoc-community-meta {
  font-size: 12px; color: var(--tt-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ttsoc-community-card ion-icon {
  color: var(--tt-text-3); font-size: 18px; flex: 0 0 auto;
}
