/* ============================================================
   TrueView â€“ Public Feed Stylesheet
   Stage 15: UI/UX + Branding System
   ============================================================ */

:root {
  /* â”€â”€ Palette â”€â”€ */
  --page-bg:      #050508;
  --text:         #ffffff;
  --muted:        rgba(255, 255, 255, 0.72);
  --border:       rgba(255, 255, 255, 0.08);
  --surface:      rgba(255, 255, 255, 0.04);

  /* â”€â”€ Brand â”€â”€ */
  --accent:       #7c3aed;          /* Violet â€” TrueView primary */
  --accent-light: #a78bfa;          /* Lighter violet for text on dark */
  --accent-glow:  rgba(124, 58, 237, 0.22);
  --accent-2:     #22d3ee;          /* Cyan â€” secondary (+ button right tab) */

  /* â”€â”€ Interaction States â”€â”€ */
  --liked:        #f472b6;          /* Pink â€” liked state */
  --disliked:     #60a5fa;          /* Blue â€” disliked state */
  --favorited:    #fbbf24;          /* Amber â€” saved/bookmarked state */
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  overscroll-behavior: none;
}

h1 { display: none; }

/* â”€â”€ Page Shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Mobile  : transparent flex column (full viewport)
   Tablet  : centered at 420px with side borders
   Desktop : three-column layout with phone frame at center
*/

.page-shell {
  display: flex;
  align-items: stretch;
  min-height: 100dvh;
}

/* Sidebars: hidden on mobile */
.dl-left,
.dl-right {
  display: none;
}

/* Phone shell: fills viewport on mobile */
.phone-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* â”€â”€ App Shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.app {
  width: 100%;
  height: 100dvh;
  position: relative;
}

/* â”€â”€ Category Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* â”€â”€ Search Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

#search-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  z-index: 26;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(5,5,8,0.96) 0%, rgba(5,5,8,0.78) 65%, transparent 100%);
}

#search-logo {
  flex-shrink: 0;
  height: 34px;
  width: auto;
  border-radius: 9px;
  object-fit: contain;
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.search-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  transition: flex 0.18s ease;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
  flex-shrink: 0;
}

#search-bar input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 5, 8, 0.60);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: width 0.18s ease, padding 0.18s ease, opacity 0.18s ease, border-color 0.15s;
  -webkit-appearance: none;
}

#search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

#search-bar input:focus {
  border-color: var(--accent);
}

#searchClearBtn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  display: none; /* shown by JS only when activeSearch is set */
}

#searchClearBtn:hover { opacity: 0.85; }

/* ── Search toggle: collapsed (default) / expanded (.search-bar--active) ── */

/* Collapsed: wrap shrinks to a framed icon button */
#search-bar:not(.search-bar--active) .search-input-wrap {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Collapsed: icon repositioned to normal flow (no longer absolute inside input) */
#search-bar:not(.search-bar--active) .search-icon {
  position: static;
  transform: none;
  color: rgba(255, 255, 255, 0.82);
}

/* Collapsed: input collapses to zero width — invisible and untouchable */
#search-bar:not(.search-bar--active) #searchInput {
  width: 0;
  min-width: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
}

/* Expanded: hide categories row — it is now a child of #search-bar */
#search-bar.search-bar--active .categories-bar {
  display: none !important;
}

/* â”€â”€ Category Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.categories-bar {
  /* Sits between logo and search icon on the same row — fills available space */
  flex: 1;
  min-width: 0;  /* allows flex shrink below content size */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar { display: none; }
.categories-bar.hidden { display: none; }

.cat-tab {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 5, 8, 0.72);
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.5;
  letter-spacing: 0.1px;
}

.cat-tab:hover {
  background: rgba(124, 58, 237, 0.18);
  color: #fff;
  border-color: rgba(124, 58, 237, 0.38);
}

.cat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* â”€â”€ Status Pill â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

#status {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.68);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#status.hidden { opacity: 0; }

/* â”€â”€ Feed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

#feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Scrollbar hidden â€” scroll is controlled by JS (one video per swipe) */
  scrollbar-width: none;
}

#feed::-webkit-scrollbar { display: none; }

/* â”€â”€ Video Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.video-card {
  position: relative;
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always; /* browser cannot skip this snap point â€” one card per swipe */
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top: 2px solid rgba(255, 255, 255, 0.10);
}

.video-card:first-child {
  border-top: none;
}

/* ── Feed Spinner ─────────────────────────────────────────────── */

#feedSpinner {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

#feedSpinner.active { opacity: 1; }

.feed-spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: feed-spin 0.75s linear infinite;
}

@keyframes feed-spin {
  to { transform: rotate(360deg); }
}

/* ── End-of-feed Message ────────────────────────────────────── */

#feedEndMsg {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(20, 20, 24, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  padding: 8px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  white-space: nowrap;
}

#feedEndMsg.visible { opacity: 1; }

.feed-end-icon {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.feed-end-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

/* ── Card entrance animation (append only) ───────────────────── */

.card--entering {
  animation: card-fade-in 250ms ease-out forwards;
}

@keyframes card-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Top vignette — reinforces the cut between cards */
.video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.40) 0%, transparent 100%);
  z-index: 4;
  pointer-events: none;
}

/* Rich bottom gradient for text readability */
.video-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(
    to top,
    rgba(5, 5, 8, 0.90) 0%,
    rgba(5, 5, 8, 0.55) 30%,
    rgba(5, 5, 8, 0.18) 60%,
    transparent 100%
  );
  z-index: 4;
  pointer-events: none;
}

/* â”€â”€ Video Info Block (author / title / timestamp) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.video-info-block {
  position: absolute;
  left: 16px;
  bottom: 78px;
  right: 74px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none; /* tap-through to card click handler */
}

.vi-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

a.vi-author {
  pointer-events: auto; /* overrides parent pointer-events: none on .video-info-block */
  cursor: pointer;
}

a.vi-author:hover { color: #fff; }
a.vi-author:hover .vi-avatar { background: #a78bfa; }

.vi-avatar {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  transition: background 0.15s;
}

.vi-author-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vi-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  line-height: 1.45;
  letter-spacing: -0.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vi-timestamp {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.1px;
}

/* Expanded state: remove clamp so full title is visible */
.vi-title--expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* "more" / "less" toggle button */
.vi-more {
  display: inline-block;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto; /* overrides parent pointer-events: none */
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.vi-more:hover { color: rgba(255, 255, 255, 0.72); }

/* Inline #hashtag spans inside the title */
.vi-hashtag {
  color: #a78bfa;
  cursor: pointer;
  pointer-events: auto; /* overrides parent pointer-events: none */
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.vi-hashtag:hover { color: #c4b5fd; }

/* Tags row rendered below timestamp */
.vi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 2px;
  pointer-events: auto; /* overrides parent pointer-events: none */
}

.vi-tag {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.vi-tag:hover { color: #c4b5fd; }

/* â”€â”€ Video Watermark â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.video-watermark {
  position: absolute;
  top: 90px;  /* below search bar + categories bar area */
  right: 14px;
  z-index: 5;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.34);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.3px;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* â”€â”€ Video Element â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.video-wrap {
  width: 100%;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: cover;
}

/* â”€â”€ Video Action Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.video-actions {
  position: absolute;
  right: 14px;
  bottom: 114px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  padding: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.action-btn:hover  { color: #fff; transform: scale(1.06); }
.action-btn:active { transform: scale(0.88); }
.action-btn:focus  { outline: none; }

.action-btn.voted[data-type="like"]    { color: var(--liked);    }
.action-btn.voted[data-type="dislike"] { color: var(--disliked); }
.action-btn.bookmark-btn.favorited     { color: var(--favorited); }
.action-btn.share-btn:hover  { color: var(--accent-light); }
.action-btn.share-btn:active { color: var(--accent); }

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Pop animation â€” triggered via JS class toggle */
@keyframes action-pop {
  0%   { transform: scale(1);    }
  35%  { transform: scale(1.48); }
  65%  { transform: scale(0.90); }
  100% { transform: scale(1);    }
}

.action-btn.popping {
  animation: action-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mute button â€” circular, slightly separated from like/dislike */
.action-btn.mute-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.88);
  justify-content: center;
  filter: none;
  margin-bottom: 6px;
  transition: background 0.15s, opacity 0.15s;
}

/* Override the global hover/active scale â€” mute button uses opacity instead */
.action-btn.mute-btn:hover  { transform: none; opacity: 0.82; background: rgba(0, 0, 0, 0.55); }
.action-btn.mute-btn:active { transform: scale(0.92); }
.action-btn.mute-btn:focus  { outline: none; }

.action-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  line-height: 1;
}

.share-feedback {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  line-height: 1;
  min-height: 13px; /* prevents layout shift when text appears/clears */
}

/* â”€â”€ Bottom Navigation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  height: 56px;
  display: flex;
  align-items: center;
  background: rgba(5, 5, 8, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 40;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.36);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
  letter-spacing: 0.2px;
}

.bnav-item.active { color: #fff; }
.bnav-item:hover  { color: rgba(255, 255, 255, 0.72); }

/* TrueView upload button â€” violet gradient pill */
.bnav-upload-item { cursor: pointer; }

.bnav-plus-outer {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* No pseudo-element decorations â€” clean look */
.bnav-plus-outer::before,
.bnav-plus-outer::after { display: none; }

.bnav-plus-inner {
  width: 46px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 3px 14px rgba(124, 58, 237, 0.50);
  transition: opacity 0.15s, transform 0.1s;
}

.bnav-upload-item:hover  .bnav-plus-inner { opacity: 0.85; }
.bnav-upload-item:active .bnav-plus-inner { transform: scale(0.92); }

/* â”€â”€ Welcome Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

@keyframes welcome-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes welcome-card-in {
  from { opacity: 0; transform: scale(0.91) translateY(18px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.welcome-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110; /* above auth modal */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px;
  animation: welcome-backdrop-in 0.28s ease-out;
}

.welcome-modal.hidden { display: none; }

.welcome-card {
  background: #0f0f18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 32px 28px 28px;
  box-shadow:
    0 32px 96px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(124, 58, 237, 0.10),
    0 0 60px rgba(124, 58, 237, 0.06);
  animation: welcome-card-in 0.36s cubic-bezier(0.22, 1.0, 0.36, 1);
}

.welcome-card::-webkit-scrollbar { display: none; }

.welcome-brand-mark {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
}

.welcome-logo {
  height: 72px;
  width: auto;
  border-radius: 14px;
  object-fit: contain;
}

.welcome-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
}

.welcome-title {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  line-height: 1.28;
  margin: 0 0 22px;
  letter-spacing: -0.4px;
}

.welcome-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 28px;
}

.welcome-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.70;
  color: rgba(255, 255, 255, 0.68);
}

.welcome-signature {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.welcome-signature a {
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 255, 255, 0.30);
  text-decoration: none;
  transition: color 0.15s;
}

.welcome-signature a:hover { color: rgba(255, 255, 255, 0.55); }

.welcome-continue-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: opacity 0.15s, transform 0.1s;
}

.welcome-continue-btn:hover  { opacity: 0.87; }
.welcome-continue-btn:active { transform: scale(0.98); }

/* â”€â”€ User Auth Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.hidden { display: none; }

.modal-content {
  background: #101018;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 26px;
  border-radius: 18px;
  width: 90%;
  max-width: 340px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(124, 58, 237, 0.10);
}

.modal-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.modal-logo {
  height: 64px;
  width: auto;
  border-radius: 12px;
  object-fit: contain;
}

.modal-content input {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.modal-content input:focus {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.06);
}

.modal-content button {
  width: 100%;
  margin-bottom: 8px;
  padding: 11px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.modal-content button:hover  { opacity: 0.86; }
.modal-content button:active { transform: scale(0.98); }

#userLoginBtn   { background: var(--accent); color: #fff; }
#userRegBtn     { background: var(--accent); color: #fff; }
#closeUserModal { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.50); }

#userModalResult {
  min-height: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin-bottom: 4px;
}

/* â”€â”€ User Modal Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.user-modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 14px;
}

.user-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.user-tab:hover  { color: #fff; background: rgba(255, 255, 255, 0.05); }
.user-tab.active { background: rgba(124, 58, 237, 0.14); color: var(--accent-light); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   TABLET  â‰¥ 768px  â€” centered column with side borders
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@media (min-width: 768px) and (max-width: 1099px) {
  .phone-shell {
    max-width: 420px;
    margin: 0 auto;
    border-left:  1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  .bottom-nav {
    border-left:  1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DESKTOP  â‰¥ 1100px â€” three-column layout + phone frame
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@media (min-width: 1100px) {

  body {
    /* Subtle radial glow from center â€” adds depth to dark page */
    background: radial-gradient(
      ellipse 130% 110% at 50% 50%,
      #0e0e18 0%,
      var(--page-bg) 65%
    );
  }

  /* Three-column centered layout */
  .page-shell {
    align-items: center;
    justify-content: center;
    gap: 54px;
    padding: 0 48px;
  }

  /* Reveal sidebars */
  .dl-left,
  .dl-right {
    display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    align-self: center;
  }

  /* â”€â”€ Phone Frame â”€â”€ */
  .phone-shell {
    flex: none;
    width: 390px;
    height: min(90vh, 844px);
    border-radius: 46px;
    overflow: hidden;
    position: relative;

    /* Multi-layer shadow for depth + brand glow */
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.07),
      0 0 0 10px rgba(255, 255, 255, 0.015),
      0 48px 120px rgba(0, 0, 0, 0.90),
      0 0 100px var(--accent-glow);

    /*
      KEY: transform creates a new containing block for position:fixed children.
      This "contains" the fixed categories-bar, status pill, and bottom-nav
      inside the phone frame instead of the viewport.
    */
    transform: translateZ(0);
  }

  /* Override viewport-relative heights inside the phone frame */
  .phone-shell .app        { height: 100%; max-width: 100%; }
  .phone-shell #feed       { height: 100%; }
  .phone-shell .video-card { height: 100%; }
  .phone-shell .video-wrap { height: 100%; }

  /* Strip tablet border on desktop â€” the box-shadow is the frame */
  .phone-shell .bottom-nav {
    border-left:  none;
    border-right: none;
  }

  /* â”€â”€ Left Sidebar: Brand â”€â”€ */
  .dl-left {
    align-items: flex-start;
    gap: 22px;
    max-height: min(90vh, 844px);
    justify-content: center;
  }

  .brand-mark {
    display: flex;
    align-items: center;
    gap: 13px;
  }

  .brand-icon {
    flex-shrink: 0;
    filter: drop-shadow(0 6px 20px var(--accent-glow));
  }

  .brand-name {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.6px;
  }

  .brand-moretech {
    display: inline-block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.1px;
    padding-left: 1px;
    transition: color 0.15s;
  }

  .brand-moretech:hover { color: rgba(255, 255, 255, 0.48); }

  .brand-tagline {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.32);
    font-weight: 400;
    margin: 0;
    padding-left: 2px;
  }

  .brand-links {
    padding-left: 2px;
  }

  .brand-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.22);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    padding: 3px 11px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
  }

  /* â”€â”€ Right Sidebar: Video Info â”€â”€ */
  .dl-right {
    justify-content: space-between;
    max-height: min(90vh, 844px);
    padding: 8px 0;
  }

  .dl-video-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .dl-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--accent-light);
    opacity: 0.70;
  }

  .dl-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    letter-spacing: -0.3px;
    /* Clamp to 4 lines */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dl-counts {
    display: flex;
    gap: 18px;
  }

  .dl-count-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.48);
  }

  .dl-count-icon {
    opacity: 0.55;
  }

  .dl-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 500;
  }

}

/* â”€â”€ Ban Overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.ban-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ban-overlay-card {
  max-width: 300px;
  padding: 36px 28px;
  text-align: center;
  color: #fff;
}

.ban-overlay-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 18px;
}

.ban-overlay-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.ban-overlay-reason {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.55;
  margin-bottom: 18px;
  word-break: break-word;
}

.ban-overlay-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.5;
}

.ban-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.ban-overlay-btn {
  display: block;
  width: 100%;
  padding: 11px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: none;
  transition: opacity 0.15s;
}

.ban-overlay-btn:hover  { opacity: 0.82; }
.ban-overlay-btn:active { opacity: 0.65; }

.ban-overlay-btn--secondary {
  background: #7c3aed;
  color: #fff;
}

.ban-overlay-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
}

/* â”€â”€ PWA Install Button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Shared base â€” hidden until JS reveals it */
.pwa-install-trigger { display: none; }
.pwa-install-trigger.hidden { display: none !important; }

/* Mobile pill: fixed just above the bottom nav */
.pwa-install-pill {
  position: fixed;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 39;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.40);
  border-radius: 999px;
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-pill:not(.hidden) { display: flex; }
.pwa-install-pill:hover  { background: rgba(124, 58, 237, 0.26); }
.pwa-install-pill:active { opacity: 0.72; }

@media (min-width: 1100px) {
  /* Hide mobile pill on desktop â€” sidebar button handles it */
  .pwa-install-pill { display: none !important; }

  /* Sidebar button â€” appears below the Beta badge */
  .pwa-install-sidebar:not(.hidden) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 14px;
    background: rgba(124, 58, 237, 0.10);
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: 999px;
    color: rgba(167, 139, 250, 0.80);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.1px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }

  .pwa-install-sidebar:not(.hidden):hover {
    background: rgba(124, 58, 237, 0.22);
    color: var(--accent-light);
    border-color: rgba(124, 58, 237, 0.50);
  }

  .pwa-install-sidebar:not(.hidden):active { opacity: 0.72; }
}
