/**
 * community.css
 * Styles for GRRC Community Chat
 * Imports existing theme variables
 * FIXED VERSION - Full Theme Support
 */

@import url('variables.css');

/* ============================================
   COMMUNITY LAYOUT
   ============================================ */

.community-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--background-color);
  overflow: hidden;
}

.community-header {
  background: var(--header-background);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  margin: 0;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(-4px);
}

.community-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--header-text);
}

.community-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Remove that weird bottom bar */
#chatContent {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#chatContent.show {
  display: flex !important;
}

/* Ensure no extra elements appear */
.chat-area > *:not(#emptyChat):not(#chatContent) {
  display: none !important;
}
/* ============================================
   USER LIST SIDEBAR
   ============================================ */

.users-sidebar {
  width: 320px;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.users-header {
  padding: 1rem;
  border-bottom: 2px solid var(--border-color);
  background: var(--background-secondary);
}

/* ✅ NEW: Active Users Bar (Messenger Style) */
.active-users-bar {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.active-users-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  scrollbar-width: none; /* Firefox */
}

.active-users-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.active-user-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.active-user-item:hover {
  transform: scale(1.05);
}

.active-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  border: 2px solid var(--surface-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.active-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.active-user-avatar .online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2px solid var(--surface-color);
  border-radius: 50%;
}

.active-user-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.users-search {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--background-color);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
}

.users-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
  background: var(--surface-color);
}

.chat-tab-btn {
  transition: all 0.3s ease;
  font-weight: 600;
  border: none;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
}

.chat-tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chat-tab-btn.active {
  background: var(--primary-color) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
  transform: translateY(-2px);
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
  border: 2px solid transparent;
}

.user-item:hover {
  background: var(--background-color);
  transform: translateX(4px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.user-item.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.user-item:hover .user-avatar {
  transform: scale(1.1);
}

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

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid var(--surface-color);
  border-radius: 50%;
}

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

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9375rem;
}

.user-item.active .user-name {
  color: white;
  font-weight: 700;
}

.user-status {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.user-item.active .user-status {
  color: rgba(255, 255, 255, 0.9);
}

.user-status::before {
  content: '• ';
  margin-right: 0.25rem;
}

.unread-badge {
  background: var(--error-color);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* ============================================
   CHAT AREA
   ============================================ */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--background-color);
  position: relative;
}

.chat-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.chat-header {
  background: var(--surface-color);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.125rem;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.chat-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-user-details h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-user-details p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(to bottom, var(--background-secondary) 0%, var(--background-color) 10%);
  position: relative;
  z-index: 1;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 70%;
}

.message.own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.message-content {
  background: var(--surface-color);
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-xl);
  position: relative;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.message:hover .message-content {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.message.own .message-content {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.message-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.message.own .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.message-actions {
  display: none;
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.message.own:hover .message-actions {
  display: block;
}

/* ============================================
   MESSAGE INPUT
   ============================================ */

.chat-input-area {
  background: var(--surface-color);
  border-top: 2px solid var(--border-color);
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.chat-input-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1.125rem;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-2xl);
  background: var(--background-color);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-primary);
  resize: none;
  max-height: 120px;
  min-height: 44px;
  transition: all 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
  background: var(--surface-color);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.send-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: scale(1);
  box-shadow: none;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--background-color);
  position: relative;
  overflow: hidden;
}

.empty-chat::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(29, 78, 216, 0.08) 0%, transparent 50%);
  animation: rotateGradient 20s linear infinite;
}

@keyframes rotateGradient {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



.empty-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
  filter: drop-shadow(0 4px 12px rgba(29, 78, 216, 0.2));
  position: relative;
  z-index: 1;
}

.empty-chat h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-chat p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .community-main {
    position: relative;
  }
  
  .users-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-right: none;
    z-index: 10;
    transform: translateX(0);
    transition: transform 0.3s ease;
  }
  
  .users-sidebar:not(.mobile-show) {
    transform: translateX(-100%);
  }
  
  .chat-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  .chat-area.mobile-show {
    transform: translateX(0);
  }
  
  .message {
    max-width: 85%;
  }
  
  .chat-input-area {
    padding: 0.75rem;
  }
  
  .mobile-only {
    display: inline-block !important;
  }
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.typing-indicator {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  align-items: center;
  background: var(--background-color);
  border-top: 1px solid var(--border-color);
}

.typing-indicator-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

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

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: typingBounce 1.4s infinite;
}

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

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

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

/* ============================================
   SCROLLBAR
   ============================================ */

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

.users-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.users-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ============================================
   MODERN ENHANCEMENTS - MATCH MAIN WEBSITE
   ============================================ */

/* Gradient overlays for depth */
.community-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0.5;
}

/* Enhanced logout button hover */
#logoutBtn {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

#logoutBtn:hover {
  background: var(--error-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* User list scrollbar styling */
.users-list::-webkit-scrollbar {
  width: 6px;
}

.users-list::-webkit-scrollbar-track {
  background: var(--background-secondary);
  border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Chat messages scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Typing indicator animation */
.typing-indicator {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  align-items: center;
  background: linear-gradient(90deg, var(--background-secondary) 0%, var(--background-color) 100%);
  border-top: 1px solid var(--border-color);
}

.typing-indicator-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 500;
}

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

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% { 
    transform: translateY(0); 
    opacity: 0.7;
  }
  30% { 
    transform: translateY(-10px); 
    opacity: 1;
  }
}

/* Message timestamp styling */
.message-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  font-weight: 500;
  opacity: 0.8;
}

.message.own .message-time {
  color: rgba(255, 255, 255, 0.8);
}

/* Online indicator pulse */
.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid var(--surface-color);
  border-radius: 50%;
  animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

/* Tab buttons with better styling */
.chat-tab-btn {
  position: relative;
  overflow: hidden;
}

.chat-tab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.chat-tab-btn:hover::before {
  left: 100%;
}

/* Message hover effects */
.message {
  transition: all 0.3s ease;
}

.message:hover {
  transform: translateX(2px);
}

.message.own:hover {
  transform: translateX(-2px);
}

/* Search input with icon */
.users-search::placeholder {
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Empty state improvements */
.empty-chat p strong {
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Chat header shadow on scroll */
.chat-header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Message action button */
.message-actions {
  display: none;
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  transition: all 0.3s ease;
}

.message-actions:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.message.own:hover .message-actions {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Unread badge */
.unread-badge {
  background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
/* ============================================
   THEME-SPECIFIC OVERRIDES FOR FULL VISIBILITY
   ============================================ */

/* Light Theme - Ensure proper contrast */
[data-theme="light"] .community-header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .community-title,
[data-theme="light"] .back-btn {
  color: #1a202c;
}

[data-theme="light"] .chat-header {
  background: white;
  border-bottom: 2px solid #e2e8f0;
}

[data-theme="light"] .chat-user-details h3,
[data-theme="light"] .chat-user-details p {
  color: #1a202c;
}

[data-theme="light"] .user-name {
  color: #1a202c;
}

[data-theme="light"] .user-status {
  color: #64748b;
}

/* Dark Theme - Maximum visibility */
[data-theme="dark"] .community-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .community-title,
[data-theme="dark"] .back-btn {
  color: #f8fafc;
}

[data-theme="dark"] .chat-header {
  background: #1e293b;
  border-bottom: 2px solid #334155;
}

[data-theme="dark"] .chat-user-details h3 {
  color: #f8fafc;
}

[data-theme="dark"] .chat-user-details p {
  color: #e2e8f0;
}

[data-theme="dark"] .user-name {
  color: #f8fafc;
}

[data-theme="dark"] .user-status {
  color: #cbd5e1;
}

[data-theme="dark"] .message-content {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .message.own .message-content {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  color: #0f172a;
}

[data-theme="dark"] .chat-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .users-search {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

/* Global Chat Header Fix */
.global-chat-item {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  color: white !important;
}

.global-chat-item .user-name,
.global-chat-item .user-status {
  color: white !important;
}

/* Ensure white text on gradient backgrounds */
[style*="background: linear-gradient"] * {
  color: white !important;
}
/* Modern card-like message groups */
.message + .message {
  margin-top: 0.5rem;
}

.message + .message.same-sender {
  margin-top: 0.25rem;
}

/* Better focus states */
.chat-input:focus,
.users-search:focus {
  transform: translateY(-1px);
}

/* Loading skeleton for users */
.user-item.loading {
  pointer-events: none;
  opacity: 0.6;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
}

/* ============================================
   ENHANCED THEME SUPPORT - COMPLETE FIX
   ============================================ */

/* Force proper theme colors on all elements */
.community-container {
    background: var(--background-color);
    color: var(--text-primary);
}

.community-header {
    background: var(--surface-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.community-title {
    color: var(--text-primary) !important;
}

.back-btn {
    background: var(--background-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.back-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.users-sidebar {
    background: var(--surface-color) !important;
    border-right: 1px solid var(--border-color) !important;
}

.users-header {
    background: var(--background-secondary) !important;
}

.users-search {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-medium) !important;
}

.user-item {
    color: var(--text-primary) !important;
}

.user-name {
    color: var(--text-primary) !important;
}

.user-status {
    color: var(--text-secondary) !important;
}

.chat-area {
    background: var(--background-color) !important;
}

.chat-header {
    background: var(--surface-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.chat-user-details h3 {
    color: var(--text-primary) !important;
}

.chat-user-details p {
    color: var(--text-secondary) !important;
}

.chat-messages {
    background: var(--background-color) !important;
}

.message-content {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.message.own .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    color: white !important;
    border: none !important;
}

.chat-input-area {
    background: var(--surface-color) !important;
    border-top: 2px solid var(--border-color) !important;
}

.chat-input {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-medium) !important;
}

.chat-input::placeholder {
    color: var(--text-tertiary) !important;
}

.empty-chat {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
}

.empty-chat h2 {
    color: var(--text-primary) !important;
}

.empty-chat p {
    color: var(--text-secondary) !important;
}

/* Dark theme specific overrides */
[data-theme="dark"] .community-header {
    background: #1e293b !important;
}

[data-theme="dark"] .users-sidebar {
    background: #1e293b !important;
}

[data-theme="dark"] .chat-header {
    background: #1e293b !important;
}

[data-theme="dark"] .message-content {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* Light theme specific overrides */
[data-theme="light"] .community-header {
    background: white !important;
}

[data-theme="light"] .users-sidebar {
    background: white !important;
}

[data-theme="light"] .chat-header {
    background: white !important;
}

[data-theme="light"] .message-content {
    background: white !important;
    color: #1a202c !important;
}