/* Improved Text Contrast & Legibility */

/* Override Bootstrap's text-muted for better contrast */
.text-muted {
    color: #6b7280 !important; /* Improved gray with better contrast ratio */
}

/* Light mode text improvements */
.text-secondary {
    color: #64748b !important; /* Better than default secondary */
}

/* Ensure small muted text is still readable */
.text-muted.small,
small.text-muted {
    color: #64748b !important;
    font-weight: 500;
}

/* Lead text with muted class - slightly better contrast */
.lead.text-muted {
    color: #475569 !important;
    font-weight: 400;
}

/* Dark mode text improvements */
[data-bs-theme="dark"] .text-muted,
.dark-mode .text-muted {
    color: #94a3b8 !important; /* Much better contrast for dark mode */
}

[data-bs-theme="dark"] .text-secondary,
.dark-mode .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-muted.small,
[data-bs-theme="dark"] small.text-muted,
.dark-mode .text-muted.small,
.dark-mode small.text-muted {
    color: #a1a1aa !important;
    font-weight: 500;
}

[data-bs-theme="dark"] .lead.text-muted,
.dark-mode .lead.text-muted {
    color: #cbd5e0 !important;
}

/* Hero section specific muted text improvements */
.hero-section .text-muted {
    color: #475569 !important;
}

[data-bs-theme="dark"] .hero-section .text-muted,
.dark-mode .hero-section .text-muted {
    color: #a0aec0 !important;
}

/* Card and component muted text */
.card .text-muted,
.card-body .text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .card .text-muted,
[data-bs-theme="dark"] .card-body .text-muted,
.dark-mode .card .text-muted,
.dark-mode .card-body .text-muted {
    color: #94a3b8 !important;
}

/* Statistics section muted text */
.statistics-section .text-muted {
    color: #64748b !important;
    font-weight: 500;
}

[data-bs-theme="dark"] .statistics-section .text-muted,
.dark-mode .statistics-section .text-muted {
    color: #a1a1aa !important;
}

/* Navigation and header muted text */
.navbar .text-muted,
.dropdown-menu .text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .navbar .text-muted,
[data-bs-theme="dark"] .dropdown-menu .text-muted,
.dark-mode .navbar .text-muted,
.dark-mode .dropdown-menu .text-muted {
    color: #94a3b8 !important;
}

/* Override any inline styles that might use the old color */
*[style*="#cfd3d7"] {
    color: #64748b !important;
}

[data-bs-theme="dark"] *[style*="#cfd3d7"],
.dark-mode *[style*="#cfd3d7"] {
    color: #94a3b8 !important;
}

/* Ensure proper contrast for specific elements */
.floating-info-card .text-muted,
.feature-tag .text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .floating-info-card .text-muted,
[data-bs-theme="dark"] .feature-tag .text-muted,
.dark-mode .floating-info-card .text-muted,
.dark-mode .feature-tag .text-muted {
    color: #a1a1aa !important;
}

/* Form elements muted text */
.form-label.text-muted,
.form-text.text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .form-label.text-muted,
[data-bs-theme="dark"] .form-text.text-muted,
.dark-mode .form-label.text-muted,
.dark-mode .form-text.text-muted {
    color: #94a3b8 !important;
}

/* Breadcrumb and pagination muted text */
.breadcrumb .text-muted,
.pagination .text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .breadcrumb .text-muted,
[data-bs-theme="dark"] .pagination .text-muted,
.dark-mode .breadcrumb .text-muted,
.dark-mode .pagination .text-muted {
    color: #94a3b8 !important;
}

/* Improved focus states for better accessibility */
.text-muted:focus,
.text-secondary:focus {
    color: #374151 !important;
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

[data-bs-theme="dark"] .text-muted:focus,
[data-bs-theme="dark"] .text-secondary:focus,
.dark-mode .text-muted:focus,
.dark-mode .text-secondary:focus {
    color: #e5e7eb !important;
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* Ensure all Space Grotesk font is maintained */
.text-muted,
.text-secondary {
    font-family: "Space Grotesk", sans-serif !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .text-muted.small,
    small.text-muted {
        color: #374151 !important;
        font-weight: 600;
    }
    
    [data-bs-theme="dark"] .text-muted.small,
    [data-bs-theme="dark"] small.text-muted,
    .dark-mode .text-muted.small,
    .dark-mode small.text-muted {
        color: #d1d5db !important;
        font-weight: 600;
    }
}

/* Print styles */
@media print {
    .text-muted {
        color: #374151 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-muted {
        color: #374151 !important;
        font-weight: 600;
    }
    
    [data-bs-theme="dark"] .text-muted,
    .dark-mode .text-muted {
        color: #f3f4f6 !important;
        font-weight: 600;
    }
}
