/**
 * 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 icons + Sign In / Join Free CTA
   ============================================ */
.videoswipe-nav-menu a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.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; }

.videoswipe-nav-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--vswp-border);
}
.videoswipe-login-btn {
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: var(--vswp-grad);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 150ms ease;
}
.videoswipe-login-btn:hover { opacity: 0.88; color: #fff; }

/* ============================================
   HOMEPAGE — geo chip + tabs above grid
   ============================================ */
.videoswipe-center-header {
  flex-shrink: 0;
  padding: 20px 18px 0;
}
.videoswipe-center-header .videoswipe-feed-heading {
  border-bottom: none;
  padding: 0 0 12px 0;
}

.videoswipe-geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--vswp-accent);
  background: var(--vswp-accent-bg);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--vswp-accent-soft);
  margin-bottom: 8px;
}

.videoswipe-feed-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--vswp-border);
  margin: 0 -18px;
  padding: 0 18px;
}
.videoswipe-tab {
  padding: 6px 14px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color 150ms ease;
}
.videoswipe-tab:hover { color: #888; }
.videoswipe-tab.active {
  color: var(--vswp-accent);
  border-bottom-color: var(--vswp-accent);
}

/* Homepage grid uses the shared responsive auto-fill from layout.css
   (repeat(auto-fill, minmax(220px, 1fr))) so columns flex 2/3/4+ with
   screen width — no override needed here. */

/* ============================================
   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: #0a0a0a;
  border-bottom: 1px solid var(--vswp-border);
  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: 9px;
  background: transparent;
  border: 1px solid var(--vswp-border);
  color: #666;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.videoswipe-btn-more:hover { border-color: #444; color: #aaa; }

/* (.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(4, 1fr);
  padding: 16px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  /* Match homepage grid: lock cards to 9:16 without letting one tall
     image stretch the row, and don't oversize rows during resize. */
  align-items: start;
  grid-auto-rows: max-content;
}
.videoswipe-grid-feed--author::-webkit-scrollbar { width: 4px; }
.videoswipe-grid-feed--author::-webkit-scrollbar-thumb { background: var(--vswp-border); border-radius: 2px; }

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

/* Sort bar (used on Author + Category) */
.videoswipe-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #080808;
  border-bottom: 1px solid #111;
  position: sticky;
  top: 0;
  z-index: 5;
}
.videoswipe-sort-group { display: flex; gap: 4px; }
.videoswipe-sort-btn {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--vswp-border);
  color: var(--vswp-text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  text-decoration: none;
}
.videoswipe-sort-btn.active {
  background: var(--vswp-accent-bg);
  border-color: var(--vswp-accent-soft);
  color: var(--vswp-accent);
}
.videoswipe-video-count { font-size: 11px; color: #333; }

/* 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 badges (color variants for HOT/NEW/HD/EXCL) */
.videoswipe-grid-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  z-index: 3;
}
.videoswipe-grid-badge--hot  { background: rgba(239,68,68,0.85); }
.videoswipe-grid-badge--new  { background: rgba(16,185,129,0.85); }
.videoswipe-grid-badge--hd   { background: rgba(59,130,246,0.85); }
.videoswipe-grid-badge--excl { background: rgba(168,85,247,0.85); }

/* ============================================
   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 20px;
  height: 52px;
  background: #111;
  border-bottom: 1px solid var(--vswp-border);
  flex-shrink: 0;
}
.videoswipe-brand--inline {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  background: var(--vswp-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 28px;
  text-decoration: none;
  padding: 0;
}
.videoswipe-top-nav {
  display: flex;
  gap: 2px;
}
.videoswipe-tn-item {
  padding: 6px 12px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.videoswipe-tn-item:hover { color: #aaa; }
.videoswipe-tn-item.active {
  color: #fff;
  background: var(--vswp-surface-2);
}
.videoswipe-top-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.videoswipe-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--vswp-surface-2);
  border: 1px solid #222;
  border-radius: 8px;
  padding: 5px 10px;
}
.videoswipe-search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: #aaa;
  font-family: 'DM Sans', sans-serif;
  width: 120px;
  margin: 0;
  padding: 0;
}
.videoswipe-search-icon { font-size: 12px; color: var(--vswp-text-muted); }
.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: 16px 20px 0;
  background: var(--vswp-bg);
  flex-shrink: 0;
}
.videoswipe-controls { flex-shrink: 0; }
.videoswipe-breadcrumb {
  font-size: 10px;
  color: #444;
  margin-bottom: 5px;
}
.videoswipe-breadcrumb a {
  color: #444;
  text-decoration: none;
}
.videoswipe-breadcrumb a:hover { color: #888; }
.videoswipe-breadcrumb span { color: #666; }
.videoswipe-cat-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.videoswipe-cat-title {
  font-family: var(--font-display);
  font-size: var(--vt-h1);
  font-weight: var(--vw-display);
  letter-spacing: var(--vt-tracking-display);
  line-height: 1.15;
  margin: 0;
  color: #fff;
}
.videoswipe-geo-badge {
  font-size: 10px;
  color: var(--vswp-accent);
  background: var(--vswp-accent-bg);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--vswp-accent-soft);
}
.videoswipe-vid-count { font-size: 11px; color: #444; }

.videoswipe-filter-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--vswp-border);
  overflow-x: auto;
}
.videoswipe-filter-bar::-webkit-scrollbar { display: none; }
.videoswipe-ftab {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--vswp-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.videoswipe-ftab:hover { color: #888; }
.videoswipe-ftab.active {
  color: var(--vswp-accent);
  border-bottom-color: var(--vswp-accent);
}

.videoswipe-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  background: #090909;
  border-bottom: 1px solid #111;
  flex-shrink: 0;
}
.videoswipe-result-info { font-size: 11px; color: #3a3a3a; }

/* 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(5, 1fr);
  display: grid;
  gap: 10px;
  /* Match homepage grid: see comment in --author above */
  align-items: start;
  align-content: start;
  grid-auto-rows: max-content;
}

.videoswipe-cat-sidebar {
  width: 220px;
  min-width: 220px;
  background: #0a0a0a;
  border-left: 1px solid #1a1a1a;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  flex-shrink: 0;
  align-self: stretch;
}
.videoswipe-cat-sidebar::-webkit-scrollbar { width: 3px; }
.videoswipe-cat-sidebar::-webkit-scrollbar-thumb { background: var(--vswp-border); }
.videoswipe-rs-label {
  font-size: 9px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 9px;
  display: block;
}
.videoswipe-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.videoswipe-stat-box {
  background: var(--vswp-surface);
  border-radius: 7px;
  padding: 10px;
  text-align: center;
}
.videoswipe-stat-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--vswp-accent);
}
.videoswipe-stat-lbl {
  font-size: 9px;
  color: var(--vswp-text-muted);
  margin-top: 2px;
}
.videoswipe-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}
.videoswipe-ttag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--vswp-surface);
  color: var(--vswp-text-muted);
  cursor: pointer;
  border: 1px solid var(--vswp-border);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.videoswipe-ttag:hover {
  color: var(--vswp-accent);
  border-color: var(--vswp-accent-soft);
}
.videoswipe-top-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.videoswipe-top-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--vswp-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.videoswipe-top-row:hover { color: #ccc; }
.videoswipe-top-rank {
  font-size: 12px;
  font-weight: 600;
  color: var(--vswp-accent);
  min-width: 18px;
}
.videoswipe-top-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.videoswipe-top-views {
  font-size: 9px;
  color: #333;
  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-left: none; border-top: 1px solid #1a1a1a; }
  .videoswipe-grid-feed--category { grid-template-columns: repeat(3, 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; }
}
