/* explore.css — Explore 2.0 Intelligent Discovery Grid */

.explore-page {
  padding: 24px 28px 80px;
  max-width: 1400px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.explore-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.explore-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF4D6D 0%, #FF2D55 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.explore-header-icon svg { width: 22px; height: 22px; }
.explore-header-text { flex-shrink: 0; }
.explore-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.explore-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  margin: 2px 0 0;
}

/* ── Search bar ───────────────────────────────────────────────────────────── */
.explore-search-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.explore-search-form:focus-within { border-color: rgba(255,77,109,0.4); }
.explore-search-input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  padding: 9px 16px;
  width: 220px;
}
.explore-search-input::placeholder { color: rgba(255,255,255,0.3); }
.explore-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.explore-search-btn:hover { color: #FF4D6D; }
.explore-search-btn svg { width: 16px; height: 16px; }

/* ── Category tabs ──────────────────────────────────────────────────────────── */
.explore-tabs-row {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  scrollbar-width: none;
}
.explore-tabs-row::-webkit-scrollbar { display: none; }
.explore-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #A0A0A0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
  margin-bottom: -1px;
}
.explore-tab:hover { color: #fff; }
.explore-tab.active {
  color: #FF4D6D;
  border-bottom-color: #FF4D6D;
}

/* ── Grid header ──────────────────────────────────────────────────────────── */
.explore-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.explore-grid-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.explore-sort-select {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.explore-sort-select:hover { border-color: rgba(255,77,109,0.3); }
.explore-sort-select option { background: #1A1A1A; }

/* ── Explore grid ─────────────────────────────────────────────────────────── */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ── Reel card ────────────────────────────────────────────────────────────── */
.reel-card {
  display: block;
  background: #1A1A1A;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
}
.reel-card:hover {
  transform: scale(1.03);
  border-color: rgba(255,77,109,0.6);
  box-shadow: 0 0 0 1px rgba(255,77,109,0.3), 0 8px 24px rgba(0,0,0,0.4);
}

/* ── Reel thumbnail ───────────────────────────────────────────────────────── */
.reel-thumb {
  position: relative;
  overflow: hidden;
  background: #121218;
  aspect-ratio: 16/9;
  border-radius: 8px;
  display: block;
}
.reel-thumb-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Badges */
.reel-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,45,85,0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.live-badge-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
.trending-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #FF4D6D;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* View count — top-right corner */
.reel-views {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.reel-views svg { width: 10px; height: 10px; }

/* Duration badge — bottom-right */
.reel-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
}

/* Creator overlay — bottom-left inside thumb */
.reel-creator-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.55);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
  backdrop-filter: blur(2px);
}
.reel-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}
.reel-handle {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reel-verified {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Skeleton loading ─────────────────────────────────────────────────────── */
.skeleton-card { pointer-events: none; }
.skeleton-thumb {
  background: linear-gradient(90deg, #1A1A1A 25%, #252525 50%, #1A1A1A 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 160px;
}
.skeleton-strip {
  height: 36px;
  background: linear-gradient(90deg, #1A1A1A 25%, #252525 50%, #1A1A1A 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Skeleton row (for infinite scroll) ─────────────────────────────────── */
.explore-skeleton-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* ── End message ──────────────────────────────────────────────────────────── */
.explore-end {
  text-align: center;
  padding: 32px 20px;
  color: rgba(255,255,255,0.3);
  font-size: 0.82rem;
}

/* ── Hover autoplay iframe ───────────────────────────────────────────────── */
.reel-thumb .autoplay-frame {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  pointer-events: none;
}

/* ── Responsive: 4-col → 3-col → 2-col → 1-col ─────────────────────────────── */
@media (max-width: 1100px) {
  .explore-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .explore-page { padding: 16px 16px 60px; }
  .explore-search-input { width: 160px; }
}
@media (max-width: 480px) {
  .explore-grid { grid-template-columns: 1fr; }
  .explore-header { flex-wrap: wrap; }
  .explore-search-form { margin-left: 0; width: 100%; order: 3; }
  .explore-search-input { width: 100%; }
}

/* ── Live Now section (from legacy) ───────────────────────────────────────── */
.live-now-section {
  margin-bottom: 32px;
}
.live-now-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.live-now-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.live-now-section__count {
  background: #FF2D55;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.live-now-row { display: flex; gap: 12px; overflow-x: auto; }
.live-now-card {
  flex-shrink: 0;
  width: 140px;
  background: #1A1A1A;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.04);
}
.live-now-card:hover { border-color: rgba(255,77,109,0.3); }
.live-now-thumb {
  position: relative;
  aspect-ratio: 9/16;
  background: #121218;
}
.live-now-thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-now-info { padding: 8px; }
.live-now-name { font-size: 0.75rem; font-weight: 600; color: #fff; }
.live-now-handle { font-size: 0.68rem; color: rgba(255,255,255,0.4); }

/* ── Trending creators section (from legacy) ─────────────────────────────── */
.explore-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.explore-creators-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.explore-creator-card {
  background: #1A1A1A;
  border-radius: 10px;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}
.explore-creator-card:hover { transform: translateY(-2px); border-color: rgba(255,77,109,0.2); }
.explore-creator-avatar-wrap { position: relative; margin-bottom: 10px; }
.explore-creator-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,77,109,0.35);
  object-fit: cover;
  background: #2a2a2a;
}
.explore-creator-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: #FF4D6D;
}
.explore-verified-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 18px; height: 18px;
  background: #000; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.explore-verified-badge svg { width: 14px; height: 14px; }
.explore-creator-name { font-size: 0.85rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.explore-creator-handle { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.explore-creator-followers { font-size: 0.7rem; color: rgba(255,255,255,0.35); margin-bottom: 10px; }
.explore-follow-btn {
  padding: 6px 16px;
  background: #FF4D6D; color: #fff; border: none; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s; font-family: 'Inter', sans-serif;
}
.explore-follow-btn:hover { background: #e8435f; }
.explore-follow-btn.following { background: transparent; border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.5); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.explore-empty {
  text-align: center; padding: 40px 20px;
  color: rgba(255,255,255,0.3); background: #1A1A1A;
  border-radius: 12px; margin-bottom: 32px;
  border: 1px solid rgba(255,255,255,0.04);
}
.explore-empty p { font-size: 0.85rem; margin: 0; }

@media (max-width: 768px) {
  .explore-creators-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
  .explore-creators-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Restricted post preview overlay on explore tiles ─────────────────────── */

.explore-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 45%);
  border-radius: 12px;
  pointer-events: none;
}
.explore-preview-media {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
}
.explore-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1px) brightness(0.65);
}
.explore-preview-placeholder {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
}
.explore-lock-badge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.6);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.72rem;
  color: #f0f0f0;
}
.explore-preview-cta {
  position: relative;
  z-index: 1;
  background: #00F2EA;
  color: #000;
  border-radius: 12px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  pointer-events: all;
}
.explore-preview-cta:hover { opacity: 0.88; }