/**
 * Site-wide light mode text contrast
 *
 * Eduport sets --bs-secondary-color to #cfd3d7, so .text-muted /
 * .text-body-secondary (and anything using that token) disappear on white.
 * Tokens are restored on dark surfaces (footer, solid fills) so gray-on-dark
 * stays readable.
 */

html[data-bs-theme="light"] {
    --bs-body-color: #334155;
    --bs-body-color-rgb: 51, 65, 85;
    --bs-secondary-color: #475569;
    --bs-secondary-color-rgb: 71, 85, 105;
    --bs-tertiary-color: #64748b;
    --bs-heading-color: #0f172a;
    --bs-emphasis-color: #0f172a;
    --bs-emphasis-color-rgb: 15, 23, 42;
    --bs-link-color: var(--bs-primary-text-emphasis) !important;
    --bs-link-hover-color: #052c56 !important;
}

/* Dark / saturated surfaces keep light muted text */
html[data-bs-theme="light"] .bg-dark,
html[data-bs-theme="light"] .bg-black,
html[data-bs-theme="light"] .bg-dark-blue,
html[data-bs-theme="light"] .navbar-dark,
html[data-bs-theme="light"] footer.bg-dark,
html[data-bs-theme="light"] .bg-grad-pink,
html[data-bs-theme="light"] .bg-grad-blue,
html[data-bs-theme="light"] .bg-primary:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25),
html[data-bs-theme="light"] .text-bg-dark,
html[data-bs-theme="light"] .text-bg-primary,
html[data-bs-theme="light"] .card.bg-dark,
html[data-bs-theme="light"] .card.text-white {
    --bs-secondary-color: #cbd5e1;
    --bs-secondary-color-rgb: 203, 213, 225;
    --bs-body-color: #e2e8f0;
    --bs-heading-color: #fff;
    --bs-emphasis-color: #fff;
}

html[data-bs-theme="light"] .text-muted,
html[data-bs-theme="light"] .text-body-secondary,
html[data-bs-theme="light"] .text-secondary,
html[data-bs-theme="light"] .text-body-tertiary {
    color: var(--bs-secondary-color) !important;
}

html[data-bs-theme="light"] .text-muted.opacity-50,
html[data-bs-theme="light"] .text-muted.opacity-75 {
    opacity: 1 !important;
    color: #64748b !important;
}

html[data-bs-theme="light"] .bg-dark .text-muted.opacity-50,
html[data-bs-theme="light"] .bg-dark .text-muted.opacity-75,
html[data-bs-theme="light"] footer.bg-dark .text-muted.opacity-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

html[data-bs-theme="light"] .text-secondary-emphasis {
    color: #475569 !important;
}

html[data-bs-theme="light"] .bg-dark .text-secondary-emphasis,
html[data-bs-theme="light"] footer.bg-dark .text-secondary-emphasis {
    color: #cbd5e1 !important;
}

html[data-bs-theme="light"] .text-dark {
    color: #0f172a !important;
}

html[data-bs-theme="light"] .text-dark-emphasis {
    color: #1e293b !important;
}

/* Primary text: use the darker emphasis tone (neon #19f032 fails on white) */
html[data-bs-theme="light"] .text-primary:not(.btn):not(.badge) {
    color: var(--bs-primary-text-emphasis, #044a8d) !important;
}

html[data-bs-theme="light"] .btn-primary-soft:not(:hover):not(:focus):not(.active) {
    color: var(--bs-primary-text-emphasis, #044a8d);
}

html[data-bs-theme="light"] .badge.bg-primary.bg-opacity-10,
html[data-bs-theme="light"] .badge.bg-primary.bg-opacity-15 {
    color: var(--bs-primary-text-emphasis, #044a8d) !important;
}

html[data-bs-theme="light"] .navbar:not(.navbar-dark):not([data-bs-theme="dark"]) {
    --bs-navbar-color: #334155;
    --bs-navbar-hover-color: var(--bs-primary-text-emphasis, #044a8d);
    --bs-navbar-active-color: var(--bs-primary-text-emphasis, #044a8d);
}

html[data-bs-theme="light"] .form-label,
html[data-bs-theme="light"] .col-form-label {
    color: #1e293b;
}

html[data-bs-theme="light"] .form-control,
html[data-bs-theme="light"] .form-select {
    color: #0f172a;
}

html[data-bs-theme="light"] .form-control::placeholder,
html[data-bs-theme="light"] .form-control::-webkit-input-placeholder,
html[data-bs-theme="light"] textarea::placeholder {
    color: #64748b;
    opacity: 1;
}

html[data-bs-theme="light"] .form-text,
html[data-bs-theme="light"] .form-check-label {
    color: #475569;
}

html[data-bs-theme="light"] .dropdown-item {
    color: #1e293b;
}

html[data-bs-theme="light"] .dropdown-item:hover,
html[data-bs-theme="light"] .dropdown-item:focus {
    color: #0f172a;
}

html[data-bs-theme="light"] .breadcrumb-item.active {
    color: #334155;
}

html[data-bs-theme="light"] .pagination .page-link {
    color: #334155;
}

html[data-bs-theme="light"] .list-group-item {
    color: #1e293b;
}

html[data-bs-theme="light"] .table {
    --bs-table-color: #1e293b;
    color: #1e293b;
}

html[data-bs-theme="light"] .alert-info {
    color: #0c4a6e;
}

html[data-bs-theme="light"] .alert-warning {
    color: #78350f;
}

html[data-bs-theme="light"] .paragraph-text {
    color: #334155;
}

html[data-bs-theme="light"] .lead {
    color: #334155;
}

html[data-bs-theme="light"] .text-primary-hover a,
html[data-bs-theme="light"] a.text-primary-hover,
html[data-bs-theme="light"] button.text-primary-hover,
html[data-bs-theme="light"] .text-primary-hover li {
    color: #475569;
}

html[data-bs-theme="light"] .bg-dark .text-primary-hover a,
html[data-bs-theme="light"] footer.bg-dark .text-primary-hover a,
html[data-bs-theme="light"] footer.bg-dark a.text-primary-hover,
html[data-bs-theme="light"] footer.bg-dark .text-primary-hover li {
    color: #cbd5e1;
}

/* Footer / dark nav links stay light */
html[data-bs-theme="light"] footer.bg-dark .nav-link,
html[data-bs-theme="light"] .bg-dark .nav-link,
html[data-bs-theme="light"] .nav-pills-white-soft .nav-link {
    color: rgba(255, 255, 255, 0.78);
}

html[data-bs-theme="light"] footer.bg-dark .nav-link:hover,
html[data-bs-theme="light"] .bg-dark .nav-link:hover,
html[data-bs-theme="light"] .nav-pills-white-soft .nav-link:hover {
    color: #fff;
}

/* Solid primary buttons keep white labels */
html[data-bs-theme="light"] .btn-primary,
html[data-bs-theme="light"] .btn-success,
html[data-bs-theme="light"] .btn-danger,
html[data-bs-theme="light"] .btn-info,
html[data-bs-theme="light"] .btn-dark,
html[data-bs-theme="light"] .btn-secondary,
html[data-bs-theme="light"] .badge.bg-primary:not(.bg-opacity-10):not(.bg-opacity-15),
html[data-bs-theme="light"] .badge.bg-success:not(.bg-opacity-10),
html[data-bs-theme="light"] .badge.bg-danger:not(.bg-opacity-10),
html[data-bs-theme="light"] .badge.bg-dark {
    color: #fff !important;
}

html[data-bs-theme="light"] .btn-primary-soft:hover,
html[data-bs-theme="light"] .btn-primary-soft:focus,
html[data-bs-theme="light"] .btn-primary-soft.active {
    color: #fff !important;
}

html[data-bs-theme="light"] .btn-outline-primary {
    --bs-btn-color: var(--bs-primary-text-emphasis, #044a8d);
    --bs-btn-border-color: var(--bs-primary-text-emphasis, #044a8d);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary-text-emphasis, #044a8d);
    --bs-btn-hover-border-color: var(--bs-primary-text-emphasis, #044a8d);
}

/* Course cards already have per-element rules; keep titles dark */
html[data-bs-theme="light"] .ddt-course-card {
    color: #334155;
}
