@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Core variables --- */
:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg-main: #06070a;
  --bg-surface: #0d0f14;
  --bg-surface-elevated: #161920;
  --bg-glass: rgba(13, 15, 20, 0.7);
  --bg-glass-hover: rgba(22, 25, 32, 0.8);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-neon: rgba(139, 92, 246, 0.3);

  --accent: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #f472b6, #a78bfa);
  --accent-glow: 0 0 20px rgba(167, 139, 250, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --success: #10b981;
  --error: #ef4444;
  --gold: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #f59e0b, #fbbf24);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base resets & scrolls --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Utilities --- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Age Gate & Auth Gate Overlay --- */
.overlay-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #040508;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.overlay-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.gate-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gate-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.gate-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #040508;
  box-shadow: var(--accent-glow);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--text-primary);
}

/* Form Styles inside gate */
.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.15);
}

/* --- Layout Grid --- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* --- Sidebar Navigation --- */
.sidebar {
  width: 260px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: width var(--transition-normal);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-menu {
  list-style: none;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.menu-item.active {
  background: rgba(167, 139, 250, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.menu-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
}

.menu-item:hover svg {
  transform: scale(1.05);
}

.badge {
  background: var(--accent-gradient);
  color: #040508;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
}

.user-profile-btn:hover {
  background: var(--bg-surface-elevated);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  background-color: var(--bg-surface-elevated);
}

.avatar.verified-border {
  border-color: var(--success);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-handle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Top Bar & Content Viewport --- */
.viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  position: relative;
}

.top-bar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  z-index: 90;
}

.search-container {
  position: relative;
  width: 320px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  width: 360px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wallet-badge:hover {
  background: rgba(245, 158, 11, 0.15);
  transform: translateY(-1px);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--error);
  border-radius: 50%;
}

.role-switcher-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 220px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: fadeIn var(--transition-fast);
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 12px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.dropdown-item.active {
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent);
}

/* --- View Viewport Wrapper --- */
.view-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: none;
}

.view-content.active {
  display: block;
}

/* --- Feed (Home View) Styles --- */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Sub-header Tabs */
.sub-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  gap: 24px;
}

.sub-tab {
  padding: 12px 4px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.sub-tab:hover {
  color: var(--text-primary);
}

.sub-tab.active {
  color: var(--text-primary);
}

.sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
}

/* Stories Tray */
.stories-tray {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 24px;
  scrollbar-width: none; /* Firefox */
}

.stories-tray::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.story-card {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.story-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: transform var(--transition-fast);
}

.story-ring.watched {
  background: var(--border-color);
}

.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--bg-main);
  background-color: var(--bg-surface-elevated);
}

.story-card:hover .story-ring {
  transform: scale(1.05);
}

.story-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Post Cards */
.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.post-creator {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.post-creator-info {
  display: flex;
  flex-direction: column;
}

.post-creator-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-icon {
  color: var(--success);
  width: 15px;
  height: 15px;
}

.vip-icon {
  color: var(--gold);
  width: 15px;
  height: 15px;
}

.post-meta-time {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.post-caption {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.post-media-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface-elevated);
  margin-bottom: 16px;
  position: relative;
  aspect-ratio: 16 / 9;
}

.post-media-container.vertical {
  aspect-ratio: 4 / 5;
}

.post-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-media:not(.blurred) {
  transform: scale(1.02);
}

/* Blurry Premium Overlay */
.premium-blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 15, 20, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.blurred {
  filter: blur(30px);
}

.premium-overlay-icon {
  width: 44px;
  height: 44px;
  color: var(--accent);
  margin-bottom: 12px;
}

.premium-overlay-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.premium-overlay-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Post Actions */
.post-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.post-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-action-btn:hover {
  color: var(--text-primary);
}

.post-action-btn.liked {
  color: var(--error);
}

.post-action-btn svg {
  width: 20px;
  height: 20px;
}

.post-action-btn.tip-btn {
  margin-left: auto;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid var(--border-neon);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.post-action-btn.tip-btn:hover {
  background: var(--accent-gradient);
  color: #040508;
  border-color: transparent;
}

/* Comments Drawer / Area */
.comments-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: none;
}

.comments-section.open {
  display: block;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 220px;
  overflow-y: auto;
}

.comment-item {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-bubble {
  background: var(--bg-surface-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  flex: 1;
}

.comment-user {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.comment-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

.comment-input-row {
  display: flex;
  gap: 8px;
}

.comment-input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.comment-input:focus {
  border-color: var(--accent);
}

/* Right Sidebar (Featured Creators & Trends) */
.featured-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.creators-mini-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-creator-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-creator-btn {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.trends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trend-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  padding: 4px 0;
}

.trend-category {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.trend-hashtag {
  font-size: 0.9rem;
  font-weight: 600;
}

.trend-posts {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --- Explore Page (TikTok/Discovery View) --- */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.category-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.category-badge:hover, .category-badge.active {
  background: var(--accent-gradient);
  color: #040508;
  border-color: transparent;
}

.tiktok-simulator {
  max-width: 420px;
  margin: 0 auto;
  height: 680px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: #000;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.tiktok-video-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

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

.tiktok-live-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--error);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: pulse 1.5s infinite;
}

.tiktok-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 80px 24px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: white;
}

.tiktok-creator-handle {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tiktok-caption {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.4;
}

.tiktok-actions-sidebar {
  position: absolute;
  bottom: 40px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.tiktok-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.tiktok-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition-fast);
}

.tiktok-action-icon:hover {
  transform: scale(1.08);
  background: rgba(30, 41, 59, 0.9);
}

.tiktok-action-text {
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- Creator Profile View --- */
.profile-cover {
  width: 100%;
  height: 240px;
  position: relative;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.profile-avatar-container {
  position: absolute;
  bottom: -40px;
  left: 30px;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--bg-main);
  object-fit: cover;
  background-color: var(--bg-surface);
}

.profile-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 50px;
  margin-bottom: 24px;
  padding-right: 10px;
}

.profile-details {
  max-width: 800px;
  margin-bottom: 30px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-display-name {
  font-size: 1.8rem;
  font-weight: 800;
}

.profile-username {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.profile-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.profile-stat-item span {
  font-weight: 700;
  color: var(--text-primary);
}

.profile-stat-item {
  color: var(--text-secondary);
}

.profile-bio {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}

.subscription-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  align-self: start;
}

.sub-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.sub-panel-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.sub-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sub-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-features-list svg {
  color: var(--success);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Chat Console View --- */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  height: calc(100vh - 130px);
  overflow: hidden;
}

.chat-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.chat-thread-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  transition: background var(--transition-fast);
}

.chat-thread-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.chat-thread-item.active {
  background: rgba(167, 139, 250, 0.06);
  border-left: 3px solid var(--accent);
}

.thread-details {
  flex: 1;
  min-width: 0;
}

.thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.thread-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.thread-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #090a0f;
}

.chat-window-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.chat-window-creator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.message-bubble-wrapper.sent {
  align-self: flex-end;
  align-items: flex-end;
}

.message-bubble-wrapper.received {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  position: relative;
}

.message-bubble-wrapper.sent .message-bubble {
  background: var(--accent-gradient);
  color: #040508;
  border-bottom-right-radius: 2px;
}

.message-bubble-wrapper.received .message-bubble {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.message-media-unlock {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 16px;
  text-align: center;
  margin-bottom: 4px;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.chat-input-bar {
  padding: 16px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-xl);
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* --- Wallet Page View --- */
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.credit-pack-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.credit-pack-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.credit-pack-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.credit-pack-price {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.table-container {
  overflow-x: auto;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold);
}

/* --- Dashboards (Creator, Mod, Admin) --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.dashboard-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dashboard-card-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.dashboard-card-sub {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 6px;
}

.dashboard-row-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}

/* Mod/Admin specific lists */
.queue-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.queue-item:last-child {
  border-bottom: none;
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

/* Plus Item Sidebar Styling (Desktop) */
.plus-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.plus-circle {
  background: var(--accent-gradient);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 4px 10px rgba(167, 139, 250, 0.3);
}

.plus-circle svg {
  width: 16px;
  height: 16px;
  stroke: #000;
}

/* Mobile responsive fixes */
@media (max-width: 1024px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }
  .featured-sidebar {
    display: none;
  }
  .profile-layout-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-row-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column-reverse;
  }
  
  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-color);
    position: relative;
    padding: 0;
  }
  
  .sidebar-header, .sidebar-footer {
    display: none;
  }
  
  .sidebar-menu {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0;
    overflow-y: visible;
  }
  
  .menu-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    font-size: 0.65rem;
    flex: 1;
    align-items: center;
  }
  
  .menu-item svg {
    width: 20px;
    height: 20px;
  }
  
  .menu-item span {
    display: none; /* Hide label on mobile to keep clean icons bar */
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .plus-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  
  .plus-circle {
    background: var(--accent-gradient) !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #000 !important;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.5) !important;
    transition: all var(--transition-fast) !important;
  }
  
  .plus-circle svg {
    width: 22px !important;
    height: 22px !important;
    stroke: #000 !important;
  }

  .plus-circle:active {
    transform: scale(0.92);
  }
  
  .top-bar {
    padding: 0 16px;
    height: 60px;
  }
  
  .search-container {
    width: 180px;
  }
  
  .search-input:focus {
    width: 200px;
  }
  
  .view-content {
    padding: 16px;
  }
  
  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 120px);
  }
  
  .chat-sidebar.mobile-hide {
    display: none;
  }
  
  .chat-window.mobile-hide {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0.8; transform: scale(1); }
}
