:root{
  --bg: #fafafa;
  --card: #ffffff;
  --text: #262626;
  --text-secondary: #8e8e8e;
  --border: #dbdbdb;
  --accent: #00a3a3;
  --accent-light: #00c4c4;
  --accent-gradient: linear-gradient(135deg, #00a3a3 0%, #00c4c4 50%, #7c3aed 100%);
  --danger: #ed4956;
  --ok: #00a86b;
  --warn: #ffb833;
  --hover: #f5f5f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.app-layout {
  display: grid;
  grid-template-columns: 275px 1fr 350px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 80px 1fr 300px;
  }
  .nav-text { display: none; }
  .sidebar-left { align-items: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .brand-text { display: none; }
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.mobile-menu-btn:hover {
  background: var(--hover);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.mobile-brand:hover {
  text-decoration: none;
}

.mobile-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.mobile-brand span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 250;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ===== SIDEBAR CLOSE BUTTON ===== */
.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.sidebar-close:hover {
  background: var(--hover);
  color: var(--text);
}

.sidebar-close svg {
  width: 24px;
  height: 24px;
  display: block;
}

@media (max-width: 900px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
  }

  /* Adjust layout for mobile - single column, no sidebars in grid */
  .app-layout {
    display: block; /* Switch from grid to block layout */
  }

  /* Main feed adjustments */
  .main-feed {
    border-right: none;
    min-height: calc(100vh - 60px); /* Account for mobile header */
  }

  .feed-header {
    display: flex; /* Keep header visible on mobile */
    padding: 12px 16px;
  }

  .feed-header .feed-title {
    font-size: 18px;
  }

  .feed-header .new-post-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  /* LEFT SIDEBAR - Hidden by default, slide out panel */
  .sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--card);
    border-right: 1px solid var(--border);
    border-top: none;
    padding: 16px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
  }

  .sidebar-left.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-left .sidebar-close {
    display: block;
  }

  .sidebar-left .brand-logo {
    display: flex;
    margin-top: 40px;
  }

  .sidebar-left .nav-text {
    display: inline;
  }

  .sidebar-left .nav-item {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  /* RIGHT SIDEBAR - Hidden by default, slide out panel */
  .sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: var(--card);
    border-left: 1px solid var(--border);
    padding: 16px 20px;
    padding-top: 60px;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
  }

  .sidebar-right.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-right .sidebar-close {
    display: block;
    top: 16px;
    right: 16px;
  }

  /* Compose box adjustments for mobile */
  .compose-box {
    padding: 12px 16px;
  }

  .compose-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .compose-options {
    flex-direction: column;
    gap: 8px;
  }

  .compose-options input {
    width: 100%;
  }

  /* Post adjustments for mobile */
  .post {
    padding: 12px 16px;
  }

  .post-actions {
    gap: 16px;
    flex-wrap: wrap;
  }

  .post-action span {
    display: none;
  }
}

/* ===== LEFT SIDEBAR / NAV ===== */
.sidebar-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-right: 1px solid var(--border);
  background: var(--card);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.brand-logo img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
  transition: background 0.15s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--hover);
  text-decoration: none;
}

.nav-item.active {
  font-weight: 700;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-item.active svg {
  stroke-width: 2.5;
}

.nav-profile {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.profile-btn:hover {
  background: var(--hover);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.profile-info {
  flex: 1;
  text-align: left;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
}

.profile-handle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== MAIN FEED ===== */
.main-feed {
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

.feed-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 10;
}

.feed-title {
  font-size: 20px;
  font-weight: 700;
}

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

.new-post-btn {
  padding: 8px 20px;
  font-size: 14px;
}

/* ===== COMPOSE BOX ===== */
.compose-box {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.compose-inner {
  display: flex;
  gap: 12px;
}

.compose-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.compose-content {
  flex: 1;
}

.compose-content textarea {
  width: 100%;
  border: none;
  resize: none;
  font-size: 16px;
  padding: 8px 0;
  min-height: 60px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}

.compose-content textarea:focus {
  outline: none;
}

.compose-content textarea::placeholder {
  color: var(--text-secondary);
}

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

.compose-options {
  display: flex;
  gap: 12px;
  align-items: center;
}

.compose-options select,
.compose-options input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}

.compose-options input {
  width: 180px;
}

.btn {
  border: none;
  padding: 10px 20px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn.primary {
  background: var(--accent-gradient);
  color: white;
}

.btn.primary:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.outline:hover {
  background: var(--hover);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

/* ===== POSTS ===== */
.posts-container {
  background: var(--card);
}

.post {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.post:hover {
  background: var(--hover);
}

.post-header {
  display: flex;
  gap: 12px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.post-meta {
  flex: 1;
}

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

.post-name {
  font-weight: 600;
  color: var(--text);
}

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

.post-handle {
  color: var(--text-secondary);
  font-size: 14px;
}

.post-time {
  color: var(--text-secondary);
  font-size: 14px;
}

.post-time::before {
  content: "·";
  margin-right: 6px;
}

.post-body {
  padding-left: 56px; /* avatar width (44px) + gap (12px) */
}

.post-content {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: left;
}

.post-media {
  margin-top: 12px;
}

.post-media a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent);
}

.post-media a:hover {
  background: var(--hover);
  text-decoration: none;
}

/* Inline media display in feed */
.post-media-inline {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.post-media-inline img,
.post-media-inline video {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

/* Clickable posts */
.post-clickable {
  cursor: pointer;
}

.post-actions {
  display: flex;
  gap: 40px;
  margin-top: 12px;
  padding-top: 8px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
}

.post-action:hover {
  color: var(--accent);
  background: rgba(0, 163, 163, 0.1);
}

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

/* Post action as button */
button.post-action {
  background: none;
  border: none;
  font-family: inherit;
}

.post-action .action-count {
  min-width: 16px;
}

/* Active states for post actions */
.post-action.active {
  color: var(--accent);
}

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

.post-action.liked:hover {
  color: #ed4956;
  background: rgba(237, 73, 86, 0.1);
}

.post-action.saved {
  color: var(--warn);
}

.post-action.saved:hover {
  color: var(--warn);
  background: rgba(255, 184, 51, 0.1);
}

.post-action.active:not(.liked):not(.saved) {
  color: var(--ok);
}

.post-action.active:not(.liked):not(.saved):hover {
  background: rgba(0, 168, 107, 0.1);
}

/* Repost indicator */
.repost-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px 20px 0;
}

.repost-indicator svg {
  color: var(--ok);
}

/* Embedded post card for reposts */
.embedded-post {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.embedded-post:hover {
  background: var(--hover);
}

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

.embedded-post-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.embedded-post-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}

.embedded-post-name:hover {
  text-decoration: underline;
}

.embedded-post-handle {
  color: var(--text-secondary);
  font-size: 13px;
}

.embedded-post-time {
  color: var(--text-secondary);
  font-size: 12px;
}

.embedded-post-time::before {
  content: "·";
  margin-right: 6px;
}

.embedded-post-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.embedded-post-media {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.embedded-post-media img,
.embedded-post-media video {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

/* Nested embedded post (repost of repost) */
.nested-embedded {
  margin-top: 10px;
  background: var(--bg);
}

.nested-embedded .embedded-post-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.nested-embedded .embedded-post-name,
.nested-embedded .embedded-post-handle,
.nested-embedded .embedded-post-time {
  font-size: 12px;
}

.nested-embedded .embedded-post-content {
  font-size: 13px;
}

.nested-embedded .embedded-post-media img,
.nested-embedded .embedded-post-media video {
  max-height: 150px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

.badge.friends {
  background: rgba(255, 184, 51, 0.15);
  color: #b8860b;
}

.badge.followers {
  background: rgba(0, 102, 255, 0.1);
  color: var(--accent);
}

.badge.public {
  background: rgba(0, 168, 107, 0.1);
  color: var(--ok);
}

/* ===== RIGHT SIDEBAR ===== */
.sidebar-right {
  padding: 12px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ===== SEARCH BOX ===== */
.search-box {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== FILTER PILLS ===== */
.filter-section {
  margin-bottom: 20px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--card);
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

/* ===== SUGGESTIONS ===== */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.suggestion-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.suggestion-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.suggestion-info {
  flex: 1;
}

.suggestion-name {
  font-weight: 600;
  font-size: 14px;
}

.suggestion-handle {
  color: var(--text-secondary);
  font-size: 13px;
}

.suggestion-btn {
  padding: 8px 16px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion-btn:hover {
  background: #444;
}

.suggestion-btn.requested {
  background: var(--border);
  color: var(--text-secondary);
  cursor: default;
}

.suggestion-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.suggestion-reason {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.suggestion-name {
  text-decoration: none;
  color: inherit;
}

.suggestion-name:hover {
  text-decoration: underline;
}

.suggestion-avatar {
  text-decoration: none;
  flex-shrink: 0;
}

.suggestions-loading,
.suggestions-empty {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== QUICK LINKS ===== */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  transition: background 0.15s;
}

.quick-link:hover {
  background: var(--hover);
  text-decoration: none;
}

.quick-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

/* ===== GROUND RULES ===== */
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.rules-list li::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
}

/* ===== UTILITY CLASSES ===== */
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.error { color: var(--danger); margin-top: 8px; }
.help { color: var(--text-secondary); font-size: 13px; line-height: 1.4; }

/* ===== LEGACY SUPPORT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.container.narrow { max-width: 600px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.h1 { font-size: 28px; font-weight: 700; margin: 0 0 8px; }
.h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.hr { height: 1px; background: var(--border); margin: 16px 0; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; }
}

/* ===== ADMIN STYLES ===== */
.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-nav a {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.admin-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg);
}

.data-table tr:hover td {
  background: var(--hover);
}

.data-table .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
}

.inline-form .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.inline-form input,
.inline-form select {
  width: 100%;
}

.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { min-height: 100px; resize: vertical; }

/* ===== NAV (legacy pages) ===== */
.nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 26px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.nav-links a:hover {
  background: var(--hover);
  text-decoration: none;
}

/* Forms on auth pages */
label.small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ===== CSS-ONLY LOGO ===== */
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.logo-icon::before {
  content: "U";
}

.logo-icon:has(img)::before {
  content: none;
}

.logo-icon:has(img) {
  background: transparent;
}

.logo-icon img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: inherit;
}

/* ===== MOBILE RESPONSIVE OVERRIDES (must be last) ===== */
@media (max-width: 900px) {
  .mobile-header {
    display: flex;
  }

  .app-layout {
    display: block;
  }

  .main-feed {
    border-right: none;
  }

  .sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 16px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
  }

  .sidebar-left.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-left .sidebar-close {
    display: block;
  }

  .sidebar-left .brand-logo {
    display: flex;
    margin-top: 40px;
  }

  .sidebar-left .nav-text {
    display: inline;
  }

  .sidebar-left .nav-item {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: var(--card);
    border-left: 1px solid var(--border);
    padding: 16px 20px;
    padding-top: 60px;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
  }

  .sidebar-right.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-right .sidebar-close {
    display: block;
    top: 16px;
    right: 16px;
  }

  .compose-box {
    padding: 12px 16px;
  }

  .compose-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .compose-options {
    flex-direction: column;
    gap: 8px;
  }

  .compose-options input {
    width: 100%;
  }

  .post {
    padding: 12px 16px;
  }

  .post-body {
    padding-left: 52px; /* smaller on mobile: avatar (40px) + gap (12px) */
  }

  .post-actions {
    gap: 16px;
    flex-wrap: wrap;
  }

  .post-action span {
    display: none;
  }
}

/* ===== MODAL SYSTEM ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: var(--card);
  border-radius: 12px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  z-index: 10;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

.modal-close svg {
  width: 24px;
  height: 24px;
  display: block;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 50px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.modal-header .modal-close {
  top: 50%;
  transform: translateY(-50%);
}

/* ===== POST DETAIL MODAL (Instagram-style) ===== */
.modal-post-detail {
  display: flex;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  max-height: 700px;
}

.modal-left {
  flex: 1.2;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.modal-post-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-post-media img,
.modal-post-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-post-content-area {
  display: none;
  padding: 40px;
  color: white;
  text-align: center;
  font-size: 18px;
  line-height: 1.6;
}

.modal-left.no-media {
  background: var(--accent-gradient);
}

.modal-left.no-media .modal-post-media {
  display: none;
}

.modal-left.no-media .modal-post-content-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-right {
  width: 400px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.modal-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-post-header .post-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.modal-post-header .author-info {
  flex: 1;
}

.modal-post-header .author-name {
  font-weight: 600;
  font-size: 14px;
}

.modal-post-header .author-handle {
  color: var(--text-secondary);
  font-size: 13px;
}

.modal-post-text {
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  display: none;
}

.modal-post-text.visible {
  display: block;
}

.modal-comments {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.modal-comment {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}

.modal-comment:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.modal-comment .comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.modal-comment .comment-content {
  flex: 1;
  min-width: 0;
}

.modal-comment .comment-author {
  font-weight: 600;
  font-size: 13px;
  margin-right: 6px;
}

.modal-comment .comment-text {
  font-size: 14px;
  line-height: 1.4;
  display: inline;
}

.modal-comment .comment-time {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 4px;
}

.modal-comments-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.modal-post-actions {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.modal-post-actions .post-action {
  padding: 4px;
}

.modal-post-stats {
  padding: 0 16px 12px;
  font-size: 14px;
  font-weight: 600;
}

.modal-comment-form {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  margin-top: auto;
}

.comment-form-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-form-inner .comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.comment-form-inner input {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  font-size: 14px;
}

.comment-form-inner input:focus {
  outline: none;
}

/* ===== NEW POST / REPOST MODAL ===== */
.modal-compose,
.modal-repost {
  width: 90vw;
  max-width: 580px;
}

.compose-modal-inner {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.compose-modal-content {
  flex: 1;
}

.compose-modal-content textarea {
  width: 100%;
  border: none;
  resize: none;
  font-size: 16px;
  padding: 0;
  min-height: 100px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
}

.compose-modal-content textarea:focus {
  outline: none;
}

.compose-modal-content textarea::placeholder {
  color: var(--text-secondary);
}

.compose-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(237, 73, 86, 0.1);
  border-radius: 8px;
}

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

.compose-modal-options {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ===== MEDIA UPLOAD ===== */
.media-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s;
}

.media-upload-btn:hover {
  background: rgba(0, 163, 163, 0.1);
}

.media-upload-btn svg {
  width: 24px;
  height: 24px;
}

.media-preview {
  margin-top: 12px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.media-preview img,
.media-preview video {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.media-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.15s;
}

.media-preview-remove:hover {
  background: rgba(0, 0, 0, 0.9);
}

.media-preview-remove svg {
  width: 18px;
  height: 18px;
}

/* ===== MEDIA DROPZONE ===== */
.media-dropzone {
  margin-top: 12px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}

.media-dropzone:hover {
  border-color: var(--accent);
  background: rgba(0, 163, 163, 0.05);
}

.media-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0, 163, 163, 0.1);
  border-style: solid;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  opacity: 0.8;
}

.dropzone-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.dropzone-link {
  color: var(--accent);
  font-weight: 500;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 280px;
}

/* Mobile/desktop text visibility */
.dropzone-mobile {
  display: none;
}

.dropzone-desktop {
  display: inline;
}

/* On touch devices, show mobile text */
@media (hover: none) and (pointer: coarse) {
  .dropzone-mobile {
    display: inline;
  }
  .dropzone-desktop {
    display: none;
  }

  .media-dropzone {
    padding: 20px 16px;
  }

  .dropzone-icon {
    width: 32px;
    height: 32px;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .media-dropzone {
    padding: 16px 12px;
  }

  .dropzone-hint {
    font-size: 11px;
    max-width: 240px;
  }
}

/* ===== REPOST PREVIEW ===== */
.repost-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

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

.repost-preview-header .preview-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 11px;
}

.repost-preview-header .preview-name {
  font-weight: 600;
  font-size: 13px;
}

.repost-preview-header .preview-handle {
  color: var(--text-secondary);
  font-size: 12px;
}

.repost-preview-content {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.repost-preview-media {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
}

.repost-preview-media img,
.repost-preview-media video {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

/* Nested repost in preview (repost of repost) */
.repost-embedded {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}

.repost-embedded .repost-preview-header .preview-avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.repost-embedded .repost-preview-header .preview-name {
  font-size: 12px;
}

.repost-embedded .repost-preview-header .preview-handle {
  font-size: 11px;
}

.repost-embedded .repost-preview-content {
  font-size: 12px;
}

.repost-embedded .repost-preview-media img,
.repost-embedded .repost-preview-media video {
  max-height: 100px;
}

/* ===== FLOATING NEW POST BUTTON ===== */
.new-post-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 163, 163, 0.4);
  z-index: 100;
  transition: transform 0.15s, box-shadow 0.15s;
}

.new-post-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 163, 163, 0.5);
}

.new-post-fab svg {
  width: 28px;
  height: 28px;
}

/* ===== POST MENU (Edit/Hide) ===== */
.post-menu-wrapper {
  position: relative;
  margin-left: auto;
}

.post-menu-btn {
  background: none;
  border: none;
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.post:hover .post-menu-btn {
  opacity: 1;
}

.post-menu-btn:hover {
  background: var(--hover);
  color: var(--text);
}

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

.post-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 140px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  margin-top: 4px;
}

.post-menu-dropdown.active {
  display: block;
}

.post-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.post-menu-item:hover {
  background: var(--hover);
}

.post-menu-item.danger {
  color: var(--danger);
}

.post-menu-item.danger:hover {
  background: rgba(237, 73, 86, 0.1);
}

.post-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== HIDE POST MODAL ===== */
.modal-hide-post {
  width: 90vw;
  max-width: 440px;
}

.hide-post-content {
  padding: 20px;
}

.hide-post-content p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.hide-post-content label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hide-post-content textarea {
  min-height: 80px;
}

.hide-post-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ===== ALERT MODAL ===== */
.modal-alert {
  width: 90vw;
  max-width: 400px;
}

.alert-modal-content {
  padding: 20px;
}

.alert-modal-content p {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}

.alert-modal-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ===== LIKES MODAL ===== */
.modal-likes {
  width: 90vw;
  max-width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.likes-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.likes-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.likes-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.likes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.likes-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.likes-item:last-child {
  border-bottom: none;
}

.likes-item:hover {
  background: var(--hover);
}

.likes-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.likes-item a:hover {
  text-decoration: none;
}

.likes-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.likes-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.likes-display-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.likes-username {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Clickable likes link in post stats */
.likes-link {
  cursor: pointer;
  transition: color 0.15s ease;
}

.likes-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===== NOTIFICATIONS ===== */
.notifications-container {
  padding: 0;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: var(--hover-bg);
}

.notification-item.unread {
  background: rgba(var(--accent-rgb), 0.05);
}

.notification-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-text {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-primary);
}

.notification-actor {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.notification-actor:hover {
  text-decoration: underline;
}

.notification-post-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid var(--border);
}

.notification-post-preview:hover {
  background: var(--hover-bg);
}

.notification-time {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.notification-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon svg {
  width: 20px;
  height: 20px;
}

.notification-icon .icon-like {
  color: #e0245e;
}

.notification-icon .icon-comment {
  color: var(--accent);
}

.notification-icon .icon-repost {
  color: #17bf63;
}

.notification-icon .icon-follow {
  color: var(--accent);
}

.load-more-container {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.load-more-btn {
  min-width: 120px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state p {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state .muted {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Notification badge on nav */
.nav-item {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e0245e;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MODAL RESPONSIVE ===== */
@media (max-width: 900px) {
  .modal-post-detail {
    flex-direction: column;
    width: 95vw;
    height: auto;
    max-height: 90vh;
  }

  .modal-left {
    height: 300px;
    flex: none;
  }

  .modal-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 50vh;
  }

  .modal-comments {
    max-height: 200px;
  }

  .new-post-fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-compose,
  .modal-repost {
    width: 95vw;
  }

  .post-menu-btn {
    opacity: 1;
  }
}

/* ===== LANDING & PUBLIC PAGES ===== */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.landing-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.landing-brand:hover {
  text-decoration: none;
}

.landing-brand .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
}

.landing-brand span {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-links a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.landing-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.btn-cta {
  background: var(--accent-gradient);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 163, 163, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 163, 163, 0.4);
  text-decoration: none;
}

.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 60px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 163, 163, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0, 196, 196, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 40%);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-light);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.2;
}

.hero h1 .line1 { color: var(--text); }
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 .line3 { color: var(--text); }

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.6;
  margin: 0 0 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(0, 163, 163, 0.05);
  text-decoration: none;
}

.about-section {
  padding: 80px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.about-section h2 {
  font-size: 2rem;
  margin: 0 0 24px;
  color: var(--text);
}

.about-section h3 {
  font-size: 1.4rem;
  margin: 32px 0 16px;
  color: var(--text);
}

.about-section p {
  color: #555;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0 0 20px;
}

.about-section ul {
  color: #555;
  font-size: 1.1rem;
  line-height: 2;
  margin: 0 0 20px;
  padding-left: 24px;
}

.about-section li {
  margin-bottom: 8px;
}

.features {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg);
}

.features-header {
  text-align: center;
  margin-bottom: 60px;
}

.features-header h2 {
  font-size: 2rem;
  margin: 0 0 12px;
  color: var(--text);
}

.features-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(0, 163, 163, 0.1);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 28px;
}

.feature-icon.community { background: rgba(0, 163, 163, 0.1); }
.feature-icon.connect { background: rgba(0, 168, 107, 0.1); }
.feature-icon.events { background: rgba(255, 184, 51, 0.15); }
.feature-icon.private { background: rgba(124, 58, 237, 0.1); }

.feature-card h3 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.cta-section {
  padding: 100px 24px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(0, 163, 163, 0.06) 0%, transparent 50%);
}

.cta-section h2 {
  font-size: 2.2rem;
  margin: 0 0 16px;
  color: var(--text);
}

.cta-section p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0 0 32px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Landing page mobile menu button */
.landing-nav .mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .landing-nav .mobile-menu-btn { display: block; }
  .landing-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .landing-links.open { display: flex; }
}

/* ===== EXPLORE PAGE ===== */
.explore-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.explore-tabs::-webkit-scrollbar {
  display: none;
}

.explore-tab {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.explore-tab:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}

.explore-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.explore-tab svg {
  width: 20px;
  height: 20px;
}

/* Filter Bar */
.explore-filter-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.explore-filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  min-width: 180px;
  cursor: pointer;
}

.explore-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.suggest-link {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
}

.suggest-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  text-decoration: none;
}

.time-pills {
  display: flex;
  gap: 8px;
}

.time-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.time-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.time-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* Hashtags browse section */
.hashtags-browse {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hashtags-hint {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.active-hashtag-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
}

.clear-filter {
  color: white;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  opacity: 0.8;
}

.clear-filter:hover {
  opacity: 1;
  text-decoration: none;
}

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

.trending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-item:hover {
  text-decoration: none;
}

.trending-item:hover .trending-tag {
  color: var(--accent);
}

.trending-tag {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.trending-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Hashtag links in posts */
.hashtag {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.hashtag:hover {
  text-decoration: underline;
}

/* Explore page responsive */
@media (max-width: 900px) {
  .explore-tab {
    min-width: 70px;
    padding: 12px 8px;
    font-size: 11px;
  }

  .explore-tab svg {
    width: 18px;
    height: 18px;
  }

  .explore-filter-bar {
    padding: 10px 12px;
  }

  .explore-filter-select {
    min-width: 150px;
    font-size: 13px;
  }

  .time-pill {
    padding: 5px 10px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .explore-tab span {
    display: none;
  }

  .explore-tab {
    min-width: 50px;
    padding: 12px 10px;
  }

  .explore-tab svg {
    width: 22px;
    height: 22px;
  }
}

/* ===== MESSAGING SYSTEM ===== */

/* Override app-layout for messages page (no right sidebar) */
.app-layout:has(.main-messages) {
  grid-template-columns: 275px 1fr;
  max-width: none;
  margin: 0;
}

@media (max-width: 1200px) {
  .app-layout:has(.main-messages) {
    grid-template-columns: 80px 1fr;
  }
}

/* Main Messages Layout */
.main-messages {
  flex: 1;
  min-width: 0;
  background: var(--card);
}

.messages-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  height: 100vh;
  max-width: 100%;
}

.app-layout-messages {
  display: flex;
}

.main-conversation {
  flex: 1;
  min-width: 0;
  background: var(--card);
}

/* Conversations List */
.conversations-list {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--card);
  overflow: hidden;
  height: 100%;
}

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

.conversations-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

/* Messages Tabs */
.messages-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.messages-tabs .tab {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.messages-tabs .tab:hover {
  color: var(--text);
  background: var(--hover);
}

.messages-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.messages-tabs .badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
}

/* Conversations Container */
.conversations {
  flex: 1;
  overflow-y: auto;
}

/* Conversation Item */
.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.conversation-item:hover {
  background: var(--hover);
}

.conversation-item.active {
  background: var(--hover);
}

.conv-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conv-avatar.group-avatar {
  background: var(--border);
  color: var(--text-secondary);
}

.conv-avatar.group-avatar svg {
  width: 24px;
  height: 24px;
}

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

.conv-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.unread-badge {
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Request Item */
.request-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.request-user {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 12px;
}

.request-actions {
  display: flex;
  gap: 8px;
  padding-left: 60px;
}

/* Empty State */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  margin: 0;
}

.empty-state .muted {
  font-size: 13px;
  margin-top: 8px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.empty-state.small {
  padding: 20px;
}

.empty-state.small svg {
  width: 32px;
  height: 32px;
}

/* Empty Conversation View */
.empty-conversation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-conversation svg {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-conversation h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

.empty-conversation p {
  margin: 0;
  font-size: 14px;
}

/* Conversation Container */
.conversation-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

/* Conversation Header */
.conversation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.back-btn:hover {
  background: var(--hover);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.conv-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}

.conv-header-text {
  min-width: 0;
}

.conv-header-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.conv-header-actions {
  position: relative;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn.danger:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--hover);
}

.dropdown-item.danger {
  color: #dc3545;
}

.dropdown-item.danger:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messages-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Message Bubbles */
.message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  word-wrap: break-word;
  position: relative;
}

.message.sent {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.received {
  align-self: flex-start;
  background: var(--hover);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.message.sent .message-sender {
  color: rgba(255, 255, 255, 0.8);
}

.message-media {
  margin-bottom: 6px;
  border-radius: 12px;
  overflow: hidden;
}

.message-media img,
.message-media video {
  max-width: 100%;
  max-height: 300px;
  display: block;
  cursor: pointer;
}

.message-text {
  line-height: 1.4;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Message Composer */
.message-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.composer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}

.composer-btn:hover {
  background: rgba(0, 163, 163, 0.1);
}

.composer-btn svg {
  width: 24px;
  height: 24px;
}

.message-composer input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.message-composer input[type="text"]:focus {
  border-color: var(--accent);
}

.composer-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: opacity 0.15s;
}

.composer-send:hover {
  opacity: 0.9;
}

.composer-send svg {
  width: 20px;
  height: 20px;
}

/* Media Preview Bar */
.media-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--hover);
}

.media-preview-content {
  flex: 1;
}

.media-preview-content img,
.media-preview-content video {
  max-height: 100px;
  border-radius: 8px;
}

/* Group Members Panel */
.group-members-panel {
  width: 280px;
  border-left: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

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

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.members-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.member-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-handle {
  font-size: 13px;
  color: var(--text-secondary);
}

.member-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 8px;
  background: rgba(0, 163, 163, 0.1);
  border-radius: 10px;
}

/* New Group Form */
.new-group-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.form-section {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.member-search {
  margin-bottom: 12px;
}

.selected-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.selected-member-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent);
  color: white;
  border-radius: 16px;
  font-size: 13px;
}

.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.chip-remove svg {
  width: 10px;
  height: 10px;
  color: white;
}

.available-members {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.member-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.member-option:hover {
  background: var(--hover);
}

.member-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.member-details {
  flex: 1;
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Inline Conversation View */
.inline-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.inline-conv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}

.inline-conv-header .conv-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.inline-conv-header .conv-header-info {
  flex: 1;
  min-width: 0;
}

.inline-conv-header .conv-header-name {
  font-weight: 600;
  font-size: 16px;
}

.inline-conv-header .conv-header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.inline-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.inline-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}

.inline-composer input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.inline-composer input[type="text"]:focus {
  border-color: var(--accent);
}

.loading-conversation {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Conversation View fills remaining space */
.conversation-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}

/* Desktop only */
.desktop-only {
  display: flex;
}

/* Mobile title */
.mobile-title {
  font-weight: 600;
  font-size: 16px;
}

/* Message badge */
.message-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  margin-left: auto;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .messages-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 60px); /* Account for mobile header */
  }

  .conversation-view:not(.has-conversation) {
    display: none;
  }

  .group-members-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 1000;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .conversation-container {
    height: calc(100vh - 56px);
  }

  .message {
    max-width: 85%;
  }

  .conversations-header {
    padding: 12px;
  }

  .conversations-header h2 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .message {
    max-width: 90%;
    padding: 8px 12px;
  }

  .conv-avatar {
    width: 44px;
    height: 44px;
  }

  .request-actions {
    padding-left: 56px;
  }
}

/* ===== CHAT WIDGET ===== */

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chat-widget-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
}

.chat-widget-btn:hover {
  background: var(--hover);
  transform: scale(1.05);
}

.chat-widget-btn svg {
  width: 26px;
  height: 26px;
}

.chat-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-avatars {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: -8px;
}

.widget-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-left: -8px;
  overflow: hidden;
}

.widget-mini-avatar:first-child {
  margin-left: 0;
}

.widget-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Chat Panel */
.chat-widget-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-height: 500px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chat-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-panel-actions {
  display: flex;
  gap: 4px;
}

.chat-panel-conversations {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
}

.chat-panel-loading,
.chat-panel-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.chat-panel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
}

.chat-panel-footer:hover {
  background: var(--hover);
  color: var(--accent);
}

.chat-panel-footer svg {
  width: 16px;
  height: 16px;
}

/* Conversation Items */
.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-conv-item:hover {
  background: var(--hover);
}

.chat-conv-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-conv-avatar.group {
  background: var(--border);
  color: var(--text-secondary);
}

.chat-conv-avatar.group svg {
  width: 24px;
  height: 24px;
}

.active-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid var(--card);
  border-radius: 50%;
}

.chat-conv-info {
  flex: 1;
  min-width: 0;
}

.chat-conv-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-conv-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-text {
  color: #22c55e;
}

.chat-conv-unread {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* New Message Panel */
.chat-new-message .chat-panel-header {
  gap: 12px;
}

.chat-new-message-to {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.to-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.selected-users {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-user-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--accent);
  color: white;
  border-radius: 14px;
  font-size: 13px;
}

.selected-user-chip button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.chat-new-message-to input {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--text);
}

.chat-new-message-results {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
}

.search-hint {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.user-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.user-result-item:hover {
  background: var(--hover);
}

.user-result-item.selected {
  background: rgba(0, 163, 163, 0.1);
}

.user-result-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.user-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-result-info {
  flex: 1;
  min-width: 0;
}

.user-result-name {
  font-weight: 500;
  color: var(--text);
}

.user-result-handle {
  font-size: 13px;
  color: var(--text-secondary);
}

.user-result-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.user-result-item.selected .user-result-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.user-result-check svg {
  width: 14px;
  height: 14px;
}

.chat-start-btn {
  margin: 12px 16px;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.chat-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-start-btn:not(:disabled):hover {
  opacity: 0.9;
}

/* Chat Popups */
.chat-popups {
  position: fixed;
  bottom: 20px;
  right: 90px;
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  z-index: 999;
}

.chat-popup {
  width: 328px;
  height: 450px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-popup-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
}

.chat-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chat-popup-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-popup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  overflow: hidden;
}

.chat-popup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-popup-name {
  font-weight: 600;
  font-size: 14px;
}

.chat-popup-actions {
  display: flex;
  gap: 4px;
}

.chat-popup-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 13px;
}

.popup-message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.popup-message.sent {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.popup-message.received {
  align-self: flex-start;
  background: var(--hover);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.popup-message-media {
  max-width: 100%;
  max-height: 150px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.chat-popup-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-popup-composer input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  background: var(--card);
  color: var(--text);
}

.chat-popup-composer input:focus {
  border-color: var(--accent);
}

.chat-popup-composer button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-popup-composer button svg {
  width: 16px;
  height: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .chat-widget-btn {
    width: 52px;
    height: 52px;
  }

  .chat-widget-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
  }

  .chat-popups {
    right: 0;
    left: 0;
    bottom: 0;
  }

  .chat-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* ===== CALENDAR & EVENTS ===== */
.events-container {
  padding: 0;
}

.event-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}

.event-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.event-date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #00a3a3, #00c4c4);
  border-radius: 8px;
  color: white;
  text-align: center;
}

.event-month {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.event-day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.event-range {
  font-size: 10px;
  opacity: 0.9;
  margin-top: 2px;
}

.event-details {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.event-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  align-items: center;
}

.event-type-badge {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-secondary);
}

.event-location,
.event-time,
.event-org {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.event-hashtags {
  margin-top: 8px;
}

.event-hashtags .hashtag {
  margin-right: 8px;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.event-hashtags .hashtag:hover {
  text-decoration: underline;
}

/* Calendar Filter Styles */
.calendar-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-filters .filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Mobile responsive for events */
@media (max-width: 640px) {
  .event-card {
    flex-direction: column;
  }

  .event-date-box {
    flex-direction: row;
    gap: 8px;
    min-width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .event-day {
    font-size: 20px;
  }

  .event-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .calendar-filters {
    flex-direction: column;
  }

  .calendar-filters .filter-group {
    width: 100%;
  }

  .calendar-filters .form-input {
    width: 100% !important;
  }
}
