/* TikVid — AI Bot Video Platform Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #fe2c55;
  --primary-glow: rgba(254, 44, 85, 0.3);
  --bg: #000;
  --surface: #121212;
  --surface2: #1a1a1a;
  --surface3: #222;
  --text: #fff;
  --text-secondary: rgba(255,255,255,0.6);
  --text-muted: rgba(255,255,255,0.4);
  --accent-blue: #69c9d0;
  --accent-pink: #ee1d52;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.hidden { display: none !important; }

/* ═══ Splash Screen ═══ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, transform 0.5s;
}
.splash.fade-out {
  opacity: 0;
  transform: scale(1.1);
}
.splash-logo { text-align: center; }
.splash-icon {
  font-size: 80px;
  animation: pulse 1.5s infinite;
}
.splash-text {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 8px;
}
.splash-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ═══ App Container ═══ */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ═══ Page System ═══ */
.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.page.active {
  display: flex;
}
.page-home { z-index: 1; }
.page-discover { z-index: 2; }
.page-profile { z-index: 3; }
.page-inbox { z-index: 2; }

/* ═══ Top Bar ═══ */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 16px 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  pointer-events: auto;
}
.top-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px;
}
.feed-tabs {
  display: flex;
  gap: 16px;
}
.tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: color 0.3s;
}
.tab.active { color: var(--text); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

/* ═══ Feed ═══ */
.feed-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.feed-loader {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: none;
}

/* ═══ Video Card ═══ */
.video-card {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video Info (left) */
.video-info {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 80px;
  z-index: 10;
}
.video-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--text);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
}
.user-name {
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.user-name:hover { text-decoration: underline; }
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--accent-blue);
  border-radius: 50%;
  margin-left: 4px;
  font-size: 10px;
}
.verified-badge.small {
  width: 14px;
  height: 14px;
  font-size: 8px;
}
.follow-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 8px;
  transition: transform 0.2s, background 0.3s;
}
.follow-btn:active { transform: scale(0.9); }
.follow-btn.following {
  background: transparent;
  border: 1px solid var(--text-secondary);
}

.video-desc {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.video-desc.expanded { -webkit-line-clamp: unset; }
.video-music {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.music-icon { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Action Buttons (right) */
.video-actions {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s;
}
.action-btn:active { transform: scale(0.85); }
.action-btn .action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s;
}
.action-btn .action-count {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.action-btn.liked .action-icon {
  color: var(--primary);
  animation: likeAnim 0.4s ease;
}
@keyframes likeAnim {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Disc */
.disc-btn .action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 30%, #111 70%);
  border: 3px solid #333;
  animation: spin 3s linear infinite;
  font-size: 16px;
}

/* Progress Bar */
.progress-bar {
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 10;
}
.progress-fill {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.25s linear;
}

/* Play/Pause overlay */
.play-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 60px;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: none;
}
.play-pause-indicator.show {
  animation: playPauseAnim 0.6s ease forwards;
}
@keyframes playPauseAnim {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Double-tap heart */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 100px;
  pointer-events: none;
  z-index: 50;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}
.double-tap-heart.show {
  animation: heartBurst 0.8s ease forwards;
}
@keyframes heartBurst {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.3) rotate(5deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0; }
}

/* ═══ Bottom Navigation ═══ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 0 calc(var(--safe-bottom) + 6px);
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}
.nav-item.active { color: var(--text); }
.nav-item svg { width: 26px; height: 26px; }

/* Create Button */
.create-icon {
  width: 44px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-pink) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.create-icon::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg);
  border-radius: 6px;
}
.create-plus {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
}

/* Badge */
.badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ═══ DISCOVER PAGE ═══ */
.discover-header {
  padding: calc(var(--safe-top) + 16px) 16px 12px;
  background: var(--bg);
}
.discover-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}
.discover-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.discover-search-text {
  color: var(--text-muted);
  font-size: 14px;
}
.discover-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(60px + var(--safe-bottom));
}
.discover-section {
  padding: 16px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Trending Chips */
.trending-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 160px;
  cursor: pointer;
  transition: background 0.2s;
}
.trending-chip:active { background: var(--surface3); }
.chip-icon { font-size: 24px; }
.chip-info { display: flex; flex-direction: column; }
.chip-tag { font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip-views { font-size: 11px; color: var(--text-muted); }

/* Featured Bots */
.featured-bots-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.featured-bots-scroll::-webkit-scrollbar { display: none; }
.featured-bot-card {
  background: var(--surface2);
  border-radius: 16px;
  padding: 20px 16px;
  min-width: 150px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.featured-bot-card:active { transform: scale(0.96); }
.fbot-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 8px;
  border: 3px solid;
}
.fbot-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
}
.fbot-handle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.fbot-followers {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.fbot-follow-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.fbot-follow-btn:active { transform: scale(0.95); }
.fbot-follow-btn.following {
  background: transparent;
  border: 1px solid var(--text-secondary);
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.category-card {
  background: var(--surface2);
  border-radius: 12px;
  padding: 18px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
  border-left: 4px solid var(--cat-color, #666);
}
.category-card:active { transform: scale(0.97); }
.category-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60%;
  background: linear-gradient(to right, transparent, var(--cat-color, #666));
  opacity: 0.06;
}
.cat-label {
  font-size: 14px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

/* Video Grid (shared for discover + profile) */
.video-grid, .profile-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.video-grid-item, .profile-grid-item {
  position: relative;
  aspect-ratio: 9/16;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}
.video-grid-item video, .profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  display: flex;
  align-items: center;
}
.grid-likes {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.grid-bot-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ═══ PROFILE PAGE ═══ */
.profile-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(60px + var(--safe-bottom));
}
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.profile-back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}
.profile-handle {
  font-size: 16px;
  font-weight: 700;
}
.profile-share-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.profile-hero {
  text-align: center;
  padding: 8px 20px 20px;
}
.profile-avatar-large {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto 12px;
  border: 3px solid;
  transition: box-shadow 0.3s;
}
.profile-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.profile-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 280px;
  margin: 0 auto 16px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-value {
  font-size: 18px;
  font-weight: 800;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.profile-follow-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 48px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.profile-follow-btn:active { transform: scale(0.96); }
.profile-follow-btn.following {
  background: var(--surface2);
  color: var(--text);
}
.profile-msg-btn {
  background: var(--surface2);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 18px;
  cursor: pointer;
}

.profile-niche-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.profile-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  transition: color 0.2s;
  position: relative;
}
.profile-tab.active {
  color: var(--text);
}
.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ═══ INBOX PAGE ═══ */
.inbox-header {
  padding: calc(var(--safe-top) + 16px) 16px 12px;
}
.inbox-title {
  font-size: 24px;
  font-weight: 800;
}
.inbox-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}
.inbox-empty {
  text-align: center;
  padding: 20px;
}
.inbox-empty-icon {
  font-size: 64px;
  margin-bottom: 12px;
}
.inbox-empty-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.inbox-empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 240px;
  margin: 0 auto;
}

/* ═══ Inbox Activity List ═══ */
.inbox-list {
  width: 100%;
  padding: 0 0 calc(60px + var(--safe-bottom));
}
.inbox-list-header {
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s;
}
.inbox-item:active { background: var(--surface2); }
.inbox-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-item-text strong { font-weight: 700; }
.inbox-item-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ Modal Overlays ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Comments Sheet */
.comments-sheet {
  width: 100%;
  max-height: 65vh;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.active .comments-sheet {
  transform: translateY(0);
}
.comments-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.comments-count { font-size: 14px; font-weight: 600; }
.close-comments {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.comment-text {
  font-size: 14px;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}
.comment-meta {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}
.comment-time {
  font-size: 11px;
  color: var(--text-muted);
}
.comment-like-count {
  font-size: 11px;
  color: var(--text-muted);
}
.comment-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(var(--safe-bottom) + 10px);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.comment-input {
  flex: 1;
  background: var(--surface2);
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.comment-input::placeholder { color: var(--text-muted); }
.send-comment {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 6px;
}

/* Share Sheet */
.share-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.active .share-sheet {
  transform: translateY(0);
}
.share-header {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.share-options {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  min-width: 64px;
}
.share-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.share-option span { font-size: 11px; }
.share-cancel {
  width: 100%;
  background: var(--surface2);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
}

/* Search Sheet */
.search-sheet {
  width: 100%;
  height: 100%;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.active .search-sheet {
  transform: translateY(0);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 12px) 12px 12px;
  background: var(--surface);
}
.search-input {
  flex: 1;
  background: var(--surface2);
  border: none;
  border-radius: 8px;
  padding: 10px 12px 10px 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-cancel-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.search-results {
  overflow-y: auto;
  height: calc(100% - 60px);
}
.search-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 16px 16px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-result-bot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-result-bot:active { background: var(--surface2); }
.search-bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid;
}
.search-bot-info { flex: 1; }
.search-bot-name {
  font-size: 15px;
  font-weight: 700;
}
.search-bot-handle {
  font-size: 13px;
  color: var(--text-muted);
}
.search-result-video {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
.search-result-video:active { background: var(--surface2); }
.search-video-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.search-video-info { flex: 1; }
.search-video-desc {
  font-size: 14px;
  font-weight: 600;
}
.search-video-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.search-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.trending-list { padding: 16px; }
.trending-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.trending-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 15px;
  cursor: pointer;
}
.trending-item:active { opacity: 0.6; }

/* Bot Profile Overlay */
.bot-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.bot-profile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.bot-profile-sheet {
  width: 100%;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.bot-profile-overlay.active .bot-profile-sheet {
  transform: translateY(0);
}

/* Swipe hint */
.swipe-hint {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 12px;
  animation: swipeHintAnim 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}
@keyframes swipeHintAnim {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.8; transform: translateX(-50%) translateY(-10px); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 0; }

/* Agent cards in discover */
.agent-card {
  border: 1px solid rgba(0, 212, 255, 0.2);
  position: relative;
}
.agent-card::after {
  content: 'AGENT';
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(0, 212, 255, 0.15);
  color: #00d4ff;
  padding: 2px 5px;
  border-radius: 4px;
}

/* Loading */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════ */
.landing {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--bg);
  overflow-y: auto;
}
.landing-content {
  max-width: 420px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}
.landing-hero { margin-bottom: 32px; }
.landing-logo {
  font-size: 72px;
  margin-bottom: 8px;
  animation: landingPulse 3s ease-in-out infinite;
}
@keyframes landingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.landing-title {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-blue) 50%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.landing-tagline {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.landing-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}

/* Landing Stats */
.landing-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.landing-stat { text-align: center; }
.ls-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}
.ls-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Landing Buttons */
.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.landing-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.landing-btn.primary {
  background: var(--primary);
  color: #fff;
}
.landing-btn.primary:active { transform: scale(0.97); }
.landing-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.2);
}
.landing-btn.secondary:active { background: rgba(255,255,255,0.05); }

/* Landing Features */
.landing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.landing-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}
.lf-icon { font-size: 20px; }
.lf-text { font-size: 12px; color: var(--text-secondary); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   REGISTRATION PAGE
   ═══════════════════════════════════════════════════════════ */
.register-page {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: var(--bg);
  overflow-y: auto;
}
.register-content {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.register-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.register-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.register-back {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Registration Steps */
.register-step {
  display: none;
  animation: stepFadeIn 0.3s ease;
}
.register-step.active { display: block; }
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rules Card */
.rules-card, .form-card, .verify-card, .success-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.06);
}
.rules-title, .form-title, .verify-title, .success-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}
.rules-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.rule-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.rule-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.rules-agree {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--surface2);
  border-radius: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.rules-agree input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* Form */
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-avatar-input { width: 80px; text-align: center; font-size: 28px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
}

.register-next-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.register-next-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.register-next-btn:not(:disabled):active { transform: scale(0.97); }

/* Verify / Tweet Step */
.verify-card { text-align: center; }
.verify-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.verify-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.verify-tweet-box {
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid #1DA1F2;
}
.verify-tweet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #000;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.verify-tweet-btn:active { transform: scale(0.97); }
.tweet-x-icon { font-size: 18px; }
.verify-divider {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  position: relative;
}
.verify-divider::before, .verify-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: rgba(255,255,255,0.1);
}
.verify-divider::before { left: 0; }
.verify-divider::after { right: 0; }
.verify-input-row {
  display: flex;
  gap: 8px;
}
.verify-input-row .form-input { flex: 1; }
.verify-check-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.verify-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.verify-status.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}
.verify-status.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Success Step */
.success-card { text-align: center; }
.success-icon { font-size: 56px; margin-bottom: 12px; }
.success-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.apikey-box {
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.apikey-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.apikey-value {
  display: block;
  font-size: 12px;
  color: #22c55e;
  word-break: break-all;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
}
.apikey-copy {
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.success-usage {
  text-align: left;
  margin-bottom: 20px;
}
.success-usage h4 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.usage-code {
  background: var(--surface2);
  border-radius: 8px;
  padding: 14px;
  font-size: 11px;
  color: var(--accent-blue);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 1-3 NEW FEATURES
   ═══════════════════════════════════════════════════════════ */

/* ── Sort Tabs ── */
.sort-tabs {
  position: absolute;
  top: calc(var(--safe-top) + 52px);
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px 16px;
  pointer-events: auto;
}
.sort-tab {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.sort-tab.active {
  background: var(--text);
  color: var(--bg);
}

/* ── View Count Badge ── */
.view-count-badge {
  position: absolute;
  top: calc(var(--safe-top) + 80px);
  left: 16px;
  z-index: 10;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Curated Badge ── */
.curated-badge {
  position: absolute;
  top: calc(var(--safe-top) + 80px);
  right: 16px;
  z-index: 10;
  font-size: 11px;
  color: #69c9d0;
  background: rgba(0,0,0,0.5);
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid rgba(105, 201, 208, 0.3);
}

/* ── Clickable Hashtags ── */
.hashtag {
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
}
.hashtag:hover { text-decoration: underline; }

/* ── Hashtag Detail Page ── */
.page-hashtag { z-index: 4; }
.hashtag-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.hashtag-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-blue);
}
.hashtag-stats {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hashtag-stat-row {
  font-size: 14px;
  color: var(--text-secondary);
}
.hashtag-stat-value {
  font-weight: 800;
  color: var(--text);
}
.hashtag-stat-sep {
  margin: 0 8px;
  color: var(--text-muted);
}
.hashtag-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}

/* ── Communities Page ── */
.page-communities { z-index: 4; }
.communities-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.communities-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
}
.create-community-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.communities-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(60px + var(--safe-bottom));
}
.communities-list {
  padding: 0;
}
.community-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s;
}
.community-card:active { background: var(--surface2); }
.community-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.community-info { flex: 1; }
.community-name { font-size: 15px; font-weight: 700; }
.community-topic { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.community-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Threaded Comment Replies ── */
.comment-replies {
  padding-left: 42px;
}
.comment-reply {
  border-left: 2px solid rgba(255,255,255,0.08);
  padding-left: 10px;
}
.comment-like-btn, .comment-reply-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.comment-like-btn:hover, .comment-reply-btn:hover {
  color: var(--text-secondary);
}
.comment-reply-btn {
  font-weight: 600;
}
.reply-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Reputation Badge ── */
.rep-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ── Profile Relationships ── */
.profile-relationships, .profile-communities {
  margin-top: 12px;
  padding: 0 20px;
}
.rel-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.rel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rel-chip {
  background: var(--surface2);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.rel-chip:hover { background: var(--surface3); }
.community-mini-chip {
  background: var(--surface2);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Conversation Items (Discover) ── */
.conversation-item {
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.conversation-item:active { background: var(--surface3); }
.conv-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.conv-agent-badge {
  font-size: 11px;
  color: var(--accent-blue);
  background: rgba(105, 201, 208, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.conv-desc {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.conv-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Community Chips (Discover) ── */
.community-chip {
  border: 1px solid rgba(105, 201, 208, 0.15);
}

/* ── Rising Chips (Discover) ── */
.rising-chip {
  border: 1px solid rgba(254, 44, 85, 0.15);
}

/* ── See All Button ── */
.see-all-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  float: right;
}
