/* ═══════════════════════════════════════════════════════════════════
   GlueArrow Hub — Showcase Hero + Snap Video Feed + Grid
   Mirrors mobile app: ShowcaseCard → TikTok snap feed → Grid
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Scroll Snap (TikTok-style vertical snap — mirrors mobile FlatList) ── */
.swipe-page[data-view="hub"] {
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

/* ─── Showcase Hero (full viewport, mirrors ShowcaseCard.js) ─────── */
.hub-showcase {
  position: relative;
  height: calc(100vh - 110px);
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 0;
  scroll-snap-align: start;
}

/* Subtle accent blobs */
.hub-showcase::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.06);
  pointer-events: none;
}
.hub-showcase::after {
  content: '';
  position: absolute;
  bottom: 100px;
  left: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.04);
  pointer-events: none;
}

.showcase-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 24px 0;
  position: relative;
  z-index: 2;
  animation: showcase-fade-in 0.6s ease-out;
}

@keyframes showcase-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Brand */
.showcase-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.showcase-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.showcase-brand-icon svg {
  width: 22px;
  height: 22px;
  color: #10b981;
}
.showcase-brand-text {
  font-size: 26px;
  font-weight: 900;
  color: #10b981;
  letter-spacing: -0.8px;
}

/* Search bar */
.showcase-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 18px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 28px;
}
.showcase-search:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.showcase-search svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
.showcase-search-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
}

/* Intel preview section */
.showcase-intel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.showcase-intel-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 2px;
}
.showcase-intel-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.15s;
}
.showcase-intel-card:hover {
  background: rgba(255, 255, 255, 0.07);
}
.showcase-intel-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.showcase-industry-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}
.showcase-signal-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}
.showcase-signal-pill.buy { border-color: #00FF87; color: #00FF87; }
.showcase-signal-pill.wait { border-color: #FF4560; color: #FF4560; }
.showcase-signal-pill.stable { border-color: #FFB800; color: #FFB800; }
.showcase-signal-pill.watch { border-color: #4DA6FF; color: #4DA6FF; }
.showcase-intel-headline {
  font-size: 15px;
  font-weight: 700;
  color: #EEF2F7;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.showcase-intel-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}
.showcase-intel-meta svg {
  width: 9px;
  height: 9px;
  color: #10b981;
}
.showcase-intel-meta span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.3);
}

/* Swipe hint (bottom bouncing arrow) */
.showcase-swipe-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 24px;
  position: relative;
  z-index: 2;
}
.showcase-swipe-text {
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.3px;
}
.showcase-swipe-arrow {
  animation: showcase-bounce 1.4s ease-in-out infinite;
  cursor: pointer;
}
.showcase-swipe-arrow svg {
  width: 28px;
  height: 28px;
  color: #10b981;
}

@keyframes showcase-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ─── Snap Video Feed (TikTok-style) ─────────────────────────────── */
.hub-snap-card {
  position: relative;
  height: calc(100vh - 110px);
  min-height: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  scroll-snap-align: start;
  cursor: pointer;
}

/* Background image */
.hub-snap-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hub-snap-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hub-snap-card-bg .snap-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--stone-900), var(--stone-800));
}
.hub-snap-card-bg .snap-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--stone-600);
  stroke-width: 1;
}

/* Gradient overlay */
.hub-snap-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.1) 70%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Type badge */
.hub-snap-card-type {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  z-index: 3;
}
.hub-snap-card-type.video { background: rgba(239, 68, 68, 0.85); color: #fff; }
.hub-snap-card-type.intel { background: rgba(59, 130, 246, 0.85); color: #fff; }
.hub-snap-card-type.radio { background: rgba(16, 185, 129, 0.85); color: #fff; }
.hub-snap-card-type.tv { background: rgba(168, 85, 247, 0.85); color: #fff; }
.hub-snap-card-type.post { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* Play button overlay */
.hub-snap-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.hub-snap-card:hover .hub-snap-play { opacity: 1; }
.hub-snap-play svg { width: 32px; height: 32px; color: #fff; margin-left: 4px; }

/* Content overlay at bottom */
.hub-snap-card-content {
  position: relative;
  z-index: 2;
  padding: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.hub-snap-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: var(--stone-700);
}
.hub-snap-card-meta { flex: 1; min-width: 0; }
.hub-snap-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.hub-snap-card-author {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}
.hub-snap-card-topic {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* Right-side action buttons */
.hub-snap-actions {
  position: absolute;
  right: 16px;
  bottom: 100px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hub-snap-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s;
}
.hub-snap-action:hover { transform: scale(1.1); }
.hub-snap-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-snap-action-icon svg { width: 20px; height: 20px; color: #fff; }
.hub-snap-action-label { font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.6); }

/* Snap counter */
.hub-snap-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ─── Section Divider ────────────────────────────────────────────── */
.hub-section-divider {
  padding: 32px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hub-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone-500);
}

/* ─── Category Pills Bar ──────────────────────────────────────────── */
.hub-pills {
  display: flex;
  gap: 6px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--stone-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hub-pills::-webkit-scrollbar { display: none; }

.hub-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--stone-400);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.hub-pill:hover { background: rgba(255, 255, 255, 0.1); color: var(--stone-200); }
.hub-pill.active { background: #fff; color: var(--stone-950); border-color: #fff; }

/* ─── Content Grid ────────────────────────────────────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 0;
}

/* ─── Content Card ────────────────────────────────────────────────── */
.hub-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  background: var(--stone-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}
.hub-card:active { transform: scale(0.98); }

.hub-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--stone-800);
  overflow: hidden;
}
.hub-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.hub-card:hover .hub-card-thumb img { transform: scale(1.03); }

.hub-card-thumb .thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--stone-800), var(--stone-900));
}
.hub-card-thumb .thumb-placeholder svg { width: 32px; height: 32px; color: var(--stone-600); stroke-width: 1.5; }

.hub-card-type {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}
.hub-card-type.video { background: rgba(239, 68, 68, 0.85); color: #fff; }
.hub-card-type.intel { background: rgba(59, 130, 246, 0.85); color: #fff; }
.hub-card-type.radio { background: rgba(16, 185, 129, 0.85); color: #fff; }
.hub-card-type.tv { background: rgba(168, 85, 247, 0.85); color: #fff; }
.hub-card-type.post { background: rgba(255, 255, 255, 0.15); color: #fff; }

.hub-card-play {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.hub-card:hover .hub-card-play { opacity: 1; }
.hub-card-play svg { width: 16px; height: 16px; color: #fff; margin-left: 2px; }

.hub-card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.hub-card-engagement {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}
.hub-card-engagement svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

.hub-card-info { padding: 10px; display: flex; gap: 8px; align-items: flex-start; }
.hub-card-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--stone-700); }
.hub-card-meta { flex: 1; min-width: 0; }
.hub-card-title {
  font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px;
}
.hub-card-author { font-size: 11px; color: var(--stone-500); display: flex; align-items: center; gap: 4px; }
.hub-card-time { font-size: 10px; color: var(--stone-600); margin-top: 2px; }

/* ─── Skeleton Loading Cards ──────────────────────────────────────── */
.hub-skeleton {
  border-radius: 12px;
  overflow: hidden;
  background: var(--stone-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hub-skeleton-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(110deg, var(--stone-800) 30%, var(--stone-700) 50%, var(--stone-800) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}
.hub-skeleton-info { padding: 10px; display: flex; gap: 8px; }
.hub-skeleton-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--stone-800); flex-shrink: 0; }
.hub-skeleton-lines { flex: 1; }
.hub-skeleton-line {
  height: 10px; border-radius: 4px;
  background: linear-gradient(110deg, var(--stone-800) 30%, var(--stone-700) 50%, var(--stone-800) 70%);
  background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; margin-bottom: 6px;
}
.hub-skeleton-line:last-child { width: 60%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Load More / End of Feed ─────────────────────────────────────── */
.hub-load-more { display: flex; justify-content: center; padding: 24px 0 32px; }
.hub-load-more-btn {
  padding: 12px 32px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--stone-300); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.hub-load-more-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hub-load-more-btn:disabled { opacity: 0.5; cursor: default; }

.hub-spinner {
  width: 24px; height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.1); border-top-color: var(--emerald);
  border-radius: 50%; animation: hub-spin 0.7s linear infinite;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }

.hub-end { text-align: center; padding: 24px 0 32px; color: var(--stone-600); font-size: 12px; font-weight: 500; }

/* ─── Empty State ─────────────────────────────────────────────────── */
.hub-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.hub-empty svg { width: 48px; height: 48px; color: var(--stone-600); margin-bottom: 16px; }
.hub-empty h3 { font-size: 16px; font-weight: 700; color: var(--stone-300); margin-bottom: 6px; }
.hub-empty p { font-size: 13px; color: var(--stone-500); max-width: 280px; }

/* ─── Discovery Section (unauthenticated) ─────────────────────────── */
.hub-discover { padding: 20px 0 8px; }
.hub-discover-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--stone-500); margin-bottom: 12px; }
.hub-discover-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hub-discover-card {
  background: var(--stone-900); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px; padding: 16px; cursor: pointer; transition: all 0.15s;
}
.hub-discover-card:hover { background: var(--stone-800); border-color: rgba(255, 255, 255, 0.1); }
.hub-discover-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.hub-discover-card-icon svg { width: 18px; height: 18px; color: #fff; stroke-width: 2; }
.hub-discover-card h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.hub-discover-card p { font-size: 12px; color: var(--stone-500); line-height: 1.4; }

/* ─── Sign-in CTA ────────────────────────────────────────────────── */
.hub-signin-cta {
  background: linear-gradient(135deg, var(--stone-900), var(--stone-800));
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 24px; text-align: center; grid-column: 1 / -1;
}
.hub-signin-cta h3 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.hub-signin-cta p { font-size: 13px; color: var(--stone-400); margin-bottom: 16px; }
.hub-signin-cta .cta-btn {
  display: inline-block; padding: 12px 28px; border-radius: 100px;
  background: #fff; color: var(--stone-900); font-size: 14px; font-weight: 700; text-decoration: none; transition: background 0.15s;
}
.hub-signin-cta .cta-btn:hover { background: var(--stone-100); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hub-showcase { height: calc(100vh - 140px); min-height: 420px; scroll-snap-align: start; }
  .showcase-content { padding: 20px 16px 0; }
  .showcase-brand-text { font-size: 22px; }
  .showcase-search { height: 44px; }
  .hub-snap-card { height: calc(100vh - 140px); min-height: 420px; scroll-snap-align: start; }
  .hub-pills { padding: 10px 0; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 0; }
  .hub-card-info { padding: 8px; }
  .hub-card-title { font-size: 12px; }
  .hub-snap-card-content { padding: 16px; }
  .hub-snap-card-title { font-size: 15px; }
  .hub-snap-actions { right: 12px; bottom: 80px; gap: 16px; }
  .hub-snap-action-icon { width: 40px; height: 40px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hub-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (min-width: 1024px) {
  .hub-showcase { height: calc(100vh - 130px); }
  .hub-snap-card { height: calc(100vh - 130px); }
  .hub-pills { padding: 14px 0; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--stone-950); }
  .hub-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 0; }
  .hub-card { border-radius: 14px; }
  .hub-card-info { padding: 12px; }
  .hub-card-title { font-size: 14px; }
  .hub-discover-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (min-width: 1440px) {
  .hub-grid { grid-template-columns: repeat(5, 1fr); }
}
