/**
 * Media Engine V2 — Page-specific layouts (Homepage / Author / Category)
 *
 * Companion to layout.css. layout.css owns the shared 3-column shell, this
 * file adds the differences each page design demands:
 *
 *   - Homepage: geo chip + tabs + 2-col grid
 *   - Author: hero + 4-col grid + sort bar
 *   - Category: NO left nav, top horizontal bar, 5-col grid, stats sidebar
 *
 * Reference mockups: 51xfree_homepage_v2.html, _author_v2.html, _category_v2.html
 */

/* ============================================
   LEFT NAV — SVG icon polish only
   (the menu link itself is now styled in layout.css; this file
    only tweaks the icon ↔ text relationship)
   ============================================ */
.videoswipe-nav-icon {
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 150ms ease;
}
.videoswipe-nav-menu a:hover .videoswipe-nav-icon { opacity: 1; }
.videoswipe-nav-menu .current-menu-item .videoswipe-nav-icon { opacity: 1; color: var(--vswp-accent); }
.videoswipe-nav-label-text { flex: 1; min-width: 0; }

/* NOTE — `.videoswipe-nav-footer`, `.videoswipe-login-btn`,
   `.videoswipe-center-header`, `.videoswipe-feed-tabs`, `.videoswipe-tab`,
   and `.videoswipe-geo-chip` styles previously lived here but have all
   been migrated to layout.css to keep the Fintech Clean visual rules in
   one place (no border-bottom underlines, pill-shaped tabs, gradient
   active state). Don't re-add them here unless you intend to override.

   Homepage grid: uses the shared responsive auto-fill from layout.css. */

/* ============================================
   AUTHOR PAGE — Hero + 4-col grid
   ============================================ */
/* Author center: hero pinned at top, grid + sidebar each scroll independently
   inside .videoswipe-author-body. The col-center keeps overflow:hidden from
   the base layout so nothing leaks past the viewport. */
.videoswipe-layout--author .videoswipe-col-center {
  overflow: hidden;
}

.videoswipe-author-hero {
  flex-shrink: 0;
  background: var(--vswp-bg);
  position: relative;
  overflow: hidden;
}
.videoswipe-author-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.videoswipe-author-hero-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 28px 20px;
  position: relative;
  z-index: 1;
}

.videoswipe-author-av-wrap {
  position: relative;
  flex-shrink: 0;
}
.videoswipe-author-av {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--vswp-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  border: 3px solid var(--vswp-accent);
  box-shadow: 0 0 24px rgba(168,85,247,0.3);
  color: #fff;
  object-fit: cover;
}
.videoswipe-author-av--img {
  background: #1a1a2e;
  display: block;
}
.videoswipe-author-verified {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vswp-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #0a0a0a;
}

.videoswipe-author-info { flex: 1; min-width: 0; }
.videoswipe-author-name {
  font-family: var(--font-display);
  font-size: var(--vt-display);
  font-weight: var(--vw-display);
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: var(--vt-tracking-display);
  line-height: 1.05;
}
.videoswipe-author-handle {
  font-family: var(--font-body);
  font-size: var(--vt-body);
  font-weight: var(--vw-medium);
  color: var(--vswp-text-muted);
  margin-bottom: 14px;
}
.videoswipe-author-bio {
  font-family: var(--font-body);
  font-size: var(--vt-caption);
  color: var(--vswp-text-dim);
  line-height: 1.55;
  margin: 0 0 16px;
  max-width: 460px;
}

.videoswipe-author-stats {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 18px;
}
.videoswipe-author-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.videoswipe-author-stat-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--vw-display);
  /* Tabular + lining nums: every digit takes the same width, so the four
     stat numbers (0 / 9 / 0 / 4.8) sit on the same visual rhythm even
     though Syne's proportional digits would otherwise drift in width. */
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum", "lnum";
  letter-spacing: 0;
  line-height: 1;
  color: #fff;
}
.videoswipe-author-stat-star {
  /* The ★ glyph isn't in Syne, so it falls back to the system font and
     used to break the row's consistency. Render it in the body font
     family at smaller scale + accent colour, deliberately. */
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7em;
  font-weight: var(--vw-bold);
  color: var(--vswp-accent);
  margin-left: 3px;
  vertical-align: 0.15em;
  line-height: 1;
}
.videoswipe-author-stat-lbl {
  font-family: var(--font-body);
  font-size: var(--vt-meta);
  font-weight: var(--vw-semi);
  color: var(--vswp-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--vt-tracking-wide);
  margin-top: 6px;
  line-height: 1.2;
}

.videoswipe-author-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.videoswipe-btn-follow {
  padding: 9px 22px;
  border-radius: 9px;
  background: var(--vswp-grad);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 14px rgba(124,58,237,0.35);
  transition: opacity 0.15s;
}
.videoswipe-btn-follow:hover { opacity: 0.88; }
.videoswipe-btn-follow.is-following {
  background: transparent;
  border: 1px solid var(--vswp-accent);
  color: var(--vswp-accent);
  box-shadow: none;
}
.videoswipe-btn-share-earn {
  padding: 9px 18px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid var(--vswp-accent);
  color: var(--vswp-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.videoswipe-btn-share-earn:hover { background: rgba(168,85,247,0.08); }
.videoswipe-btn-more {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: #b8b0c8;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}
.videoswipe-btn-more:hover { background: rgba(168, 85, 247, 0.18); color: #fff; }

/* (.videoswipe-author-tags / .videoswipe-author-tag rules removed —
   the filter-chip row was retired from the author hero. Newest /
   Most Views / Top Rated sort tabs cover the discovery use case.) */

/* Author body: video grid + inline right panel.
   min-height:0 + overflow:hidden is critical so the inner scroll containers
   actually scroll instead of pushing the whole page taller. */
.videoswipe-author-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.videoswipe-author-body .videoswipe-video-section {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The grid itself owns the scroll. flex:1 + overflow-y:auto + min-height:0
   means new rows append cleanly and infinite-scroll just works. The grid
   uses CSS Grid auto-placement, so adding more cards via JS doesn't shift
   anything outside this container. */
.videoswipe-grid-feed--author {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 24px 32px 36px;
  gap: 26px 22px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
}
.videoswipe-grid-feed--author::-webkit-scrollbar { width: 6px; }
.videoswipe-grid-feed--author::-webkit-scrollbar-thumb { background: #1c1c1c; border-radius: 3px; }
.videoswipe-grid-feed--author::-webkit-scrollbar-thumb:hover { background: #2a2a2a; }

/* Inline right panel scrolls independently — does not move when grid scrolls */
.videoswipe-col-right--inline {
  position: static;
  align-self: stretch;
  width: 260px;
  flex-shrink: 0;
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Sort bar (used on Author + Category) — Fintech Clean: no borders,
   pill-shaped buttons, active state is the same gradient pill as the
   homepage feed tabs so the visual rhythm carries across pages. */
.videoswipe-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.videoswipe-sort-group { display: flex; gap: 6px; flex-wrap: wrap; }
.videoswipe-sort-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: #6b6480;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
  text-decoration: none;
}
.videoswipe-sort-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.videoswipe-sort-btn.active {
  background: var(--vswp-grad);
  color: #fff;
  box-shadow: 0 6px 22px -8px rgba(124, 58, 237, 0.65);
}
.videoswipe-video-count { font-size: 11px; color: var(--vswp-text-muted); }

/* Loading more dots indicator */
.videoswipe-load-more {
  text-align: center;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #2a2a2a;
  font-size: 11px;
}
.videoswipe-ld {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--vswp-accent);
  animation: vswpPulse 1.2s infinite;
}
.videoswipe-ld:nth-child(2) { animation-delay: 0.2s; }
.videoswipe-ld:nth-child(3) { animation-delay: 0.4s; }
@keyframes vswpPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* (Card-badge styles moved to layout.css and refined to gradient pills.
   Only the EXCL modifier — exclusive content — is kept here; HOT/NEW/HD
   are owned by layout.css.) */
.videoswipe-grid-badge--excl { background: linear-gradient(135deg, #a855f7, #6d28d9); }

/* ============================================
   CATEGORY PAGE — NO left nav, top horizontal bar
   ============================================ */
.videoswipe-layout--category {
  grid-template-columns: minmax(0, 1fr);
}
.videoswipe-layout--category .videoswipe-col-left { display: none; }

.videoswipe-col-center--full {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.videoswipe-top-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 28px;
  height: 64px;
  background: var(--vswp-bg);
  flex-shrink: 0;
}
.videoswipe-brand--inline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--vswp-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 32px;
  text-decoration: none;
  padding: 0;
}
.videoswipe-top-nav { display: flex; gap: 4px; }
.videoswipe-tn-item {
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #6b6480;
  cursor: pointer;
  border-radius: 999px;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}
.videoswipe-tn-item:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.videoswipe-tn-item.active {
  color: #fff;
  background: var(--vswp-grad);
  box-shadow: 0 6px 22px -8px rgba(124, 58, 237, 0.65);
}
.videoswipe-top-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.videoswipe-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  transition: background 150ms ease;
}
.videoswipe-search-box:focus-within {
  background: rgba(168, 85, 247, 0.10);
}
.videoswipe-search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  font-family: var(--font-body);
  width: 160px;
  margin: 0;
  padding: 0;
}
.videoswipe-search-box input::placeholder { color: #5a5470; }
.videoswipe-search-icon { font-size: 14px; color: var(--vswp-accent); }
.videoswipe-login-btn-sm {
  padding: 6px 14px;
  border-radius: 7px;
  background: var(--vswp-grad);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  transition: opacity 0.15s;
}
.videoswipe-login-btn-sm:hover { opacity: 0.88; color: #fff; }

.videoswipe-cat-header {
  padding: 28px 32px 8px;
  background: var(--vswp-bg);
  flex-shrink: 0;
}
.videoswipe-controls { flex-shrink: 0; }
.videoswipe-breadcrumb {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #5a5470;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.videoswipe-breadcrumb a {
  color: var(--vswp-accent);
  text-decoration: none;
  transition: opacity 150ms ease;
}
.videoswipe-breadcrumb a:hover { opacity: 0.75; }
.videoswipe-breadcrumb span { color: #444; }
.videoswipe-cat-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.videoswipe-cat-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  color: #fff;
}
.videoswipe-geo-badge {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(168, 85, 247, 0.18);
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
}
.videoswipe-vid-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--vswp-text-muted);
}

.videoswipe-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0;
}
.videoswipe-filter-bar::-webkit-scrollbar { display: none; }
.videoswipe-ftab {
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: transparent;
  color: #6b6480;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}
.videoswipe-ftab:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.videoswipe-ftab.active {
  color: #fff;
  background: var(--vswp-grad);
  box-shadow: 0 6px 22px -8px rgba(124, 58, 237, 0.65);
}

.videoswipe-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: transparent;
  flex-shrink: 0;
}
.videoswipe-result-info {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--vswp-text-muted);
  letter-spacing: 0.02em;
}

/* Category body: grid container + stats sidebar each scroll independently.
   Top bar / cat-header / controls stay pinned above. */
.videoswipe-cat-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}
.videoswipe-video-grid-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 20px;
}
.videoswipe-video-grid-container::-webkit-scrollbar { width: 3px; }
.videoswipe-video-grid-container::-webkit-scrollbar-thumb { background: var(--vswp-border); }

.videoswipe-grid-feed--category {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  display: grid;
  gap: 22px 18px;
  align-items: start;
  align-content: start;
  grid-auto-rows: max-content;
}

.videoswipe-cat-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--vswp-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 22px 28px;
  flex-shrink: 0;
  align-self: stretch;
}
.videoswipe-cat-sidebar::-webkit-scrollbar { width: 6px; }
.videoswipe-cat-sidebar::-webkit-scrollbar-thumb { background: #1c1c1c; border-radius: 3px; }
.videoswipe-rs-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--vswp-accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
  display: block;
}
.videoswipe-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.videoswipe-stat-box {
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.videoswipe-stat-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums lining-nums;
}
.videoswipe-stat-lbl {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vswp-text-muted);
  margin-top: 4px;
}
.videoswipe-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.videoswipe-ttag {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #b8b0c8;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}
.videoswipe-ttag:hover {
  color: #fff;
  background: var(--vswp-grad);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(124, 58, 237, 0.6);
}
.videoswipe-top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.videoswipe-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #b8b0c8;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 8px;
  transition: color 150ms ease, background 150ms ease;
}
.videoswipe-top-row:hover { color: #fff; background: rgba(255, 255, 255, 0.025); }
.videoswipe-top-rank {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  background: var(--vswp-grad-h);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 22px;
}
.videoswipe-top-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.videoswipe-top-views {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: var(--vswp-text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .videoswipe-grid-feed--author { grid-template-columns: repeat(3, 1fr); }
  .videoswipe-grid-feed--category { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  /* Author page: stack hero + grid + sidebar vertically */
  .videoswipe-layout--author .videoswipe-col-center { height: auto; overflow: visible; }
  .videoswipe-author-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px 16px;
    gap: 16px;
  }
  .videoswipe-author-stats { justify-content: center; gap: 20px; }
  .videoswipe-author-actions { justify-content: center; }
  .videoswipe-author-body { flex-direction: column; }
  .videoswipe-col-right--inline { width: 100%; }
  .videoswipe-grid-feed--author { grid-template-columns: repeat(2, 1fr); padding: 12px; }

  /* Category page: stack grid + sidebar */
  .videoswipe-cat-body { flex-direction: column; }
  .videoswipe-cat-sidebar { width: 100%; min-width: 0; border: none; padding: 24px 18px; }
  .videoswipe-grid-feed--category { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 600px) {
  .videoswipe-grid-feed--author,
  .videoswipe-grid-feed--category { grid-template-columns: repeat(2, 1fr); }
  .videoswipe-top-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .videoswipe-search-box input { width: 80px; }
  .videoswipe-author-name { font-size: 18px; }
}
