/* ================= Fanvue Design System ================= */
:root {
  --bg-primary: #151515;
  --bg-secondary: #1c1c1c;
  --bg-card: #222222;
  --surface-primary: #262626;
  --surface-secondary: #2e2e2e;
  --border-color: #333333;
  --border-subtle: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #d4d4d4;
  --text-tertiary: #a3a3a3;
  --accent-green: #49f264;
  --accent-green-hover: #3ee058;
  --pill-bg: #262626;
  --pill-active-bg: #ffffff;
  --pill-active-text: #151515;
  --overlay-glass: rgba(20, 20, 20, 0.72);
}

.light {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --surface-primary: #f0f0f0;
  --surface-secondary: #e5e5e5;
  --border-color: #e0e0e0;
  --border-subtle: #eaeaea;
  --text-primary: #151515;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --pill-bg: #e5e5e5;
  --pill-active-bg: #151515;
  --pill-active-text: #ffffff;
  --overlay-glass: rgba(255, 255, 255, 0.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { 
  background: var(--bg-primary); 
  color: var(--text-primary); 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* Side Banner Ads (Desktop Only) */
.side-banner {
  display: none;
}

@media (min-width: 1200px) {
  .side-banner {
    display: block;  /* Add display block */
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: auto;
    min-width: 160px;
    overflow: visible;
  }
  
  .left-banner {
    left: 10px;
  }
  
  .right-banner {
    right: 10px;
  }
  
  /* Force iframe dimensions */
  .side-banner iframe {
    display: block;
    width: 160px !important;
    height: 600px !important;
    border: none;
  }
}

@media (min-width: 1280px) {
  .left-banner {
    left: 30px;
  }
  
  .right-banner {
    right: 30px;
  }
}

@media (min-width: 1440px) {
  /*
   * FIX: Posisi banner sebelumnya bisa menjadi negatif.
   * Contoh viewport 1440px:
   * (1440 - 1200) / 2 - 200 = -80px
   * sehingga banner kiri terpotong di luar layar.
   *
   * app-container = 608px, banner = 160px,
   * jarak dari container = 24px.
   */
  .left-banner {
    left: calc(50% - 488px);
  }

  .right-banner {
    right: calc(50% - 488px);
  }
}

/* Shell Container (Fanvue mobile/desktop center view) */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

@media (min-width: 769px) {
  .app-container {
    max-width: 608px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
  }
}

/* Main Profile Header Card */
.profile-card {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

/* Banner / Cover */
.cover-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 50%, rgba(21,21,21,0.9) 100%);
}

/* Profile Info Section */
.profile-info {
  padding: 0 16px 20px;
  position: relative;
}

.avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -48px;
  margin-bottom: 12px;
  position: relative;
  z-index: 5;
}

.avatar-container {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--bg-primary);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  position: relative;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.verified-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(73, 242, 100, 0.15);
  color: var(--accent-green);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.online-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-green);
}

.user-handle-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.top-creator-tag {
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-item svg { opacity: 0.75; }

.bio-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
  white-space: pre-line;
  margin-bottom: 16px;
}

.bio-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.show-more-btn {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
}
.show-more-btn:hover { text-decoration: underline; }

/* Main Vibrant Join Button */
.main-join-btn {
  width: 100%;
  background: var(--accent-green);
  color: #0b180d;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(73, 242, 100, 0.25);
  cursor: pointer;
}

.main-join-btn:hover {
  background: var(--accent-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(73, 242, 100, 0.35);
}

/* Preview Gallery */
.preview-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.preview-item {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-secondary);
}

.preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.preview-item video,
.preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.preview-item:hover img,
.preview-item:hover video {
  transform: scale(1.05);
}

/* Preview Overlay Label */
.preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.preview-label {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 480px) {
  .preview-label {
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 20px;
  }
}

/* Feed Header & Filters */
.feed-header-section {
  padding: 16px 16px 8px;
}

.counts-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.count-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.count-tab.active { color: var(--text-primary); }

.filter-pills-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-pills-scroll::-webkit-scrollbar { display: none; }

.pill {
  flex: 0 0 auto;
  background: var(--pill-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: var(--pill-active-bg);
}

/* Feed Posts List */
.feed-posts-list {
  padding: 12px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  overflow: hidden;
  position: relative;
}

.post-header {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #332244;
}

.author-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.author-handle {
  font-size: 12px;
  color: var(--text-tertiary);
}

.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Post Media & Unlock Glass Overlay */
.post-media-area {
  position: relative;
  height: 320px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.post-bg-img,
.post-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.3);
}

.glass-unlock-card {
  position: relative;
  z-index: 10;
  width: calc(100% - 48px);
  max-width: 320px;
  background: var(--overlay-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.unlock-avatar-badge {
  position: relative;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
}

.unlock-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  object-fit: cover;
}

.unlock-lock-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  color: #151515;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.unlock-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.unlock-subtext {
  font-size: 13px;
  color: #b0b0b0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
}

.unlock-btn {
  background: #ffffff;
  color: #151515;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 999px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255,255,255,0.15);
  cursor: pointer;
  width: 100%;
}

.unlock-btn:hover {
  transform: scale(1.02);
  background: #f0f0f0;
}