:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #666;
  --border: #e5e5e5;
  --primary: #2d2d8e;
  --accent: #7c3aed;
  --gold: #f59e0b;
  --nav-bg: #1a1a3e;
  --nav-text: #c0c0e0;
  --shadow: rgba(0,0,0,0.08);
}
[data-theme="dark"] {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --text: #e8e8ff;
  --text-muted: #9090b0;
  --border: #2d2d4e;
  --shadow: rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 80px;
  transition: background 0.3s, color 0.3s;
}

/* SPLASH */
.splash {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1a1a3e 0%, #2d2d8e 60%, #7c3aed 100%);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; }
.splash-logo {
  width: 80px; height: 80px;
  animation: pulse 1.5s ease-in-out infinite;
  margin-bottom: 16px;
}
.splash-title { font-size: 32px; font-weight: 800; letter-spacing: 1px; }
.splash-tagline { font-size: 14px; opacity: 0.8; margin: 8px 0 24px; letter-spacing: 2px; }
.splash-loader { width: 200px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; margin: 0 auto; }
.loader-bar { height: 100%; width: 0; background: #f59e0b; border-radius: 4px; animation: load 1.5s ease forwards; }

@keyframes load { to { width: 100%; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.animate-fade { animation: fadeIn 0.6s ease both; }
.animate-slide { animation: slideIn 0.6s ease both; }

/* TOP NAV */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px var(--shadow);
}
.menu-btn {
  background: var(--primary); color: #fff;
  border: none; width: 38px; height: 38px;
  border-radius: 10px; font-size: 16px; cursor: pointer;
}
.icon-btn {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
}
.nav-logo { width: 36px; height: 36px; }
.avatar-top { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--accent); }

/* SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: -280px;
  width: 280px; height: 100%;
  background: var(--nav-bg);
  z-index: 200; transition: left 0.3s ease;
  display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar.open { left: 0; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
.overlay.show { display: block; }
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon { width: 32px; }
.logo-text { color: #fff; font-size: 18px; font-weight: 700; flex: 1; }
.close-btn { color: #aaa; cursor: pointer; font-size: 18px; }
.nav-label { color: #7c6fa0; font-size: 11px; font-weight: 600; padding: 16px 16px 8px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; color: var(--nav-text);
  text-decoration: none; font-size: 15px; transition: background 0.2s;
}
.nav-item:hover, .nav-item.active {
  background: #3d3daf; color: #fff;
  border-radius: 12px; margin: 0 8px;
}
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 16px; }
.dark-toggle {
  width: 100%; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c0c0e0; padding: 10px; border-radius: 10px;
  font-size: 13px; cursor: pointer;
}
.sidebar-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; }
.user-name { color: #fff; font-size: 14px; font-weight: 600; }
.user-email { color: #aaa; font-size: 11px; }
.logout-icon { color: #ef4444; margin-left: auto; cursor: pointer; }

/* HERO */
.hero {
  background: linear-gradient(135deg, #2d2d8e 0%, #1a1a3e 100%);
  color: #fff; text-align: center; padding: 60px 24px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800') center/cover;
  opacity: 0.08;
}
.hero-badge {
  display: inline-block; background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.4);
  color: #f59e0b; padding: 6px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 600; margin-bottom: 16px;
}
.hero h1 { font-size: 30px; margin-bottom: 16px; position: relative; }
.hero-highlight { color: #f59e0b; }
.hero p { font-size: 15px; line-height: 1.7; opacity: 0.9; max-width: 500px; margin: 0 auto 24px; position: relative; }
.hero-btns { display: flex; gap: 12px; justify-content: center; position: relative; }
.btn-primary {
  background: #f59e0b; color: #1a1a3e;
  padding: 12px 24px; border-radius: 25px;
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: transform 0.2s;
}
.btn-primary:hover { transform: scale(1.05); }
.btn-secondary {
  background: rgba(255,255,255,0.15); color: #fff;
  padding: 12px 24px; border-radius: 25px;
  font-size: 14px; text-decoration: none; border: 1px solid rgba(255,255,255,0.3);
}

/* STATS BAR */
.stats-bar {
  display: flex; justify-content: space-around;
  background: var(--surface); padding: 16px;
  box-shadow: 0 2px 8px var(--shadow);
}
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 20px; font-weight: 800; color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--text-muted); }

/* FOUNDER */
.founder-section { padding: 24px 16px; }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.founder-card {
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 32px var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}
.founder-img-wrap { position: relative; }
.founder-img { width: 100%; height: 300px; object-fit: cover; object-position: top; display: block; }
.founder-glow {
  position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(to top, var(--surface), transparent);
}
.founder-details { padding: 20px; }
.founder-badge {
  display: inline-block; background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4); color: #f59e0b;
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; margin-bottom: 10px;
}
.founder-name { color: var(--text); font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.founder-handle { color: var(--accent); font-size: 13px; margin-bottom: 12px; }
.founder-bio { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.founder-stats-row { display: flex; gap: 20px; margin-bottom: 14px; }
.fstat { display: flex; flex-direction: column; }
.fstat-num { font-size: 18px; font-weight: 800; color: var(--accent); }
.fstat-lbl { font-size: 11px; color: var(--text-muted); }
.founder-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ftag {
  background: rgba(45,45,142,0.1); color: var(--primary);
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.founder-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; padding: 10px 24px; border-radius: 25px;
  text-decoration: none; font-size: 14px; font-weight: 700;
  transition: transform 0.2s;
}
.founder-cta:hover { transform: scale(1.04); }

/* FEATURES */
.features { padding: 24px 16px; }
.features h2, .membership h2 { font-size: 20px; margin-bottom: 16px; color: var(--text); }
.features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature-card {
  background: var(--surface); border-radius: 14px; padding: 20px 16px;
  text-align: center; box-shadow: 0 2px 12px var(--shadow);
  transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon-wrap {
  width: 50px; height: 50px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: #fff; font-size: 20px;
}
.feature-card h4 { font-size: 14px; margin-bottom: 6px; color: var(--text); }
.feature-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* MEMBERSHIP */
.membership { padding: 24px 16px; }
.plans-grid { display: flex; flex-direction: column; gap: 14px; }
.plan-card {
  background: var(--surface); border-radius: 16px; padding: 20px;
  box-shadow: 0 2px 12px var(--shadow); position: relative; border: 2px solid transparent;
}
.plan-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(45,45,142,0.05), rgba(124,58,237,0.08));
}
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 4px 14px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.plan-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.plan-price { font-size: 32px; font-weight: 800; color: var(--accent); margin-bottom: 16px; }
.plan-price span { font-size: 14px; color: var(--text-muted); }
.plan-features { list-style: none; margin-bottom: 16px; }
.plan-features li { font-size: 13px; color: var(--text-muted); padding: 5px 0; }
.plan-features li i { color: #10b981; margin-right: 8px; }
.plan-btn {
  width: 100%; padding: 12px; border-radius: 25px; border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.plan-btn.outline {
  background: transparent; border: 2px solid var(--accent); color: var(--accent);
}

/* PWA BANNER */
.pwa-banner {
  position: fixed; bottom: 80px; left: 16px; right: 16px;
  background: var(--primary); color: #fff;
  padding: 12px 16px; border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(45,45,142,0.4); z-index: 90; font-size: 13px;
}
.pwa-banner i { font-size: 20px; color: #f59e0b; }
.pwa-banner span { flex: 1; }
.pwa-banner button {
  background: #f59e0b; color: #1a1a3e;
  border: none; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.pwa-close { background: transparent !important; color: rgba(255,255,255,0.7) !important; font-size: 16px !important; }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); display: flex; justify-content: space-around;
  align-items: center; padding: 8px 0;
  box-shadow: 0 -2px 12px var(--shadow); z-index: 100;
}
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #999; text-decoration: none; font-size: 10px; }
.bn-item i { font-size: 20px; }
.bn-item.active { color: var(--accent); }
.plus-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff !important; width: 50px; height: 50px; border-radius: 50%;
  justify-content: center; margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(124,58,237,0.5);
}
.plus-btn i { font-size: 22px; }

/* PAGE CONTENT */
.page-content { padding: 20px 16px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* FEED */
.story-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.story-card { min-width: 100px; background: var(--surface); border-radius: 14px; padding: 12px; text-align: center; box-shadow: 0 2px 8px var(--shadow); flex-shrink: 0; }
.story-avatar { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--accent); margin-bottom: 6px; }
.story-plus { width: 24px; height: 24px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; margin: -14px auto 6px; border: 2px solid #fff; }
.story-label { font-size: 11px; color: var(--text); }

.feed-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.feed-tab { padding: 8px 16px; border-radius: 20px; font-size: 13px; border: none; cursor: pointer; background: var(--surface); color: var(--text-muted); box-shadow: 0 1px 4px var(--shadow); }
.feed-tab.active { background: var(--primary); color: #fff; }

.categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.cat-chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; cursor: pointer; color: var(--text); }
.cat-chip.active { background: #f59e0b; color: #fff; border-color: #f59e0b; }

.ai-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.ai-badge { background: linear-gradient(135deg, var(--accent), #ec4899); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 11px; }

.post-card { background: var(--surface); border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 2px 10px var(--shadow); }
.post-img { width: 100%; height: 200px; object-fit: cover; }
.post-info { padding: 12px; }
.post-views { font-size: 12px; color: var(--text-muted); }
.post-title { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 4px; }
.post-actions { display: flex; gap: 16px; padding: 0 12px 12px; }
.post-action { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.post-action.liked { color: #ef4444; }

/* CHANNELS */
.channel-card { background: var(--surface); border-radius: 14px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px var(--shadow); }
.channel-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; flex-shrink: 0; }
.channel-name { font-size: 15px; font-weight: 600; color: var(--text); }
.channel-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.follow-btn { margin-left: auto; background: var(--accent); color: #fff; border: none; padding: 7px 16px; border-radius: 20px; font-size: 12px; cursor: pointer; }

/* COMMUNITY */
.member-card { background: var(--surface); border-radius: 14px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px var(--shadow); }
.member-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--accent); }
.member-name { font-size: 15px; font-weight: 600; color: var(--text); }
.member-role { font-size: 12px; color: var(--accent); }
.connect-btn { margin-left: auto; border: 1px solid var(--accent); color: var(--accent); background: transparent; padding: 7px 14px; border-radius: 20px; font-size: 12px; cursor: pointer; }

/* EVENTS */
.event-card { background: var(--surface); border-radius: 14px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 2px 10px var(--shadow); }
.event-banner { background: linear-gradient(135deg, var(--primary), var(--accent)); padding: 20px; color: #fff; }
.event-date { font-size: 12px; opacity: 0.8; }
.event-title { font-size: 18px; font-weight: 700; margin: 4px 0; }
.event-info { padding: 14px; display: flex; justify-content: space-between; align-items: center; }
.event-meta { font-size: 12px; color: var(--text-muted); }
.join-btn { background: var(--accent); color: #fff; border: none; padding: 8px 18px; border-radius: 20px; font-size: 13px; cursor: pointer; }

/* MESSAGES */
.msg-card { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border-radius: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px var(--shadow); }
.msg-avatar { width: 50px; height: 50px; border-radius: 50%; }
.msg-name { font-size: 15px; font-weight: 600; color: var(--text); }
.msg-preview { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.msg-time { margin-left: auto; font-size: 11px; color: #aaa; text-align: right; }
.msg-badge { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 4px; }

/* MARKETPLACE */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card { background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px var(--shadow); }
.product-img { width: 100%; height: 130px; object-fit: cover; }
.product-info { padding: 10px; }
.product-name { font-size: 13px; font-weight: 600; color: var(--text); }
.product-price { font-size: 15px; font-weight: 700; color: var(--accent); margin-top: 4px; }

/* CREATOR LAB */
.lab-card { background: linear-gradient(135deg, var(--primary), #3d3daf); border-radius: 16px; padding: 20px; color: #fff; margin-bottom: 14px; }
.lab-card h3 { font-size: 17px; margin-bottom: 6px; }
.lab-card p { font-size: 13px; opacity: 0.8; margin-bottom: 14px; }
.lab-btn { background: #f59e0b; color: #1a1a3e; border: none; padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* ANALYTICS */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border-radius: 14px; padding: 18px; text-align: center; box-shadow: 0 2px 8px var(--shadow); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* COLLABORATIONS */
.collab-card { background: var(--surface); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px var(--shadow); }
.collab-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.collab-avatar { width: 46px; height: 46px; border-radius: 50%; }
.collab-name { font-size: 15px; font-weight: 600; color: var(--text); }
.collab-type { font-size: 11px; color: var(--accent); background: rgba(124,58,237,0.1); padding: 2px 8px; border-radius: 10px; }
.collab-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.collab-btn { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; padding: 9px 20px; border-radius: 20px; font-size: 13px; cursor: pointer; width: 100%; }

/* PROFILE */
.profile-header { background: linear-gradient(135deg, var(--primary), #1a1a3e); padding: 30px 16px 60px; text-align: center; color: #fff; }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; border: 3px solid #f59e0b; margin-bottom: 12px; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-username { font-size: 13px; opacity: 0.7; }
.profile-stats { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.pstat-value { font-size: 20px; font-weight: 700; }
.pstat-label { font-size: 11px; opacity: 0.7; }
.profile-body { padding: 16px; }
.edit-profile-btn { width: 100%; border: 2px solid var(--accent); color: var(--accent); background: transparent; padding: 10px; border-radius: 25px; font-size: 15px; cursor: pointer; margin-bottom: 16px; }

/* DISCOVER */
.search-bar { display: flex; align-items: center; background: var(--surface); border-radius: 12px; padding: 10px 14px; gap: 10px; margin-bottom: 16px; box-shadow: 0 2px 8px var(--shadow); }
.search-bar input { border: none; outline: none; font-size: 14px; flex: 1; background: transparent; color: var(--text); }
.search-bar i { color: #aaa; }
.trending-tag { display: inline-block; background: rgba(124,58,237,0.1); color: var(--accent); padding: 6px 14px; border-radius: 20px; font-size: 13px; margin: 4px; cursor: pointer; }
