/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #060c18;
  --bg-2: #0a1220;
  --bg-card: #0f1b2d;
  --bg-hover: #162236;
  --border: rgba(0,180,216,0.08);
  --border-2: rgba(0,180,216,0.18);
  --text: #ddeeff;
  --text-2: #7a9bbf;
  --text-3: #3a5570;
  --accent: #00b4d8;
  --accent-2: #0ea5e9;
  --gradient: linear-gradient(135deg, #1d4ed8, #00b4d8);
  --like: #f43f5e;
  --online: #22c55e;
  --danger: #ef4444;
  --sidebar-w: 240px;
  --right-w: 300px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5a; }
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; color: var(--text); }
::placeholder { color: var(--text-3); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 0 16px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: #2a2a3a transparent;
}
.sidebar-logo { display: none; }
.logo-wave { display: none; }
.logo-text { display: none; }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 0 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-profile:hover { background: var(--bg-hover); }
.profile-avatar { position: relative; flex-shrink: 0; }
.avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}
.online-dot {
  width: 10px; height: 10px;
  background: var(--online);
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  position: absolute;
  bottom: 0; right: 0;
}
.profile-name { font-weight: 600; font-size: 13px; }
.profile-status { font-size: 11px; color: var(--online); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: rgba(0,180,216,0.12);
  color: var(--accent);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1.4;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  display: flex;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
  justify-content: center;
}
.feed-column {
  flex: 1;
  max-width: 620px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.right-panel {
  width: var(--right-w);
  padding: 24px 16px 24px 0;
  flex-shrink: 0;
}
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== STORIES ===== */
.stories-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stories-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.stories-scroll::-webkit-scrollbar { display: none; }
.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.story:hover { transform: translateY(-2px); }
/* Gradient ring wrapper */
.story-ring {
  width: 66px; height: 66px;
  border-radius: 50%;
  padding: 3px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.story-viewed .story-ring { background: var(--bg-hover); }
.story-add .story-ring {
  background: transparent;
  border: 2px dashed rgba(0,180,216,0.35);
  padding: 2px;
}
.story-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2.5px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: white;
}
.story-add .story-avatar {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: transparent;
}
.story span:last-child {
  font-size: 11px;
  color: var(--text-2);
  max-width: 66px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== CREATE POST ===== */
.create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.create-post-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.create-post-inner:hover { background: var(--bg-hover); }
.create-post-placeholder {
  color: var(--text-3);
  font-size: 14px;
}
.create-post-actions {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 4px;
  gap: 4px;
}
.create-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.create-action-btn:hover { background: var(--bg-hover); color: var(--accent); }

/* ===== AVATAR SIZES ===== */
.avatar-xs {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 10px; color: white;
  flex-shrink: 0;
}
.avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
}
.avatar-md {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: white;
  flex-shrink: 0;
  position: relative;
}
.avatar-online {
  width: 12px; height: 12px;
  background: var(--online);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  position: absolute;
  bottom: 0; right: 0;
}
.community-avatar {
  background: rgba(0,180,216,0.15);
  border: 1px solid rgba(0,180,216,0.35);
  color: var(--accent);
}
.community-avatar-sm {
  background: rgba(0,180,216,0.15);
  border: 1px solid rgba(0,180,216,0.35);
  color: var(--accent);
}

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--border-2); }

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.post-author { display: flex; align-items: center; gap: 10px; }
.author-info { display: flex; flex-direction: column; gap: 2px; }
.author-name {
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s;
}
.author-name:hover { color: var(--accent); }
.post-time {
  font-size: 12px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 3px;
}
.community-tag { font-size: 12px; color: var(--text-3); }

.post-menu-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all 0.15s;
}
.post-menu-btn:hover { background: var(--bg-hover); color: var(--text); }

.post-body { padding: 0 16px 12px; }
.post-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  padding: 0 16px 10px;
  white-space: pre-wrap;
  transition: color 0.15s;
}
.post-text:hover { color: var(--accent); }
.post-author-name { font-weight: 600; font-size: 14px; color: var(--text); }
.post-author-name:hover { color: var(--accent); }

/* Post Media */
.post-media { border-radius: var(--radius-sm); overflow: hidden; margin-top: 4px; }
.post-media-1 .media-placeholder { height: 320px; }
.post-media-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
}
.post-media-2 .media-placeholder { height: 180px; }
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  cursor: pointer;
  transition: filter 0.2s;
}
.media-placeholder:hover { filter: brightness(1.1); }
.media-more {
  position: relative;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

/* Follow btn */
.follow-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.follow-btn:hover { background: var(--accent); color: white; }
.follow-btn.following {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-2);
}

/* ===== POST STATS BAR ===== */
.post-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-3);
}
.stat-item svg { flex-shrink: 0; }

/* ===== POST ACTIONS ===== */
.post-actions {
  display: flex;
  padding: 2px 8px;
}
.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.action-btn:hover { background: var(--bg-hover); color: var(--text); }
.action-btn.liked { color: var(--like); }
.action-btn.liked:hover { background: rgba(244,63,94,0.1); }

/* ===== REPOST CARD ===== */
.repost-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.repost-card:hover { border-color: var(--border-2); }
.repost-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.repost-author { font-weight: 600; font-size: 13px; }
.repost-time { font-size: 11px; color: var(--text-3); margin-left: auto; }
.repost-text { font-size: 13.5px; color: var(--text-2); }

/* ===== COMMENTS ===== */
.comments-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comments-section.hidden { display: none; }
.comment-input-row { display: flex; gap: 10px; align-items: flex-start; }
.comment-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-hover);
  border-radius: 20px;
  padding: 0 14px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.comment-input-wrap:focus-within { border-color: var(--accent); }
.comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 9px 0;
  color: var(--text);
}
.comment-send-btn {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 4px;
}
.comment-input-wrap:focus-within .comment-send-btn { opacity: 1; }

.comment { display: flex; gap: 10px; }
.comment-content { flex: 1; }
.comment-author { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.comment-text { font-size: 13.5px; color: var(--text); }
.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.comment-like-btn, .comment-reply-btn {
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.15s;
}
.comment-like-btn:hover { color: var(--like); }
.comment-reply-btn:hover { color: var(--accent); }
.comment-like-btn.liked { color: var(--like); }
.comment-time { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* ===== RIGHT PANEL ===== */
.right-panel { position: sticky; top: 24px; height: fit-content; }
.panel-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 12px;
}
.panel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
}
.panel-tab.active { background: rgba(0,180,216,0.15); color: var(--accent); }
.panel-tab:hover:not(.active) { background: var(--bg-hover); color: var(--text); }
.panel-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-content.hidden { display: none; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-hover);
  border-radius: 20px;
  padding: 0 14px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
  color: var(--text-3);
}
.search-bar:focus-within { border-color: var(--accent); color: var(--accent); }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 10px 0;
  color: var(--text);
}
.panel-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
}

/* Recent searches */
.search-recent { display: flex; flex-direction: column; gap: 4px; }
.search-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.search-recent-item:hover { background: var(--bg-hover); }
.recent-info { flex: 1; }
.recent-name { font-size: 13px; font-weight: 500; }
.recent-type { font-size: 11px; color: var(--text-3); }
.recent-remove {
  font-size: 16px;
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 50%;
  transition: all 0.15s;
  line-height: 1;
}
.recent-remove:hover { background: var(--bg-hover); color: var(--danger); }

/* Trending */
.trending-list { display: flex; flex-direction: column; gap: 4px; }
.trending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.trending-item:hover { background: var(--bg-hover); }
.trending-rank { font-size: 12px; color: var(--text-3); width: 20px; text-align: center; font-weight: 700; }
.trending-tag { font-size: 13px; font-weight: 600; color: var(--accent); }
.trending-count { font-size: 11px; color: var(--text-3); }

/* People */
.people-list { display: flex; flex-direction: column; gap: 8px; }
.person-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.person-card:hover { background: var(--bg-hover); }
.person-info { flex: 1; }
.person-name { font-size: 13px; font-weight: 600; }
.person-mutual { font-size: 11px; color: var(--text-3); }
.add-friend-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,180,216,0.12);
  border: 1px solid rgba(0,180,216,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: all 0.15s;
  flex-shrink: 0;
}
.add-friend-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.add-friend-btn.added { background: var(--bg-hover); border-color: var(--border); color: var(--text-3); }

/* ===== POST MENU DROPDOWN ===== */
.post-menu-dropdown {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 200px;
  z-index: 500;
  box-shadow: var(--shadow);
  animation: fadeIn 0.1s ease;
}
.post-menu-dropdown.hidden { display: none; }
.menu-section { display: flex; flex-direction: column; gap: 1px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(239,68,68,0.1); }
.menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-create { width: 540px; }
.modal-stats { width: 480px; }
.modal-repost { width: 480px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* Create Post Modal */
.create-author-row { display: flex; gap: 12px; align-items: center; }
/* ===== CUSTOM SELECT ===== */
.custom-select { position: relative; display: inline-block; margin-top: 4px; }
.custom-select-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.custom-select-btn:hover { border-color: var(--accent); color: var(--accent); }
.custom-select.open .custom-select-btn { border-color: var(--accent); color: var(--accent); }
.custom-select-btn svg { transition: transform 0.2s; }
.custom-select.open .custom-select-btn svg { transform: rotate(180deg); }
.custom-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 200;
  animation: fadeIn 0.1s ease;
}
.custom-select.open .custom-select-menu { display: flex; flex-direction: column; gap: 1px; }
.custom-select-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}
.custom-select-option:hover { background: var(--bg-hover); color: var(--text); }
.custom-select-option.active { color: var(--accent); font-weight: 600; }
.custom-select-option .check { margin-left: auto; opacity: 0; }
.custom-select-option.active .check { opacity: 1; }
.create-textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  color: var(--text);
}
.upload-zone {
  border: 2px dashed rgba(0,180,216,0.25);
  border-radius: var(--radius-sm);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0,180,216,0.04);
  color: var(--text);
}
.upload-zone p { font-size: 14px; font-weight: 500; }
.upload-btn {
  padding: 8px 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.create-tools {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.tool-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all 0.15s;
}
.tool-btn:hover { background: var(--bg-hover); color: var(--accent); }
.btn-ghost {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-publish {
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  background: var(--gradient);
  color: white;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-publish:hover { opacity: 0.9; transform: translateY(-1px); }

/* Stats Modal */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stats-card {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stats-number {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stats-label { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.stats-section { display: flex; flex-direction: column; gap: 12px; }
.stats-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.stats-users-list { display: flex; flex-direction: column; gap: 8px; }
.stats-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stats-see-all {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
}
.stats-see-all:hover { text-decoration: underline; }

/* Story Overlay */
.story-overlay { background: rgba(0,0,0,0.9); }
.story-viewer {
  width: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
}
.story-progress { padding: 12px 12px 0; }
.story-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  background: white;
  border-radius: 3px;
  width: 0%;
  transition: width 5s linear;
}
.story-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  position: absolute;
  top: 20px; left: 0; right: 0;
}
.story-viewer-author { display: flex; align-items: center; gap: 8px; color: white; font-weight: 600; font-size: 13px; }
.story-time-ago { font-size: 11px; color: rgba(255,255,255,0.7); font-weight: 400; }
.story-content {
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-placeholder-text { color: rgba(255,255,255,0.3); font-size: 14px; }
.story-reply {
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0,0,0,0.5);
}
.story-reply-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: white;
  outline: none;
}
.story-reply-btn {
  color: white;
  padding: 8px;
}

/* Repost preview */
.repost-preview {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: slideUpFade 0.2s ease;
}
.toast.hidden { display: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideUpFade { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes likePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.like-pop { animation: likePop 0.3s ease; }

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ===== POST HEADER / META ===== */
.post-author-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.post-author-info { display: flex; flex-direction: column; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 6px; }
.post-meta-name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta-time { font-size: 12px; color: var(--text-3); }
.post-menu-wrap { position: relative; margin-left: auto; }
.post-menu-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); transition: background 0.15s; }
.post-menu-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ===== POST DROPDOWN ===== */
.post-dropdown {
  position: absolute; top: 36px; right: 0; z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 160px;
  overflow: hidden;
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--text-2);
  transition: background 0.12s;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item.danger { color: var(--like); }
.dropdown-item.danger:hover { background: rgba(244,63,94,0.08); }

/* ===== POST STATS ROW ===== */
.post-stats-row {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 16px 6px;
  font-size: 12px; color: var(--text-3);
}
.post-stat-likes, .post-stat-cmts { display: flex; align-items: center; gap: 3px; }
.post-divider { height: 1px; background: var(--border); margin: 0 16px; }

/* ===== MEDIA GRID ===== */
.media-grid { margin: 6px 16px 10px; border-radius: var(--radius-sm); overflow: hidden; }
.grid-single .media-cell { max-height: 480px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.grid-three { display: grid; grid-template-columns: 2fr 1fr; gap: 2px; }
.grid-three .media-cell:first-child { grid-row: span 2; }
.grid-four { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.media-cell {
  position: relative; overflow: hidden; background: #0a1628;
  max-height: 300px; min-height: 120px;
}
.media-cell img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; cursor: pointer;
  transition: transform 0.2s;
}
.media-cell img:hover { transform: scale(1.02); }
.media-more {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
  cursor: pointer;
}

/* ===== VIDEO IN POST ===== */
.post-video { margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.post-video-el { width: 100%; max-height: 480px; display: block; }

/* ===== AUDIO PLAYER ===== */
.audio-player {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
}
.ap-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s;
}
.ap-play:hover { background: var(--accent-2, #0077cc); }
.ap-play svg { color: #fff; }
.ap-body { flex: 1; min-width: 0; }
.ap-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.ap-track {
  height: 4px; background: var(--border-2);
  border-radius: 2px; cursor: pointer; position: relative;
}
.ap-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; pointer-events: none; transition: width 0.1s linear; }
.ap-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ===== SKELETON LOADING ===== */
.skeleton-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.sk-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sk-av { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-hover); flex-shrink: 0; }
.sk-lines { flex: 1; }
.sk-line {
  height: 10px; border-radius: 5px; background: var(--bg-hover);
  margin-bottom: 6px;
  animation: skPulse 1.4s ease-in-out infinite;
}
.sk-line.short { width: 40%; }
.sk-body { height: 80px; border-radius: 8px; background: var(--bg-hover); animation: skPulse 1.4s ease-in-out infinite; }
@keyframes skPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== COMMENT SECTION ===== */
.comment-section { padding: 0 16px 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.comment-item { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.comment-bubble { flex: 1; background: var(--bg-hover); border-radius: 10px; padding: 8px 12px; }
.comment-author { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.comment-text { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.comment-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.comment-input-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.comment-input-wrap { flex: 1; }
.comment-input-wrap input {
  width: 100%; background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 14px;
  font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.comment-input-wrap input:focus { border-color: var(--accent); }
.comment-send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comment-send-btn svg { color: #fff; }
.comment-send-btn:hover { opacity: 0.85; }

/* ===== MEDIA PREVIEW LIST (create post) ===== */
.media-preview-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
}
.media-preview-item {
  position: relative; width: 80px; height: 80px;
  border-radius: 8px; overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.media-preview-item img, .media-preview-item video {
  width: 100%; height: 100%; object-fit: cover;
}
.media-preview-item .mp-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.media-preview-item .mp-icon {
  font-size: 11px; color: var(--text-3); text-align: center; padding: 4px;
}
.mp-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; cursor: pointer; line-height: 1;
}
.mp-remove:hover { background: var(--like); }

/* ===== DYNAMIC AVATAR ===== */
.dyn-avatar { flex-shrink: 0; }

/* ===== EMOJI PICKER ===== */
.emoji-panel {
  position: absolute;
  bottom: 44px;
  left: 0;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px;
  width: 260px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.emoji-grid span {
  font-size: 20px;
  text-align: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.1s;
  line-height: 1.3;
}
.emoji-grid span:hover { background: var(--bg-hover); }

/* ===== REPOST BADGE & ORIGINAL POST PREVIEW ===== */
.repost-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--accent);
  background: rgba(0,180,216,.1);
  border-radius: 10px; padding: 1px 7px;
  margin-left: 6px; vertical-align: middle;
}
.orig-post-preview {
  margin: 6px 16px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
}
.orig-post-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.orig-post-name { font-size: 12px; font-weight: 600; color: var(--text); }
.orig-post-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ===== PROFILE MODAL ===== */
.modal-profile { max-width: 480px; }
.profile-modal-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 24px 32px; text-align: center;
}
.profile-modal-avatar { margin-bottom: 12px; }
.profile-modal-name { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.profile-modal-status { font-size: 13px; color: #22c55e; margin-bottom: 20px; }
.profile-modal-actions { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; justify-content: center; }
.profile-modal-coming {
  color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px;
  border-top: 1px solid var(--border); width: 100%; padding-top: 20px;
}

/* ===== POST DETAIL MODAL ===== */
.modal-post-detail { max-width: 680px; width: 100%; }

/* ===== COMING SOON ===== */
.coming-soon-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}
.coming-soon-icon { color: var(--accent); margin-bottom: 20px; opacity: 0.7; }
.coming-soon-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.coming-soon-sub { font-size: 14px; color: var(--text-3); max-width: 320px; line-height: 1.6; margin: 0; }

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox-overlay img { max-width: 92vw; max-height: 92vh; border-radius: 8px; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  color: #fff; font-size: 30px; cursor: pointer; opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

/* ===== HASHTAGS ===== */
.hashtag {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}
.hashtag:hover { text-decoration: underline; }

/* ===== EMOJI PANEL FIX (scroll) ===== */
.emoji-panel { max-height: 200px; overflow-y: auto; }

/* ===== SEARCH RESULTS ===== */
#searchResults { margin-bottom: 8px; }
.sr-section {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-3);
  padding: 10px 4px 4px;
}
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
}
.sr-item:hover { background: var(--bg-hover); }
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub  { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== FRIENDS PAGE ===== */
.page-title-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px;
}
.page-title-bar h2 { font-size: 18px; font-weight: 700; margin: 0; color: var(--text); flex: 1; }
.friends-section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  margin: 16px 0 8px;
}
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.friend-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
}
.friend-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.friend-card-sub  { font-size: 12px; color: var(--text-3); }
.friend-btns { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.friend-btn {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text); cursor: pointer; transition: background 0.15s;
}
.friend-btn:hover { background: var(--border); }
.friend-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.friend-btn.primary:hover { opacity: 0.9; }
.friend-btn.danger { background: transparent; color: #ef4444; border-color: #ef4444; }
.friend-btn.danger:hover { background: rgba(239,68,68,.08); }

/* ===== BOOKMARKS PAGE ===== */
.bookmarks-empty, .empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 24px; gap: 12px; color: var(--text-3);
  font-size: 14px; text-align: center;
}
.empty-state svg { opacity: 0.3; }

/* ===== PROFILE MODAL STATS ===== */
.profile-stats-bar {
  display: flex; gap: 24px; justify-content: center;
  padding: 16px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  width: 100%; margin: 12px 0 20px;
}
.profile-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.profile-stat-num { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-stat-lbl { font-size: 12px; color: var(--text-3); }
.profile-posts-preview { width: 100%; text-align: left; }
.profile-post-preview {
  background: var(--bg-hover); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; cursor: pointer;
  transition: background 0.15s;
}
.profile-post-preview:hover { background: var(--border); }
.pp-text { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.pp-meta { font-size: 11px; color: var(--text-3); }

/* ===== PROFILE PAGE ===== */
.prof-cover {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #0f1b2d 0%, #1d4ed8 50%, #00b4d8 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: visible;
  flex-shrink: 0;
}
.prof-cover-btn {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.5); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 6px 12px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .15s;
}
.prof-cover-btn:hover { background: rgba(0,0,0,.7); }
.prof-info-row {
  display: flex; align-items: flex-end; gap: 16px;
  padding: 0 20px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative; margin-top: -48px;
}
.prof-avatar-wrap {
  position: relative; flex-shrink: 0;
}
.prof-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  overflow: hidden;
  background: var(--bg-hover);
}
.prof-avatar .dyn-avatar { width: 100% !important; height: 100% !important; border-radius: 50%; }
.prof-avatar-btn {
  position: absolute; bottom: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card); cursor: pointer;
  transition: opacity .15s;
}
.prof-avatar-btn:hover { opacity: 0.85; }
.prof-details {
  flex: 1; padding-bottom: 4px;
}
.prof-name {
  font-size: 22px; font-weight: 700; color: var(--text);
  line-height: 1.2; margin-bottom: 4px;
}
.prof-bio {
  font-size: 13px; color: var(--text-2); margin-bottom: 6px;
  min-height: 18px;
}
.prof-stats { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.prof-stat { color: var(--text-2); }
.prof-stat b { color: var(--text); font-weight: 700; }
.prof-stat-sep { color: var(--text-3); }
.prof-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; padding-bottom: 4px; }

.prof-friends-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.prof-friends-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
}
.prof-friends-title span { color: var(--text-3); margin-left: 4px; }
.prof-friends-grid {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.prof-friend-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; width: 60px;
}
.prof-friend-name {
  font-size: 11px; color: var(--text-2); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

.prof-tabs {
  display: flex; gap: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}
.prof-tab {
  padding: 12px 16px; font-size: 14px; font-weight: 500;
  color: var(--text-3); border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .15s;
  background: none; border-left: none; border-right: none; border-top: none;
}
.prof-tab:hover { color: var(--text); }
.prof-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
