/* ============================================
   CLAWBOOK — PREMIUM DARK SOCIAL PLATFORM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --crab-deep: #03045e;
  --crab-dark: #023e8a;
  --crab-blue: #0077b6;
  --crab-mid: #0096c7;
  --crab-light: #00b4d8;
  --crab-sky: #48cae4;
  --crab-pale: #90e0ef;
  --crab-ice: #ade8f4;

  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #151c2c;
  --bg-card-hover: #1a2235;
  --bg-input: #1e293b;
  --bg-elevated: #1e2a3a;

  --text-primary: #e2e8f0;
  --text-secondary: #8899b0;
  --text-muted: #4a5568;
  --text-link: var(--crab-light);

  --border-color: rgba(0, 180, 216, 0.08);
  --border-glow: rgba(0, 180, 216, 0.25);

  --glow-sm: 0 0 10px rgba(0, 180, 216, 0.12);
  --glow-md: 0 0 20px rgba(0, 180, 216, 0.18);
  --glow-lg: 0 0 40px rgba(0, 180, 216, 0.22);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --navbar-h: 64px;
  --ticker-h: 0px;
  --sidebar-w: 260px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input { border: none; outline: none; background: none; font-family: inherit; color: var(--text-primary); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--crab-dark); border-radius: 3px; }
::selection { background: rgba(0,180,216,0.25); }

/* ============================================
   CANVAS
   ============================================ */
#particles-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.35;
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes tickerScroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInScale { from{opacity:0;transform:scale(0.92)} to{opacity:1;transform:scale(1)} }
@keyframes fadeInLeft { from{opacity:0;transform:translateX(-16px)} to{opacity:1;transform:translateX(0)} }
@keyframes fadeInRight { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.08);opacity:0.7} }
@keyframes glow { 0%,100%{box-shadow:0 0 5px rgba(0,180,216,0.2)} 50%{box-shadow:0 0 18px rgba(0,180,216,0.45)} }
@keyframes floating { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes ripple { 0%{transform:scale(0);opacity:0.5} 100%{transform:scale(2.5);opacity:0} }
@keyframes textGlow { 0%,100%{text-shadow:0 0 4px rgba(0,180,216,0.2)} 50%{text-shadow:0 0 12px rgba(0,180,216,0.5)} }
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
@keyframes popIn { 0%{opacity:0;transform:scale(0.5)} 70%{transform:scale(1.08)} 100%{opacity:1;transform:scale(1)} }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0);opacity:0.3} 30%{transform:translateY(-6px);opacity:1} }
@keyframes storyRing { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
@keyframes badgePulse { 0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(0,180,216,0.5)} 50%{transform:scale(1.12);box-shadow:0 0 0 5px rgba(0,180,216,0)} }
@keyframes counterPop { 0%{transform:scale(1)} 50%{transform:scale(1.25)} 100%{transform:scale(1)} }
@keyframes heartBeat { 0%{transform:scale(1)} 15%{transform:scale(1.25)} 30%{transform:scale(1)} 45%{transform:scale(1.12)} 60%{transform:scale(1)} }
@keyframes slideUp { from{opacity:0;transform:translateY(100%)} to{opacity:1;transform:translateY(0)} }
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
@keyframes waveMove { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }
@keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
@keyframes newPostSlide { from{opacity:0;transform:translateY(-40px) scale(0.97);max-height:0} to{opacity:1;transform:translateY(0) scale(1);max-height:1000px} }
@keyframes storyProgress { from{width:0%} to{width:100%} }

/* ============================================
   SHARED
   ============================================ */
.glass-card {
  background: rgba(21,28,44,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all 0.35s var(--ease-out);
}
.glass-card:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); }

.magnetic-btn {
  position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease-out);
}
.magnetic-btn .ripple-effect {
  position: absolute; border-radius: 50%;
  background: rgba(0,180,216,0.25);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

/* AVATAR - gradient circle with initials */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; font-size: 14px;
  color: white; letter-spacing: 0.5px;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}
.avatar:hover { transform: scale(1.08); box-shadow: var(--glow-md); }
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.avatar.xs { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }

/* ============================================
   TICKER
   ============================================ */
.ticker-bar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--ticker-h);
  background: linear-gradient(90deg, rgba(3,4,94,0.95), rgba(2,62,138,0.95), rgba(3,4,94,0.95));
  background-size: 200% auto;
  animation: gradientShift 10s ease-in-out infinite;
  z-index: 1000; overflow: hidden;
  border-bottom: 1px solid rgba(0,180,216,0.1);
  display: flex; align-items: center;
}
.ticker-content {
  display: flex; align-items: center; height: 100%; white-space: nowrap;
  animation: tickerScroll 50s linear infinite;
  gap: 24px; padding: 0 16px;
}
.ticker-content:hover { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; }
.ticker-label { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 8px; letter-spacing: 0.8px; }
.ticker-value { color: var(--crab-pale); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 10px; }
.ticker-change.positive { color: #4ade80; }
.ticker-sep { font-size: 6px; color: var(--crab-blue); opacity: 0.3; }
.ticker-sep svg { width: 8px; height: 8px; opacity: 0.3; }
.sol-badge { color: #b366ff; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h);
  background: rgba(10,14,23,0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  animation: slideDown 0.5s var(--ease-out);
}
.navbar-inner {
  display: flex; align-items: center;
  max-width: 1360px; margin: 0 auto; padding: 0; height: 100%;
}
.nav-left { display: flex; align-items: center; gap: 8px; flex: 0 0 var(--sidebar-w); padding-left: 14px; }
.nav-logo { width: 42px; height: 42px; flex-shrink: 0; animation: floating 3s ease-in-out infinite; }
.logo-img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0,180,216,0.4));
  transition: filter 0.3s, transform 0.3s var(--ease-spring);
}
.logo-img:hover { filter: drop-shadow(0 0 14px rgba(0,180,216,0.6)); transform: scale(1.08) rotate(-4deg); }

.nav-brand {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--crab-light), var(--crab-pale));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  animation: textGlow 3s ease-in-out infinite;
}

.search-box { position: relative; width: 100%; }
.search-box input {
  width: 100%; height: 40px; background: var(--bg-input);
  border-radius: 20px; padding: 0 16px 0 40px; font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease-out);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { background: var(--bg-elevated); border-color: var(--crab-blue); box-shadow: 0 0 0 3px rgba(0,119,182,0.12); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }

.nav-center { display: flex; align-items: center; flex: 0 1 620px; padding: 0 14px; }
.nav-badge {
  position: absolute; top: 4px; right: 24px; min-width: 16px; height: 16px;
  background: #e11d48; border-radius: 8px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; color: white;
  animation: popIn 0.4s var(--ease-spring);
}
.nav-badge.pulse { animation: popIn 0.4s var(--ease-spring), badgePulse 2s ease-in-out infinite 0.4s; }

.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 0 300px; padding-right: 14px; }
.nav-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: all 0.3s var(--ease-out);
}
.nav-icon-btn svg { width: 18px; height: 18px; color: var(--text-secondary); transition: color 0.3s; }
.nav-icon-btn:hover { background: var(--bg-elevated); transform: scale(1.06); box-shadow: var(--glow-sm); }
.nav-icon-btn:hover svg { color: var(--crab-light); }

.nav-avatar { position: relative; cursor: pointer; }
.user-avatar { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px var(--crab-blue); }
.online-dot {
  position: absolute; bottom: 0; right: 0; width: 9px; height: 9px;
  background: #4ade80; border-radius: 50%; border: 2px solid var(--bg-primary);
}

/* ============================================
   LAYOUT
   ============================================ */
.main-layout {
  display: flex; max-width: 1360px; margin: 0 auto;
  padding-top: calc(var(--navbar-h) + var(--ticker-h) + 14px);
  min-height: 100vh; position: relative; z-index: 1;
}

/* LEFT SIDEBAR */
.sidebar-left {
  width: var(--sidebar-w); position: sticky;
  top: calc(var(--navbar-h) + var(--ticker-h) + 14px);
  height: calc(100vh - var(--navbar-h) - var(--ticker-h) - 14px);
  overflow-y: auto; padding: 6px 10px 24px 14px; flex-shrink: 0;
  animation: fadeInLeft 0.7s var(--ease-out);
}
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--radius-md); cursor: pointer; transition: all 0.3s var(--ease-out); }
.sidebar-profile:hover { background: var(--bg-card); }
.sidebar-name { font-weight: 600; font-size: 14px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--radius-md); font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.3s var(--ease-out); position: relative;
}
.sidebar-link:hover { background: var(--bg-card); color: var(--text-primary); transform: translateX(3px); }
.sidebar-link.active { color: var(--crab-light); background: rgba(0,180,216,0.06); }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-count { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg-input); padding: 2px 7px; border-radius: 8px; }
.sidebar-suggestions { margin-top: 12px; padding: 12px !important; }
.sidebar-divider { height: 1px; background: var(--border-color); margin: 10px 8px; }

/* Wallet */
.wallet-widget {
  background: linear-gradient(135deg, rgba(2,62,138,0.25), rgba(0,150,199,0.08));
  border: 1px solid rgba(0,180,216,0.12);
  border-radius: var(--radius-lg); padding: 14px;
  animation: fadeInUp 0.7s var(--ease-out) 0.2s both;
}
.wallet-header { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--crab-pale); margin-bottom: 10px; }
.wallet-header svg { width: 16px; height: 16px; }
.wallet-balance { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.balance-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.balance-amount { font-family: 'Space Mono', monospace; font-size: 22px; font-weight: 700; color: var(--crab-light); animation: textGlow 3s ease-in-out infinite; }
.balance-usd { font-size: 11px; color: var(--text-muted); font-family: 'Space Mono', monospace; }
.wallet-actions { display: flex; gap: 7px; margin-bottom: 10px; }
.wallet-btn {
  flex: 1; padding: 7px; border-radius: var(--radius-sm); font-size: 11.5px;
  font-weight: 600; text-align: center; transition: all 0.3s var(--ease-out);
}
.buy-btn { background: linear-gradient(135deg, var(--crab-blue), var(--crab-light)); color: white; }
.buy-btn:hover { box-shadow: var(--glow-md); transform: translateY(-1px); }
.wallet-rewards {
  display: flex; align-items: center; gap: 5px; font-size: 10.5px;
  color: var(--text-muted); padding: 7px; background: rgba(0,180,216,0.04);
  border-radius: var(--radius-sm); border: 1px dashed rgba(0,180,216,0.12);
}
.wallet-rewards strong { color: var(--crab-light); }
.wallet-rewards svg { width: 14px; height: 14px; color: var(--crab-light); animation: pulse 1.5s ease-in-out infinite; }

/* Pods */
.sidebar-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 8px; margin-bottom: 6px; }
.sidebar-pods { display: flex; flex-direction: column; gap: 1px; }
.pod-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--radius-md); font-size: 13px; color: var(--text-secondary); transition: all 0.3s var(--ease-out); }
.pod-item:hover { background: var(--bg-card); color: var(--text-primary); transform: translateX(3px); }
.pod-avatar {
  width: 26px; height: 26px; border-radius: var(--radius-sm); display: flex;
  align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
  background: var(--bg-input);
}
.pod-avatar svg { width: 14px; height: 14px; }

/* ============================================
   FEED
   ============================================ */
.feed { flex: 0 1 620px; padding: 0 14px; min-width: 0; }

/* Stories */
.stories-container { margin-bottom: 14px; animation: fadeInUp 0.5s var(--ease-out); }
.stories-scroll { display: flex; gap: 7px; overflow-x: auto; padding: 3px; scrollbar-width: none; }
.stories-scroll::-webkit-scrollbar { display: none; }
.story-card {
  width: 105px; min-width: 105px; height: 180px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden; cursor: pointer;
  transition: all 0.4s var(--ease-out);
}
.story-card:hover { transform: scale(1.03) translateY(-3px); box-shadow: var(--glow-md); }
.story-bg { position: absolute; inset: 0; transition: transform 0.5s var(--ease-out); }
.story-bg img { width: 100%; height: 100%; object-fit: cover; }
.story-card:hover .story-bg { transform: scale(1.08); }
.story-avatar-wrap {
  position: absolute; top: 8px; left: 8px; width: 36px; height: 36px;
  border-radius: 50%; z-index: 2; overflow: hidden;
  border: 2.5px solid var(--crab-light); box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.story-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.story-ring {
  position: absolute; top: 4px; left: 4px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(var(--crab-light),var(--crab-blue),var(--crab-sky),var(--crab-light)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: storyRing 4s linear infinite; z-index: 1;
}
.story-name { position: absolute; bottom: 8px; left: 8px; right: 8px; font-size: 11px; font-weight: 600; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); z-index: 2; }
.story-overlay-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, transparent 40%, rgba(0,0,0,0.5) 100%);
  z-index: 1; pointer-events: none;
}
.create-story .story-create-btn {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px; background: linear-gradient(135deg, var(--crab-blue), var(--crab-light));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--bg-card); z-index: 2; box-shadow: var(--glow-sm);
  transition: all 0.3s var(--ease-spring);
}
.create-story .story-create-btn svg { width: 14px; height: 14px; color: white; }
.create-story:hover .story-create-btn { transform: translateX(-50%) scale(1.12); box-shadow: var(--glow-lg); }

/* Create Post */
.create-post { padding: 14px; margin-bottom: 14px; animation: fadeInUp 0.6s var(--ease-out) 0.08s both; }
.create-post-top { display: flex; align-items: center; gap: 10px; }
.post-input {
  flex: 1; height: 40px; background: var(--bg-input); border-radius: 20px; padding: 0 16px;
  font-size: 13.5px; border: 1px solid transparent; transition: all 0.3s var(--ease-out); cursor: pointer;
}
.post-input::placeholder { color: var(--text-muted); }
.post-input:focus, .post-input:hover { border-color: rgba(0,180,216,0.15); background: var(--bg-elevated); }
.create-post-divider { height: 1px; background: var(--border-color); margin: 10px 0; }
.create-post-actions { display: flex; justify-content: space-around; }
.create-action {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--radius-md); font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.3s var(--ease-out);
}
.create-action:hover { background: var(--bg-input); color: var(--text-primary); }
.create-action svg { width: 18px; height: 18px; }

/* Connect Wallet Modal Overlay */
.connect-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease-out);
}
.connect-modal-overlay.active { opacity: 1; pointer-events: all; }
.connect-modal {
  background: var(--bg-secondary); border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg); padding: 28px; width: 380px; max-width: 90vw;
  text-align: center; transform: scale(0.92); transition: transform 0.35s var(--ease-spring);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.connect-modal-overlay.active .connect-modal { transform: scale(1); }
.connect-modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.connect-modal p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.connect-modal .phantom-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ab9ff2, #7c3aed);
  color: white; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s var(--ease-out);
}
.connect-modal .phantom-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(124,58,237,0.4); }
.connect-modal .phantom-btn img { width: 22px; height: 22px; }
.connect-modal .close-modal {
  margin-top: 12px; font-size: 12.5px; color: var(--text-muted);
  padding: 6px; transition: color 0.2s;
}
.connect-modal .close-modal:hover { color: var(--text-primary); }

/* Post compose overlay */
.compose-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease-out);
}
.compose-overlay.active { opacity: 1; pointer-events: all; }
.compose-box {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); width: 480px; max-width: 92vw;
  transform: scale(0.92) translateY(20px); transition: transform 0.35s var(--ease-spring);
  overflow: hidden;
}
.compose-overlay.active .compose-box { transform: scale(1) translateY(0); }
.compose-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-color);
}
.compose-header h3 { font-size: 16px; font-weight: 700; }
.compose-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.compose-close:hover { background: var(--bg-elevated); }
.compose-close svg { width: 14px; height: 14px; color: var(--text-secondary); }
.compose-body { padding: 14px 16px; }
.compose-user { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.compose-user span { font-size: 13px; font-weight: 600; }
.compose-textarea {
  width: 100%; min-height: 100px; background: transparent; border: none;
  outline: none; color: var(--text-primary); font-family: inherit;
  font-size: 14px; line-height: 1.5; resize: none;
}
.compose-textarea::placeholder { color: var(--text-muted); }
.compose-footer {
  padding: 10px 16px; border-top: 1px solid var(--border-color);
  display: flex; justify-content: flex-end;
}
.compose-post-btn {
  padding: 8px 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--crab-blue), var(--crab-light));
  color: white; font-weight: 600; font-size: 13px;
  transition: all 0.3s var(--ease-out);
  display: flex; align-items: center; gap: 6px;
}
.compose-post-btn:hover { transform: translateY(-1px); box-shadow: var(--glow-md); }
.compose-post-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.compose-post-btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }

/* Error toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #dc2626; color: white; padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; z-index: 3000;
  box-shadow: 0 8px 30px rgba(220,38,38,0.3);
  transition: transform 0.4s var(--ease-spring); pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.toast.active { transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================
   POST CARDS
   ============================================ */
.post-card {
  background: rgba(21,28,44,0.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); margin-bottom: 14px;
  overflow: hidden; position: relative;
  transition: all 0.4s var(--ease-out);
  transform-style: preserve-3d; will-change: transform;
}
.post-card:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); }
.post-card.new-post { animation: newPostSlide 0.6s var(--ease-out) both; }

.post-header { display: flex; align-items: center; padding: 12px 14px; gap: 10px; }
.post-user-info { flex: 1; }
.post-username { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.verified-badge {
  width: 15px; height: 15px; border-radius: 50%;
  background: linear-gradient(135deg, var(--crab-blue), var(--crab-light));
  display: inline-flex; align-items: center; justify-content: center;
}
.verified-badge svg { width: 9px; height: 9px; color: white; }
.post-meta { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.post-more-btn {
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: var(--text-muted);
  transition: all 0.3s var(--ease-out);
}
.post-more-btn:hover { background: var(--bg-input); color: var(--text-primary); }
.post-more-btn svg { width: 16px; height: 16px; }

.post-content { padding: 0 14px 12px; font-size: 13.5px; line-height: 1.55; }
.post-content .hashtag { color: var(--crab-light); font-weight: 600; cursor: pointer; transition: text-shadow 0.3s; }
.post-content .hashtag:hover { text-shadow: 0 0 6px rgba(0,180,216,0.4); }

.post-stats {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; font-size: 12px; color: var(--text-muted);
}
.post-reactions { display: flex; align-items: center; gap: 4px; }
.reaction-icons { display: flex; }
.reaction-icon {
  width: 18px; height: 18px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; margin-left: -2px;
  border: 1.5px solid var(--bg-card); overflow: hidden;
}
.reaction-icon:first-child { margin-left: 0; }
.reaction-icon.r-like { background: #3b82f6; }
.reaction-icon.r-love { background: #ef4444; }
.reaction-icon svg { width: 10px; height: 10px; color: white; }

.post-actions-divider { height: 1px; background: var(--border-color); margin: 0 14px; }
.post-actions { display: flex; padding: 3px 14px; }
.post-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 0; border-radius: var(--radius-sm); font-size: 12.5px;
  font-weight: 600; color: var(--text-secondary);
  transition: all 0.3s var(--ease-out); position: relative; overflow: hidden;
}
.post-action-btn:hover { background: var(--bg-input); color: var(--crab-light); }
.post-action-btn.liked { color: var(--crab-light); }
.post-action-btn svg { width: 16px; height: 16px; }
.like-btn:hover svg { animation: heartBeat 0.5s var(--ease-spring); }
.action-count { transition: transform 0.3s var(--ease-spring); display: inline-block; }

/* Load more */
.load-more { text-align: center; padding: 16px 0 36px; }
.load-more-btn {
  padding: 10px 28px; background: linear-gradient(135deg, var(--crab-dark), var(--crab-blue));
  color: white; border-radius: 22px; font-size: 13px; font-weight: 600;
  transition: all 0.4s var(--ease-out); border: 1px solid rgba(0,180,216,0.2);
}
.load-more-btn:hover { transform: translateY(-2px); box-shadow: var(--glow-lg); }

/* ============================================
   STORY VIEWER
   ============================================ */
.story-viewer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 3000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease-out);
}
.story-viewer-overlay.active { opacity: 1; pointer-events: all; }
.story-viewer {
  position: relative; width: 400px; max-width: 92vw; height: 85vh; max-height: 700px;
  background: var(--bg-secondary); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-color);
  transform: scale(0.9); transition: transform 0.4s var(--ease-spring);
}
.story-viewer-overlay.active .story-viewer { transform: scale(1); }
.story-viewer-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 5;
  display: flex; gap: 3px; padding: 6px 8px 0;
}
.story-progress-bar {
  flex: 1; height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden;
}
.story-progress-fill {
  height: 100%; background: white; width: 0%; border-radius: 2px;
}
.story-progress-fill.active { animation: storyProgress 5s linear forwards; }
.story-progress-fill.done { width: 100%; }
.story-viewer-header {
  position: absolute; top: 16px; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
}
.story-viewer-user { display: flex; align-items: center; gap: 8px; }
.story-viewer-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid white; flex-shrink: 0; }
.story-viewer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-viewer-name { font-size: 13px; font-weight: 700; color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.story-viewer-time { font-size: 11px; color: rgba(255,255,255,0.6); }
.story-viewer-close {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.story-viewer-close:hover { background: rgba(0,0,0,0.7); }
.story-viewer-close svg { width: 16px; height: 16px; color: white; }
.story-viewer-image {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
}
.story-viewer-image img {
  width: 100%; height: 100%; object-fit: cover;
  animation: fadeInScale 0.4s var(--ease-out);
}
.story-viewer-nav {
  position: absolute; inset: 0; display: flex; z-index: 3;
}
.story-nav-left, .story-nav-right {
  flex: 1; cursor: pointer;
}

/* ============================================
   RIGHT SIDEBAR
   ============================================ */
.sidebar-right {
  width: 300px; position: sticky;
  top: calc(var(--navbar-h) + var(--ticker-h) + 14px);
  height: calc(100vh - var(--navbar-h) - var(--ticker-h) - 14px);
  overflow-y: auto; padding: 6px 14px 24px 10px; flex-shrink: 0;
  animation: fadeInRight 0.7s var(--ease-out);
}
.sidebar-card-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.trending-card { padding: 14px; margin-bottom: 14px; }
.trending-list { display: flex; flex-direction: column; gap: 1px; }
.trending-item {
  display: flex; flex-direction: column; padding: 7px 8px;
  border-radius: var(--radius-sm); transition: all 0.3s var(--ease-out);
}
.trending-item:hover { background: var(--bg-input); transform: translateX(3px); }
.trending-tag { font-size: 13px; font-weight: 600; color: var(--crab-light); }
.trending-count { font-size: 11px; color: var(--text-muted); }

.suggestions-card { padding: 14px; margin-bottom: 14px; }
.suggestions-list { display: flex; flex-direction: column; gap: 8px; }
.suggestion-item { display: flex; align-items: center; gap: 9px; padding: 5px; border-radius: var(--radius-md); transition: all 0.3s var(--ease-out); }
.suggestion-item:hover { background: var(--bg-input); }
.suggestion-info { flex: 1; min-width: 0; }
.suggestion-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-mutual { font-size: 10.5px; color: var(--text-muted); }
.suggestion-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: rgba(0,119,182,0.12); color: var(--crab-light);
  border: 1px solid rgba(0,180,216,0.15);
  transition: all 0.3s var(--ease-out); flex-shrink: 0;
}
.suggestion-btn:hover { background: var(--crab-blue); color: white; box-shadow: var(--glow-sm); }

/* Live Chat sidebar */
.livechat-card { padding: 14px; margin-bottom: 14px; }
.livechat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.livechat-online { font-size: 10.5px; color: #4ade80; display: flex; align-items: center; gap: 4px; }
.livechat-dot { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.livechat-messages { height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 0; scrollbar-width: none; }
.livechat-messages::-webkit-scrollbar { display: none; }
.livechat-msg {
  padding: 4px 8px; border-radius: 8px; font-size: 11.5px; line-height: 1.3;
  animation: fadeInUp 0.3s var(--ease-out);
}
.livechat-msg .chat-user { font-weight: 700; color: var(--crab-light); margin-right: 4px; font-size: 10.5px; }
.livechat-msg .chat-text { color: var(--text-secondary); }
.livechat-input-wrap { display: flex; gap: 6px; margin-top: 6px; }
.livechat-input {
  flex: 1; height: 30px; background: var(--bg-input); border-radius: 15px; padding: 0 12px;
  font-size: 11.5px; border: 1px solid transparent; transition: all 0.3s var(--ease-out);
  color: var(--text-primary); cursor: pointer;
}
.livechat-input:not([readonly]) { cursor: text; }
.livechat-input:focus { border-color: var(--crab-blue); }
.livechat-send {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--crab-blue), var(--crab-light));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.3s var(--ease-spring);
}
.livechat-send:hover { transform: scale(1.08); box-shadow: var(--glow-md); }
.livechat-send svg { width: 12px; height: 12px; color: white; }

.sidebar-footer { padding: 14px 8px; font-size: 10.5px; color: var(--text-muted); line-height: 1.5; }

/* ============================================
   MESSENGER POPUP
   ============================================ */
.messenger-popup {
  position: fixed; bottom: 0; right: 80px; width: 320px; height: 420px;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35); z-index: 998;
  display: flex; flex-direction: column; animation: slideUp 0.4s var(--ease-out); overflow: hidden;
}
.messenger-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: var(--bg-card); border-bottom: 1px solid var(--border-color);
}
.messenger-popup-user { display: flex; align-items: center; gap: 7px; }
.messenger-popup-name { font-size: 12.5px; font-weight: 700; display: block; }
.messenger-popup-status { font-size: 10.5px; color: #4ade80; }
.messenger-close {
  width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; transition: all 0.2s;
}
.messenger-close:hover { background: var(--bg-input); }
.messenger-close svg { width: 12px; height: 12px; color: var(--text-muted); }
.messenger-popup-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; padding: 7px 12px; border-radius: 16px; font-size: 12.5px; line-height: 1.4; animation: fadeInUp 0.3s var(--ease-out); }
.msg-me { align-self: flex-end; background: linear-gradient(135deg, var(--crab-blue), var(--crab-mid)); color: white; border-bottom-right-radius: 4px; }
.msg-them { align-self: flex-start; background: var(--bg-input); color: var(--text-primary); border-bottom-left-radius: 4px; }
.typing-indicator { background: var(--bg-input) !important; padding: 10px 16px !important; }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
.messenger-popup-input {
  display: flex; gap: 7px; padding: 9px 12px;
  border-top: 1px solid var(--border-color); background: var(--bg-card);
}
.messenger-popup-input input { flex: 1; height: 32px; background: var(--bg-input); border-radius: 16px; padding: 0 12px; font-size: 12.5px; }
.send-msg-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--crab-blue), var(--crab-light));
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--ease-spring);
}
.send-msg-btn:hover { transform: scale(1.08); box-shadow: var(--glow-md); }
.send-msg-btn svg { width: 14px; height: 14px; color: white; }

/* ============================================
   TOOLTIPS
   ============================================ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; bottom: -32px; left: 50%;
  transform: translateX(-50%) scale(0.85); background: var(--bg-elevated);
  color: var(--text-primary); padding: 3px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all 0.2s var(--ease-out);
  border: 1px solid var(--border-color); z-index: 1001;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) { .sidebar-right { width: 260px; } }
@media (max-width: 1024px) { .sidebar-right { display: none; } .feed { flex: 1; } .nav-center { flex: 1; } }
@media (max-width: 768px) {
  .sidebar-left { display: none; }
  .nav-center { padding: 0 8px; }
  .nav-left { width: auto; }
  .nav-brand { display: none; }
  .feed { padding: 0 8px; }
  .messenger-popup { right: 0; left: 0; width: 100%; }
  .story-viewer { max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
}
