/* ══════════════════════════════════════════════════════════
   BibiBook — Old Facebook Aesthetic (circa 2009-2012)
   ══════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #dddfe3;
  font-family: 'Lucida Grande', 'Lucida Sans Unicode', Tahoma, Verdana, Arial, sans-serif;
  font-size: 11px;
  color: #333;
  min-height: 100vh;
  padding-bottom: 28px;
}

/* ── Lo-fi image treatment ───────────────────────── */
.post-avatar img, .comment-avatar img, .friend-avatar img,
.ticker-mini-av img, #profile-main-avatar img, .post-image img {
  filter: contrast(1.15) saturate(0.6) brightness(0.88);
}

/* ── Subtle page flicker ─────────────────────────── */
@keyframes lofi-flicker {
  0%, 93%, 100% { opacity: 1; }
  94% { opacity: 0.96; }
  95% { opacity: 1; }
  96% { opacity: 0.98; }
  97% { opacity: 0.95; }
  98% { opacity: 1; }
}
body {
  animation: lofi-flicker 6s infinite;
}

/* ── Random text jitter ──────────────────────────── */
@keyframes text-jitter {
  0%, 97%, 100% { transform: none; }
  98% { transform: translate(-0.5px, 0.5px); }
  99% { transform: translate(0.5px, -0.3px); }
}
.post-body, .comment-text {
  animation: text-jitter 12s infinite;
}

/* ── Desaturate the whole page slightly ──────────── */
#main-content, #profile-page {
  filter: saturate(0.8) contrast(1.05);
}

a {
  color: #3b5998;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Header / Navbar ─────────────────────────────── */
#header {
  background: #3b5998;
  height: 35px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

#header-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  letter-spacing: -1px;
  margin-right: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

#header-logo span {
  font-style: italic;
}

#header-search {
  background: #fff;
  border: 1px solid #2d4073;
  border-radius: 3px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  color: #333;
  width: 180px;
  margin-right: 10px;
}

#header-search::placeholder { color: #aaa; }

#header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

/* ── Icon-style nav links (old Facebook 2010 style) ── */
.header-nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #d8dfea;
  font-size: 9px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 3px;
  white-space: nowrap;
  min-width: 44px;
  height: 29px;
  text-decoration: none;
  letter-spacing: 0.2px;
}
.header-nav-link:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
  color: #fff;
}
.header-nav-link.active {
  background: rgba(0,0,0,0.25);
  color: #fff;
}
/* Bottom white bar for active link (old FB style) */
.header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: #fff;
  border-radius: 1px 1px 0 0;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin-bottom: 1px;
}

.nav-icon svg {
  display: block;
  /* White icons on blue — globe uses internal stroke, others are solid white */
}

.nav-label {
  font-size: 9px;
  color: rgba(255,255,255,0.75);
  line-height: 1;
}

.header-nav-link:hover .nav-label,
.header-nav-link.active .nav-label {
  color: #fff;
}

/* Badge counter on icon links */
.header-nav-link .notif-count {
  position: absolute;
  top: 0px;
  right: 4px;
  background: #e1122c;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 8px;
  border: 1px solid #3b5998;
  line-height: 1.2;
  min-width: 14px;
  text-align: center;
}

#header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
}

#header-user .mini-avatar {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: #2d4073;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: bold;
}

.header-btn {
  background: linear-gradient(to bottom, #6d84b4, #5c73a0);
  border: 1px solid #3b5998;
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
}
.header-btn:hover {
  background: linear-gradient(to bottom, #7a93c7, #6980b0);
}

/* ── Page Layout ─────────────────────────────────── */
#page-wrapper {
  max-width: 980px;
  margin: 45px auto 0;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* ── Left Column ─────────────────────────────────── */
#left-col {
  width: 220px;
  flex-shrink: 0;
}

/* ── Center Column ───────────────────────────────── */
#center-col {
  flex: 1;
  min-width: 0;
}

/* ── Right Column ────────────────────────────────── */
#right-col {
  width: 220px;
  flex-shrink: 0;
}

/* ── Generic Box (sidebar widget) ────────────────── */
.box {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}

.box-header {
  background: linear-gradient(to bottom, #e8edf5, #dce4f0);
  border-bottom: 1px solid #b6c0d3;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #3b5998;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.box-header-icon {
  font-size: 13px;
  margin-right: 5px;
}

.box-body {
  padding: 8px 10px;
}

/* ── Profile Info (left sidebar) ─────────────────── */
#profile-mini {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 10px;
}

#profile-mini-cover {
  height: 50px;
  background: #1a3a6b;
  position: relative;
  border-radius: 3px 3px 0 0;
}

#profile-mini-avatar {
  width: 60px;
  height: 60px;
  border: 3px solid #fff;
  border-radius: 3px;
  position: absolute;
  bottom: -30px;
  left: 12px;
  background: #2d5a9e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  overflow: hidden;
}

.avatar-emoji-large {
  font-size: 28px;
}

#profile-mini-info {
  padding: 38px 12px 10px;
}

#profile-mini-name {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 2px;
}

#profile-mini-name a {
  color: #333;
}

#profile-mini-title {
  font-size: 10px;
  color: #777;
  margin-bottom: 6px;
}

#profile-mini-stats {
  display: flex;
  gap: 12px;
  border-top: 1px solid #e5e5e5;
  padding-top: 6px;
  margin-top: 4px;
}

.mini-stat {
  text-align: center;
}

.mini-stat-num {
  font-size: 13px;
  font-weight: bold;
  color: #3b5998;
}

.mini-stat-label {
  font-size: 9px;
  color: #777;
}

/* ── Nav Links (left sidebar) ────────────────────── */
.left-nav {
  list-style: none;
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}

.left-nav-header {
  background: linear-gradient(to bottom, #e8edf5, #dce4f0);
  border-bottom: 1px solid #b6c0d3;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #6d84b4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.left-nav li a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 11px;
  color: #333;
  border-bottom: 1px solid #f0f2f5;
}

/* Sidebar icon spans — inherit muted blue color */
.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: #6d84b4;
}

.sidebar-icon svg {
  display: block;
}

/* Friends box header icon — same style */
.sidebar-icon-friends {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d84b4;
  margin-right: 4px;
  vertical-align: middle;
}

/* Active sidebar link: icon turns blue */
.left-nav li a.active .sidebar-icon {
  color: #3b5998;
}

.left-nav li:last-child a {
  border-bottom: none;
}

.left-nav li a:hover {
  background: #e8edf5;
  text-decoration: none;
}

.left-nav li a.active {
  font-weight: bold;
  color: #3b5998;
  background: #e8edf5;
}

/* ── Friends List (sidebar) ──────────────────────── */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
}

.friend-thumb {
  text-align: center;
  cursor: pointer;
}

.friend-avatar {
  width: 58px;
  height: 58px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 3px;
  border: 1px solid #ddd;
  transition: border-color 0.2s;
  overflow: hidden;
}

.friend-thumb:hover .friend-avatar {
  border-color: #3b5998;
}

.friend-name {
  font-size: 9px;
  color: #333;
  line-height: 1.2;
  max-width: 60px;
  word-wrap: break-word;
}

.friend-thumb:hover .friend-name {
  text-decoration: underline;
  color: #3b5998;
}

/* ── Video Ads ───────────────────────────────────── */
.video-ad {
  position: relative;
  margin-bottom: 8px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  border: 1px solid #c4cfe0;
}

.video-ad video {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.video-ad-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.video-ad:hover .video-ad-overlay { opacity: 1; }

.video-ad-label {
  font-size: 9px;
  color: #888;
  padding: 3px 5px;
  background: #fff;
}

/* ── Video Lightbox ──────────────────────────────── */
#video-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}

#video-lightbox.open { display: flex; }

#video-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

#video-lightbox-player {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

#video-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  line-height: 1;
}

#video-lightbox-close:hover { background: #eee; }

/* ── Ads Box ─────────────────────────────────────── */
.ad-box {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 8px;
  padding: 6px 8px;
  font-size: 10px;
  color: #555;
}

.ad-box-title {
  font-weight: bold;
  color: #3b5998;
  margin-bottom: 3px;
  font-size: 11px;
}

.ad-box-img {
  width: 100%;
  height: 70px;
  background: linear-gradient(135deg, #1a3a6b, #3b5998);
  border-radius: 2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.ad-label {
  font-size: 9px;
  color: #aaa;
  margin-top: 3px;
}

/* ── Status Update Box ───────────────────────────── */
#status-box {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}

#status-box-header {
  background: linear-gradient(to bottom, #e8edf5, #dce4f0);
  border-bottom: 1px solid #b6c0d3;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #3b5998;
  display: flex;
  gap: 15px;
}

.status-tab {
  cursor: pointer;
  padding: 2px 4px;
  color: #6d84b4;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-tab.active {
  color: #333;
  border-bottom-color: #3b5998;
  font-weight: bold;
}

/* Icon inside each composer tab */
.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: inherit;
  flex-shrink: 0;
}

.tab-icon svg { display: block; }

.status-tab:hover { color: #3b5998; }

/* Status composer footer icons */
.status-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #6d84b4;
  cursor: pointer;
}
.status-icon-btn:hover { color: #3b5998; }
.status-icon-btn svg { display: block; }

#status-box-body {
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

#status-my-avatar {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: #2d5a9e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

#status-input-area {
  flex: 1;
}

#status-input {
  width: 100%;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 11px;
  font-family: inherit;
  resize: none;
  height: 60px;
  color: #333;
  outline: none;
}

#status-input:focus {
  border-color: #3b5998;
  box-shadow: 0 0 3px rgba(59, 89, 152, 0.3);
}

#status-input::placeholder { color: #bbb; }

#status-box-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px 8px;
}

#status-icons {
  display: flex;
  gap: 8px;
  color: #6d84b4;
  font-size: 16px;
}

#status-icons span {
  cursor: pointer;
  opacity: 0.7;
}
#status-icons span:hover { opacity: 1; }

.share-btn {
  background: linear-gradient(to bottom, #5b74a8, #3b5998);
  border: 1px solid #2d4373;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.share-btn:hover {
  background: linear-gradient(to bottom, #6b84b8, #4b69a8);
}

/* ── Sort Bar ────────────────────────────────────── */
#sort-bar {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  padding: 6px 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

#sort-bar span {
  color: #777;
}

.sort-options {
  display: flex;
  gap: 6px;
}

.sort-opt {
  color: #3b5998;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 2px;
}

.sort-opt:hover,
.sort-opt.active {
  background: #dde5f4;
}

/* ── Feed Filter Bar ─────────────────────────────── */
#feed-filter-bar {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  padding: 5px 10px;
  margin-bottom: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.feed-filter {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  color: #3b5998;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
.feed-filter:hover { background: #dde5f4; }
.feed-filter.active {
  background: #3b5998;
  color: #fff;
}
#filter-dev { color: #8b0000; }
#filter-dev.active { background: #8b0000; color: #fff; }

/* ── Feed Post ───────────────────────────────────── */
.post {
  background: #fafafa;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: opacity 0.5s;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.03);
}

.post.new-post {
  animation: slideInPost 0.4s ease-out;
  border-color: #3b5998;
}

@keyframes slideInPost {
  from { opacity: 0; transform: translateY(-15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-header {
  padding: 10px 10px 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid #ddd;
  overflow: hidden;
  transition: opacity 0.2s;
}

.post-avatar:hover { opacity: 0.85; }

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-size: 12px;
  font-weight: bold;
  color: #3b5998;
}
.post-author:hover { text-decoration: underline; }

.post-subtitle {
  font-size: 10px;
  color: #777;
  margin-bottom: 2px;
}

.post-time {
  font-size: 10px;
  color: #aaa;
}

.post-options {
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
.post-options:hover { color: #666; }

.post-body {
  padding: 4px 10px 8px 58px;
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}

.post-body p {
  word-wrap: break-word;
}

.post-image {
  margin: 6px 0 4px 0;
  border-radius: 2px;
  overflow: hidden;
  background: #1a1a1a;
  line-height: 0;
  position: relative;
}

.post-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  z-index: 1;
}

.post-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  filter: grayscale(0.6) contrast(1.3) brightness(0.75) sepia(0.2);
  transition: filter 0.3s;
}

.post-image img:hover {
  filter: grayscale(0.3) contrast(1.2) brightness(0.85) sepia(0.1);
}

/* ── Post Actions Bar ────────────────────────────── */
.post-actions {
  border-top: 1px solid #e5e5e5;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fafbfc;
}

.action-btn {
  background: linear-gradient(to bottom, #fff, #f5f6f7);
  border: 1px solid #ccc;
  border-radius: 3px;
  color: #333;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.1s;
}

.action-btn:hover {
  background: linear-gradient(to bottom, #f5f6f7, #eaeaea);
  border-color: #aaa;
}

.action-btn.liked {
  color: #3b5998;
  font-weight: bold;
  background: linear-gradient(to bottom, #e8edf5, #dce4f0);
  border-color: #3b5998;
}

.action-btn .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #555;
  flex-shrink: 0;
}

.action-btn .btn-icon svg { display: block; }

/* Like button: thumb turns blue when liked */
.action-btn.liked .btn-icon { color: #3b5998; }

.like-count {
  margin-left: auto;
  font-size: 10px;
  color: #777;
}

.like-count .liked-names {
  color: #3b5998;
}

/* ── Comments Section ────────────────────────────── */
.post-comments {
  background: #f7f7f7;
  border-top: 1px solid #e5e5e5;
  padding: 6px 10px;
}

.comment {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: flex-start;
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: bold;
  border: 1px solid #ddd;
  cursor: pointer;
  text-decoration: none;
}

.comment-bubble {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 4px 8px;
  flex: 1;
}

.comment-author {
  font-size: 10px;
  font-weight: bold;
  color: #3b5998;
  margin-bottom: 1px;
}

.comment-text {
  font-size: 11px;
  color: #333;
  line-height: 1.4;
}

.comment-actions {
  font-size: 9px;
  color: #aaa;
  margin-top: 2px;
  display: flex;
  gap: 8px;
}

.comment-actions span {
  cursor: pointer;
}
.comment-actions span:hover { color: #3b5998; }

.comment-input-row {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
}

.comment-mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  background: #2d5a9e;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: bold;
}

.comment-input {
  flex: 1;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  color: #333;
}
.comment-input:focus { border-color: #3b5998; }

/* ── Ticker (right sidebar) ──────────────────────── */
#ticker {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
  max-height: 200px;
}

#ticker-header {
  background: linear-gradient(to bottom, #e8edf5, #dce4f0);
  border-bottom: 1px solid #b6c0d3;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #3b5998;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticker-dot {
  width: 7px;
  height: 7px;
  background: #2ecc40;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#ticker-list {
  overflow-y: auto;
  max-height: 165px;
}

.ticker-item {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 10px;
  color: #555;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.ticker-item:last-child { border-bottom: none; }

.ticker-mini-av {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
  font-weight: bold;
}

.ticker-text { line-height: 1.3; }
.ticker-name { font-weight: bold; color: #3b5998; }

/* ── Suggestions Box ─────────────────────────────── */
.suggestion-item {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.suggestion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-size: 11px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-mutual {
  font-size: 9px;
  color: #777;
}

.add-friend-btn {
  background: linear-gradient(to bottom, #5b74a8, #3b5998);
  border: 1px solid #2d4373;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.add-friend-btn:hover {
  background: linear-gradient(to bottom, #6b84b8, #4b69a8);
}

/* ── Live Feed Notification ──────────────────────── */
#new-post-banner {
  display: none;
  background: #1877f2;
  color: #fff;
  text-align: center;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  border-radius: 3px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s;
}

#new-post-banner:hover {
  background: #1565d8;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Loading Spinner ─────────────────────────────── */
.spinner {
  text-align: center;
  padding: 20px;
  color: #777;
  font-size: 11px;
}

.spinner::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #c4cfe0;
  border-top-color: #3b5998;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Profile Page ────────────────────────────────── */
#profile-page {
  max-width: 980px;
  margin: 45px auto 0;
  padding: 10px;
}

#profile-cover {
  height: 180px;
  background: linear-gradient(135deg, #1a3a6b, #3b5998);
  border-radius: 3px 3px 0 0;
  position: relative;
  border: 1px solid #c4cfe0;
  border-bottom: none;
  filter: contrast(1.2) saturate(0.5) brightness(0.7);
  image-rendering: pixelated;
}

#profile-cover-pattern {
  position: absolute;
  overflow: hidden;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.15) 0px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
  pointer-events: none;
}

#profile-cover-info {
  position: absolute;
  bottom: 10px;
  left: 110px;
  right: 10px;
}

#profile-cover-name {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

#profile-cover-title {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}

#profile-main-avatar {
  position: absolute;
  bottom: -20px;
  left: 20px;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  overflow: hidden;
  padding: 0;
}

#profile-main-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#profile-tabs {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 0 0 0 0;
  display: flex;
  padding: 0 20px 0 110px;
  border-top: none;
  border-bottom: none;
}

.profile-tab {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: bold;
  color: #6d84b4;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.profile-tab:hover { color: #3b5998; }

.profile-tab.active {
  color: #3b5998;
  border-bottom-color: #3b5998;
}

#profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #c4cfe0;
  border-top: none;
  border-bottom: 1px solid #c4cfe0;
  min-height: 36px;
  justify-content: flex-end;
}

.profile-action-btn {
  background: linear-gradient(to bottom, #5b74a8, #3b5998);
  border: 1px solid #2d4373;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.profile-action-btn:hover {
  background: linear-gradient(to bottom, #6b84b8, #4b69a8);
}

#profile-body {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

#profile-left {
  width: 220px;
  flex-shrink: 0;
}

#profile-right {
  flex: 1;
  min-width: 0;
}

.info-item {
  display: flex;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 11px;
  color: #555;
}

.info-item:last-child { border-bottom: none; }

.info-label {
  font-weight: bold;
  color: #777;
  flex-shrink: 0;
  min-width: 55px;
  font-size: 10px;
  text-transform: uppercase;
}

.info-value { color: #333; }

/* ── Wall Post (profile) ─────────────────────────── */
.wall-post {
  background: #fff;
  border: 1px solid #c4cfe0;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #c4cfe0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b5998; }

/* ── Notifications popup ─────────────────────────── */
.notif-count {
  background: #e1122c;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 8px;
  margin-left: 3px;
}

/* ── Footer ──────────────────────────────────────── */
#footer {
  text-align: center;
  padding: 20px 10px;
  font-size: 10px;
  color: #aaa;
  margin-top: 20px;
}

#footer a { color: #aaa; }
#footer a:hover { text-decoration: underline; }

/* ── Generating indicator ────────────────────────── */
#generating-indicator {
  display: none;
  font-size: 10px;
  color: #777;
  padding: 4px 8px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 3px;
  margin-bottom: 8px;
  text-align: center;
}

/* ── Toast notification ──────────────────────────── */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 11px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#toast.show { opacity: 1; }

/* ── Profile picture lightbox ────────────────────── */
#photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

#photo-lightbox.open {
  display: flex;
}

#lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  line-height: 1;
}

#lightbox-close:hover { background: #eee; }

/* ── Photos Grid ─────────────────────────────────── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 0;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  border-radius: 2px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.photo-thumb:hover img { opacity: 0.85; }

.photo-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 9px;
  padding: 3px 5px;
  opacity: 0;
  transition: opacity 0.2s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.photo-thumb:hover .photo-thumb-caption { opacity: 1; }

/* ── Old-school horizontal rule ─────────────────── */
hr.old {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 6px 0;
}

/* ══════════════════════════════════════════════════
   DARK VFX LAYER
   ══════════════════════════════════════════════════ */

/* Scanlines — heavy CRT / surveillance overlay */
#fx-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9980;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent       0px,
    transparent       3px,
    rgba(0,0,0,0.10)  3px,
    rgba(0,0,0,0.10)  4px,
    transparent       4px,
    transparent       7px,
    rgba(0,0,0,0.04)  7px,
    rgba(0,0,0,0.04)  8px
  );
  animation: scanline-drift 6s linear infinite;
  mix-blend-mode: multiply;
}

@keyframes scanline-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 600px; }
}

/* Grain canvas sits just above scanlines */
#fx-grain-canvas {
  position: fixed;
  inset: 0;
  z-index: 9981;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
}

/* Vignette — dark edges closing in */
#fx-vignette {
  position: fixed;
  inset: 0;
  z-index: 9979;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* Edge pulse — red heartbeat bleed */
#fx-pulse {
  position: fixed;
  inset: 0;
  z-index: 9981;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(139, 0, 0, 0);
  transition: box-shadow 0.15s ease-in;
}

#fx-pulse.active {
  animation: blood-pulse 1.2s ease-out forwards;
}

@keyframes blood-pulse {
  0%   { box-shadow: inset 0 0 0px   0px  rgba(139,0,0,0.0); }
  15%  { box-shadow: inset 0 0 60px  20px rgba(139,0,0,0.55); }
  40%  { box-shadow: inset 0 0 80px  30px rgba(139,0,0,0.35); }
  100% { box-shadow: inset 0 0 0px   0px  rgba(139,0,0,0.0); }
}

/* Subliminal flash */
@keyframes flash-glitch-text {
  0%   { text-shadow: 0 0 20px rgba(139,0,0,0.9), 0 0 40px rgba(139,0,0,0.5); transform: translate(0,0) skewX(0deg); clip-path: none; }
  8%   { text-shadow: -4px 0 rgba(255,0,80,0.8), 4px 0 rgba(0,255,200,0.8); transform: translate(-4px,0) skewX(-2deg); }
  16%  { text-shadow: 4px 0 rgba(255,0,80,0.9), -4px 0 rgba(0,200,255,0.9); transform: translate(4px,1px) skewX(1.5deg); clip-path: inset(10% 0 60% 0); }
  24%  { text-shadow: -3px 0 rgba(255,0,80,0.7), 3px 0 rgba(0,255,200,0.7); transform: translate(-2px,0) skewX(-1deg); clip-path: none; }
  32%  { text-shadow: 0 0 30px rgba(139,0,0,1), 0 0 60px rgba(139,0,0,0.6); transform: translate(3px,-1px) skewX(2deg); clip-path: inset(50% 0 20% 0); }
  40%  { text-shadow: -5px 0 rgba(255,0,80,1), 5px 0 rgba(0,255,200,1); transform: translate(-3px,0) skewX(-2.5deg); clip-path: none; }
  48%  { text-shadow: 0 0 20px rgba(139,0,0,0.9), 0 0 40px rgba(139,0,0,0.5); transform: translate(0,0) skewX(0deg); }
  56%  { text-shadow: 2px 0 rgba(255,0,80,0.6), -2px 0 rgba(0,255,200,0.6); transform: translate(2px,0); }
  72%  { text-shadow: 0 0 20px rgba(139,0,0,0.9); transform: translate(0,0); }
  100% { text-shadow: 0 0 20px rgba(139,0,0,0.9), 0 0 40px rgba(139,0,0,0.5); transform: translate(0,0) skewX(0deg); }
}

@keyframes flash-bg-flicker {
  0%,100% { background: rgba(0,0,0,0.92); }
  10%  { background: rgba(20,0,0,0.97); }
  20%  { background: rgba(0,0,0,0.75); }
  30%  { background: rgba(30,0,5,0.98); }
  45%  { background: rgba(0,0,0,0.88); }
  55%  { background: rgba(15,0,0,0.95); }
  65%  { background: rgba(0,0,0,0.7); }
  80%  { background: rgba(0,0,0,0.92); }
}

@keyframes flash-scanline {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

#fx-flash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: clamp(28px, 6vw, 72px);
  font-weight: bold;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.06s ease-in;
  text-shadow: 0 0 20px rgba(139,0,0,0.9), 0 0 40px rgba(139,0,0,0.5);
}

#fx-flash.active {
  opacity: 1;
  transition: opacity 0.06s ease-in;
  animation: flash-bg-flicker 0.25s steps(1) infinite, flash-scanline 0.4s linear infinite;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px
  );
}

#fx-flash.active span {
  display: inline-block;
  animation: flash-glitch-text 0.3s steps(1) infinite;
}

#fx-flash.fading {
  opacity: 0;
  transition: opacity 0.4s ease-out;
  animation: none;
}

/* RGB glitch burst */
#fx-glitch {
  position: fixed;
  inset: 0;
  z-index: 999998;
  pointer-events: none;
  opacity: 0;
}

#fx-glitch.active {
  opacity: 1;
  animation: glitch-burst 0.6s steps(1) forwards;
}

@keyframes glitch-burst {
  0%   {
    background: transparent;
    mix-blend-mode: normal;
  }
  10%  {
    background: rgba(255,0,0,0.08);
    transform: translate(4px, 0);
    mix-blend-mode: screen;
  }
  20%  {
    background: rgba(0,0,255,0.08);
    transform: translate(-4px, 1px);
  }
  30%  {
    background: transparent;
    transform: translate(2px, -1px);
  }
  40%  {
    background: rgba(255,0,0,0.05);
    transform: translate(-2px, 0);
    filter: saturate(3) hue-rotate(15deg);
  }
  55%  {
    background: rgba(0, 0, 0, 0.15);
    transform: translate(1px, 1px);
    filter: contrast(1.4) brightness(0.9);
  }
  70%  {
    background: transparent;
    filter: none;
    transform: translate(0, 0);
  }
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}

/* ── Box / post glitch animations ───────────────── */

/* fast micro-shiver */
@keyframes shiver {
  0%   { transform: translate(0,0) skewX(0deg); }
  10%  { transform: translate(-2px, 0) skewX(-0.4deg); }
  20%  { transform: translate(2px, 1px) skewX(0.4deg); }
  30%  { transform: translate(-1px,-1px) skewX(-0.2deg); }
  40%  { transform: translate(2px, 0) skewX(0.5deg); }
  50%  { transform: translate(-2px, 1px) skewX(-0.4deg); }
  60%  { transform: translate(1px,-1px) skewX(0.3deg); }
  70%  { transform: translate(-1px, 0) skewX(-0.2deg); }
  80%  { transform: translate(2px, 1px) skewX(0.4deg); }
  90%  { transform: translate(-1px,-1px) skewX(-0.3deg); }
  100% { transform: translate(0,0) skewX(0deg); }
}

/* RGB channel-split glitch overlay */
@keyframes glitch-slice {
  0%   { opacity:0; clip-path: inset(0 0 100% 0); }
  8%   { opacity:1; clip-path: inset(15% 0 55% 0); transform: translate(-4px,0); filter: hue-rotate(80deg) saturate(5) brightness(1.3); }
  16%  { clip-path: inset(55% 0 20% 0); transform: translate(4px,0);  filter: hue-rotate(-70deg) saturate(5) brightness(0.8); }
  24%  { clip-path: inset(30% 0 40% 0); transform: translate(-3px,1px); filter: saturate(6) contrast(2) brightness(1.5); }
  32%  { clip-path: inset(70% 0 5% 0);  transform: translate(3px,-1px); filter: hue-rotate(120deg) saturate(4); }
  40%  { clip-path: inset(5% 0 70% 0);  transform: translate(-5px,0); filter: hue-rotate(-100deg) brightness(1.6); }
  48%  { clip-path: inset(40% 0 35% 0); transform: translate(5px,0);  filter: saturate(8) contrast(2.5); }
  56%  { clip-path: inset(0 0 0 0);     transform: translate(0,0);    filter: none; opacity:0.9; }
  100% { opacity:0; clip-path: inset(0 0 0 0); }
}

/* scanline tear that drifts across */
@keyframes glitch-scan {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* horizontal offset burst on the whole element */
@keyframes glitch-offset {
  0%,100% { transform: translate(0,0); filter: none; }
  15%  { transform: translate(-3px,0); filter: brightness(1.15) saturate(1.5); }
  30%  { transform: translate(4px,0);  filter: brightness(0.9)  hue-rotate(20deg); }
  45%  { transform: translate(-2px,1px); filter: contrast(1.4); }
  60%  { transform: translate(3px,-1px); filter: brightness(1.1) hue-rotate(-15deg); }
  75%  { transform: translate(-1px,0); filter: none; }
}

/* flicker */
@keyframes glitch-flicker {
  0%,100% { opacity:1; }
  25%  { opacity:0.75; }
  50%  { opacity:0.92; }
  60%  { opacity:0.6; }
  70%  { opacity:1; }
  80%  { opacity:0.8; }
}

/* --- glitching class applied to .box and .post --- */
.box.glitching,
.post.glitching {
  animation: shiver 0.22s linear, glitch-offset 0.22s steps(2), glitch-flicker 0.22s steps(3);
  position: relative;
  overflow: visible;
  z-index: 2;
}

/* RGB slice pseudo-element */
.box.glitching::before,
.post.glitching::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: inherit;
  animation: glitch-slice 0.22s steps(1) forwards;
  z-index: 20;
  mix-blend-mode: screen;
}

/* scanline tear pseudo-element */
.box.glitching::after,
.post.glitching::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: rgba(0,255,180,0.35);
  pointer-events: none;
  animation: glitch-scan 0.22s linear forwards;
  z-index: 21;
}

/* heavier variant for dramatic full glitch */
.box.glitching-hard,
.post.glitching-hard {
  animation: shiver 0.35s linear, glitch-offset 0.35s steps(3), glitch-flicker 0.35s steps(5);
  position: relative;
  overflow: visible;
  z-index: 2;
}
.box.glitching-hard::before,
.post.glitching-hard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: inherit;
  animation: glitch-slice 0.35s steps(1) forwards;
  z-index: 20;
  mix-blend-mode: screen;
}
.box.glitching-hard::after,
.post.glitching-hard::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  background: rgba(255,0,100,0.4);
  pointer-events: none;
  animation: glitch-scan 0.35s linear forwards;
  z-index: 21;
}

/* ── Responsive collapse ─────────────────────────── */
@media (max-width: 768px) {
  #right-col { display: none; }
  #left-col { width: 180px; }
}

@media (max-width: 580px) {
  #left-col { display: none; }
  #page-wrapper { padding: 5px; }
}
