/* ============================================
   FamTubeX — Main Styles (Premium Dark Neon)
   Mobile-first · Stripchat-inspired
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

:root {
  /* ── Ultra-dark backgrounds ── */
  --bg-primary: #0A0A0F;
  --bg-secondary: #0E0E14;
  --bg-card: #14141C;
  --bg-glass: rgba(14, 14, 22, 0.82);
  --bg-input: #111119;
  --bg-elevated: #1A1A24;

  /* ── Text ── */
  --text-primary: #F4F2F7;
  --text-secondary: #ADA8B8;
  --text-muted: #6B6580;

  /* ── Multi-accent palette ── */
  --accent: #FF3D7F;
  --pink: #FF4D8D;
  --purple: #A855F7;
  --teal: #00D4AA;
  --gold: #F59E0B;
  --green: #22c55e;
  --red: #FF1744;
  --blue: #3B82F6;

  /* ── Gradients ── */
  --accent-gradient: linear-gradient(135deg, #FF3D7F, #A855F7);
  --accent-gradient-h: linear-gradient(135deg, #FF5A9A, #B96BFF);
  --purple-gradient: linear-gradient(135deg, #A855F7, #7C3AED);
  --teal-gradient: linear-gradient(135deg, #00D4AA, #059669);
  --gold-gradient: linear-gradient(135deg, #F59E0B, #D97706);
  --pink-gradient: linear-gradient(135deg, #FF4D8D, #EC4899);
  --live-gradient: linear-gradient(135deg, #FF1744, #FF3D7F);
  --body-gradient: linear-gradient(180deg, #0A0A0F 0%, #0D0D14 40%, #0A0A10 100%);
  --card-border: rgba(255, 255, 255, 0.06);

  /* ── Neon glows ── */
  --neon-accent: 0 0 20px rgba(255, 61, 127, 0.4), 0 0 60px rgba(255, 61, 127, 0.12);
  --neon-pink: 0 0 20px rgba(255, 77, 141, 0.4), 0 0 60px rgba(255, 77, 141, 0.12);
  --neon-purple: 0 0 20px rgba(168, 85, 247, 0.4), 0 0 60px rgba(168, 85, 247, 0.12);
  --neon-teal: 0 0 20px rgba(0, 212, 170, 0.4), 0 0 60px rgba(0, 212, 170, 0.12);
  --neon-red: 0 0 12px rgba(255, 23, 68, 0.5), 0 0 40px rgba(255, 23, 68, 0.2);

  /* ── Typography ── */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Poppins', var(--font);

  /* ── Spacing scale (8px grid) ── */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* ── Typography scale ── */
  --text-xs: 0.6875rem;    /* 11px */
  --text-sm: 0.8125rem;    /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.375rem;     /* 22px */
  --text-2xl: 1.75rem;     /* 28px */
  --text-3xl: 2.25rem;     /* 36px */

  /* ── Shapes & radii ── */
  --radius: 20px;
  --radius-lg: 28px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --touch-min: 48px;

  /* ── Shadows ── */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(255, 61, 127, 0.2);

  /* ── Motion ── */
  --transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: all 0.15s ease;
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Safe areas ── */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 77, 141, 0.4); border-radius: 4px; }

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--pink); }
::selection { background: rgba(255, 77, 141, 0.3); }
img { max-width: 100%; display: block; }

/* Prevent long-press context menu / save image on all images and media */
img, video, video *, .live-video-wrap, .sp-hero, .call-video-container {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* ── Typography ── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Layout ── */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* Ambient light gradient — fixed behind content */
.app-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 60vh;
  background: radial-gradient(ellipse at 50% 15%, rgba(168, 85, 247, 0.05) 0%, transparent 65%),
              radial-gradient(ellipse at 70% 30%, rgba(255, 61, 127, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

@media (min-width: 768px) {
  .app-container { max-width: 640px; }
}


/* ── Top Bar — Glassmorphism ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 10, 15, 0.78);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.top-bar .logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  filter: drop-shadow(0 0 12px rgba(255, 77, 141, 0.3));
  flex-shrink: 0;
}

.top-bar .credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(255, 77, 141, 0.1));
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border: 1px solid rgba(168, 85, 247, 0.25);
  transition: var(--transition);
  color: var(--text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.top-bar .credits-badge:hover {
  border-color: var(--purple);
  box-shadow: var(--neon-purple);
}

.top-bar .credits-badge .coin {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple);
}

.top-bar .credits-badge .coin svg { width: 16px; height: 16px; }

/* Empty credits — pulsing CTA */
.top-bar .credits-badge:has(.credits-empty) {
  border-color: rgba(255, 61, 127, 0.35);
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.15), rgba(168, 85, 247, 0.12));
  animation: creditsBadgeGlow 3s ease-in-out infinite;
}

.credits-empty {
  font-size: 0.72rem;
  letter-spacing: 0.2px;
}

@keyframes creditsBadgeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 127, 0.1); }
  50% { box-shadow: 0 0 14px 2px rgba(255, 61, 127, 0.15); }
}

/* Back button — meets touch-min */
.back-btn {
  width: var(--touch-min); height: var(--touch-min);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.back-btn svg { width: 22px; height: 22px; }
.back-btn:hover { background: rgba(255, 255, 255, 0.1); }
.back-btn:active { transform: scale(0.9); }

/* Touch target utility */
.touch-target {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Page content */
.page-content {
  padding: var(--spacing-md);
  padding-bottom: 120px;
}

/* ── Status Filter Tabs — Premium Pill Style ── */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 16px 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: var(--transition);
  min-height: 40px;
  scroll-snap-align: start;
}

.filter-tab svg { width: 16px; height: 16px; opacity: 0.7; }

.filter-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(255, 77, 141, 0.3), 0 2px 12px rgba(255, 61, 127, 0.25);
}

.filter-tab.active svg { opacity: 1; }

.filter-tab:not(.active):hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Homepage Greeting ── */
.home-greeting {
  padding: 0 16px 10px;
  animation: fadeIn 0.5s ease-out;
}

.greeting-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.greeting-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Profile Grid ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .profile-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 20px; }
}


/* ── Bottom Navigation — Premium Glass ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(10px + var(--safe-bottom));
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(32px) saturate(1.8);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
}

@media (min-width: 768px) {
  .bottom-nav { max-width: 640px; }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  padding: 6px 14px;
  border: none;
  background: none;
  position: relative;
  min-height: 44px;
}

.nav-item .nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
}

.nav-item .nav-icon svg { width: 24px; height: 24px; transition: var(--transition); }

.nav-item.active { color: var(--pink); }

.nav-item.active .nav-icon svg {
  filter: drop-shadow(0 0 6px rgba(255, 77, 141, 0.5));
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 10px rgba(255, 77, 141, 0.5);
}

.nav-item:hover { color: var(--pink); }
.nav-item:active { transform: scale(0.9); }

/* ── Unread Badge ── */
.ftx-unread-badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.5);
  z-index: 1;
}

/* ── Online Indicator Dot (profile cards) ── */
.online-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg-card);
  z-index: 2;
}

/* ── Accessibility — Focus Visible ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip to content link (screen reader) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  z-index: 99999;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Utility Classes ── */
.hidden { display: none !important; }
.text-center { text-align: center; }

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-purple {
  background: var(--purple-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-pink {
  background: var(--pink-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.section-action {
  font-size: 0.85rem;
  color: var(--pink);
  font-weight: 600;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-icon svg { width: 48px; height: 48px; }

/* Page transitions */
.page-enter { animation: pageSlideIn 0.35s ease-out; }

@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255, 77, 141, 0.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 77, 141, 0.35);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow), 0 0 20px rgba(255, 77, 141, 0.1);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); box-shadow: var(--shadow), var(--neon-red); }
.toast.success { border-color: var(--green); }

/* ── Credits badge (global, used on multiple pages) ── */
.credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(255, 77, 141, 0.1));
  padding: 8px 16px;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(168, 85, 247, 0.25);
  transition: var(--transition);
  color: var(--text-primary);
  min-height: 38px;
}

/* ── Pull-to-Refresh Indicator ── */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 77, 141, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-card);
}

.ptr-indicator.visible {
  transform: translateX(-50%) translateY(16px);
}

.ptr-indicator .ptr-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 77, 141, 0.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Scroll Snap Utility ── */
.scroll-snap-x {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 12px;
}
.scroll-snap-x::-webkit-scrollbar { display: none; }
.scroll-snap-x > * { scroll-snap-align: start; flex-shrink: 0; }

/* ── Skeleton loading (improved) ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-circle { border-radius: 50%; }
.skeleton-text { height: 14px; border-radius: 7px; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-text.long { width: 90%; }
