/* ============================================================
   APP LAYOUT — 3-column desktop, single-column mobile
   ============================================================ */

/* Override body for app page */
body {
  font-family: var(--font-body);
  display: flex;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Kill the landing-page ambient glow */
body::after { display: none; }

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 12px;
  gap: 4px;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 8px 12px 20px;
  text-decoration: none;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  filter: invert(1) brightness(1.2);
  mix-blend-mode: screen;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-logo:hover .sidebar-logo-img {
  transform: scale(1.1) rotate(-5deg);
}

/* Nav links */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.2px;
  transition: background 0.18s, color 0.18s;
  position: relative;
  white-space: nowrap;
}

.sidebar-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  font-weight: 700;
}

.sidebar-link.active svg {
  stroke-width: 2.4;
}

/* Badge for notifications */
.nav-badge {
  position: absolute;
  top: 6px;
  left: 26px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  color: #080b08;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Post button */
.sidebar-post-btn {
  margin: 16px 8px 0;
  padding: 14px 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #080b08;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  transition: opacity 0.2s, transform 0.15s;
}

.sidebar-post-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* User card at bottom */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: var(--radius-pill);
  margin-top: auto;
  cursor: pointer;
  transition: background 0.18s;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line2);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.sidebar-user-handle {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 400;
}

.sidebar-user-more svg {
  width: 18px;
  height: 18px;
  color: var(--muted2);
}

/* ============================================================
   CENTER FEED
   ============================================================ */
.feed {
  margin-left: 260px;
  margin-right: 350px;
  flex: 1;
  min-height: 100dvh;
  border-right: 1px solid var(--line);
  min-width: 0;
  max-width: 620px;
}

/* Feed header with tabs */
.feed-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 8, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.feed-tabs {
  display: flex;
}

.feed-tab {
  flex: 1;
  padding: 16px 0;
  background: none;
  border: none;
  color: var(--muted2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s, background 0.2s;
  letter-spacing: -0.1px;
}

.feed-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
}

.feed-tab.active {
  color: var(--fg);
  font-weight: 700;
}

.feed-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

/* ============================================================
   COMPOSE BOX
   ============================================================ */
.compose {
  display: flex;
  padding: 16px 16px 12px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.compose-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line2);
  flex-shrink: 0;
}

.compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.compose-input {
  min-height: 52px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.5;
  outline: none;
  padding: 8px 0;
  word-wrap: break-word;
}

.compose-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.compose-tools {
  display: flex;
  gap: 2px;
}

.compose-tool {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-tool svg {
  width: 18px;
  height: 18px;
}

.compose-tool:hover {
  background: var(--accent-dim);
}

.compose-submit {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #080b08;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: -0.1px;
}

.compose-submit:hover {
  opacity: 0.88;
}

/* Feed divider — "show new posts" style */
.feed-divider {
  height: 4px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   POST CARDS
   ============================================================ */
.post {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
  cursor: pointer;
}

.post:hover {
  background: rgba(255, 255, 255, 0.02);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line2);
  flex-shrink: 0;
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.1px;
  line-height: 1.2;
}

.post-verified {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.post-verified svg {
  width: 15px;
  height: 15px;
}

.post-handle {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 400;
}

.post-time {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 400;
}

.post-time::before {
  content: '·';
  margin-right: 4px;
}

.post-more {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

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

.post-more svg {
  width: 18px;
  height: 18px;
}

.post-text {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--fg);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.1px;
  word-wrap: break-word;
}

.post-text em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}

.post-text a {
  color: var(--accent);
  text-decoration: none;
}

.post-text a:hover {
  text-decoration: underline;
}

/* Post image */
.post-img {
  margin-top: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: 300px;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Post actions (reply, repost, like, views, share) */
.post-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  max-width: 420px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 99px;
  transition: color 0.15s, background 0.15s;
}

.post-action svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}

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

.post-action.liked {
  color: #f43f5e;
}

.post-action.liked svg {
  fill: #f43f5e;
  stroke: #f43f5e;
}

/* ============================================================
   RIGHT SIDEBAR
   ============================================================ */
.right-bar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  padding: 12px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;

  /* hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.right-bar::-webkit-scrollbar { display: none; }

/* Search */
.rbar-search {
  position: relative;
  margin-bottom: 4px;
}

.rbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.rbar-search-icon svg {
  width: 18px;
  height: 18px;
}

.rbar-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: var(--radius-pill);
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.rbar-search-input::placeholder {
  color: var(--muted);
}

.rbar-search-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}

/* Cards */
.rbar-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rbar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rbar-card-title {
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.5px;
}

.rbar-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  transition: color 0.15s;
}

.rbar-dismiss:hover {
  color: var(--fg);
}

/* Live on Meez */
.rbar-live-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.rbar-live-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rbar-live-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rbar-live-label svg {
  opacity: 1;
}

.rbar-live-topic {
  font-size: 13px;
  color: var(--fg2);
  font-weight: 500;
  letter-spacing: -0.1px;
}

.rbar-live-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rbar-live-avatars img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg2);
}

.rbar-live-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Trending list */
.rbar-trending-list {
  display: flex;
  flex-direction: column;
}

.rbar-trend {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}

.rbar-trend:last-child {
  border-bottom: none;
}

.rbar-trend:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rbar-trend-category {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.rbar-trend-topic {
  font-size: 14px;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.2px;
}

.rbar-trend-posts {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

/* Suggestions */
.rbar-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rbar-suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rbar-suggest:last-child { border-bottom: none; }

.rbar-suggest-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--line2);
}

.rbar-suggest-info {
  flex: 1;
  min-width: 0;
}

.rbar-suggest-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.1px;
}

.rbar-suggest-handle {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 400;
}

.rbar-follow-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.rbar-follow-btn:hover {
  opacity: 0.85;
}

/* Show more link */
.rbar-show-more {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  transition: opacity 0.15s;
}

.rbar-show-more:hover {
  opacity: 0.75;
}

/* Footer */
.rbar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 0 24px;
}

.rbar-footer a,
.rbar-footer span {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
}

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

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(8, 11, 8, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.mobile-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  color: var(--muted2);
  text-decoration: none;
  transition: color 0.15s;
}

.mobile-nav-link svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.mobile-nav-link.active {
  color: var(--fg);
}

.mobile-nav-link.active svg {
  stroke-width: 2.4;
}

/* Floating action button */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 201;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #080b08;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  align-items: center;
  justify-content: center;
}

.mobile-fab svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.mobile-fab:hover {
  transform: scale(1.08);
}

/* ============================================================
   MOBILE TOP BAR (for < 700px)
   ============================================================ */
.mobile-top-bar {
  display: none;
}

.mobile-nav-badge {
  position: absolute;
  top: 6px;
  right: 22px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  color: #080b08;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--bg);
}

/* ============================================================
   RESPONSIVE — < 1280px: Collapse sidebar labels
   ============================================================ */
@media (max-width: 1280px) {
  .sidebar {
    width: 72px;
  }

  .sidebar-link span,
  .sidebar-user-info,
  .sidebar-user-more {
    display: none;
  }

  .sidebar-link {
    justify-content: center;
    padding: 14px;
  }

  .sidebar-post-btn {
    font-size: 0;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 4px 0;
  }

  /* Show a + icon instead of text */
  .sidebar-post-btn::after {
    content: '+';
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
  }

  .sidebar-user {
    justify-content: center;
    padding: 10px;
  }

  .feed {
    margin-left: 72px;
  }

  .nav-badge {
    left: 16px;
    top: 4px;
  }
}

/* ============================================================
   RESPONSIVE — < 1080px: Hide right sidebar
   ============================================================ */
@media (max-width: 1080px) {
  .right-bar {
    display: none;
  }

  .feed {
    margin-right: 0;
    max-width: none;
  }
}

/* ============================================================
   RESPONSIVE — < 700px: Mobile layout
   ============================================================ */
@media (max-width: 700px) {
  .sidebar {
    display: none;
  }

  .feed {
    margin-left: 0;
    margin-right: 0;
    border-right: none;
    padding-bottom: 72px;
  }

  .mobile-nav {
    display: flex;
  }

  .mobile-fab {
    display: flex;
  }

  /* Adjust compose */
  .compose {
    padding: 12px;
  }

  .compose-input {
    font-size: 15px;
    min-height: 40px;
  }

  /* Post tweaks */
  .post {
    padding: 12px;
  }

  .post-text {
    font-size: 14px;
  }

  .post-actions {
    max-width: none;
  }

  /* Mobile Top Bar */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 4px;
  }
  
  .mobile-top-avatar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
  }
  
  .mobile-top-avatar-text {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #080b08;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
  }
  
  .mobile-top-logo {
    height: 22px;
  }
  
  .mobile-top-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }
  
  .mobile-upgrade {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
  }
  
  .mobile-more-btn {
    background: none;
    border: none;
    color: var(--fg);
    display: flex;
    align-items: center;
    padding: 0;
    cursor: pointer;
  }

  /* Feed tabs */
  .feed-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .feed-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .feed-tab {
    font-size: 14px;
    padding: 14px 16px;
    white-space: nowrap;
    flex: none;
  }
  
  .feed-tab.active::after {
    width: 50px;
    bottom: 0;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 2px solid rgba(29, 155, 240, 0.7);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 99px;
}

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