/* Dark Theme Text Color Fixes */
/* Ensures no dark text appears on dark backgrounds */

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

/* All headings */
[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: #f1f5f9 !important;
}

/* Page title */
[data-theme="dark"] .page-title {
    color: #f1f5f9 !important;
}

/* Card headers and titles */
[data-theme="dark"] .card-header {
    color: #ffffff !important;
}

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

/* Card body text */
[data-theme="dark"] .card-body {
    color: #f1f5f9 !important;
}

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

/* Labels and form elements */
[data-theme="dark"] label,
[data-theme="dark"] .form-label {
    color: #e2e8f0 !important;
}

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

/* Small text and help text */
[data-theme="dark"] small,
[data-theme="dark"] .small,
[data-theme="dark"] .form-text {
    color: #cbd5e1 !important;
}

/* Breadcrumbs */
[data-theme="dark"] .breadcrumb-item {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .breadcrumb-item a {
    color: #93c5fd !important;
}

[data-theme="dark"] .breadcrumb-item.active {
    color: #e2e8f0 !important;
}

/* List items */
[data-theme="dark"] li {
    color: #e2e8f0 !important;
}

/* Paragraphs */
[data-theme="dark"] p {
    color: #e2e8f0 !important;
}

/* Spans */
[data-theme="dark"] span:not(.badge):not(.btn) {
    color: inherit !important;
}

/* Text muted should be lighter in dark theme */
[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* Text secondary */
[data-theme="dark"] .text-secondary {
    color: #a5b4fc !important;
}

/* Ensure text-dark becomes light in dark theme */
[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

/* Links */
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: #93c5fd !important;
}

[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: #bfdbfe !important;
}

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

/* Dropdown text */
[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .dropdown-item {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* Modal text */
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-body p,
[data-theme="dark"] .modal-body label,
[data-theme="dark"] .modal-body span {
    color: #f1f5f9 !important;
}

/* List group items */
[data-theme="dark"] .list-group-item {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

/* Nav tabs */
[data-theme="dark"] .nav-tabs .nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

/* Pagination */
[data-theme="dark"] .pagination .page-link {
    background-color: #1e293b !important;
    color: #93c5fd !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .pagination .page-link:hover {
    background-color: #334155 !important;
    color: #bfdbfe !important;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: #1e40af !important;
}

/* Input group text */
[data-theme="dark"] .input-group-text {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Stat cards and info boxes */
/* Light theme - use darker colors for better contrast */
[data-theme="light"] .stat-card .stat-value,
[data-theme="light"] .stat-card .stat-label,
[data-theme="light"] .stat-card .stat-icon {
    filter: brightness(0.7) !important;
}

/* Dark theme - keep original bright colors */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .info-box {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .stat-value,
[data-theme="dark"] .stat-label {
    color: inherit !important;
}

/* Definition lists */
[data-theme="dark"] dt,
[data-theme="dark"] dd {
    color: #e2e8f0 !important;
}

/* Code and pre blocks */
[data-theme="dark"] code {
    color: #fca5a5 !important;
    background-color: #334155 !important;
}

[data-theme="dark"] pre {
    color: #f1f5f9 !important;
    background-color: #1e293b !important;
}

/* Blockquotes */
[data-theme="dark"] blockquote {
    color: #cbd5e1 !important;
    border-left-color: #475569 !important;
}

/* HR elements */
[data-theme="dark"] hr {
    border-color: #334155 !important;
    opacity: 1 !important;
}

/* Legend */
[data-theme="dark"] legend {
    color: #f1f5f9 !important;
}

/* Fieldset */
[data-theme="dark"] fieldset {
    border-color: #334155 !important;
}

/* Strong and bold text */
[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: #f1f5f9 !important;
}

/* Emphasis */
[data-theme="dark"] em,
[data-theme="dark"] i:not(.bi) {
    color: #e2e8f0 !important;
}

/* Mark/highlight */
[data-theme="dark"] mark {
    background-color: #fbbf24 !important;
    color: #1e293b !important;
}

/* Address */
[data-theme="dark"] address {
    color: #e2e8f0 !important;
}

/* Figure caption */
[data-theme="dark"] figcaption {
    color: #94a3b8 !important;
}

/* Ensure warning cards have proper text color */
[data-theme="dark"] .bg-warning {
    background-color: #f59e0b !important;
    color: #1e293b !important;
}

[data-theme="dark"] .bg-warning * {
    color: #1e293b !important;
}

/* Ensure info cards have proper text color */
[data-theme="dark"] .bg-info {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

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

/* Ensure success cards have proper text color */
[data-theme="dark"] .bg-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

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

/* Ensure danger cards have proper text color */
[data-theme="dark"] .bg-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

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

/* Ensure primary cards have proper text color */
[data-theme="dark"] .bg-primary {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

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

/* Ensure secondary cards have proper text color */
[data-theme="dark"] .bg-secondary {
    background-color: #64748b !important;
    color: #ffffff !important;
}

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

/* Ensure light cards have dark text */
[data-theme="dark"] .bg-light {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .bg-light * {
    color: #f1f5f9 !important;
}

/* Ensure dark cards have light text (already dark in dark theme) */
[data-theme="dark"] .bg-dark {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

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