:root {
  --blue: #1877f2;
  --blue-dark: #166fe5;
  --blue-light: #2d88ff;
  --gradient-start: #1877f2;
  --gradient-end: #42b72a;
  --bg: #f0f2f5;
  --card: #fff;
  --text: #050505;
  --muted: #65676b;
  --border: #dddfe2;
  --bar: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.08);
  --reel-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent: #e41e3f;
  --success: #42b72a;
  --warning: #f7b928;
}
html.dark {
  --bg: #18191a;
  --card: #242526;
  --text: #e4e6eb;
  --muted: #b0b3b8;
  --border: #3a3b3c;
  --bar: #242526;
  --shadow: none;
  --reel-gradient: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}
.hide-on-desktop { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
  background: var(--bar);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
}
.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--blue);
}
.logo span { color: #42b72a; }
.search { flex: 1; }
.search input {
  width: 100%;
  max-width: 420px;
  border: 0;
  background: var(--bg);
  border-radius: 999px;
  padding: 10px 14px;
}
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav .me { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 6px 10px; border-radius: 8px; transition: background 0.2s; }
.top-nav .me:hover { background: var(--bg); }
.top-nav img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* SVG Icon Navigation */
.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}
.nav-icon:hover {
    background: var(--bg);
    color: var(--blue);
}
.nav-icon.active {
    color: var(--blue);
}
.nav-icon.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--blue);
    border-radius: 2px;
}
.nav-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.nav-icon-svg svg {
    width: 100%;
    height: 100%;
}
.nav-icon .badge {
    position: absolute;
    top: 2px;
    left: 2px;
}
.theme-btn {
    background: none;
    border: none;
    padding: 0;
}
.theme-btn:hover {
    background: var(--bg);
}
.app {
  max-width: 1180px;
  margin: 16px auto;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 16px;
  padding: 0 16px 40px;
}
.sidebar .card, .card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}
.nav-list a, .nav-list button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}
.nav-list a:hover { background: var(--bg); }
.nav-list .nav-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-list .nav-icon-svg svg {
  width: 100%;
  height: 100%;
}
.composer textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 70px;
  font: inherit;
  outline: none;
}
.composer .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.btn, button, .composer button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover, button:hover { background: var(--blue-dark); }
.google-btn { display: block; text-align: center; background: #fff; color: #3c4043; border: 1px solid var(--border); margin-top: 12px; padding: 10px; }
.google-btn:hover { background: #f7f8f8; color: #3c4043; }
.composer select { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--bg); color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }
.btn-ghost { background: var(--bg); color: var(--text); }
.post-head { display: flex; gap: 10px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.name { font-weight: 700; display: block; }
time { color: var(--muted); font-size: 12px; }
.post-text { white-space: pre-wrap; margin: 10px 0; }
.post-img { width: 100%; border-radius: 8px; max-height: 520px; object-fit: cover; }
.post-stats { color: var(--muted); font-size: 13px; display: flex; gap: 12px; margin: 8px 0; }
.post-actions { border-top: 1px solid var(--border); padding-top: 8px; display: flex; gap: 8px; }
.post-actions form { flex: 1; }
.post-actions button { background: transparent; color: var(--muted); width: 100%; }
.post-actions .liked { color: var(--blue); }
.post-actions .saved { color: var(--success); }

/* Read more functionality */
.post-text-container {
  position: relative;
}
.content-collapsible {
  max-height: 140px;
  overflow: hidden;
  position: relative;
}
.content-collapsible::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--card));
  pointer-events: none;
}
.read-more-toggle:checked ~ .content-collapsible {
  max-height: none;
}
.read-more-toggle:checked ~ .content-collapsible::after {
  display: none;
}
.read-more-btn {
  display: block;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}
.read-more-toggle:checked ~ .read-more-btn {
  display: none !important;
}

.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input {
  flex: 1;
  border: 0;
  background: var(--bg);
  border-radius: 999px;
  padding: 8px 12px;
}
.comments { list-style: none; padding: 0; margin: 10px 0 0; }
.comments li { background: var(--bg); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; }
.comment-main { display: flex; gap: 8px; align-items: flex-start; }
.comment-avatar-small { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.reply-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.reply-btn:hover { color: var(--blue); }
.replies {
  list-style: none;
  padding: 0 0 0 40px;
  margin: 6px 0 0;
}
.replies li {
  background: transparent;
  padding: 4px 0;
  border-radius: 0;
  border-left: 2px solid var(--border);
  margin-left: 0;
  margin-bottom: 4px;
}
.reply-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-left: 40px;
}
.reply-form input[type="text"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--card);
  color: var(--text);
}
.reply-form button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; }
.auth-card {
  width: min(420px, 92vw);
  background: var(--card);
  padding: 32px 28px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  text-align: center;
}
.auth-card h1 { color: var(--blue); margin: 0 0 8px; }
.auth-card input, .auth-card textarea {
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.error { color: #c0392b; font-size: 14px; }
.cover {
  height: 220px;
  background: linear-gradient(90deg, #1877f2, #42b72a);
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
}
.cover.has-cover {
  background: none;
}
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-upload-form {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
}
.cover-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.9);
  color: #333;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cover-upload-btn:hover {
  background: #fff;
}
.cover-upload-btn input {
  display: none;
}
.cover-remove-form {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
}
.cover-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cover-remove-btn:hover {
  background: rgba(0,0,0,0.8);
}
.profile-head { text-align: center; margin-top: -48px; padding-bottom: 16px; }
.profile-head img { width: 96px; height: 96px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; }
.profile-head h2 { margin: 8px 0 4px; }
.profile-head p { color: var(--muted); margin: 4px 0; }
.avatar-wrapper {
  position: relative;
  display: inline-block;
}
.avatar-upload-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid #fff;
  transition: background 0.2s;
}
.avatar-upload-overlay:hover {
  background: var(--blue-dark);
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}
.profile-card {
  margin-bottom: 16px;
}
.friend-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bell { position: relative; }
.badge {
  position: absolute;
  top: -6px;
  left: -8px;
  background: #e41e3f;
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.theme-btn {
  background: var(--bg);
  color: var(--text);
  padding: 6px 10px;
}
.hidden { display: none !important; }
.grow { flex: 1; }
.inline { display: inline; }
.danger { color: #e41e3f !important; }
.linkish {
  background: none !important;
  color: var(--muted) !important;
  padding: 0 6px !important;
  font-weight: 500;
  font-size: 12px;
}
.owner-actions { display: flex; gap: 4px; }
.menu { position: relative; }
.dots-btn {
  background: var(--bg) !important;
  color: var(--text) !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.menu-list {
  position: absolute;
  left: 0;
  top: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 140px;
  box-shadow: var(--shadow);
  z-index: 5;
  overflow: hidden;
}
.menu-list button {
  display: block;
  width: 100%;
  background: none;
  color: var(--text);
  text-align: right;
  padding: 10px 12px;
  border-radius: 0;
}
.menu-list button:hover { background: var(--bg); }
.react-wrap { position: relative; flex: 1; }
.react-main { width: 100%; background: transparent; color: var(--muted); }
.react-picker {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  z-index: 6;
  padding-bottom: 14px;
  margin-bottom: -10px;
}
.react-wrap:hover .react-picker { display: flex; }
.react-picker form { flex: 0; }
.react-picker button { width: auto; font-size: 20px; background: none; padding: 4px 6px; }
.media-grid { display: grid; gap: 4px; margin: 8px 0; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2, .media-grid.n3, .media-grid.n4 { grid-template-columns: 1fr 1fr; }
.tag-box { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tags { color: var(--muted); font-size: 13px; }
.edit-post-form textarea { width: 100%; min-height: 70px; font: inherit; }
.unread { background: rgba(24, 119, 242, .08); border-radius: 8px; padding: 8px !important; }
.shared-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 8px 0; }
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px 16px; }
.story-item, .story-add { text-align: center; min-width: 72px; color: var(--text); font-size: 12px; position: relative; }
.story-add input { display: none; }
.story-ring {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--blue); display: block; margin: 0 auto 6px;
  transition: transform 0.2s;
}
.story-video-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.story-viewer {
  position: relative; background: #000; color: #fff; border-radius: 16px;
  min-height: 70vh; overflow: hidden;
}
.story-viewer .story-meta { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; align-items: center; }
.story-viewer .close-x { position: absolute; top: 12px; left: 12px; z-index: 2; color: #fff; font-size: 22px; }
.story-slides .slide { display: none; width: 100%; max-height: 70vh; object-fit: contain; }
.story-slides .slide.on { display: block; }
.story-viewer .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.2); color: #fff;
}
.story-viewer .prev { right: 8px; }
.story-viewer .next { left: 8px; }

/* Story Progress Bar */
.story-progress-bar {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.1s linear;
}
.progress-fill.active {
  width: 100%;
  animation: progressAnim 5s linear forwards;
}
.progress-fill.completed {
  width: 100%;
}
@keyframes progressAnim {
  from { width: 0%; }
  to { width: 100%; }
}

/* Story Click Zones */
.story-click-zones {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  z-index: 1;
}
.click-zone {
  flex: 1;
  cursor: pointer;
}
.click-prev {
  background: transparent;
}
.click-next {
  background: transparent;
}
.chat-log { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: var(--bg); }
.bubble.me { align-self: flex-start; background: var(--blue); color: #fff; }
.bubble.them { align-self: flex-end; }
.bubble time { display: block; font-size: 11px; opacity: .8; }
.chat-media { max-width: 240px; border-radius: 8px; margin-bottom: 4px; display: block; cursor: pointer; }
.chat-form { display: flex; gap: 8px; align-items: center; }
.chat-form input[type="text"], .chat-form input[name="body"] { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 10px 14px; background: var(--bg); color: var(--text); }
.chat-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.chat-attach-btn:hover {
    background: var(--border);
}
.chat-attach-btn input {
    display: none;
}
.chat-preview {
    position: relative;
    display: inline-block;
    margin: 8px 0;
    padding: 8px;
    background: var(--bg);
    border-radius: 8px;
}
.chat-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    display: block;
}
.remove-preview {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
html.dark .auth-card { background: var(--card); color: var(--text); }
html.dark .search input, html.dark .comment-form input { background: #3a3b3c; color: var(--text); }

/* Reels Styles */
.reels-section {
  grid-column: 2;
}

.reels-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reel-upload {
  margin-bottom: 16px;
}

.reel-upload form {
  border: 2px dashed var(--border);
  padding: 20px;
  text-align: center;
}

.reel-upload h3 {
  margin: 0 0 16px;
  color: var(--blue);
}

.reel-upload input[type="file"] {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.reel-upload textarea {
  width: 100%;
  min-height: 80px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.reel-upload input[type="text"] {
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.reel-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.reel-card-link {
  display: block;
  position: relative;
}

.reel-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.reel-card:hover .reel-card-overlay {
  opacity: 1;
}

.reel-watch-btn {
  background: rgba(255,255,255,0.9);
  color: #000;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.reel-video {
  width: 100%;
  height: 400px;
  object-fit: cover;
  background: #000;
}

.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 16px;
  color: #fff;
}

.reel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reel-header .avatar {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
}

.reel-header .name {
  color: #fff;
  font-weight: 600;
}

.reel-header time {
  color: rgba(255,255,255,0.8);
  font-size: 12px;
}

.reel-caption {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.4;
}

.reel-audio {
  margin: 4px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
}

.reel-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.reel-like-form button {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s;
}

.reel-like-form button:hover {
  background: rgba(255,255,255,0.3);
}

.reel-like-form button.liked {
  background: var(--accent);
}

.reel-comments {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
}

.reel-comment-form {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.reel-comment-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.reel-comment-form button {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 20px;
}

.nav-list a.active {
  background: var(--reel-gradient);
  color: #fff;
  font-weight: 600;
}

/* Enhanced animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reel-card {
  animation: fadeIn 0.3s ease-out;
}

/* Improved button styles */
.btn, button, .composer button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover, button:hover { 
  background: var(--blue-dark); 
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Improved card hover effects */
.card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Enhanced story ring */
.story-ring:hover {
  transform: scale(1.05);
}

/* Improved logo */
.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--blue);
  background: var(--reel-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar, .right { display: none; }
  .reels-section { grid-column: 1; }
  .reels-grid { grid-template-columns: 1fr; }
  .reel-video { height: 500px; }
}

/* Full-screen Reel Viewer */
.reel-viewer-full {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-viewer-close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1001;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  transition: background 0.2s;
}

.reel-viewer-close:hover {
  background: rgba(0,0,0,0.8);
}

.reel-viewer-container {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 1400px;
}

.reel-viewer-main {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  max-width: 500px;
  margin: 0 auto;
}

.reel-viewer-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.reel-viewer-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.reel-viewer-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reel-viewer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.reel-viewer-user .avatar {
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
}

.reel-viewer-user .name {
  font-weight: 600;
  font-size: 16px;
}

.reel-viewer-caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.reel-viewer-audio {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}

.reel-viewer-actions {
  position: absolute;
  right: 16px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-icon {
  font-size: 28px;
}

.action-count {
  font-size: 12px;
  font-weight: 600;
}

.action-btn.liked .action-icon {
  animation: likeAnim 0.3s ease;
}

@keyframes likeAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.reel-viewer-mute {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.reel-viewer-mute:hover {
  background: rgba(0,0,0,0.8);
}

.reel-viewer-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.3);
}

.progress-bar {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.1s linear;
}

.reel-viewer-nav {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.nav-btn {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  text-decoration: none;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.3);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Comments Sidebar */
.reel-viewer-sidebar {
  width: 0;
  background: var(--card);
  color: var(--text);
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

.reel-viewer-sidebar.open {
  width: 350px;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-sidebar {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-content {
  flex: 1;
}

.comment-name {
  font-weight: 600;
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.comment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.comment-time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.comment-form {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.comment-form input[type="text"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
}

.comment-form button {
  padding: 10px 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .reel-viewer-main {
    max-width: 100%;
  }
  
  .reel-viewer-sidebar.open {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    border-radius: 16px 16px 0 0;
    z-index: 1002;
  }
  
  .reel-viewer-nav {
    right: 10px;
  }
  
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .reel-viewer-actions {
    right: 10px;
    bottom: 80px;
  }
  
  .action-icon {
    font-size: 24px;
  }
}

/* Search Page Styles */
.search-header {
  margin-bottom: 16px;
}
.search-header h2 {
  margin: 0;
  color: var(--text);
}
.search-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.search-tab {
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.search-tab:hover {
  background: var(--bg);
}
.search-tab.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
  background: var(--bg);
}
.search-section {
  margin-bottom: 24px;
}
.search-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}
.search-no-results {
  color: var(--muted);
  padding: 16px;
  text-align: center;
}
.search-empty {
  color: var(--muted);
  padding: 40px;
  text-align: center;
}
.search-user-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.search-user-link div {
  flex: 1;
}
.search-user-link strong {
  display: block;
}
.search-user-link small {
  color: var(--muted);
}
.search-post-link {
  text-decoration: none;
  color: var(--text);
  display: block;
}
.search-post-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.search-post-item:hover {
  background: var(--bg);
}
.search-post-item div {
  flex: 1;
}
.search-post-item strong {
  display: block;
}
.search-post-item p {
  margin: 4px 0;
  color: var(--text);
}
.search-post-item small {
  color: var(--muted);
}
.search-group-link,
.search-page-link {
  text-decoration: none;
  color: var(--text);
  display: block;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.search-item:hover {
  background: var(--bg);
}
.search-item-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 8px;
}
.search-item div {
  flex: 1;
}
.search-item strong {
  display: block;
}
.search-item small {
  color: var(--muted);
}
.search-reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.search-reel-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 9/16;
  background: #000;
  text-decoration: none;
}
.search-reel-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-reel-info {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Admin Dashboard */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  min-height: 600px;
}
.admin-sidebar {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  position: sticky;
  top: 70px;
  height: fit-content;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s;
}
.admin-nav-item:hover {
  background: var(--border);
}
.admin-nav-item.active {
  background: var(--blue);
  color: #fff;
}
.admin-main h2 {
  margin: 0 0 16px;
}
.admin-main h3 {
  margin: 20px 0 12px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}
.stat-card.today {
  border: 2px solid var(--blue);
}
.stat-card.danger {
  border: 2px solid #e41e3f;
}
.stat-icon {
  font-size: 28px;
}
.stat-number {
  font-size: 22px;
  font-weight: 700;
  display: block;
}
.stat-label {
  color: var(--muted);
  font-size: 13px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-header h2 {
  margin: 0;
}
.admin-search {
  display: flex;
  gap: 8px;
}
.admin-search input[type="search"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  width: 200px;
}
.admin-search button {
  padding: 8px 16px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.admin-search button:hover {
  opacity: 0.9;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  transition: background 0.2s;
}
.admin-item:hover {
  background: var(--border);
}
.admin-item .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.admin-item-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: 8px;
}
.admin-reel-thumb,
.admin-story-thumb {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.admin-item-info {
  flex: 1;
}
.admin-item-info a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.admin-item-info a:hover {
  text-decoration: underline;
}
.admin-item-info p {
  margin: 2px 0;
  color: var(--text);
}
.admin-item-info small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.admin-item-badges {
  display: flex;
  gap: 4px;
}
.badge-admin {
  background: var(--blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-banned {
  background: #e41e3f;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.admin-item-actions {
  display: flex;
  gap: 4px;
}
.inline {
  display: inline;
}
.btn-small {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.btn-small:hover {
  background: var(--border);
}
.btn-small.danger {
  border-color: #e41e3f;
  color: #e41e3f;
}
.btn-small.danger:hover {
  background: #e41e3f;
  color: #fff;
}
.btn-small.success {
  border-color: #25d366;
  color: #25d366;
}
.btn-small.success:hover {
  background: #25d366;
  color: #fff;
}

/* Admin Toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}
.admin-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--blue);
}
.admin-item:has(.admin-checkbox) {
  padding-left: 16px;
}

/* Admin Quick Actions */
.admin-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.quick-action-btn {
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}
.quick-action-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Export */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.export-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}
.export-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
}
.export-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.export-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.export-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Admin Table */
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td {
  background: var(--bg);
}
.log-action {
  background: var(--blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Admin Sidebar Divider */
.admin-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* Reports */
.report-pending {
  border-right: 3px solid #f0ad4e;
}
.badge-pending {
  background: #f0ad4e;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-reviewed {
  background: #25d366;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-dismissed {
  background: var(--muted);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Settings Form */
.admin-settings-form {
  max-width: 600px;
}
.settings-group {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.settings-group h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.settings-row {
  margin-bottom: 12px;
}
.settings-row:last-child {
  margin-bottom: 0;
}
.settings-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}
.settings-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.settings-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-alt);
  color: var(--text);
}
.settings-input:focus {
  outline: none;
  border-color: var(--blue);
}
.settings-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.settings-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}
.btn-primary {
  padding: 10px 24px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary:hover {
  opacity: 0.9;
}

/* Pinned Post Indicator */
.pinned-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0ad4e;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.pinned-post {
  border-right: 3px solid #f0ad4e;
}

/* Report Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: var(--card);
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.modal-close:hover {
  color: var(--text);
}
.report-options {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
}
.report-option:hover {
  background: var(--bg);
}
.report-option input[type="radio"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
}
.modal-content form {
  padding-bottom: 16px;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.profile-tab {
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.profile-tab:hover {
  background: var(--bg);
}
.profile-tab.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
  background: var(--bg);
}

/* Profile Actions */
.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-blocked-msg {
  color: var(--muted);
  font-style: italic;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
}
.profile-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Activity Items */
.activity-item {
  padding: 12px 16px;
}
.activity-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.activity-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.activity-user {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.activity-user:hover {
  text-decoration: underline;
}

/* Inline form helper */
.inline {
  display: inline;
}

/* Chat Read Receipts */
.bubble-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 2px;
}
.bubble-footer time {
  margin: 0;
  font-size: 10px;
}
.read-receipt {
  font-size: 11px;
  color: var(--muted);
}
.read-receipt.read {
  color: #25d366;
}

/* Block User Button */
.danger {
  color: #e41e3f;
}

/* Online Status Dot */
.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.online-dot.online {
  background: #25d366;
  box-shadow: 0 0 6px rgba(37, 211, 102, 0.5);
}
.online-dot.away {
  background: #f0ad4e;
}
.online-dot.offline {
  background: var(--muted);
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}
.typing-indicator.active {
  display: flex;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.typing-text {
  margin-right: 4px;
}

/* Message Reactions */
.msg-reactions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}
.msg-reaction {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 14px;
  cursor: default;
}
.bubble.me .msg-reactions {
  justify-content: flex-end;
}

/* Friend Suggestions */
.suggestion-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}
.suggestion-card .avatar {
  width: 48px;
  height: 48px;
}
.suggestion-info {
  flex: 1;
}
.suggestion-info strong {
  display: block;
}
.suggestion-info small {
  color: var(--muted);
}

/* Albums */
.albums-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.albums-header h2 {
  margin: 0;
}
.albums-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.album-card {
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.2s, box-shadow 0.2s;
}
.album-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.album-cover {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--border);
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--muted);
}
.album-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.album-info {
  padding: 10px 12px;
}
.album-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.album-info small {
  color: var(--muted);
  font-size: 12px;
}

/* Album View */
.album-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.album-view-header h2 {
  margin: 0;
}
.album-view-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Album Photos Grid */
.album-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.album-photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg);
  cursor: pointer;
}
.album-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.album-photo-item:hover img {
  transform: scale(1.05);
}
.album-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-photo-actions {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.album-photo-item:hover .album-photo-actions {
  opacity: 1;
}
.album-photo-actions button {
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.album-photo-actions button:hover {
  background: rgba(0,0,0,0.8);
}

/* Lightbox */
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--card);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  z-index: 10;
}

/* Voice Messages */
.voice-message {
  margin-bottom: 4px;
}
.voice-message audio {
  height: 36px;
  width: 220px;
  max-width: 100%;
}
.bubble.me .voice-message audio {
  filter: hue-rotate(140deg);
}
.chat-voice-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.chat-voice-btn:hover {
  background: var(--border);
}
.chat-voice-btn.recording {
  color: #e41e3f;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.voice-recording {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.voice-recording.hidden {
  display: none;
}
.voice-timer {
  font-weight: 600;
  font-size: 14px;
  color: #e41e3f;
  min-width: 50px;
}
.voice-stop {
  background: #e41e3f;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.voice-cancel {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}
.voice-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-top: 8px;
}
.voice-preview.hidden {
  display: none;
}
.voice-preview audio {
  flex: 1;
  height: 36px;
}
.chat-form {
  position: relative;
}

/* Events */
.event-card {
  overflow: hidden;
  padding: 0;
}
.event-cover {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
}
.event-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-content {
  padding: 16px;
  display: flex;
  gap: 16px;
}
.event-date-badge {
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 56px;
  flex-shrink: 0;
}
.event-date-badge.large {
  padding: 12px 16px;
  min-width: 70px;
}
.event-day {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.event-month {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}
.event-info {
  flex: 1;
}
.event-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.event-title:hover {
  text-decoration: underline;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.event-organizer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
}
.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.event-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.badge-attendee {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}
.badge-attendee.going {
  background: #25d366;
  color: #fff;
}
.badge-attendee.maybe {
  background: #f0ad4e;
  color: #fff;
}

/* Event Detail */
.event-detail-card {
  padding: 20px;
}
.event-detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.event-description {
  margin: 16px 0;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  white-space: pre-wrap;
}
.event-organizer-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 12px;
}
.event-organizer-detail .avatar {
  width: 40px;
  height: 40px;
}
.event-attendance {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.event-attendance-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
}
.event-attendance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.attendees-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.attendee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.attendee-item:hover {
  background: var(--bg);
}
.attendee-item strong {
  display: block;
  font-size: 14px;
}
.attendee-item small {
  color: var(--muted);
  font-size: 12px;
}

/* Story Reactions */
.story-reactions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.6);
  padding: 8px 12px;
  border-radius: 24px;
  z-index: 10;
}
.story-reaction-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
  opacity: 0.7;
}
.story-reaction-btn:hover {
  transform: scale(1.3);
  opacity: 1;
}
.story-reaction-btn.reacted {
  animation: reactionPop 0.4s ease;
}
@keyframes reactionPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1.3); }
}

/* Scheduled Post */
.schedule-form {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}
.schedule-form label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 600;
}
.schedule-form input[type="datetime-local"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0ad4e;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Marketplace */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.marketplace-item {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.marketplace-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.marketplace-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg);
}
.marketplace-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.marketplace-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: var(--bg);
}
.marketplace-info {
  padding: 12px;
}
.marketplace-price {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.marketplace-info h3 {
  font-size: 15px;
  margin: 0 0 4px;
}
.marketplace-info p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}
.marketplace-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.marketplace-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.marketplace-seller a {
  font-weight: 600;
  font-size: 14px;
}
.marketplace-my-actions {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

/* Close Friends */
.btn-close-active {
  background: #f0ad4e !important;
  color: #fff !important;
}
.schedule-toggle {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Highlight Delete */
.highlight-delete-form {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.btn-danger:hover {
  background: #c0392b;
}

/* Story highlight save button */
.highlight-save-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: 8px;
  transition: background 0.2s;
}
.highlight-save-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Chat Themes */
.chat-theme-picker {
  position: relative;
  display: inline-block;
}
.theme-toggle-btn {
  background: rgba(0,0,0,0.05);
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.theme-toggle-btn:hover {
  background: rgba(0,0,0,0.1);
}
.theme-options {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 200px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.theme-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, border-color 0.2s;
}
.theme-option:hover {
  transform: scale(1.1);
}
.theme-option.active {
  border-color: var(--accent);
}
/* Chat theme backgrounds */
.chat-card[data-theme="ocean"] {
  background: linear-gradient(180deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
}
.chat-card[data-theme="sunset"] {
  background: linear-gradient(180deg, rgba(240,147,251,0.1) 0%, rgba(245,87,108,0.1) 100%);
}
.chat-card[data-theme="forest"] {
  background: linear-gradient(180deg, rgba(17,153,142,0.1) 0%, rgba(56,239,125,0.1) 100%);
}
.chat-card[data-theme="lavender"] {
  background: linear-gradient(180deg, rgba(161,140,209,0.1) 0%, rgba(251,194,235,0.1) 100%);
}
.chat-card[data-theme="midnight"] {
  background: linear-gradient(180deg, rgba(35,37,38,0.1) 0%, rgba(65,67,69,0.1) 100%);
}
.chat-card[data-theme="candy"] {
  background: linear-gradient(180deg, rgba(250,112,154,0.1) 0%, rgba(254,225,64,0.1) 100%);
}
  background: linear-gradient(180deg, rgba(101,78,163,0.1) 0%, rgba(234,175,200,0.1) 100%);
}

/* --- FACEBOOK REDESIGN STYLES --- */

/* Topbar Redesign */
.topbar {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    height: 56px;
    z-index: 100;
}
html.dark .topbar { background: var(--bar); }
.topbar-inner {
    max-width: 100%;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    align-items: center;
    height: 100%;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.search {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.search input {
    width: 240px;
    height: 40px;
    border-radius: 20px;
    background: var(--bg);
    border: none;
    padding: 0 36px 0 16px; /* RTL padding */
    font-size: 15px;
    color: var(--text);
}
.top-nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 100%;
}
.top-nav-center .nav-icon {
    width: 112px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: background 0.2s;
    position: relative;
}
.top-nav-center .nav-icon:hover {
    background: var(--bg);
}
.top-nav-center .nav-icon.active {
    color: var(--blue);
}
.top-nav-center .nav-icon.active::after {
    content: '';
    position: absolute;
    bottom: -4px; /* match topbar padding diff */
    left: 0;
    right: 0;
    height: 3px;
    background: var(--blue);
    border-radius: 2px 2px 0 0;
}
.top-nav-center .nav-icon-svg svg {
    width: 28px;
    height: 28px;
}
.top-nav-left {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--text);
    position: relative;
    text-decoration: none;
}
.nav-icon-btn:hover {
    background: var(--border);
}
.nav-icon-btn .nav-icon-svg svg {
    width: 20px;
    height: 20px;
}
.me-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Sidebar Redesign */
.nav-list-clean {
    padding: 8px 0;
}
.nav-list-clean a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    gap: 12px;
    transition: background 0.2s;
    font-size: 15px;
}
.nav-list-clean a:hover {
    background: var(--border);
}
.nav-list-clean .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-icon-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 24px;
}
.see-more-btn {
    width: 100%;
    text-align: right;
    background: var(--border);
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 8px;
    transition: background 0.2s;
}
.see-more-btn:hover {
    background: #d0d2d6;
}
html.dark .see-more-btn:hover { background: #4e4f50; }
.sidebar-heading {
    font-size: 17px;
    color: var(--muted);
    padding: 0 12px;
    margin: 16px 0 8px;
}
.shortcut-item img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}
.shortcut-icon-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e41e3f;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
}

/* Stories Redesign */
.stories-fb {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
    overflow-x: auto;
}
.story-card {
    position: relative;
    width: 112px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    background: var(--card);
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}
.story-card:hover {
    transform: scale(1.02);
}
.story-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
}
.story-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.6));
}
.story-profile-img {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid var(--blue);
    overflow: hidden;
    z-index: 2;
}
.story-profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2;
    word-break: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.add-story-card {
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.add-story-card::after { display: none; }
.add-story-card .story-bg {
    bottom: 50px;
}
.story-add-btn-wrapper {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--blue);
    border: 4px solid var(--card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.story-add-btn {
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: normal;
    line-height: 1;
}
.story-add-btn input { display: none; }
.add-story-card .story-name {
    bottom: 8px;
    color: var(--text);
    text-shadow: none;
    text-align: center;
    font-size: 13px;
}

/* Composer Redesign */
.composer-fb {
    padding: 12px 16px;
}
.composer-top {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}
.composer-input-trigger {
    flex: 1;
    background: var(--bg);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--muted);
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s;
}
.composer-input-trigger:hover {
    background: var(--border);
}
.composer-actions {
    display: flex;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.composer-actions .action-btn {
    flex: 1;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}
.composer-actions .action-btn:hover {
    background: var(--bg);
}
.action-btn span {
    font-size: 20px;
}
.composer-form {
    padding: 16px;
}
.composer-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.privacy-select {
    display: block;
    background: var(--bg);
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 2px;
    font-weight: 600;
    color: var(--text);
}
.composer-form textarea {
    width: 100%;
    min-height: 100px;
    border: none;
    font-size: 20px;
    resize: none;
    background: transparent;
    color: var(--text);
    outline: none;
}
.composer-attachments {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.attach-btn {
    cursor: pointer;
    color: var(--text);
}
.attach-btn input { display: none; }
.submit-post-btn {
    width: 100%;
    padding: 10px;
    font-size: 15px;
}

/* Facelink Logo Typography */
.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--blue);
    text-decoration: none;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1;
}

/* App Grid & Responsive Redesign */
.app {
    max-width: 1920px;
    padding: 20px;
    grid-template-columns: minmax(280px, 360px) minmax(500px, 680px) minmax(280px, 360px);
    justify-content: center;
    gap: 32px;
}

/* Tablet Responsiveness */
@media (max-width: 1100px) {
    .app { 
        grid-template-columns: minmax(280px, 320px) minmax(500px, 680px); 
        gap: 20px;
    }
    .left-sidebar { display: none; }
    .topbar-inner {
        grid-template-columns: 240px 1fr 240px;
    }
    .search input { width: 180px; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Prevent horizontal scrolling on mobile */
    html, body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100%;
    }
    .app { 
        grid-template-columns: 1fr; 
        padding: 10px;
        margin-top: 10px;
        overflow-x: hidden;
        width: 100%;
    }
    .sidebar, .left-sidebar { display: none; }
    
    .topbar {
        position: sticky;
        top: 0;
        width: 100%;
    }
    .topbar-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 10px 10px 0 10px;
        gap: 10px;
        width: 100%;
    }
    .topbar-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .topbar-right .logo-text {
        font-size: 24px;
        color: var(--accent);
    }
    
    /* Main nav on second row inside topbar -> changed to bottom nav */
    .mobile-bottom-nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 5px 15px;
        margin-top: 0;
        border-top: 1px solid var(--border);
        position: fixed;
        bottom: 0;
        left: 0;
        background: var(--bg);
        z-index: 100;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    }
    .mobile-bottom-nav .nav-icon {
        width: auto;
        flex: 1;
        padding: 5px 0;
        border-radius: 0;
        display: flex;
        justify-content: center;
        position: relative;
    }
    .mobile-bottom-nav .nav-icon.active::after {
        display: none; /* Facebook app doesn't have the bottom line on mobile, just colored icon */
    }
    .mobile-bottom-nav .nav-icon.active .nav-icon-svg {
        fill: var(--accent);
        color: var(--accent);
    }
    
    /* Fix app padding so content doesn't hide behind bottom bar */
    body {
        padding-bottom: 60px;
    }
    
    .top-nav-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .nav-icon-btn {
        width: 36px;
        height: 36px;
        background: var(--bg-hover);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text);
    }
    
    .hide-on-mobile { display: none !important; }
    .hide-on-desktop { display: flex !important; }
    .nav-icon-btn .nav-icon-svg {
        width: 20px;
        height: 20px;
    }
    .me-avatar img {
        width: 36px;
        height: 36px;
    }
    
    .stories-fb {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -ms-overflow-style: none;  
        scrollbar-width: none;  
        width: 100%;
    }
    .stories-fb::-webkit-scrollbar { 
        display: none; 
    }
    .story-card {
        width: 110px;
        height: 180px;
        flex-shrink: 0;
    }
    .composer-fb {
        padding: 12px;
        border-radius: 8px;
        margin: 0 0 10px 0;
        box-shadow: none;
        border-bottom: 5px solid var(--border);
        width: 100%;
        box-sizing: border-box;
    }
    .composer-actions .action-btn {
        font-size: 14px;
        padding: 6px;
    }
    .action-btn span { font-size: 18px; }
    
    /* Post adjustments */
    .post {
        border-radius: 8px;
        margin: 0 0 10px 0;
        box-shadow: none;
        border-bottom: 5px solid var(--border);
        width: 100%;
        box-sizing: border-box;
    }
    .post-text {
        font-size: 16px !important;
        line-height: 1.5;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    /* Hide some icons on mobile to reduce crowding */
    .top-nav-center a[href="marketplace.php"],
    .top-nav-center a[href="groups.php"] {
        display: none;
    }
    
    .top-nav-left .me-avatar {
        display: none;
    }

    /* Additional Mobile Fixes to prevent horizontal overflow */
    .hide-on-mobile { display: none !important; }
    .hide-on-desktop { display: flex !important; }
    
    body, html {
        overflow-x: hidden !important;
        max-width: 100% !important;
        touch-action: pan-x pan-y !important; /* Disable pinch zoom */
        overscroll-behavior-x: none;
    }
    
    .app {
        padding: 0 8px 60px !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        word-break: break-word; /* Prevent long links from stretching */
    }
    
    .topbar-inner {
        padding: 8px !important;
        gap: 8px !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .composer-modal-content {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: auto !important;
    }
}

