/* Dark Mode Styles for Eunobia */

/* CSS Variables for Dark Mode - Eye-Friendly Professional Palette */
:root {
  --dark-bg-primary: #1a1a1a;
  --dark-bg-secondary: #242424;
  --dark-bg-tertiary: #2e2e2e;
  --dark-bg-quaternary: #383838;
  --dark-text-primary: #ffffff;
  --dark-text-secondary: #ffffff;
  --dark-text-muted: #999999;
  --dark-accent: #5ba3f5;
  --dark-accent-dark: #4a8ce0;
  --dark-accent-light: #7bb8f7;
  --dark-border: #404040;
  --dark-border-light: #505050;
  --dark-shadow: rgba(0, 0, 0, 0.3);
  --dark-shadow-light: rgba(0, 0, 0, 0.15);
  --dark-card-bg: #242424;
  --dark-card-bg-hover: #2e2e2e;
  --dark-input-bg: #2e2e2e;
  --dark-input-border: #505050;
  --dark-blue-tint: #1e2a3a;
  --dark-grey-tint: #2e2e2e;
}

/* Dark mode toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

/* Dark mode body styles */
body.dark-mode {
  background-color: var(--dark-bg-primary);
  color: var(--dark-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode navbar */
body.dark-mode .navbar {
  background-color: var(--dark-bg-secondary) !important;
  border-bottom-color: var(--dark-border) !important;
}

body.dark-mode .navbar-brand {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .nav-link {
  color: #ffffff !important;
}

body.dark-mode .nav-link:hover {
  color: #ffffff !important;
}

/* Dark mode cards and containers - Professional Styling */
body.dark-mode .dashboard-card,
body.dark-mode .profile-card,
body.dark-mode .stat-card,
body.dark-mode .doc-item,
body.dark-mode .action-card,
body.dark-mode .card,
body.dark-mode .list-group-item,
body.dark-mode .search-container,
body.dark-mode .filter-container,
body.dark-mode .document-card,
body.dark-mode .browse-card,
body.dark-mode .feed-post,
body.dark-mode .post-card,
body.dark-mode .support-card {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 2px 8px var(--dark-shadow-light) !important;
  transition: all 0.3s ease !important;
}

/* Hover effects for cards */
body.dark-mode .dashboard-card:hover,
body.dark-mode .profile-card:hover,
body.dark-mode .stat-card:hover,
body.dark-mode .action-card:hover,
body.dark-mode .card:hover,
body.dark-mode .feed-post:hover,
body.dark-mode .post-card:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
  box-shadow: 0 4px 16px var(--dark-shadow) !important;
  transform: translateY(-2px) !important;
}

/* Fix white backgrounds that should be dark */
body.dark-mode .bg-white,
body.dark-mode .bg-light,
body.dark-mode .container,
body.dark-mode .row,
body.dark-mode .col,
body.dark-mode .col-md-4,
body.dark-mode .col-md-8,
body.dark-mode .col-lg-8,
body.dark-mode .col-lg-10 {
  background-color: transparent !important;
}

/* Fix ALL white backdrops and cards - Comprehensive */
body.dark-mode .card,
body.dark-mode .activity-card,
body.dark-mode .stats-card,
body.dark-mode .profile-card,
body.dark-mode .upload-card,
body.dark-mode .faq-card,
body.dark-mode .question-card,
body.dark-mode .about-card,
body.dark-mode .team-card,
body.dark-mode .contributor-card,
body.dark-mode .upload-form,
body.dark-mode .upload-container,
body.dark-mode .form-container,
body.dark-mode .main-container,
body.dark-mode .content-container,
body.dark-mode .page-container {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

/* Invert upload elements specifically */
body.dark-mode .upload-icon,
body.dark-mode .upload-btn,
body.dark-mode .upload-action,
body.dark-mode .upload-card,
body.dark-mode .upload-section {
  background: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
}

body.dark-mode .upload-btn:hover,
body.dark-mode .upload-action:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

/* Fix search and filter containers */
body.dark-mode .search-bar-container,
body.dark-mode .filter-section,
body.dark-mode .results-container {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

/* Feed posts and document cards - Professional styling */
body.dark-mode .feed-post {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  margin-bottom: 1.5rem !important;
  transition: all 0.3s ease !important;
}

body.dark-mode .feed-post:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
  box-shadow: 0 4px 16px var(--dark-shadow) !important;
  transform: translateY(-2px) !important;
}

/* Post header styling */
body.dark-mode .post-header {
  background: transparent !important;
  border-bottom: 1px solid var(--dark-border) !important;
  padding: 1rem 1.5rem !important;
}

body.dark-mode .author-info {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .author-name,
body.dark-mode .author-link {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .post-date,
body.dark-mode .date-text {
  color: var(--dark-text-muted) !important;
}

/* Post content styling */
body.dark-mode .post-content {
  background: transparent !important;
  padding: 1rem 1.5rem !important;
}

body.dark-mode .post-title {
  color: var(--dark-text-primary) !important;
  font-weight: 600 !important;
}

body.dark-mode .post-meta {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .meta-item {
  color: var(--dark-text-secondary) !important;
}

/* Post tags styling */
body.dark-mode .post-tags {
  margin-top: 0.75rem !important;
}

body.dark-mode .tag {
  background: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  margin-right: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  display: inline-block !important;
  transition: all 0.2s ease !important;
}

body.dark-mode .tag:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

/* Post actions styling */
body.dark-mode .post-actions {
  background: var(--dark-bg-tertiary) !important;
  border-top: 1px solid var(--dark-border) !important;
  padding: 0.75rem 1.5rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

body.dark-mode .action-btn {
  background: transparent !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-secondary) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

body.dark-mode .action-btn:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

body.dark-mode .like-btn.liked {
  background: rgba(231, 76, 60, 0.1) !important;
  border-color: #e74c3c !important;
  color: #e74c3c !important;
}

body.dark-mode .view-btn {
  background: var(--dark-accent) !important;
  border-color: var(--dark-accent) !important;
  color: white !important;
}

body.dark-mode .view-btn:hover {
  background: var(--dark-accent-dark) !important;
  border-color: var(--dark-accent-dark) !important;
}

/* Dark mode section backgrounds */
body.dark-mode .dashboard-section,
body.dark-mode .profile-section {
  background: var(--dark-bg-tertiary) !important;
  border-color: var(--dark-border) !important;
}

/* Dark mode text colors */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode p,
body.dark-mode .lead {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .text-muted {
  color: var(--dark-text-muted) !important;
}

/* Fix all text elements for readability */
body.dark-mode .text-dark,
body.dark-mode .text-black,
body.dark-mode .text-secondary {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .text-light {
  color: var(--dark-text-secondary) !important;
}

/* Fix specific text elements - All names and titles */
body.dark-mode .document-name,
body.dark-mode .document-subject,
body.dark-mode .document-type,
body.dark-mode .document-grade,
body.dark-mode .document-year,
body.dark-mode .document-views,
body.dark-mode .uploader-name,
body.dark-mode .upload-date,
body.dark-mode .author-name,
body.dark-mode .author-link,
body.dark-mode .post-title,
body.dark-mode .leaderboard-info h5,
body.dark-mode .leaderboard-info p,
body.dark-mode .user-name,
body.dark-mode .profile-name,
body.dark-mode .member-name,
body.dark-mode .contributor-name,
body.dark-mode .team-member-name,
body.dark-mode .student-name,
body.dark-mode .developer-name,
body.dark-mode .admin-name,
body.dark-mode .moderator-name,
body.dark-mode .card-title,
body.dark-mode .section-title,
body.dark-mode .page-title,
body.dark-mode .form-title,
body.dark-mode .upload-title,
body.dark-mode .activity-title,
body.dark-mode .stats-title,
body.dark-mode .leaderboard-title,
body.dark-mode .community-title,
body.dark-mode .browse-title,
body.dark-mode .profile-title,
body.dark-mode .about-title,
body.dark-mode .faq-title,
body.dark-mode .question-title,
body.dark-mode .answer-title,
body.dark-mode .help-title,
body.dark-mode .support-title,
body.dark-mode .contact-title,
body.dark-mode .settings-title,
body.dark-mode .dashboard-title,
body.dark-mode .home-title,
body.dark-mode .welcome-title,
body.dark-mode .main-title,
body.dark-mode .subtitle,
body.dark-mode .heading,
body.dark-mode .h1,
body.dark-mode .h2,
body.dark-mode .h3,
body.dark-mode .h4,
body.dark-mode .h5,
body.dark-mode .h6 {
  color: var(--dark-text-primary) !important;
}

/* Fix meta information text */
body.dark-mode .meta-item,
body.dark-mode .post-meta,
body.dark-mode .leaderboard-stats,
body.dark-mode .upload-count {
  color: var(--dark-text-secondary) !important;
}

/* Fix date and time text */
body.dark-mode .post-date,
body.dark-mode .date-text,
body.dark-mode .upload-date {
  color: var(--dark-text-muted) !important;
}

/* Fix tag buttons - Make tags darker */
body.dark-mode .badge,
body.dark-mode .tag,
body.dark-mode .btn-sm,
body.dark-mode .status-badge,
body.dark-mode .rank-badge,
body.dark-mode .contributor-badge,
body.dark-mode .follow-badge,
body.dark-mode .mutual-badge {
  background-color: var(--dark-bg-quaternary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  transition: all 0.2s ease !important;
}

body.dark-mode .tag:hover,
body.dark-mode .badge:hover {
  background-color: var(--dark-bg-tertiary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

/* Make specific tags even darker */
body.dark-mode .tag {
  background-color: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  margin-right: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  display: inline-block !important;
  transition: all 0.2s ease !important;
}

body.dark-mode .tag:hover {
  background-color: var(--dark-bg-secondary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

/* Fix document meta tags specifically */
body.dark-mode .meta-item,
body.dark-mode .document-meta,
body.dark-mode .post-meta span,
body.dark-mode .card-meta {
  background-color: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  margin-right: 0.25rem !important;
  margin-bottom: 0.25rem !important;
  display: inline-block !important;
}

/* Fix form elements and inputs */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode select,
body.dark-mode input,
body.dark-mode textarea {
  background-color: var(--dark-input-bg) !important;
  border: 1px solid var(--dark-input-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus,
body.dark-mode select:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus {
  background-color: var(--dark-input-bg) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(91, 163, 245, 0.25) !important;
}

body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--dark-text-muted) !important;
}

/* Dark mode buttons */
body.dark-mode .btn-primary {
  background-color: var(--dark-accent);
  border-color: var(--dark-accent);
  color: white;
}

body.dark-mode .btn-primary:hover {
  background-color: var(--dark-accent-dark);
  border-color: var(--dark-accent-dark);
}

body.dark-mode .btn-outline-primary {
  color: var(--dark-accent);
  border-color: var(--dark-accent);
}

body.dark-mode .btn-outline-primary:hover {
  background-color: var(--dark-accent);
  border-color: var(--dark-accent);
  color: white;
}

/* Dark mode form elements */
body.dark-mode .form-control {
  background-color: var(--dark-input-bg) !important;
  border-color: var(--dark-input-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .form-control:focus {
  background-color: var(--dark-input-bg) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25) !important;
}

/* Fix input fields that turn black */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="search"],
body.dark-mode textarea,
body.dark-mode select {
  background-color: var(--dark-input-bg) !important;
  border-color: var(--dark-input-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--dark-text-muted) !important;
}

/* Dark mode dropdowns */
body.dark-mode .dropdown-menu {
  background-color: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .dropdown-item {
  color: var(--dark-text-primary) !important;
  background-color: transparent !important;
}

body.dark-mode .dropdown-item:hover {
  background-color: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
}

/* Profile dropdown specific styling */
body.dark-mode .dropdown-menu.dropdown-menu-end {
  background-color: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .dropdown-menu.dropdown-menu-end .dropdown-item {
  color: #ffffff !important;
  background-color: transparent !important;
  border: none !important;
}

body.dark-mode .dropdown-menu.dropdown-menu-end .dropdown-item:hover {
  background-color: var(--dark-bg-tertiary) !important;
  color: #ffffff !important;
}

body.dark-mode .dropdown-menu.dropdown-menu-end .dropdown-divider {
  border-color: var(--dark-border) !important;
}


/* Special rank colors for top 3 */
body.dark-mode .home-rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
  color: #8b6914 !important;
  border-color: #ffd700 !important;
}

body.dark-mode .home-rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8) !important;
  color: #666 !important;
  border-color: #c0c0c0 !important;
}

body.dark-mode .home-rank-3 {
  background: linear-gradient(135deg, #cd7f32, #daa520) !important;
  color: white !important;
  border-color: #cd7f32 !important;
}

/* Dark mode status badges */
body.dark-mode .status-badge.approved {
  background: #28a745;
  color: white;
}

body.dark-mode .status-badge.pending {
  background: #ffc107;
  color: #212529;
}

body.dark-mode .status-badge.rejected {
  background: #dc3545;
  color: white;
}

/* Dark mode progress bars */
body.dark-mode .view-progress {
  background: rgba(74, 158, 255, 0.2);
}

body.dark-mode .view-progress-bar {
  background: linear-gradient(90deg, #28a745, #20c997);
}


body.dark-mode .follower-item {
  background: var(--dark-bg-tertiary);
  border-color: var(--dark-border);
  color: var(--dark-text-primary);
}

body.dark-mode .follower-item:hover {
  background: var(--dark-bg-secondary);
}

/* Dark mode footer */
body.dark-mode .footer-branding {
  background-color: var(--dark-bg-secondary);
  color: var(--dark-text-secondary);
}

body.dark-mode .footer-branding a {
  color: var(--dark-text-secondary);
}

body.dark-mode .footer-branding a:hover {
  color: var(--dark-text-primary);
}

/* Dark mode alerts and notifications */
body.dark-mode .alert-success {
  background-color: rgba(40, 167, 69, 0.2);
  border-color: #28a745;
  color: #28a745;
}

body.dark-mode .alert-danger {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: #dc3545;
  color: #dc3545;
}

body.dark-mode .alert-warning {
  background-color: rgba(255, 193, 7, 0.2);
  border-color: #ffc107;
  color: #ffc107;
}

body.dark-mode .alert-info {
  background-color: rgba(23, 162, 184, 0.2);
  border-color: #17a2b8;
  color: #17a2b8;
}

/* Dark mode notification system */
body.dark-mode .notification {
  background: linear-gradient(135deg, var(--dark-accent), var(--dark-accent-dark));
  color: white;
}

body.dark-mode .notification.error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

body.dark-mode .notification.warning {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
}

body.dark-mode .notification.info {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

/* Dark mode profile elements */
body.dark-mode .profile-icon {
  background-color: var(--dark-accent);
  border-color: var(--dark-accent);
}

body.dark-mode .profile-icon:hover {
  background-color: var(--dark-accent-dark);
  border-color: var(--dark-accent-dark);
}

/* Profile card specific dark mode styling - OVERRIDE INLINE STYLES */
body.dark-mode .profile-card,
body.dark-mode .card.profile-card,
body.dark-mode .profile-section .card {
  background: var(--dark-card-bg) !important;
  background-color: var(--dark-card-bg) !important;
  background-image: none !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Profile card content */
body.dark-mode .profile-card .card-body,
body.dark-mode .card.profile-card .card-body {
  background-color: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

/* Profile card text elements */
body.dark-mode .profile-card h1,
body.dark-mode .profile-card h2,
body.dark-mode .profile-card h3,
body.dark-mode .profile-card h4,
body.dark-mode .profile-card h5,
body.dark-mode .profile-card h6,
body.dark-mode .profile-card p,
body.dark-mode .profile-card .text-muted,
body.dark-mode .profile-card .bio,
body.dark-mode .profile-card .profile-name,
body.dark-mode .profile-card .profile-title {
  color: var(--dark-text-primary) !important;
}

/* Profile card buttons */
body.dark-mode .profile-card .btn,
body.dark-mode .card.profile-card .btn {
  background-color: var(--dark-bg-tertiary) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .profile-card .btn:hover,
body.dark-mode .card.profile-card .btn:hover {
  background-color: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-text-primary) !important;
}

/* PROTECT ONLINE STATUS - Keep green dot unchanged, but respect offline status */
body.dark-mode .online-indicator:not(.offline),
body.dark-mode .status-dot:not(.offline),
body.dark-mode .online-dot:not(.offline),
body.dark-mode [class*="online"]:not(.offline),
body.dark-mode [class*="status"]:not(.offline) {
  background-color: #28a745 !important;
  color: #28a745 !important;
  border-color: #28a745 !important;
}

/* Offline status in dark mode */
body.dark-mode .online-indicator.offline,
body.dark-mode .status-dot.offline,
body.dark-mode .online-dot.offline {
  background-color: #6c757d !important;
  color: #6c757d !important;
  border-color: #6c757d !important;
}

/* Role badges in profile */
body.dark-mode .profile-card .badge,
body.dark-mode .card.profile-card .badge {
  background-color: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
}

/* NUCLEAR OPTION - FORCE PROFILE CARD DARK */
body.dark-mode .profile-card {
  background: var(--dark-card-bg) !important;
  background-color: var(--dark-card-bg) !important;
  background-image: none !important;
  background-gradient: none !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Override any inline styles */
body.dark-mode .profile-card[style*="background"] {
  background: var(--dark-card-bg) !important;
  background-color: var(--dark-card-bg) !important;
  background-image: none !important;
}

/* Dark mode online indicators */
body.dark-mode .online-indicator {
  border-color: var(--dark-bg-primary);
}

/* Dark mode contributor badges */
body.dark-mode .contributor-name {
  color: #ffd700 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .contributor-badge {
  color: #ffd700 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Dark mode support section */
body.dark-mode .support-card {
  background: linear-gradient(145deg, var(--dark-bg-tertiary), var(--dark-bg-secondary));
  border-color: #ffc107;
  color: var(--dark-text-primary);
}

/* Dark mode team section */
body.dark-mode .team-member {
  color: var(--dark-text-primary);
}

/* Dark mode why section */
body.dark-mode .why-point h4 {
  color: var(--dark-text-primary);
}

body.dark-mode .why-point p {
  color: var(--dark-text-secondary);
}


/* Dark mode toggle animation */
.theme-toggle .fa-sun {
  display: none;
}

.theme-toggle .fa-moon {
  display: inline;
}

body.dark-mode .theme-toggle .fa-sun {
  display: inline;
}

body.dark-mode .theme-toggle .fa-moon {
  display: none;
}

/* Fix more white elements */
body.dark-mode .navbar {
  background-color: var(--dark-bg-secondary) !important;
}

body.dark-mode .navbar-light {
  background-color: var(--dark-bg-secondary) !important;
}

body.dark-mode .border-bottom {
  border-color: var(--dark-border) !important;
}

/* Search bar and filter containers */
body.dark-mode .search-bar-container {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

body.dark-mode .search-filters {
  background: transparent !important;
}

body.dark-mode .search-filters-container {
  background: var(--dark-bg-tertiary) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
}

/* Form labels and inputs in search */
body.dark-mode .form-label {
  color: var(--dark-text-primary) !important;
  font-weight: 500 !important;
}

body.dark-mode .filter-select {
  background: var(--dark-input-bg) !important;
  border: 1px solid var(--dark-input-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .filter-select:focus {
  background: var(--dark-input-bg) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25) !important;
}

/* Result count and filter toggle */
body.dark-mode #resultCount {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .btn-outline-primary {
  background: transparent !important;
  border: 1px solid var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

body.dark-mode .btn-outline-primary:hover {
  background: var(--dark-accent) !important;
  border-color: var(--dark-accent) !important;
  color: white !important;
}

/* Fix search results and document listings */
body.dark-mode .search-results,
body.dark-mode .document-list,
body.dark-mode .browse-results {
  background: transparent !important;
}

body.dark-mode .document-item,
body.dark-mode .result-item {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

/* Fix pagination */
body.dark-mode .pagination .page-link {
  background-color: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .pagination .page-item.active .page-link {
  background-color: var(--dark-accent) !important;
  border-color: var(--dark-accent) !important;
  color: white !important;
}


/* Fix tables */
body.dark-mode .table {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--dark-bg-tertiary) !important;
}

/* Additional card types and components */
body.dark-mode .no-docs {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 3rem 2rem !important;
  text-align: center !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .no-docs h3 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .no-docs p {
  color: var(--dark-text-secondary) !important;
}

/* Pagination styling */
body.dark-mode .pagination-container {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  margin-top: 2rem !important;
}

body.dark-mode .pagination-info {
  color: var(--dark-text-secondary) !important;
}

/* Loading indicator */
body.dark-mode .spinner-border {
  color: var(--dark-accent) !important;
}

body.dark-mode #pageLoadingIndicator p {
  color: var(--dark-text-secondary) !important;
}





/* Admin dashboard cards */
body.dark-mode .admin-stats {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
}

body.dark-mode .stat-widget {
  background: var(--dark-bg-tertiary) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 8px !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .stat-widget:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-border-light) !important;
}

/* Document view page */
body.dark-mode .doc-card {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
}

/* Support section */
body.dark-mode .support-card {
  background: linear-gradient(145deg, var(--dark-bg-tertiary), var(--dark-card-bg)) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
}

/* Why section cards */
body.dark-mode .why-point {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .why-point h4 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .why-point p {
  color: var(--dark-text-secondary) !important;
}

/* Team section */
body.dark-mode .team-member {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .team-member h4 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .team-member p {
  color: var(--dark-text-secondary) !important;
}

/* FAQ and Questions section - Fix white backdrops */
body.dark-mode .faq-section,
body.dark-mode .questions-section,
body.dark-mode .help-section,
body.dark-mode .support-section {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .faq-item,
body.dark-mode .question-item,
body.dark-mode .help-item,
body.dark-mode .support-item {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
  margin-bottom: 1rem !important;
}

body.dark-mode .faq-question,
body.dark-mode .question-text,
body.dark-mode .help-question,
body.dark-mode .support-question {
  color: var(--dark-text-primary) !important;
  font-weight: 600 !important;
}

body.dark-mode .faq-answer,
body.dark-mode .question-answer,
body.dark-mode .help-answer,
body.dark-mode .support-answer {
  color: var(--dark-text-secondary) !important;
}

/* About section - Fix white backdrops */
body.dark-mode .about-section,
body.dark-mode .about-container,
body.dark-mode .about-content {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .about-card,
body.dark-mode .about-info,
body.dark-mode .about-description {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .about-title,
body.dark-mode .about-subtitle {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .about-text,
body.dark-mode .about-description p {
  color: var(--dark-text-secondary) !important;
}

/* Fix huge white banners - Community and main sections with stronger rules */
body.dark-mode .main-section,
body.dark-mode .main-container,
body.dark-mode .main-banner,
body.dark-mode .main-header,
body.dark-mode .main-intro,
body.dark-mode .hero-section,
body.dark-mode .banner-section,
body.dark-mode .header-section,
body.dark-mode .intro-section,
body.dark-mode .welcome-section,
body.dark-mode .top-contributors,
body.dark-mode .contributors-section {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 2rem !important;
  margin: 1rem 0 !important;
}

/* Force override community banner specifically */
body.dark-mode .community-banner,
body.dark-mode .community-header,
body.dark-mode .community-intro,
body.dark-mode .main-banner,
body.dark-mode .main-header,
body.dark-mode .main-intro,
body.dark-mode .hero-banner,
body.dark-mode .intro-banner,
body.dark-mode .welcome-banner {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
  padding: 2rem !important;
  margin: 1rem 0 !important;
}


/* Created by section - Fix white backdrop with stronger rules */
body.dark-mode .created-by-section,
body.dark-mode .created-by-container,
body.dark-mode .created-by-content,
body.dark-mode .created-by,
body.dark-mode .about-section,
body.dark-mode .about-container,
body.dark-mode .about-content,
body.dark-mode .team-section,
body.dark-mode .team-container,
body.dark-mode .team-content {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  padding: 2rem !important;
}

body.dark-mode .created-by-title,
body.dark-mode .created-by-subtitle,
body.dark-mode .about-title,
body.dark-mode .about-subtitle,
body.dark-mode .team-title,
body.dark-mode .team-subtitle {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .created-by-text,
body.dark-mode .created-by-description,
body.dark-mode .about-text,
body.dark-mode .about-description,
body.dark-mode .team-text,
body.dark-mode .team-description {
  color: var(--dark-text-secondary) !important;
}


/* Activity cards - Fix white backdrops */
body.dark-mode .activity-item,
body.dark-mode .activity-card,
body.dark-mode .stats-item,
body.dark-mode .stats-card,
body.dark-mode .points-card,
body.dark-mode .member-card,
body.dark-mode .earned-card,
body.dark-mode .days-card {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
  padding: 1.5rem !important;
  margin-bottom: 1rem !important;
}

body.dark-mode .activity-title,
body.dark-mode .stats-title {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .activity-value,
body.dark-mode .stats-value,
body.dark-mode .points-value,
body.dark-mode .member-value {
  color: var(--dark-accent) !important;
  font-weight: 600 !important;
  font-size: 1.5rem !important;
}

body.dark-mode .activity-label,
body.dark-mode .stats-label,
body.dark-mode .points-label,
body.dark-mode .member-label {
  color: var(--dark-text-secondary) !important;
}

/* Fix collapse buttons and options */
body.dark-mode .collapse-btn,
body.dark-mode .collapse-button,
body.dark-mode .toggle-btn,
body.dark-mode .toggle-button,
body.dark-mode .expand-btn,
body.dark-mode .expand-button {
  background: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 8px !important;
  padding: 0.5rem 1rem !important;
  transition: all 0.2s ease !important;
}

body.dark-mode .collapse-btn:hover,
body.dark-mode .collapse-button:hover,
body.dark-mode .toggle-btn:hover,
body.dark-mode .toggle-button:hover,
body.dark-mode .expand-btn:hover,
body.dark-mode .expand-button:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}



/* Additional fixes for better readability */



/* Reset specific elements that should be transparent */
body.dark-mode .container,
body.dark-mode .row,
body.dark-mode .col,
body.dark-mode .col-md-4,
body.dark-mode .col-md-8,
body.dark-mode .col-lg-8,
body.dark-mode .col-lg-10 {
  background-color: transparent !important;
}


/* Fix contributor styling */
body.dark-mode .contributor-name {
  color: #ffd700 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .contributor-badge {
  color: #ffd700 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Fix upload count styling */
body.dark-mode .upload-count {
  color: var(--dark-text-secondary) !important;
  font-weight: 500 !important;
}

/* Fix action buttons in cards */
body.dark-mode .like-count {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .share-btn,
body.dark-mode .like-btn {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .share-btn:hover,
body.dark-mode .like-btn:hover {
  color: var(--dark-accent) !important;
}

/* Additional comprehensive fixes for all white backdrops */

/* Fix all remaining white banners and sections */
body.dark-mode .banner,
body.dark-mode .hero,
body.dark-mode .intro,
body.dark-mode .welcome,
body.dark-mode .main-content,
body.dark-mode .page-content,
body.dark-mode .section-content,
body.dark-mode .content-wrapper,
body.dark-mode .main-wrapper,
body.dark-mode .page-wrapper {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-primary) !important;
}

/* Fix specific white sections */
body.dark-mode .main-header,
body.dark-mode .main-intro,
body.dark-mode .main-banner,
body.dark-mode .page-header,
body.dark-mode .page-intro,
body.dark-mode .page-banner {
  background: var(--dark-card-bg) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: 12px !important;
  color: var(--dark-text-primary) !important;
  padding: 2rem !important;
  margin: 1rem 0 !important;
}

/* Fix all white containers and wrappers */
body.dark-mode .container,
body.dark-mode .wrapper,

/* Fix all remaining white elements */
body.dark-mode .white,
body.dark-mode .light,
body.dark-mode .bg-white,
body.dark-mode .bg-light,
body.dark-mode .light-bg,
body.dark-mode .white-bg {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

/* Fix all text that might be invisible */
body.dark-mode .invisible-text,
body.dark-mode .hidden-text,
body.dark-mode .faded-text,
body.dark-mode .muted-text,
body.dark-mode .light-text,
body.dark-mode .grey-text {
  color: var(--dark-text-primary) !important;
}

/* Fix all buttons and interactive elements */
body.dark-mode .btn,
body.dark-mode .button,
body.dark-mode .action-btn,
body.dark-mode .interactive-btn {
  background: var(--dark-bg-tertiary) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
}

body.dark-mode .btn:hover,
body.dark-mode .button:hover,
body.dark-mode .action-btn:hover,
body.dark-mode .interactive-btn:hover {
  background: var(--dark-bg-quaternary) !important;
  border-color: var(--dark-accent) !important;
  color: var(--dark-accent) !important;
}

/* Responsive adjustments for dark mode */
@media (max-width: 768px) {
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  body.dark-mode .feed-post {
    margin-bottom: 1rem !important;
  }
  
  body.dark-mode .post-header,
  body.dark-mode .post-content,
  body.dark-mode .post-actions {
    padding: 0.75rem 1rem !important;
  }
  
}

@media (max-width: 480px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  body.dark-mode .search-bar-container {
    padding: 1rem !important;
  }
  
  body.dark-mode .tag {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.5rem !important;
  }
  
}

/* Exclude popups and modals from dark mode interference */
body.dark-mode .hover-card,
body.dark-mode .popup,
body.dark-mode .modal,
body.dark-mode [class*="popup"],
body.dark-mode [class*="modal"],
body.dark-mode [class*="hover"] {
  background: inherit !important;
  color: inherit !important;
  border: inherit !important;
  box-shadow: inherit !important;
  transition: inherit !important;
}

/* Community Page Dark Mode Styling */
body.dark-mode .community-header {
  background: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
}

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

body.dark-mode .community-tabs {
  background: var(--dark-bg-secondary) !important;
  border-bottom-color: var(--dark-border) !important;
}

body.dark-mode .tab-btn {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-secondary) !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode .tab-btn.active {
  background: var(--dark-accent) !important;
  color: white !important;
  border-color: var(--dark-accent) !important;
}

body.dark-mode .tab-btn:hover {
  background: var(--dark-bg-hover) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-search {
  background: var(--dark-bg-secondary) !important;
}

body.dark-mode .leaderboard-search input {
  background: var(--dark-bg-primary) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-search input::placeholder {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .leaderboard-entry {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-entry:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
}

body.dark-mode .leaderboard-info h5 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-info p {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .rank-badge {
  background: var(--dark-accent) !important;
  color: white !important;
}

body.dark-mode .upload-count {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .community-banner {
  background: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .community-banner h2 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .community-banner p {
  color: var(--dark-text-secondary) !important;
}

/* Community Page - Dark Mode Color Overrides Only */
body.dark-mode .community-header {
  background: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
}

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

body.dark-mode .community-tabs {
  background: var(--dark-bg-secondary) !important;
  border-bottom-color: var(--dark-border) !important;
}

body.dark-mode .tab-btn {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-secondary) !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode .tab-btn.active {
  background: var(--dark-accent) !important;
  color: white !important;
  border-color: var(--dark-accent) !important;
}

body.dark-mode .tab-btn:hover {
  background: var(--dark-bg-hover) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-search {
  background: var(--dark-bg-secondary) !important;
}

body.dark-mode .leaderboard-search input {
  background: var(--dark-bg-primary) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-search input::placeholder {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .leaderboard-entry {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-entry:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
}

body.dark-mode .leaderboard-info h5 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-info p {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .rank-badge {
  background: var(--dark-accent) !important;
  color: white !important;
}

body.dark-mode .upload-count {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .recommended-user-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .recommended-user-card:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
}

body.dark-mode .all-user-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .all-user-card:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
}

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

body.dark-mode .user-card-school {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .user-card-points {
  color: var(--dark-accent) !important;
}

body.dark-mode .stat-item {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .section-title {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .loading-spinner {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .no-results {
  color: var(--dark-text-secondary) !important;
}

/* Fix white backdrops and fonts in community */
body.dark-mode .community-card {
  background: var(--dark-bg-primary) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-container {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .leaderboard-list {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .leaderboard-entry {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-entry:hover {
  background: var(--dark-card-bg-hover) !important;
}

body.dark-mode .leaderboard-user {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-avatar {
  background: var(--dark-bg-secondary) !important;
}

body.dark-mode .user-avatar-img {
  border-color: var(--dark-border) !important;
}

body.dark-mode .leaderboard-info h5 {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-info p {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .rank-badge {
  background: var(--dark-accent) !important;
  color: white !important;
}

body.dark-mode .upload-count {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .hover-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .hc-title {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .hc-sub {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .hc-bio {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .hc-btn {
  background: var(--dark-accent) !important;
  color: white !important;
  border-color: var(--dark-accent) !important;
}

body.dark-mode .hc-btn:hover {
  background: var(--dark-accent-dark) !important;
  border-color: var(--dark-accent-dark) !important;
}

/* Fix search bar */
body.dark-mode .leaderboard-search input {
  background: var(--dark-bg-primary) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-search input::placeholder {
  color: var(--dark-text-secondary) !important;
}

/* Fix tab content backgrounds */
body.dark-mode .tab-content {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .find-people-section {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .recommended-section {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .all-users-section {
  background: var(--dark-bg-primary) !important;
}

/* Fix grid backgrounds */
body.dark-mode .recommended-grid {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .all-users-grid {
  background: var(--dark-bg-primary) !important;
}

/* Home Page - Dashboard Stats Cards - Match dark mode theme */
body.dark-mode .stat-item {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .stat-number {
  color: var(--dark-accent) !important;
  font-weight: 700 !important;
}

body.dark-mode .stat-label {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .stat-content {
  color: var(--dark-text-primary) !important;
}

/* Home Page - Top Contributors Dark Mode */
body.dark-mode .leaderboard-section {
  background: var(--dark-bg-primary) !important;
}

body.dark-mode .leaderboard-card {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-header {
  background: var(--dark-bg-secondary) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-title {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-subtitle {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .home-leaderboard-entry {
  background: var(--dark-card-bg) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .home-leaderboard-entry:hover {
  background: var(--dark-card-bg-hover) !important;
  border-color: var(--dark-border-light) !important;
}

body.dark-mode .home-name-text {
  color: var(--dark-text-primary) !important;
}

body.dark-mode .home-upload-count {
  color: var(--dark-text-secondary) !important;
}

body.dark-mode .home-rank-badge {
  background: var(--dark-accent) !important;
  color: white !important;
}

body.dark-mode .home-rank-1 {
  background: #ffd700 !important;
  color: #000 !important;
}

body.dark-mode .home-rank-2 {
  background: #c0c0c0 !important;
  color: #000 !important;
}

body.dark-mode .home-rank-3 {
  background: #cd7f32 !important;
  color: white !important;
}

body.dark-mode .leaderboard-footer .btn {
  background: var(--dark-bg-secondary) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-footer .btn:hover {
  background: var(--dark-accent) !important;
  border-color: var(--dark-accent) !important;
  color: white !important;
}

/* NUCLEAR OPTION - FORCE ALL NAV LINKS WHITE */
body.dark-mode .nav-link,
body.dark-mode .navbar-collapse .nav-link,
body.dark-mode .collapse.navbar-collapse .nav-link,
body.dark-mode #navbarNav .nav-link,
body.dark-mode .navbar-collapse ul.navbar-nav .nav-link,
body.dark-mode .navbar-collapse .nav-item .nav-link,
body.dark-mode .collapse.navbar-collapse .nav-item .nav-link,
body.dark-mode #navbarNav .nav-item .nav-link,
body.dark-mode .navbar-collapse a,
body.dark-mode .collapse.navbar-collapse a,
body.dark-mode #navbarNav a,
body.dark-mode .navbar-collapse ul.navbar-nav a,
body.dark-mode .navbar-collapse .nav-item a,
body.dark-mode .collapse.navbar-collapse .nav-item a,
body.dark-mode #navbarNav .nav-item a {
  color: #ffffff !important;
  color: white !important;
}

/* FORCE ALL MOBILE MENU TEXT WHITE */
body.dark-mode .navbar-collapse *,
body.dark-mode .collapse.navbar-collapse *,
body.dark-mode #navbarNav * {
  color: #ffffff !important;
}
