/* cspell:ignore Craigslist */
/* AutoTechPro Community - New 3-Tab Design */
/* Tab 1: Social Network + Forums (Facebook/Instagram/Reddit style) */
/* Tab 2: Live Chat Rooms (Discord/Zoom style with Audio/Video/Text) */
/* Tab 3: Marketplace (Facebook Marketplace/eBay/Craigslist style) */

/* Prevent horizontal overflow on all screen sizes */
* {
  box-sizing: border-box;
}

body {
  overflow-x: auto;
  min-width: 360px;
}

.container {
  width: 100%;
  max-width: 100%;
  min-width: 360px;
}

/* ============================================================================
   HERO SECTION ENHANCEMENTS
   ============================================================================ */
.page-hero {
  text-align: center;
  padding: 3rem 0 2rem 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Smooth scrolling for layouts */
.social-layout,
.chat-rooms-layout,
.marketplace-layout {
  scroll-behavior: smooth;
}

.social-layout::-webkit-scrollbar,
.chat-rooms-layout::-webkit-scrollbar,
.marketplace-layout::-webkit-scrollbar {
  height: 6px;
}

.social-layout::-webkit-scrollbar-thumb,
.chat-rooms-layout::-webkit-scrollbar-thumb,
.marketplace-layout::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

[data-theme="dark"] .social-layout::-webkit-scrollbar-thumb,
[data-theme="dark"] .chat-rooms-layout::-webkit-scrollbar-thumb,
[data-theme="dark"] .marketplace-layout::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

.page-hero h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: #000000;
  animation: fadeInUp 0.6s ease;
  font-weight: 700;
}

[data-theme="dark"] .page-hero h1 {
  color: #ffffff;
}

.page-hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 2rem 0;
  animation: fadeInUp 0.7s ease;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

[data-theme="dark"] .page-hero-subtitle {
  color: #9ca3af;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  animation: fadeInUp 0.8s ease;
  flex-wrap: wrap;
}

.hero-stat-item {
  text-align: center;
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .stat-number {
  color: #ffffff;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   MAIN TAB NAVIGATION
   ============================================================================ */
.community-main-tabs {
  display: flex;
  gap: 1rem;
  padding: 2rem 0;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.community-main-tabs::-webkit-scrollbar {
  display: none;
}

[data-theme="dark"] .community-main-tabs {
  border-bottom-color: #374151;
}

.main-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.main-tab-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
  color: #000000;
}

[data-theme="dark"] .main-tab-btn {
  color: #9ca3af;
}

[data-theme="dark"] .main-tab-btn:hover {
  background: #374151;
  color: #ffffff;
}

.main-tab-btn.active {
  background: #000000;
  color: white;
}

[data-theme="dark"] .main-tab-btn.active {
  background: #ffffff;
  color: #000000;
}

.main-tab-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.main-tab-content {
  display: none;
}

.main-tab-content.active {
  display: block;
}

/* ============================================================================
   TAB 1: SOCIAL NETWORK + FORUMS
   ============================================================================ */
.social-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Left Sidebar - User Profile & Navigation */
.social-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.user-profile-widget {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

[data-theme="dark"] .user-profile-widget {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid #374151;
}

.profile-cover {
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .profile-cover {
  background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

.profile-avatar-container {
  position: relative;
  margin-top: -50px;
  text-align: center;
  padding: 0 1rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid white;
}

[data-theme="dark"] .profile-avatar {
  border-color: #1f2937;
}

.edit-avatar-btn {
  position: absolute;
  bottom: 0;
  right: calc(50% - 50px);
  background: #000000;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

[data-theme="dark"] .edit-avatar-btn {
  background: #ffffff;
  color: #000000;
}

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

.profile-info {
  padding: 1rem;
  text-align: center;
}

.profile-info h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .profile-info h3 {
  color: #f9fafb;
}

.profile-tagline {
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  margin: 0.25rem 0;
}

[data-theme="dark"] .profile-tagline {
  color: #d1d5db;
}

.profile-stats-mini {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .profile-stats-mini {
  border-top-color: #374151;
}

.profile-stats-mini div {
  text-align: center;
}

.profile-stats-mini strong {
  display: block;
  font-size: 1.25rem;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .profile-stats-mini strong {
  color: #f9fafb;
  font-weight: 700;
}

.profile-stats-mini span {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .profile-stats-mini span {
  color: #d1d5db;
}

.user-profile-widget .btn {
  margin: 0 1rem 1rem 1rem;
}

/* Social Navigation */
.social-nav {
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .social-nav {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid #374151;
}

.social-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-primary, #111827);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

[data-theme="dark"] .social-nav-btn {
  color: #f9fafb;
}

.social-nav-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .social-nav-btn:hover {
  background: #374151;
}

.social-nav-btn.active {
  background: #000000;
  color: white;
}

[data-theme="dark"] .social-nav-btn.active {
  background: #ffffff;
  color: #000000;
}

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

.notification-badge {
  position: absolute;
  right: 1rem;
  background: var(--danger-color, #ef4444);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

/* Main Content Area */
.social-main-content {
  position: relative;
}

.social-view {
  display: none;
}

.social-view.active {
  display: block;
}

/* Create Post Box */
.create-post-box {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
}

[data-theme="dark"] .create-post-box {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.create-post-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.create-post-input {
  flex: 1;
  background: var(--bg-secondary, #f3f4f6);
  border: none;
  padding: 1rem;
  border-radius: 24px;
  text-align: left;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .create-post-input {
  background: #374151;
  color: #9ca3af;
}

.create-post-input:hover {
  background: #e5e7eb;
}

.create-post-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem 1rem;
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-action-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
}

/* Feed Posts */
.feed-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .post-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.post-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  position: relative;
}

.post-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .post-avatar {
  border-color: #374151;
}

.post-meta {
  flex: 1;
}

.post-meta h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .post-meta h4 {
  color: #f3f4f6;
}

.post-time {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.25rem 0 0 0;
}

[data-theme="dark"] .post-time {
  color: #9ca3af;
}

.post-menu-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.post-menu-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .post-menu-btn {
  color: #9ca3af;
}

[data-theme="dark"] .post-menu-btn:hover {
  background: #374151;
}

.post-content {
  margin-bottom: 1rem;
  color: var(--text-primary, #111827);
  line-height: 1.6;
  font-size: 0.95rem;
}

[data-theme="dark"] .post-content {
  color: #e5e7eb;
}

.post-image-grid {
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
}

.post-image-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.post-image-grid.multi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.post-image-grid.multi img {
  height: 200px;
  object-fit: cover;
}

.post-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .post-stats {
  border-bottom-color: #374151;
  color: #9ca3af;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-action-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .post-action-btn {
  color: #9ca3af;
}

[data-theme="dark"] .post-action-btn:hover {
  background: #374151;
  color: #ffffff;
}

.post-action-btn.liked {
  color: #000000;
}

[data-theme="dark"] .post-action-btn.liked {
  color: #ffffff;
}

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

/* Comments Section */
.post-comments {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .post-comments {
  border-top-color: #374151;
}

.comment-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  background: var(--bg-secondary, #f3f4f6);
  padding: 0.75rem;
  border-radius: 12px;
}

[data-theme="dark"] .comment-content {
  background: #111827;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.comment-header strong {
  font-size: 0.875rem;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .comment-header strong {
  color: #f3f4f6;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .comment-time {
  color: #9ca3af;
}

.comment-content p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .comment-content p {
  color: #d1d5db;
}

.comment-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.comment-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.comment-action-btn:hover {
  color: #000000;
}

[data-theme="dark"] .comment-action-btn {
  color: #9ca3af;
}

[data-theme="dark"] .comment-action-btn:hover {
  color: #ffffff;
}

.write-comment {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.comment-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 24px;
  font-size: 0.875rem;
  background: var(--bg-secondary, #f3f4f6);
}

.comment-input:focus {
  outline: none;
  border-color: #000000;
  background: white;
}

[data-theme="dark"] .comment-input {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

[data-theme="dark"] .comment-input:focus {
  border-color: #ffffff;
  background: #111827;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .btn-icon:hover {
  background: #374151;
}

/* Right Sidebar - Widgets */
.social-right-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.widget {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

[data-theme="dark"] .widget {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid #374151;
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .widget-title {
  color: #f9fafb;
  font-weight: 700;
}

/* Friend Suggestions */
.friend-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.suggestion-item:hover {
  background: var(--bg-tertiary, #f9fafb);
}

[data-theme="dark"] .suggestion-item:hover {
  background: #374151;
}

.suggestion-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.suggestion-info h5 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .suggestion-info h5 {
  color: #f9fafb;
}

.suggestion-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .suggestion-info p {
  color: #d1d5db;
}

/* Trending Topics */
.trending-topics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trending-item {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary, #f3f4f6);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--primary-color, #667eea);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trending-item:hover {
  background: var(--primary-color, #667eea);
  color: white;
  transform: translateX(4px);
}

[data-theme="dark"] .trending-item {
  background: #374151;
  color: #a78bfa;
}

[data-theme="dark"] .trending-item:hover {
  background: #a78bfa;
  color: #1f2937;
}

/* Events List */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary, #f9fafb);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.event-item:hover {
  background: var(--bg-secondary, #f3f4f6);
  transform: translateX(4px);
}

[data-theme="dark"] .event-item {
  background: #374151;
}

[data-theme="dark"] .event-item:hover {
  background: #4b5563;
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary-color, #667eea);
  color: white;
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 50px;
  flex-shrink: 0;
}

.event-day {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.event-month {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
}

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

.event-info h5 {
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .event-info h5 {
  color: #f9fafb;
}

.event-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .event-info p {
  color: #d1d5db;
}

/* Groups and Photos Tab Navigation */
.groups-tabs,
.photos-tabs,
.friends-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  padding-bottom: 0;
}

[data-theme="dark"] .groups-tabs,
[data-theme="dark"] .photos-tabs,
[data-theme="dark"] .friends-tabs {
  border-bottom-color: #374151;
}

.groups-tab-btn,
.photos-tab-btn,
.friends-tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.groups-tab-btn:hover,
.photos-tab-btn:hover,
.friends-tab-btn:hover {
  color: var(--text-primary, #111827);
  background: var(--bg-tertiary, #f9fafb);
}

[data-theme="dark"] .groups-tab-btn,
[data-theme="dark"] .photos-tab-btn,
[data-theme="dark"] .friends-tab-btn {
  color: #9ca3af;
}

[data-theme="dark"] .groups-tab-btn:hover,
[data-theme="dark"] .photos-tab-btn:hover,
[data-theme="dark"] .friends-tab-btn:hover {
  color: #f3f4f6;
  background: #374151;
}

.groups-tab-btn.active,
.photos-tab-btn.active,
.friends-tab-btn.active {
  color: var(--primary-color, #667eea);
  font-weight: 600;
  border-bottom-color: var(--primary-color, #667eea);
}

[data-theme="dark"] .groups-tab-btn.active,
[data-theme="dark"] .photos-tab-btn.active,
[data-theme="dark"] .friends-tab-btn.active {
  color: #a78bfa;
  border-bottom-color: #a78bfa;
}

.groups-tab-btn .badge,
.photos-tab-btn .badge,
.friends-tab-btn .badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* Friends & Groups Grid */
.friends-grid,
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.friend-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

[data-theme="dark"] .friend-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .friend-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.friend-card-header {
  position: relative;
  background: #000000;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
}

[data-theme="dark"] .friend-card-header {
  background: #ffffff;
}

.friend-card-header img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .friend-card-header img {
  border-color: #1f2937;
}

.online-indicator {
  position: absolute;
  bottom: 1.5rem;
  right: calc(50% - 35px);
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 3px solid white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

[data-theme="dark"] .online-indicator {
  border-color: #1f2937;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.friend-card-body {
  padding: 1rem;
  text-align: center;
}

.friend-card-body h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .friend-card-body h4 {
  color: #f3f4f6;
}

.friend-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 0.5rem 0;
}

[data-theme="dark"] .friend-subtitle {
  color: #9ca3af;
}

.friend-mutual {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 0.75rem 0;
}

[data-theme="dark"] .friend-mutual {
  color: #9ca3af;
}

.friend-stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .friend-stats {
  color: #9ca3af;
  border-top-color: #374151;
}

.friend-card-actions {
  padding: 0 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: transparent;
}

.group-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

[data-theme="dark"] .group-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid #374151;
}

[data-theme="dark"] .group-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-color: #4b5563;
}

.group-cover {
  height: 120px;
  position: relative;
}

.group-cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.75rem;
}

.group-privacy {
  background: rgba(255, 255, 255, 0.95);
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

[data-theme="dark"] .group-privacy {
  background: rgba(31, 41, 55, 0.95);
  color: #f3f4f6;
}

.group-body {
  padding: 1rem;
  text-align: center;
}

.group-body h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .group-body h3 {
  color: #f9fafb;
  font-weight: 700;
}

.group-description {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.4;
  margin: 0 0 1rem 0;
}

[data-theme="dark"] .group-description {
  color: #d1d5db;
}

.group-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .group-stats {
  color: #d1d5db;
  border-top-color: #374151;
}

/* ============================================================================
   TAB 1: FORUMS - PROFESSIONAL REDESIGN
   ============================================================================ */

/* Forums Container */
.forums-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* Forums Header */
.forums-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 1.5rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

[data-theme="dark"] .forums-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.forums-header-left h2 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .forums-header-left h2 {
  color: #ffffff;
}

.forums-subtitle {
  margin: 0;
  font-size: 1rem;
  color: #6b7280;
  font-weight: 400;
}

[data-theme="dark"] .forums-subtitle {
  color: #9ca3af;
}

.btn-new-post {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.btn-new-post:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-new-post svg {
  flex-shrink: 0;
}

/* Forums Navigation */
.forums-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  padding: 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .forums-nav {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.forums-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.forums-nav-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #000000;
}

.forums-nav-btn.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .forums-nav-btn {
  color: #9ca3af;
}

[data-theme="dark"] .forums-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

[data-theme="dark"] .forums-nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.forums-nav-btn svg {
  flex-shrink: 0;
}

/* Forum Categories Grid */
.forums-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Forum Category Cards */
.forum-category-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.forum-category-card:hover {
  border-color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

[data-theme="dark"] .forum-category-card {
  background: var(--color-bg-elevated);
  border-color: var(--color-border);
}

[data-theme="dark"] .forum-category-card:hover {
  border-color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Category Icon */
.category-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.category-icon-wrapper svg {
  color: #ffffff;
  transition: all 0.3s ease;
}

.forum-category-card:hover .category-icon-wrapper {
  transform: scale(1.05);
}

.category-icon-wrapper.featured {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.category-icon-wrapper.featured svg {
  color: #ffffff;
}

/* Category Info */
.category-info {
  flex: 1;
  min-width: 0;
}

.category-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.category-info p {
  margin: 0 0 0.85rem 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Category Stats */
.category-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.stat-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.stat-divider {
  color: var(--color-border);
  font-weight: 400;
}

/* Category Arrow */
.category-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.category-arrow svg {
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.forum-category-card:hover .category-arrow {
  background: var(--color-text);
  transform: translateX(4px);
}

.forum-category-card:hover .category-arrow svg {
  color: var(--color-bg);
}

/* Forum Threads Section */
.forum-threads {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .forum-threads {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .forums-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .forums-header-left h2 {
    font-size: 1.75rem;
  }

  .btn-new-post {
    width: 100%;
    justify-content: center;
  }

  .forums-nav {
    flex-direction: column;
    gap: 6px;
  }

  .forums-nav-btn {
    justify-content: flex-start;
  }

  .forums-categories {
    grid-template-columns: 1fr;
  }

  .forum-category-card {
    padding: 1.5rem;
  }

  .category-icon-wrapper {
    width: 48px;
    height: 48px;
  }

  .category-info h3 {
    font-size: 1rem;
  }
}

.group-actions {
  padding: 0 1rem 1rem 1rem;
  background: transparent;
}

.group-actions .btn {
  margin-top: 0;
}

[data-theme="dark"] .group-actions {
  background: transparent;
}

/* ============================================================================
   TAB 2: LIVE CHAT ROOMS - ENHANCED DESIGN
   ============================================================================ */
.chat-rooms-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 280px);
  min-height: 600px;
}

.rooms-sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .rooms-sidebar {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rooms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .rooms-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.rooms-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

[data-theme="dark"] .rooms-header h3 {
  color: #ffffff;
}

.rooms-search {
  margin-bottom: 0.85rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
  outline: none;
  border-color: #000000;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-input {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

[data-theme="dark"] .search-input:focus {
  border-color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.rooms-filter {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.filter-btn.active {
  background: #000000;
  color: white;
  border-color: #000000;
}

[data-theme="dark"] .filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .filter-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1a1a1a;
}

.room-item:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.room-item.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.room-item.active * {
  color: #ffffff !important;
}

[data-theme="dark"] .room-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-theme="dark"] .room-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .room-item.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

[data-theme="dark"] .room-item.active * {
  color: #000000 !important;
}

.room-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.room-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  flex-shrink: 0;
}

.room-item.active .room-icon {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .room-icon {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .room-item.active .room-icon {
  background: rgba(0, 0, 0, 0.2);
}

.room-icon svg {
  stroke-width: 2;
}

.room-item.active .room-icon svg {
  stroke: white;
}

[data-theme="dark"] .room-item.active .room-icon svg {
  stroke: #000000;
}

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

.room-info h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.room-info p {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
}

.room-item.active .room-info p {
  opacity: 0.9;
}

[data-theme="dark"] .room-item .room-info p {
  opacity: 0.7;
}

[data-theme="dark"] .room-item.active .room-info p {
  opacity: 0.9;
}

.room-info p::before {
  content: "●";
  color: #10b981;
  font-size: 0.6rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.room-type-badge {
  padding: 0.3rem 0.65rem;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  color: #1a1a1a;
}

.room-item.active .room-type-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

[data-theme="dark"] .room-type-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-theme="dark"] .room-item.active .room-type-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #000000;
}

/* Main Chat Area - Enhanced */
.chat-main-area {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .chat-main-area {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-room-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .chat-room-header {
  background: rgba(0, 0, 0, 0.3);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.room-header-info h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

[data-theme="dark"] .room-header-info h2 {
  color: #ffffff;
}

.room-header-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Members Ticker - Stock Style */
.members-ticker-container {
  background: #000000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  height: 40px;
  width: 100%;
  display: block;
  flex-shrink: 0;
  z-index: 1;
}

[data-theme="dark"] .members-ticker-container {
  background: #1a1a1a;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.members-ticker-wrapper {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.members-ticker {
  display: flex;
  align-items: center;
  height: 100%;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
  gap: 2rem;
  padding: 0 1rem;
  width: max-content;
}

.members-ticker:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-member {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ticker-member:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.ticker-member-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.ticker-member-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.ticker-member-name {
  font-weight: 600;
}

.ticker-separator {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

/* Chat Messages Area */

.room-header-info p::before {
  content: "●";
  color: #10b981;
  font-size: 0.7rem;
  animation: pulse 2s ease-in-out infinite;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.01);
  scroll-behavior: smooth;
}

[data-theme="dark"] .chat-messages {
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.message-group {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  position: relative;
  flex-shrink: 0;
}

.message-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .message-avatar img {
  border-color: rgba(255, 255, 255, 0.15);
}

.message-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
}

[data-theme="dark"] .message-avatar::after {
  border-color: #1a1a1a;
}

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

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.message-author {
  font-weight: 600;
  font-size: 0.875rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-secondary, #9ca3af);
}

.message-content {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 12px 12px 12px 4px;
  line-height: 1.5;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  max-width: 70%;
  word-wrap: break-word;
}

[data-theme="dark"] .message-content {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.typing-indicator {
  display: flex;
  gap: 0.3rem;
  padding: 0.75rem;
  animation: messageSlideIn 0.3s ease;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

.chat-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .chat-input-area {
  background: rgba(0, 0, 0, 0.3);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.chat-input-field {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.9);
}

.chat-input-field:focus {
  outline: none;
  border-color: #000000;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .chat-input-field {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

[data-theme="dark"] .chat-input-field:focus {
  border-color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.send-btn {
  border-radius: 20px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  background: #000000;
  border: none;
  color: white;
  transition: all 0.2s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

[data-theme="dark"] .send-btn {
  background: #ffffff;
  color: #000000;
}

/* Participants Sidebar */
.participants-sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .participants-sidebar {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Rooms Toggle - Hidden by default on desktop */
.mobile-rooms-toggle {
  display: none;
}

.mobile-rooms-toggle.hidden {
  display: none;
}

/* Clear filters button spacing */
.btn-block[id="clear-marketplace-filters-btn"] {
  margin-top: 1rem;
}

/* Profile form fieldset styles */
.profile-social-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.profile-social-legend {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.profile-social-input {
  margin-bottom: 8px;
}

/* ============================================================================
   TAB 3: MARKETPLACE - PROFESSIONAL DESIGN
   ============================================================================ */
.marketplace-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  min-height: calc(100vh - 280px);
}

.marketplace-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .marketplace-sidebar {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.marketplace-create-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.marketplace-filters {
  margin-top: 0;
}

.marketplace-filters h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 1.25rem 0 0.75rem 0;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .marketplace-filters h4 {
  color: #ffffff;
}

.marketplace-filters h4:first-child {
  margin-top: 0;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-checkbox:hover {
  padding-left: 0.25rem;
}

.filter-checkbox input {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filter-checkbox span {
  font-size: 0.875rem;
  color: #374151;
}

[data-theme="dark"] .filter-checkbox span {
  color: #d1d5db;
}

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.price-input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  font-size: 0.875rem;
}

.price-input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .price-input {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.price-separator {
  color: #6b7280;
  font-weight: 600;
}

.marketplace-main {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.marketplace-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.marketplace-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 300px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

.search-input-large {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  transition: all 0.2s ease;
  width: 100%;
}

.search-input-large::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.search-input-large:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-input-large {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

[data-theme="dark"] .search-input-large::placeholder {
  color: #6b7280;
  opacity: 1;
}

.marketplace-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.marketplace-sort label {
  color: #6b7280;
  font-weight: 500;
}

.sort-select {
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-select:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .sort-select {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.marketplace-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.stats-separator {
  color: #d1d5db;
}

#listing-count {
  font-weight: 600;
  color: #111827;
}

[data-theme="dark"] #listing-count {
  color: #ffffff;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.listing-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .listing-card {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .listing-card:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.listing-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #f3f4f6;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.listing-card:hover .listing-image img {
  transform: scale(1.05);
}

.listing-timer {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.listing-timer.expires-soon {
  background: rgba(239, 68, 68, 0.95);
}

.listing-timer svg {
  width: 14px;
  height: 14px;
}

.listing-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #10b981;
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.listing-badge.used {
  background: #3b82f6;
}

.listing-badge.expired {
  background: #ef4444;
}

.listing-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.listing-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #111827;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .listing-title {
  color: #ffffff;
}

.listing-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 0.5rem 0;
}

[data-theme="dark"] .listing-price {
  color: #ffffff;
}

.listing-location {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0 0 0.65rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.listing-location svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.listing-description {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .listing-description {
  color: #d1d5db;
}

.listing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .listing-meta {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.listing-seller {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.listing-views {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.listing-views svg {
  width: 14px;
  height: 14px;
}

.listing-condition {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .social-layout {
    grid-template-columns: 200px 1fr 200px;
    gap: 0.75rem;
  }

  .chat-rooms-layout {
    grid-template-columns: 200px 1fr 200px;
    gap: 0.75rem;
  }

  .marketplace-layout {
    grid-template-columns: 200px 1fr;
    gap: 0.75rem;
  }

  .friends-grid,
  .groups-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  /* Ensure main content area doesn't overflow */
  .social-main-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Make sidebars scrollable on smaller screens */
  .social-sidebar,
  .social-right-sidebar,
  .rooms-sidebar,
  .participants-sidebar,
  .marketplace-sidebar {
    font-size: 0.875rem;
  }

  /* Compact navigation buttons */
  .social-nav-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .social-nav-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 1.5rem 0.5rem;
  }

  .page-hero h1 {
    font-size: 1.5rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .hero-stat-item {
    min-width: 80px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .community-main-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    padding: 0 0.25rem;
  }

  .community-main-tabs::-webkit-scrollbar {
    height: 4px;
  }

  .community-main-tabs::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 2px;
  }

  .main-tab-btn {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    min-width: auto;
  }

  /* Keep 3-column layout but make it scrollable */
  .social-layout {
    grid-template-columns: 150px 1fr 150px;
    gap: 0.5rem;
    overflow-x: auto;
  }

  /* Enhanced Chat Rooms Mobile Layout */
  .chat-rooms-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    height: calc(100vh - 250px);
  }

  .rooms-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .rooms-sidebar.mobile-open {
    display: block;
    transform: translateX(0);
  }

  .chat-main-area {
    grid-column: 1;
  }

  .rooms-header h3 {
    font-size: 0.95rem;
  }

  .rooms-search {
    margin-bottom: 0.75rem;
  }

  .search-input {
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
    font-size: 0.8125rem;
  }

  .rooms-filter {
    gap: 0.4rem;
    margin-bottom: 0.85rem;
  }

  .filter-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }

  .room-item {
    padding: 0.75rem;
  }

  .room-icon {
    font-size: 1.4rem;
  }

  .room-info h4 {
    font-size: 0.875rem;
  }

  .room-info p {
    font-size: 0.7rem;
  }

  .room-type-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
  }

  .chat-room-header {
    padding: 1rem 1.25rem;
  }

  .room-header-info h2 {
    font-size: 1.1rem;
  }

  .room-header-info p {
    font-size: 0.8rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .message-group {
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .message-avatar img {
    width: 36px;
    height: 36px;
  }

  .message-avatar::after {
    width: 10px;
    height: 10px;
  }

  .message-author {
    font-size: 0.875rem;
  }

  .message-time {
    font-size: 0.7rem;
  }

  .message-content {
    font-size: 0.875rem;
    padding: 0.75rem 0.95rem;
    max-width: 85%;
    border-radius: 14px 14px 14px 4px;
  }

  .chat-input-area {
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }

  .chat-input-field {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: 20px;
  }

  .send-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 20px;
  }

  /* Mobile menu button for rooms */
  .mobile-rooms-toggle {
    display: block;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 52px;
    height: 52px;
    background: #000000;
    border-radius: 50%;
    border: none;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 999;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-rooms-toggle:active {
    transform: scale(0.95);
  }

  .mobile-rooms-toggle svg {
    stroke: white;
  }

  [data-theme="dark"] .mobile-rooms-toggle {
    background: #ffffff;
    color: #000000;
  }

  [data-theme="dark"] .mobile-rooms-toggle svg {
    stroke: #000000;
  }

  .marketplace-layout {
    grid-template-columns: 150px 1fr;
    gap: 0.5rem;
    overflow-x: auto;
  }

  /* Compact sidebars */
  .social-sidebar,
  .social-right-sidebar,
  .rooms-sidebar,
  .participants-sidebar,
  .marketplace-sidebar {
    min-width: 150px;
    font-size: 0.8125rem;
  }

  .profile-avatar {
    width: 70px;
    height: 70px;
  }

  .profile-avatar-container {
    margin-top: -35px;
  }

  .social-nav-btn {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }

  .social-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .marketplace-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .friends-grid,
  .groups-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    padding: 0.875rem;
    margin-bottom: 0.75rem;
  }

  .post-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .post-action-btn {
    font-size: 0.75rem;
    padding: 0.5rem;
    flex: 1 1 auto;
  }

  .friend-card-header {
    height: 80px;
  }

  .friend-card-header img {
    width: 60px;
    height: 60px;
  }

  .group-cover {
    height: 80px;
  }

  /* Fix for main content area */
  .main-tab-content {
    padding: 0 0.25rem;
  }

  /* Fix post images on mobile */
  .post-image-grid img {
    width: 100%;
    max-width: 100%;
  }

  /* Fix for forum categories */
  .forum-categories {
    grid-template-columns: 1fr;
  }

  /* Compact trending/events sections */
  .trending-topics,
  .upcoming-events {
    padding: 0.75rem;
  }

  .trending-topic,
  .event-item {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .page-hero h1 {
    font-size: 1.25rem;
  }

  .page-hero {
    padding: 1rem 0.25rem;
  }

  .hero-stats {
    gap: 0.75rem;
  }

  .hero-stat-item {
    min-width: 70px;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.688rem;
  }

  .main-tab-btn {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }

  .main-tab-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Keep 3-column layout but more compact */
  .social-layout {
    grid-template-columns: 120px 1fr 120px;
    gap: 0.25rem;
  }

  .chat-rooms-layout {
    grid-template-columns: 120px 1fr 120px;
    gap: 0.25rem;
  }

  .marketplace-layout {
    grid-template-columns: 120px 1fr;
    gap: 0.25rem;
  }

  /* Very compact sidebars */
  .social-sidebar,
  .social-right-sidebar,
  .rooms-sidebar,
  .participants-sidebar,
  .marketplace-sidebar {
    min-width: 120px;
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .user-profile-widget {
    font-size: 0.75rem;
  }

  .profile-avatar {
    width: 50px;
    height: 50px;
  }

  .profile-avatar-container {
    margin-top: -25px;
  }

  .profile-info h3 {
    font-size: 0.875rem;
  }

  .profile-tagline {
    font-size: 0.688rem;
  }

  .social-nav-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  .social-nav-btn svg {
    width: 14px;
    height: 14px;
  }

  .notification-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.25rem;
  }

  /* Compact post cards */
  .post-card {
    padding: 0.625rem;
    font-size: 0.8125rem;
  }

  .post-header {
    gap: 0.375rem;
  }

  .post-avatar {
    width: 36px;
    height: 36px;
  }

  .post-meta h4 {
    font-size: 0.8125rem;
  }

  .post-time {
    font-size: 0.688rem;
  }

  .post-content {
    font-size: 0.8125rem;
  }

  .post-stats {
    font-size: 0.688rem;
  }

  .post-image-grid.multi {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-action-btn {
    font-size: 0.688rem;
    padding: 0.375rem 0.5rem;
  }

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

  /* Compact right sidebar sections */
  .trending-topics,
  .upcoming-events,
  .friend-suggestions {
    padding: 0.5rem;
  }

  .section-title {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
  }

  .trending-topic,
  .event-item {
    padding: 0.375rem;
    font-size: 0.75rem;
  }

  /* Compact online friends */
  .online-friends-list {
    gap: 0.5rem;
  }

  .online-friend {
    font-size: 0.75rem;
  }

  .online-friend-avatar {
    width: 32px;
    height: 32px;
  }

  /* Ensure container fits small screens */
  .container {
    max-width: 100%;
    padding: 0 0.25rem;
  }

  /* Fix chat input on mobile */
  .chat-input-container {
    padding: 0.375rem;
  }

  .chat-input-container input {
    font-size: 0.8125rem;
  }

  /* Fix marketplace items on very small screens */
  .marketplace-item {
    flex-direction: column;
    font-size: 0.8125rem;
  }

  .item-image {
    width: 100%;
    height: 120px;
  }

  /* Fix grids */
  .forum-categories {
    grid-template-columns: 1fr;
  }

  .marketplace-grid {
    grid-template-columns: 1fr;
  }

  .friends-grid,
  .groups-grid {
    grid-template-columns: 1fr;
  }

  /* Fix photos grid */
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
  }

  /* Prevent wide content from breaking layout */
  .post-content p,
  .post-content div {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Fix modal on small screens */
  .modal-container {
    width: 95%;
    margin: 0 auto;
    font-size: 0.875rem;
  }

  .main-tab-content {
    padding: 0 0.25rem;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

[data-theme="dark"] .modal-container {
  background: #1f2937;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #000000;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #000000;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #000000;
  background: #ffffff;
  transition: all 0.2s;
}

[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="email"],
[data-theme="dark"] .form-group input[type="file"],
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .form-group select:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

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

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

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

.modal-actions .btn-primary {
  background: #000000;
  color: #ffffff;
}

.modal-actions .btn-primary:hover {
  background: #1f2937;
}

.modal-actions .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.modal-actions .btn-secondary:hover {
  background: #e5e7eb;
}

/* AI Writing Helper Styles */
.ai-helper-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.btn-ai-helper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-ai-helper:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-ai-helper.active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-ai-helper svg {
  flex-shrink: 0;
}

[data-theme="dark"] .btn-ai-helper {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .btn-ai-helper:hover {
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.ai-helper-options {
  background: var(--bg-tertiary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 1rem;
  animation: slideDown 0.3s ease;
}

[data-theme="dark"] .ai-helper-options {
  background: #374151;
  border-color: #4b5563;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-option-group {
  margin-bottom: 1rem;
}

.ai-option-group:last-child {
  margin-bottom: 0.75rem;
}

.ai-option-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .ai-option-group label {
  color: #f9fafb;
}

.ai-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  color: var(--text-primary, #111827);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .ai-select {
  background: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

[data-theme="dark"] .ai-select:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.ai-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  user-select: none;
}

[data-theme="dark"] .ai-checkbox-label {
  color: #d1d5db;
}

.ai-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #667eea;
}

[data-theme="dark"] .ai-checkbox-label input[type="checkbox"] {
  accent-color: #a78bfa;
}

.ai-checkbox-label:hover {
  color: var(--text-primary, #111827);
}

[data-theme="dark"] .ai-checkbox-label:hover {
  color: #f9fafb;
}

.ai-suggestions {
  margin-top: 0.75rem;
  animation: slideDown 0.3s ease;
}

.ai-suggestion-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
  border: 2px solid #667eea;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .ai-suggestion-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #a78bfa;
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.15);
}

.ai-suggestion-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: #667eea;
  font-size: 0.875rem;
}

[data-theme="dark"] .ai-suggestion-header {
  color: #a78bfa;
}

.ai-suggestion-header svg {
  flex-shrink: 0;
}

.ai-suggestion-text {
  color: var(--text-primary, #111827);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  white-space: pre-line;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}

[data-theme="dark"] .ai-suggestion-text {
  color: #f9fafb;
  background: rgba(0, 0, 0, 0.2);
}

.ai-suggestion-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.spinning {
  animation: spin 1s linear infinite;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Dark Mode Modal Styles */
[data-theme="dark"] .modal-container {
  background: #1a1a1a;
  color: #ffffff;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #333333;
}

[data-theme="dark"] .modal-header h2 {
  color: #ffffff;
}

[data-theme="dark"] .modal-close {
  color: #9ca3af;
}

[data-theme="dark"] .modal-close:hover {
  background: #2d2d2d;
  color: #ffffff;
}

[data-theme="dark"] .form-group label {
  color: #ffffff;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .form-group select:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-actions .btn-primary {
  background: #ffffff;
  color: #000000;
}

[data-theme="dark"] .modal-actions .btn-primary:hover {
  background: #e5e7eb;
}

[data-theme="dark"] .modal-actions .btn-secondary {
  background: #2d2d2d;
  color: #d1d5db;
}

[data-theme="dark"] .modal-actions .btn-secondary:hover {
  background: #404040;
}

/* Listing Detail Modal Styles */
.listing-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
}

.listing-detail-image {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
}

.listing-detail-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.listing-timer-large {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing-timer-large.expires-soon {
  background: rgba(239, 68, 68, 0.9);
  animation: pulse 2s ease-in-out infinite;
}

.listing-timer-large svg {
  flex-shrink: 0;
}

.listing-detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.listing-detail-price {
  font-size: 32px;
  font-weight: 700;
  color: #000000;
}

.listing-detail-condition {
  font-size: 14px;
  color: #6b7280;
}

.listing-detail-condition strong {
  color: #000000;
  text-transform: capitalize;
}

.listing-detail-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6b7280;
}

.listing-detail-location svg {
  color: #ef4444;
  flex-shrink: 0;
}

.listing-detail-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  margin: 8px 0 0 0;
}

.listing-detail-description {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin: 0;
}

.listing-detail-seller {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  margin-top: 8px;
}

.listing-detail-seller svg {
  color: #6b7280;
  flex-shrink: 0;
  margin-top: 2px;
}

.listing-detail-seller div {
  flex: 1;
}

.listing-detail-seller strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.listing-detail-seller p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}

.listing-detail-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #9ca3af;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.listing-expiry-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  margin-top: 8px;
}

.listing-expiry-notice svg {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 1px;
}

.listing-expiry-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group input[type="number"] {
  width: 100%;
}

/* Dark mode listing detail styles */
[data-theme="dark"] .listing-detail-price {
  color: #ffffff;
}

[data-theme="dark"] .listing-detail-condition strong,
[data-theme="dark"] .listing-detail-content h4 {
  color: #ffffff;
}

[data-theme="dark"] .listing-detail-description {
  color: #d1d5db;
}

[data-theme="dark"] .listing-detail-seller {
  background: #2d2d2d;
}

[data-theme="dark"] .listing-detail-seller p {
  color: #ffffff;
}

[data-theme="dark"] .listing-detail-stats {
  border-top-color: #404040;
}

[data-theme="dark"] .listing-expiry-notice {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .listing-expiry-notice p {
  color: #fbbf24;
}

/* Responsive styles */
@media (max-width: 768px) {
  .listing-detail-price {
    font-size: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .listing-timer-large {
    font-size: 12px;
    padding: 8px 12px;
  }
}
