/* Dark Theme Fixes - Critical overrides for text visibility */

/* Force text colors in dark theme */
[data-theme="dark"] {
  color: #ffffff !important;
}

[data-theme="dark"] body {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

/* All text elements */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #ffffff !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div:not(.alert):not(.btn),
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th:not(.card-header),
[data-theme="dark"] label,
[data-theme="dark"] small {
  color: #ffffff !important;
}

/* Card specific fixes */
[data-theme="dark"] .card {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
}

[data-theme="dark"] .card * {
  color: #ffffff !important;
}

[data-theme="dark"] .card .text-muted {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .card-body h1,
[data-theme="dark"] .card-body h2,
[data-theme="dark"] .card-body h3,
[data-theme="dark"] .card-body h4,
[data-theme="dark"] .card-body h5,
[data-theme="dark"] .card-body h6 {
  color: #ffffff !important;
}

/* Content wrapper fixes */
[data-theme="dark"] .content-wrapper {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
}

[data-theme="dark"] .content-wrapper * {
  color: #ffffff !important;
}

[data-theme="dark"] .content-wrapper .text-muted {
  color: #b0b0b0 !important;
}

/* Welcome section fixes */
[data-theme="dark"] .welcome-text {
  color: #e0e0e0 !important;
}

/* Bootstrap component overrides */
[data-theme="dark"] .lead {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .text-muted {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .text-secondary {
  color: #e0e0e0 !important;
}

/* List overrides */
[data-theme="dark"] ul li,
[data-theme="dark"] ol li {
  color: #ffffff !important;
}

[data-theme="dark"] .list-unstyled li {
  color: #ffffff !important;
}

/* Icon text combinations */
[data-theme="dark"] .fa + span,
[data-theme="dark"] .fas + span,
[data-theme="dark"] .far + span {
  color: #ffffff !important;
}

/* Nav items in dark theme */
[data-theme="dark"] .navbar-nav .nav-link {
  color: #ffffff !important;
}

[data-theme="dark"] .navbar-nav .nav-link:hover {
  color: #3898ec !important;
}

/* Dropdown items */
[data-theme="dark"] .dropdown-item {
  color: #ffffff !important;
  background-color: transparent !important;
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: #3a3a3a !important;
  color: #3898ec !important;
}

/* Pagination in dark theme */
[data-theme="dark"] .pagination .page-link {
  background-color: #2d2d2d !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

[data-theme="dark"] .pagination .page-link:hover {
  background-color: #3a3a3a !important;
  color: #3898ec !important;
  border-color: #555 !important;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: #242424 !important;
  color: #777 !important;
  border-color: #333 !important;
}

/* Outline buttons */
[data-theme="dark"] .btn-outline-secondary {
  color: #ffffff !important;
  border-color: #777 !important;
}

[data-theme="dark"] .btn-outline-secondary:hover,
[data-theme="dark"] .btn-outline-secondary:focus {
  color: #3898ec !important;
  background-color: #2f2f2f !important;
  border-color: #999 !important;
}

/* Secondary badges */
[data-theme="dark"] .badge.bg-secondary {
  background-color: #555 !important;
  color: #fff !important;
}

/* Table fixes */
[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
  color: #ffffff !important;
  border-color: #404040 !important;
}

/* Form controls */
[data-theme="dark"] .form-control {
  background-color: #3a3a3a !important;
  border-color: #555555 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .form-control::placeholder {
  color: #b0b0b0 !important;
}

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

/* Alert fixes */
[data-theme="dark"] .alert {
  color: inherit !important;
}

/* User menu text */
[data-theme="dark"] .user-menu {
  color: #ffffff !important;
}

/* Links that should remain colored */
[data-theme="dark"] .text-gradient {
  background: linear-gradient(45deg, #ff0d00, #3898ec);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Important: Override any remaining black text */
[data-theme="dark"] *:not(.text-gradient):not(.btn):not(.alert-success):not(.alert-error):not(.alert-warning):not(.alert-info) {
  color: #ffffff !important;
}

/* Exception for muted text */
[data-theme="dark"] .text-muted,
[data-theme="dark"] .welcome-text,
[data-theme="dark"] .card .text-muted {
  color: #b0b0b0 !important;
}

/* Exception for buttons - keep their intended colors */
[data-theme="dark"] .btn,
[data-theme="dark"] .btn * {
  color: inherit !important;
}

/* Exception for gradients and special colored text */
[data-theme="dark"] .text-gradient {
  color: transparent !important;
}

/* Main content background */
[data-theme="dark"] .main-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
}

/* Ensure readability on all nested elements */
[data-theme="dark"] .container-fluid > *,
[data-theme="dark"] .row > *,
[data-theme="dark"] .col-* {
  color: #ffffff !important;
}
