/* ===== MODERN TYPOGRAPHY SYSTEM ===== */
/* Tokenised for dark mode support — uses design-tokens.css custom properties */

/* Modern Text Colors - WCAG AA compliant */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--gray-500) !important; }

/* Bootstrap text color overrides */
.text-gray-800 { color: var(--text-primary) !important; }
.text-gray-600 { color: var(--text-muted) !important; }

/* Card text specifically */
.card-text { color: var(--text-muted) !important; }
.card-body p { color: var(--text-muted) !important; }
.card-body .small,
.card-body small { color: var(--text-muted) !important; }

/* Small text elements */
.small, small { color: var(--text-muted) !important; }
.form-text { color: var(--text-muted) !important; }

/* Page Headers */
.page-header h1,
.page-header h2,
.page-header h3 {
  color: var(--text-secondary) !important;
  font-weight: 600;
}

.page-header p,
.page-header .subtitle {
  color: var(--gray-500) !important;
  font-weight: 400;
}

/* Card Content - only apply to card body, not colored headers */
.card-body h1, .card-body h2, .card-body h3, .card-body h4, .card-body h5, .card-body h6 {
  color: var(--text-secondary) !important;
}

.card-body p,
.card-body .text-secondary {
  color: var(--text-muted) !important;
}

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

/* Preserve white text on colored backgrounds */
.text-white { color: #ffffff !important; }
.bg-primary .font-weight-bold,
.bg-success .font-weight-bold,
.bg-warning .font-weight-bold,
.bg-danger .font-weight-bold,
.bg-info .font-weight-bold,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-success h1, .bg-success h2, .bg-success h3, .bg-success h4, .bg-success h5, .bg-success h6,
.bg-danger h1, .bg-danger h2, .bg-danger h3, .bg-danger h4, .bg-danger h5, .bg-danger h6,
.bg-info h1, .bg-info h2, .bg-info h3, .bg-info h4, .bg-info h5, .bg-info h6 {
  color: #ffffff !important;
}

/* Warning bg needs dark text for contrast */
.bg-warning h1, .bg-warning h2, .bg-warning h3, .bg-warning h4, .bg-warning h5, .bg-warning h6,
.bg-warning .font-weight-bold {
  color: var(--text-inverse) !important;
}

/* Table Content */
.table th {
  color: var(--text-secondary) !important;
  font-weight: 600;
}

.table td {
  color: var(--gray-500) !important;
}

/* Form Labels */
.form-label,
label {
  color: var(--text-secondary) !important;
  font-weight: 500;
}

/* Button Text */
.btn {
  font-weight: 500;
}

/* Badge Text */
.badge {
  font-weight: 500;
}

/* Modal Headers - Default text for light backgrounds */
.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header .modal-title {
  color: var(--text-secondary);
}

/* Modal Headers with colored/gradient backgrounds need white text */
.modal .modal-header[style*="background"],
.modal-header.bg-primary,
.modal-header.bg-purple,
.modal-header.bg-success,
.modal-header.bg-danger,
.modal-header.bg-warning,
.modal-header.bg-info,
.custom-modal .modal-header,
.modern-modal-header {
  color: white !important;
}

.modal .modal-header[style*="background"] h1,
.modal .modal-header[style*="background"] h2,
.modal .modal-header[style*="background"] h3,
.modal .modal-header[style*="background"] h4,
.modal .modal-header[style*="background"] h5,
.modal .modal-header[style*="background"] .modal-title,
.modal-header.bg-primary h1,
.modal-header.bg-primary h2,
.modal-header.bg-primary h3,
.modal-header.bg-primary h4,
.modal-header.bg-primary h5,
.modal-header.bg-primary .modal-title,
.modal-header.bg-purple h1,
.modal-header.bg-purple h2,
.modal-header.bg-purple h3,
.modal-header.bg-purple h4,
.modal-header.bg-purple h5,
.modal-header.bg-purple .modal-title,
.custom-modal .modal-header h1,
.custom-modal .modal-header h2,
.custom-modal .modal-header h3,
.custom-modal .modal-header h4,
.custom-modal .modal-header h5,
.custom-modal .modal-header .modal-title,
.modern-modal-header h1,
.modern-modal-header h2,
.modern-modal-header h3,
.modern-modal-header h4,
.modern-modal-header h5,
.modern-modal-header .modal-title {
  color: white !important;
}

/* List Items */
.list-group-item {
  color: var(--gray-500) !important;
}

.list-group-item h1,
.list-group-item h2,
.list-group-item h3,
.list-group-item h4,
.list-group-item h5,
.list-group-item h6 {
  color: var(--text-secondary) !important;
}

/* Alert Content */
.alert {
  color: var(--text-secondary) !important;
}

/* Navigation Breadcrumbs */
.breadcrumb-item {
  color: var(--text-muted) !important;
}

.breadcrumb-item.active {
  color: var(--text-secondary) !important;
}

/* Footer Text */
.footer-content {
  color: var(--gray-500) !important;
}

.footer-content h4 {
  color: var(--text-secondary) !important;
}
