/* =========================================================
   SPLASHES v2 — Premium Design System
   A dark-first, social-native aesthetic.
   Comparable to X, Instagram, and Reddit.
   ========================================================= */


:root {
  /* ——— Deep Obsidian Futuristic Palette ——— */
  --bg-body: #090d14;
  --bg-surface: #0e131d;
  --bg-surface-2: #141b26;
  --bg-elevated: #1a2232;
  --bg-card: #121822;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-header: rgba(9, 13, 20, 0.88);
  --bg-mobile-nav: rgba(9, 13, 20, 0.95);
  --bg-bottom-nav: rgba(14, 19, 29, 0.95);
  --bg-chat-header: rgba(14, 19, 29, 0.95);

  /* ——— Vibrant Neon Accents ——— */
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.4);

  /* ——— Text ——— */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d14;

  /* ——— Semantic ——— */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* ——— Borders ——— */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-accent: rgba(16, 185, 129, 0.3);

  /* ——— Shadows ——— */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.12);

  /* ——— Radius ——— */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ——— Typography ——— */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* ——— Transitions ——— */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Override old theme colors — DARK */
[data-theme="dark"] {
  --bg-body: #090d14;
  --bg-surface: #0e131d;
  --bg-surface-2: #141b26;
  --bg-elevated: #1a2232;
  --bg-card: #121822;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-header: rgba(9, 13, 20, 0.88);
  --bg-mobile-nav: rgba(9, 13, 20, 0.95);
  --bg-bottom-nav: rgba(14, 19, 29, 0.95);
  --bg-chat-header: rgba(14, 19, 29, 0.95);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d14;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
}

/* Override old theme colors — LIGHT */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-card: #ffffff;
  --bg-glass: rgba(0, 0, 0, 0.03);
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-mobile-nav: rgba(255, 255, 255, 0.98);
  --bg-bottom-nav: rgba(255, 255, 255, 0.98);
  --bg-chat-header: rgba(255, 255, 255, 0.98);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-accent: rgba(16, 185, 129, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] body {
  background-color: var(--bg-body) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] #brand-name {
  background: linear-gradient(135deg, #0f172a 0%, var(--accent) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

[data-theme="light"] .post-title,
[data-theme="light"] .hero-title,
[data-theme="light"] .discovery-title,
[data-theme="light"] .section-title,
[data-theme="light"] .sheet-title,
[data-theme="light"] .topic-option-left,
[data-theme="light"] .modal-card h1,
[data-theme="light"] .modal-card h2,
[data-theme="light"] .modal-card h3,
[data-theme="light"] .modal-card h4,
[data-theme="light"] .modal-card h5,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5 {
  color: var(--text-primary) !important;
}

[data-theme="light"] .post-body,
[data-theme="light"] .hero-subtitle,
[data-theme="light"] .discovery-desc,
[data-theme="light"] p {
  color: var(--text-secondary);
}

[data-theme="light"] .post-card-modern,
[data-theme="light"] .post-card,
[data-theme="light"] .chain-card,
[data-theme="light"] .today-discovery-card,
[data-theme="light"] .ai-widget-card,
[data-theme="light"] .pref-customizer-sheet,
[data-theme="light"] .modal-card,
[data-theme="light"] .auth-card {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="light"] #global-search-input,
[data-theme="light"] #mobile-global-search-input {
  background: var(--bg-surface-2) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="light"] #main-header,
[data-theme="light"] #mobile-nav,
[data-theme="light"] #bottom-nav {
  background: var(--bg-surface) !important;
  border-color: var(--border-color) !important;
}

[data-theme="light"] .header-btn {
  background: var(--bg-surface-2) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

[data-theme="light"] #brand-tagline {
  color: var(--text-muted) !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   1. Header Redesign
   ========================================================= */

#main-header {
  background: var(--bg-header);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  height: 56px;
}

#brand-name {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-btn {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  width: 36px;
  height: 36px;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  transform: scale(1.05);
}

#points-display {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

#mobile-nav {
  background: var(--bg-mobile-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-item {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.mobile-nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* =========================================================
   2. Bottom Navigation Redesign
   ========================================================= */

#bottom-nav {
  background: var(--bg-bottom-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-color);
  height: 56px;
}

.bottom-nav-item {
  transition: all var(--transition-fast);
  position: relative;
}

.bottom-nav-item .nav-icon svg {
  stroke-width: 1.8;
  transition: all var(--transition-fast);
}

.bottom-nav-item.active .nav-icon svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.bottom-nav-item .nav-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.bottom-nav-item.active .nav-label {
  color: var(--accent);
  font-weight: 600;
}

/* =========================================================
   3. Side Navigation (Desktop) Redesign
   ========================================================= */

#side-nav {
  background: transparent;
  border-right: 1px solid var(--border-color);
}

.side-nav-item {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}

.side-nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.side-nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.side-nav-item.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

/* =========================================================
   4. Buttons Redesign
   ========================================================= */

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.2px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: var(--text-inverse);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.35);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* =========================================================
   5. Cards & Posts (Feed) — Instagram / X style
   ========================================================= */

.post-card-modern,
.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.post-card-modern::before,
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.post-card-modern:hover::before,
.post-card:hover::before {
  opacity: 1;
}

.post-card-modern:hover,
.post-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.post-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.post-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.post-actions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: auto;
}

.post-action {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.post-action:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.post-action.active {
  color: var(--accent);
}

.post-action.active svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* =========================================================
   6. Profile Redesign
   ========================================================= */

.profile-header {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-body) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  opacity: 0.15;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--bg-body);
  box-shadow: 0 0 0 2px var(--accent), 0 4px 20px rgba(0, 212, 170, 0.2);
  object-fit: cover;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface-2);
  box-shadow: 0 0 0 1px var(--border-color);
  object-fit: cover;
}

.profile-name {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
  margin-top: 12px;
}

.profile-username {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 8px auto 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* =========================================================
   7. Tabs Redesign
   ========================================================= */

.tabs {
  border-bottom: 1px solid var(--border-subtle);
  gap: 0;
  padding: 0;
}

.tab {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  border-radius: 0;
  background: none;
}

.tab:hover {
  color: var(--text-secondary);
  background: none;
}

.tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
  background: none;
}

/* =========================================================
   8. Forms & Inputs Redesign
   ========================================================= */

.form-input,
.form-textarea,
.form-select {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  padding: 12px 16px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.form-error {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 500;
}

/* =========================================================
   9. Chat Redesign — Modern Messaging (Instagram/WhatsApp style)
   ========================================================= */

.chat-header {
  background: var(--bg-chat-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
}

.chat-messages {
  background: var(--bg-body);
  padding: 20px 16px;
  gap: 4px;
}

.message-row {
  display: flex;
  width: 100%;
  margin-bottom: 8px;
}

.message-row.sent {
  justify-content: flex-end;
}

.message-row.received {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  box-shadow: var(--shadow-sm);
  animation: bubbleIn 0.25s ease-out;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: scale(0.9) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.sent .chat-bubble {
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: var(--text-inverse);
  border-bottom-right-radius: 4px;
  font-weight: 400;
}

.received .chat-bubble {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.msg-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
  font-weight: 500;
}

.chat-input-area {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  gap: 10px;
}

.chat-input-area .form-input {
  border-radius: var(--radius-pill);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  font-size: 0.95rem;
}

.chat-input-area .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.chat-input-area .btn-primary {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.chat-input-area .btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.4);
}

/* Empty chat start message */
#empty-chat-msg {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 16px 0;
  padding: 8px 16px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-pill);
  align-self: center;
}

/* =========================================================
   10. Inbox / Chat List Redesign
   ========================================================= */

.chat-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-row:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

.chat-row .avatar-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface-2);
  box-shadow: 0 0 0 2px var(--border-color);
  object-fit: cover;
  transition: all var(--transition-fast);
}

.chat-row:hover .avatar-sm {
  box-shadow: 0 0 0 2px var(--accent);
}

.chat-row .name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.chat-row .last-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Unread badge */
.chat-row .unread-badge {
  background: linear-gradient(135deg, var(--error), #f97316);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* =========================================================
   11. Auth Page Redesign
   ========================================================= */

.auth-page {
  background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-surface) 50%, var(--bg-body) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 212, 170, 0.05);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #3b82f6, var(--accent));
}

.auth-card h1 {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   12. Pills, Tags & Badges
   ========================================================= */

.pill {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pill:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Eureka badge */
.eureka-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.verified-causer {
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* =========================================================
   13. Modals Redesign
   ========================================================= */

.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

/* =========================================================
   14. Empty States & Loading
   ========================================================= */

.empty-state {
  color: var(--text-muted);
  padding: 48px 24px;
  text-align: center;
}

.empty-state svg {
  opacity: 0.4;
  margin-bottom: 16px;
}

.loading-spinner {
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.2);
}

/* =========================================================
   15. Explorer Page Redesign
   ========================================================= */

.explore-section-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.heatmap-block {
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.heatmap-block::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.heatmap-block:hover::after {
  opacity: 1;
}

.heatmap-block:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.momentum-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: all var(--transition-fast);
}

.momentum-row:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

.velocity-indicator {
  color: var(--accent);
}

.anomaly-card {
  background: var(--bg-surface);
  border: 1px dashed var(--warning);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.anomaly-card:hover {
  border-style: solid;
  border-color: var(--warning);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
}

.anomaly-badge {
  background: linear-gradient(135deg, var(--warning), #f97316);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* =========================================================
   16. Consensus / Split Layout (Node page)
   ========================================================= */

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

.consensus-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.consensus-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.prediction-row {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 10px;
  transition: all var(--transition-fast);
}

.prediction-row:hover {
  border-color: var(--border-accent);
}

/* =========================================================
   17. Toast Notifications Redesign
   ========================================================= */

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--info);
}

/* =========================================================
   18. Animations
   ========================================================= */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Card entrance stagger */
.post-card-modern,
.post-card {
  animation: fadeUp 0.35s ease-out backwards;
}

.post-card-modern:nth-child(1) { animation-delay: 0ms; }
.post-card-modern:nth-child(2) { animation-delay: 50ms; }
.post-card-modern:nth-child(3) { animation-delay: 100ms; }
.post-card-modern:nth-child(4) { animation-delay: 150ms; }
.post-card-modern:nth-child(5) { animation-delay: 200ms; }

/* =========================================================
   19. Scrollbar Redesign
   ========================================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =========================================================
   20. Mobile-Specific Polish
   ========================================================= */

@media (max-width: 640px) {
  .post-card-modern,
  .post-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: -16px;
    margin-right: -16px;
    padding: 16px;
  }

  .profile-header {
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
  }

  .chat-row {
    border-radius: var(--radius-md);
  }

  .auth-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    max-width: 100%;
  }

  .auth-card::before {
    display: none;
  }

  #main-content {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* =========================================================
   21. Standalone PWA Polish
   ========================================================= */

@media (display-mode: standalone) {
  #main-header {
    height: calc(52px + env(safe-area-inset-top, 0px));
  }

  #bottom-nav {
    background: var(--bg-bottom-nav);
  }
}

/* =========================================================
   22. Pristine Desktop Sidebar Layout & Collapsed State Rules
   ========================================================= */

#side-nav {
  width: 240px;
  background: var(--bg-body) !important;
  border-right: 1px solid var(--border-color) !important;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

#side-nav::-webkit-scrollbar {
  display: none;
}

/* Collapsed Icon Rail State */
#side-nav.collapsed {
  width: 68px !important;
  padding: 16px 8px !important;
}

#side-nav.collapsed .nav-text,
#side-nav.collapsed .nav-label,
#side-nav.collapsed .nav-section-title,
#side-nav.collapsed .topics-follow-header,
#side-nav.collapsed .topic-label-text,
#side-nav.collapsed .sidebar-gamification-card,
#side-nav.collapsed #sidebar-ad-section,
#side-nav.collapsed .ad-section {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

#side-nav.collapsed .nav-item {
  justify-content: center !important;
  padding: 10px 0 !important;
  gap: 0 !important;
  border-radius: 12px !important;
}

#side-nav.collapsed .topic-link-item {
  justify-content: center !important;
  padding: 8px 0 !important;
}

#side-nav.collapsed #sidebar-toggle {
  transform: rotate(180deg);
  margin: 0 auto 12px !important;
}

/* =========================================================
   23. Missing Utility Classes
   ========================================================= */

.w-full { width: 100%; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* =========================================================
   24. Missing Component Classes
   ========================================================= */

/* Secondary Button */
.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.2px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  padding: 8px 16px;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* Card Footer Actions (post cards) */
.card-footer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Like / Bookmark Action Buttons */
.like-btn-action,
.bookmark-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.like-btn-action:hover { color: var(--error); background: rgba(239, 68, 68, 0.08); }
.bookmark-btn-action:hover { color: var(--accent); background: var(--accent-dim); }
.active-liked { color: var(--error) !important; }
.active-liked svg { fill: var(--error); stroke: var(--error); }

/* Inbox — New Chat Modal Search Results */
.share-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.share-user-row:hover {
  background: var(--bg-surface-2);
}
.share-user-info {
  flex: 1;
  min-width: 0;
}
.share-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.share-user-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.share-send-btn {
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.share-send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Tag Suggestions Dropdown (append page) */
.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
}
.tag-suggestions .tag-option {
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.tag-suggestions .tag-option:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* Topic Icon & Count (more page) */
.topic-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.topic-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Admin Dashboard (super-control) */
.admin-section-view {
  display: none;
  animation: fadeUp 0.3s ease-out;
}
.admin-section-view.active {
  display: block;
}
.requests-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Interactive Panel (pulse page) */
.interactive-panel {
  pointer-events: auto;
}

/* =========================================================
   25. Missing Animation Keyframes
   ========================================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   26. Accessibility — Focus Styles
   ========================================================= */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-dim);
}

