/* ============================================================
   Fabavio — TikTok-style BROWSE screens (2026-09-23)
   ------------------------------------------------------------
   Page-specific CSS for feed / for-you / reels / discover /
   search / trending. Companions the immutable design system in
   public/css/tiktok-theme.css (tokens, .tt-topbar, .tt-post, …).

   Loaded AFTER the Minify block on each page, so these rules win.
   Mobile-first (390px); desktop >=768px keeps the 2-col layout.
   ============================================================ */

/* ---------- A. TikTok topbar — solid sticky variant ----------
   The theme's .tt-topbar is an absolute overlay for immersive
   content. Browse list pages pin it with a blurred dark bar. */
.tt-topbar.tt-topbar-solid {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 5, 7, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  /* 2026-10-03, per Fabian: no divider lines. */
  border-bottom: 0;
  transition: box-shadow .2s ease;
}
.tt-topbar.tt-topbar-solid.is-scrolled {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
/* keep the center tabs optically centered regardless of side widths */
.tt-topbar.tt-topbar-solid .tt-feed-tabs {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.tt-topbar-spacer {
  width: 52px;
  flex: 0 0 52px;
}
.tt-topbar .tt-live-badge .tt-live-dot {
  width: 10px;
  height: 10px;
}
/* small violet Create pill that sits next to the search icon */
.tt-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 38px;
  padding: 0 14px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--tt-violet);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  text-shadow: none;
}
.tt-create-btn ion-icon { font-size: 20px; }

/* ---------- B. Chip rows (horizontal snap scroll) ---------- */
.tt-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tt-chip-row::-webkit-scrollbar { display: none; }
.tt-chip-row .tt-chip {
  flex: 0 0 auto;
  min-height: 40px;
  text-decoration: none;
}
.tt-chip-row .tt-chip:hover { color: var(--tt-text-2); }
.tt-chip-row .tt-chip.active:hover { color: #000; }
.tt-chip-row .tt-chip .menu-notification-badge {
  position: static;
  margin-left: 2px;
}

/* ---------- C. Dark search box ---------- */
.tt-search-form { width: 100%; }
.tt-search-field {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding-left: 16px;
  padding-right: 2px;
  background: var(--tt-surface-2);
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tt-search-form:focus-within .tt-search-field {
  border-color: var(--tt-violet);
  box-shadow: 0 0 0 3px rgba(124, 60, 255, .25);
}
.tt-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--tt-text);
  font-size: 15px;
  padding: 0;
}
.tt-search-input::placeholder { color: var(--tt-text-3); }
.tt-search-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--tt-text-2);
  cursor: pointer;
}
.tt-search-btn:hover { color: #fff; }
.tt-search-btn ion-icon { font-size: 22px; }

/* ---------- D. Discover tabs (Creators / Reels / Live / Trending) ---------- */
.tt-discover-tabs {
  background: var(--tt-bg);
}
.tt-discover-tabs .tt-chip-row {
  padding-left: 12px;
  padding-right: 12px;
}
.tt-discover-tabs .tt-chip ion-icon { font-size: 18px; }

/* ---------- E. Home feed — immersive mobile posts ---------- */
@media (max-width: 767.98px) {
  .tt-feed-scope .feed-box { border-top: 0; }

  .tt-feed-scope .post-box {
    background: transparent;
    border: 0;
    border-bottom: 8px solid #000;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    padding-bottom: 4px;
  }
  /* full-bleed media: flush with the card edges */
  .tt-feed-scope .post-box .post-media {
    margin: 10px 0 0;
    border-radius: 0;
    background: #000;
  }
  .tt-feed-scope .post-box .post-media img,
  .tt-feed-scope .post-box .post-media video {
    border-radius: 0;
  }
  .tt-feed-scope .post-box .post-header {
    padding-top: 12px;
  }
  .tt-feed-scope .post-box .post-header .text-bold a {
    color: #fff;
  }
  /* roomier TikTok-density action row, 44px targets */
  .tt-feed-scope .post-box .post-footer {
    padding-bottom: 10px;
  }
  .tt-feed-scope .post-box .post-footer .h-pill {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .tt-feed-scope .post-box .post-footer .h-pill ion-icon {
    font-size: 24px;
  }
}

/* ---------- F. Stories row — dark ---------- */
.tt-stories-row {
  background: var(--tt-bg);
  border-bottom: 1px solid var(--tt-line);
}
.tt-stories-row .stories-swiper-skeleton__avatar,
.tt-stories-row .stories-swiper-skeleton__line {
  background: var(--tt-surface-2);
}

/* ---------- G. For You — immersive cards ---------- */
.tt-foryou-scope #twf-foryou-feed {
  max-width: 640px;
  margin: 0 auto;
}
.twf-foryou-card.tt-post {
  background: transparent;
  border: 0;
  border-bottom: 8px solid #000;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}
.twf-foryou-card .tt-post-head {
  padding: 12px 14px 8px;
}
.twf-foryou-card .tt-post-head .avatar {
  width: 44px;
  height: 44px;
}
.twf-foryou-card .tt-post-head .text-bold a {
  color: #fff;
  font-size: 15px;
}
.twf-foryou-card .tt-post-media {
  background: #000;
}
.twf-foryou-card .tt-post-media img {
  width: 100%;
  display: block;
}
.twf-foryou-card .tt-post-body {
  padding: 10px 14px 4px;
  font-size: 14.5px;
  color: var(--tt-text);
  line-height: 1.5;
}
.twf-foryou-card .tt-post-stats {
  padding: 8px 14px 16px;
  color: var(--tt-text-3);
  font-size: 13px;
  gap: 18px;
}
.twf-foryou-card .tt-post-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@media (max-width: 767.98px) {
  .twf-foryou-card .tt-post-media .video-wrapper,
  .twf-foryou-card .tt-post-media video.video-preview {
    max-height: 72vh;
  }
}

/* ---------- H. Reels page ---------- */
.tt-reels-scope {
  position: relative;
  background: #000;
  min-height: 100vh;
  min-height: 100svh;
}
/* Seamless black flow (per Fabian 2026-10-03): the pure black must run
   uninterrupted to the bottom of the screen. The CTA bar's near-black
   background (#0b0b0f) and top border render as a visible band on OLED,
   breaking the flow — pure black and borderless on the reels page. */
.watch-cta-bar[data-context="reel"] {
  background: #000;
  border-top-color: transparent;
}
@media (min-width: 768px) {
  .watch-cta-bar[data-context="reel"] {
    border-color: transparent;
  }
}
body:has(.tt-reels-scope) .mobile-bottom-nav.fb-nav {
  border-top-color: transparent !important;
}
/* "No reels yet" empty state: the black fills the whole screen and the
   message sits centered in it (was: 60vh black + 18rem box pinned up top,
   leaving a dead void below). The JS player swaps #reels-feed's innerHTML
   for the template's .app-empty-state when no reels load, so BOTH the
   initial .reels-empty-state (spinner) and the rendered
   #reels-feed > .app-empty-state need the centering. When reels exist the
   player mounts its own viewer and neither selector matches. */
.tt-reels-scope .reels-empty-state,
.tt-reels-scope #reels-feed > .app-empty-state {
  min-height: calc(100vh - 230px);
  min-height: calc(100svh - 230px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-reels-scope .reels-empty-state > .app-empty-state,
.tt-reels-scope #reels-feed > .app-empty-state {
  width: 100%;
}
/* the JS player mounts a full-screen viewer inside #reels-feed;
   the topbar stays as page chrome above the grid */
.tt-reels-scope .reels-grid {
  gap: 2px;
  padding: 2px;
}
.tt-reels-scope .reel-grid-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--tt-surface);
}
.tt-reels-scope .reel-grid-card .reel-grid-media {
  border-radius: 10px;
}
.tt-reels-scope .reels-empty-state .spinner-border {
  margin: 48px auto;
  display: block;
}

/* ---------- I. Search / discover results ---------- */
/* sticky dark search header on the search page */
.tt-search-header {
  position: sticky;
  top: 0;
  z-index: 35;
  background: rgba(5, 5, 7, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tt-line);
}
.tt-search-filters {
  padding: 10px 12px 4px;
  border-bottom: 1px solid var(--tt-line);
  background: var(--tt-bg);
}
/* TikTok-style creator rows */
.tt-creator-rows .user-search-box-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--tt-line);
  border-radius: 0;
  padding: 12px 14px;
  margin-bottom: 0 !important;
}
.tt-creator-rows .user-search-box-item .avatar {
  width: 56px;
  height: 56px;
}
.tt-creator-rows .user-search-box-item .h6 a {
  color: #fff;
  font-size: 15px;
}
.tt-creator-rows .user-search-box-item .description-content {
  color: var(--tt-text-3);
  font-size: 13px;
}
.tt-creator-rows .search-follow-button,
.tt-creator-rows .user-search-box-item .btn-outline-primary {
  border-color: var(--tt-violet);
  color: #fff;
  background: var(--tt-violet);
  min-height: 40px;
  border-radius: 999px;
  font-weight: 700;
}
.tt-creator-rows .user-search-box-item .btn-outline-primary:hover {
  background: #6e2bea;
  border-color: #6e2bea;
  color: #fff;
}
/* media results (photos / videos filters) -> 3-col TikTok grid */
.tt-media-grid-results .posts-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}
/* the <hr> separators posts-wrapper emits between cards must not become cells */
.tt-media-grid-results .posts-wrapper > hr {
  display: none;
}
/* modal / photoswipe includes live inside .posts-wrapper; they are
   position:fixed when open, so they never participate in the grid */
.tt-media-grid-results .post-box {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0a0a0c;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
/* grid cells show media only */
.tt-media-grid-results .post-box .post-header,
.tt-media-grid-results .post-box .post-footer,
.tt-media-grid-results .post-box .post-poll-override,
.tt-media-grid-results .post-box > div[class*="post-poll-"],
.tt-media-grid-results .post-box .post-text,
.tt-media-grid-results .post-box .post-description {
  display: none !important;
}
.tt-media-grid-results .post-box .post-media {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 0;
  background: #0a0a0c;
}
.tt-media-grid-results .post-box .post-media .swiper,
.tt-media-grid-results .post-box .post-media .swiper-wrapper,
.tt-media-grid-results .post-box .post-media .swiper-slide,
.tt-media-grid-results .post-box .post-media .video-wrapper {
  height: 100%;
}
.tt-media-grid-results .post-box .post-media img,
.tt-media-grid-results .post-box .post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.tt-media-grid-results .post-box .post-media .swiper-button,
.tt-media-grid-results .post-box .post-media .swiper-pagination,
.tt-media-grid-results .post-box .repost-header {
  display: none !important;
}

/* ---------- J. Discover page cards — dark ---------- */
.tt-discover-scope .discover-page {
  max-width: 600px;
}
.tt-discover-scope .discover-card {
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  box-shadow: none;
}
.tt-discover-scope .discover-creator-name {
  color: #fff;
}
.tt-discover-scope .discover-card .post-box {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.tt-discover-scope .discover-subscribe-btn .btn {
  min-height: 40px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---------- K. Trending creators — TikTok rows ---------- */
.tt-trending-scope .list-group-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--tt-line);
  border-radius: 0;
  padding: 12px 4px;
}
.tt-trending-scope .list-group-item .text-bold {
  color: #fff;
}
.tt-trending-scope .tt-rank {
  font-size: 17px;
  font-weight: 800;
  color: var(--tt-text-3);
  width: 34px;
  flex: 0 0 34px;
  text-align: center;
}
.tt-trending-scope .tt-rank-1,
.tt-trending-scope .tt-rank-2,
.tt-trending-scope .tt-rank-3 {
  color: var(--tt-violet);
}

/* ---------- L. Desktop (>=768px) guards ----------
   Two-column layouts stay intact; only polish. */
@media (min-width: 768px) {
  .tt-topbar.tt-topbar-solid {
    border-left: 1px solid var(--tt-line);
    border-right: 1px solid var(--tt-line);
  }
  .tt-feed-scope .post-box {
    background: var(--tt-surface);
    border: 1px solid var(--tt-line);
    border-radius: var(--tt-radius);
    margin-bottom: 16px;
  }
  .tt-media-grid-results .posts-wrapper {
    gap: 6px;
    padding: 6px;
  }
  .tt-media-grid-results .post-box {
    border-radius: 10px;
  }
  .tt-search-header {
    position: static;
  }
}

/* ---------- M. Safe area / reduced motion / RTL ---------- */
.tt-topbar.tt-topbar-solid {
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
}
@media (prefers-reduced-motion: reduce) {
  .tt-topbar.tt-topbar-solid { transition: none; }
  .tt-chip-row { scroll-behavior: auto; }
}
[dir="rtl"] .tt-topbar.tt-topbar-solid .tt-feed-tabs {
  transform: translate(50%, -50%);
}
[dir="rtl"] .tt-search-field {
  padding-left: 2px;
  padding-right: 16px;
}

/* ============================================================
   Fabavio quick menu — see-through glass topbar (TikTok style).
   Sticky + translucent gradient so content shows through;
   no bottom border. Scrollable text-tab strip between the
   LIVE badge and the icon buttons.
   ============================================================ */
.tt-topbar.tt-topbar-glass {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, rgba(5, 5, 7, .82), rgba(5, 5, 7, .25));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: none;
  transition: box-shadow .2s ease;
}
.tt-topbar.tt-topbar-glass.is-scrolled {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.tt-topbar.tt-topbar-glass .tt-feed-tabs {
  position: static;
  left: auto; top: auto;
  transform: none;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 8px;
  padding: 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tt-topbar.tt-topbar-glass .tt-feed-tabs::-webkit-scrollbar { display: none; }
.tt-topbar.tt-topbar-glass .tt-feed-tabs a {
  flex-shrink: 0;
}
[dir="rtl"] .tt-topbar.tt-topbar-glass .tt-feed-tabs {
  transform: none;
}

/* Red pulsing LIVE dot (2026-09-24, per Fabian). Links to /live. */
.tt-live-dot-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px 8px 14px;
    flex-shrink: 0;
}
.tt-live-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fe2c55;
    animation: tt-live-pulse 1.6s ease-in-out infinite;
}
@keyframes tt-live-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(254, 44, 85, 0);
        transform: scale(1.15);
    }
}
