/* Contrast Fix for Green Theme #013C28 */

/* High contrast text colors */
:root {
  --text-primary: #1F2937;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --green-primary: #013C28;
  --green-light: #E8F5F0;
  --green-lighter: #F4FAF7;
}

/* Force high contrast for all text elements */
body, 
.container,
.container-fluid,
.row,
.col,
[class*="col-"] {
  color: var(--text-secondary) !important;
}

/* Headings with high contrast */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* Button text contrast */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: white !important;
  background-color: var(--green-primary) !important;
  border-color: var(--green-primary) !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

.btn-light-primary,
.btn-light-primary:hover,
.btn-light-primary:focus,
.btn-light-primary:active {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  border-color: var(--green-light) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* Form elements contrast */
.form-label,
label {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.form-control,
.form-select,
input,
textarea,
select {
  color: var(--text-secondary) !important;
  background-color: white !important;
  border-color: #D1D5DB !important;
}

.form-control:focus,
.form-select:focus {
  color: var(--text-secondary) !important;
  background-color: white !important;
  border-color: var(--green-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(1, 60, 40, 0.25) !important;
}

.form-control::placeholder {
  color: var(--text-light) !important;
  opacity: 1 !important;
}

/* Table contrast */
.table {
  color: var(--text-secondary) !important;
}

.table th {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  background-color: #F9FAFB !important;
}

.table td {
  color: var(--text-secondary) !important;
}

/* Card contrast */
.card {
  color: var(--text-secondary) !important;
}

.card-header {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  background-color: #F9FAFB !important;
}

.card-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* Dropdown contrast */
.dropdown-menu {
  color: var(--text-secondary) !important;
}

.dropdown-item {
  color: var(--text-secondary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
}

.dropdown-item:active,
.dropdown-item.active {
  color: white !important;
  background-color: var(--green-primary) !important;
}

/* Badge contrast */
.badge-primary {
  color: white !important;
  background-color: var(--green-primary) !important;
  font-weight: 500 !important;
}

.badge-light-primary {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  font-weight: 600 !important;
}

/* Navigation contrast */
.nav-link {
  color: var(--text-secondary) !important;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--green-primary) !important;
}

.nav-link.active {
  color: var(--green-primary) !important;
  font-weight: 600 !important;
}

/* Sidebar contrast */
.menu-item .menu-link {
  color: var(--text-secondary) !important;
}

.menu-item.here > .menu-link,
.menu-item.show > .menu-link {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  font-weight: 600 !important;
}

/* Alert contrast */
.alert-primary {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  border-color: var(--green-primary) !important;
}

/* Pagination contrast */
.page-link {
  color: var(--green-primary) !important;
}

.page-link:hover {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  border-color: var(--green-primary) !important;
}

.page-item.active .page-link {
  color: white !important;
  background-color: var(--green-primary) !important;
  border-color: var(--green-primary) !important;
}

/* Switch/Toggle contrast */
.form-switch .form-check-label {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

.form-switch .form-check-input:checked + .form-check-label {
  color: var(--green-primary) !important;
  font-weight: 600 !important;
}

/* Status colors with high contrast */
.text-success {
  color: #059669 !important;
  font-weight: 500 !important;
}

.text-danger {
  color: #DC2626 !important;
  font-weight: 500 !important;
}

.text-warning {
  color: #D97706 !important;
  font-weight: 500 !important;
}

.text-info {
  color: #0284C7 !important;
  font-weight: 500 !important;
}

/* Small text with enhanced contrast */
.fs-7, .fs-8, .fs-9,
.small, small {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

/* Links with high contrast */
a:not(.btn) {
  color: var(--green-primary) !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

a:not(.btn):hover,
a:not(.btn):focus {
  color: #012218 !important;
  text-decoration: underline !important;
}

/* Icon colors */
.svg-icon,
.ki-duotone {
  color: inherit !important;
}

/* Ensure text is visible on all backgrounds */
[style*="background-color: #013C28"],
[style*="background: #013C28"],
.bg-primary {
  color: white !important;
}

[style*="background-color: #E8F5F0"],
[style*="background: #E8F5F0"],
.bg-light-primary {
  color: var(--green-primary) !important;
}

/* Force contrast for dynamic content */
* {
  text-shadow: none !important;
}

/* Ensure readability for all text sizes */
.fs-1, .fs-2, .fs-3, .fs-4, .fs-5, .fs-6 {
  color: var(--text-secondary) !important;
}

/* Special cases for very small text */
.badge, .label, .tag {
  font-weight: 500 !important;
}

/* Ensure dropdown toggle text is visible */
.dropdown-toggle {
  color: var(--green-primary) !important;
  font-weight: 500 !important;
}

.btn-light-primary.dropdown-toggle {
  color: var(--green-primary) !important;
  background-color: var(--green-light) !important;
  font-weight: 600 !important;
}
