/* Community Cards & Buttons Dark/Light Mode Fixes */

/* ============================================
   FRIEND CARDS - Fix text/button visibility
   ============================================ */

.friend-card-body h4 {
  color: #111827;
}

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

.friend-subtitle {
  color: #6b7280;
}

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

.friend-mutual {
  color: #6b7280;
}

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

.friend-stats {
  color: #6b7280;
  border-top-color: #e5e7eb;
}

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

/* Friend card action buttons - ensure visibility */
.friend-card-actions .btn {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.friend-card-actions .btn:hover {
  background-color: #1f2937;
  border-color: #1f2937;
}

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

[data-theme="dark"] .friend-card-actions .btn:hover {
  background-color: #e5e7eb;
  border-color: #e5e7eb;
}

.friend-card-actions .btn-secondary {
  background-color: transparent;
  color: #111827;
  border-color: #d1d5db;
}

.friend-card-actions .btn-secondary:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

[data-theme="dark"] .friend-card-actions .btn-secondary {
  background-color: transparent;
  color: #f9fafb;
  border-color: #4b5563;
}

[data-theme="dark"] .friend-card-actions .btn-secondary:hover {
  background-color: #374151;
  border-color: #6b7280;
}

/* ============================================
   GROUP CARDS - Fix text/button visibility
   ============================================ */

.group-body h3 {
  color: #111827;
}

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

.group-description {
  color: #6b7280;
}

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

.group-stats {
  color: #6b7280;
  border-top-color: #e5e7eb;
}

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

/* Group action buttons - ensure visibility */
.group-actions .btn {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.group-actions .btn:hover {
  background-color: #1f2937;
  border-color: #1f2937;
}

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

[data-theme="dark"] .group-actions .btn:hover {
  background-color: #e5e7eb;
  border-color: #e5e7eb;
}

.group-actions .btn-secondary {
  background-color: transparent;
  color: #111827;
  border-color: #d1d5db;
}

.group-actions .btn-secondary:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

[data-theme="dark"] .group-actions .btn-secondary {
  background-color: transparent;
  color: #f9fafb;
  border-color: #4b5563;
}

[data-theme="dark"] .group-actions .btn-secondary:hover {
  background-color: #374151;
  border-color: #6b7280;
}

/* ============================================
   EDIT PROFILE BUTTON - Fix sizing/fit
   ============================================ */

#edit-profile-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  margin: 0;
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

#edit-profile-btn:hover {
  background-color: #1f2937;
  border-color: #1f2937;
}

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

[data-theme="dark"] #edit-profile-btn:hover {
  background-color: #e5e7eb;
  border-color: #e5e7eb;
}

#edit-profile-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Fix user profile widget button container */
.user-profile-widget {
  padding: 1rem;
}

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

/* ============================================
   ONLINE FRIENDS WIDGET
   ============================================ */

.online-friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.online-friend-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .online-friend-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.online-friend-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.online-friend-item span:not(.online-status) {
  color: #111827;
  font-size: 0.875rem;
  font-weight: 500;
}

[data-theme="dark"] .online-friend-item span:not(.online-status) {
  color: #f9fafb;
}

.online-friend-item .online-status {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  left: 38px;
  top: 38px;
}

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

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
  #edit-profile-btn {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }

  .friend-card-actions,
  .group-actions {
    padding: 0 0.75rem 0.75rem 0.75rem;
  }

  .user-profile-widget .btn {
    margin: 0 0.75rem 0.75rem 0.75rem;
    width: calc(100% - 1.5rem);
  }
}
