/**
 * CONTRAST FIXES — Global Text Visibility Overhaul
 * Ensures all text elements meet WCAG AA standards (4.5:1 contrast ratio)
 * Fixes dark-on-dark visibility issues across all pages
 */

/* === GLOBAL TEXT COLOR OVERRIDES === */
/* Force all text elements to use high-contrast colors */
body, html {
    color: #e7eaf0 !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.heading-xl, .heading-lg, .heading-md, .heading-sm {
    color: #e7eaf0 !important;
}

p, span, div, li, td, th, label {
    color: #e7eaf0 !important;
}

/* === FORM ELEMENTS === */
/* Form labels must be readable */
.form-label {
    color: #e7eaf0 !important;
    font-weight: 600 !important;
}

.form-label.fw-medium {
    color: #e7eaf0 !important;
}

/* Form input placeholder text */
.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
    color: #a7b0c2 !important;
    opacity: 1 !important;
}

/* Form control text */
.form-control,
.form-select {
    color: #e7eaf0 !important;
    background: #1a1f2e !important;
}

.form-control:focus,
.form-select:focus {
    color: #e7eaf0 !important;
}

.form-check-label {
    color: #e7eaf0 !important;
}

.form-text {
    color: #a7b0c2 !important;
}

/* === DROPDOWN/SELECT ELEMENTS === */
/* Fix select dropdown options visibility */
.form-select option {
    background: #1a1f2e !important;
    color: #e7eaf0 !important;
}

.form-select option:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* Modal select dropdowns */
.modal .form-select option {
    background: #1a1f2e !important;
    color: #e7eaf0 !important;
}

/* Activity Hub selects */
.form-select.bg-dark {
    background: #1a1f2e !important;
    color: #e7eaf0 !important;
}

/* === CARD CONTENT === */
.card,
.card * {
    color: #e7eaf0 !important;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.card .h1, .card .h2, .card .h3, .card .h4, .card .h5, .card .h6,
.card .card-title {
    color: #e7eaf0 !important;
}

.card p, .card span, .card div, .card li {
    color: #e7eaf0 !important;
}

.card .text-muted,
.card .small,
.card .caption {
    color: #a7b0c2 !important;
}

.card .small {
    color: #a7b0c2 !important;
}

.card-header {
    color: #e7eaf0 !important;
}

.card-header h5,
.card-header h6 {
    color: #e7eaf0 !important;
}

/* === BUTTON TEXT === */
.btn,
.btn * {
    color: inherit !important;
}

.btn-outline-secondary {
    color: #e7eaf0 !important;
    border-color: #3b3d47 !important;
}

.btn-outline-secondary:hover {
    color: #ffffff !important;
    background: #3b3d47 !important;
}

/* Button text in dark theme */
.btn-dark,
.btn-secondary {
    color: #e7eaf0 !important;
}

/* === TEXT UTILITY CLASSES === */
.text-muted {
    color: #a7b0c2 !important;
}

.text-muted-light {
    color: #a7b0c2 !important;
}

.small,
.caption {
    color: #a7b0c2 !important;
}

/* === BADGES & STATUS INDICATORS === */
.badge,
.badge * {
    color: inherit !important;
}

.badge.bg-dark,
.badge.bg-secondary {
    background: #3b3d47 !important;
    color: #e7eaf0 !important;
}

.badge.bg-info {
    color: #ffffff !important;
}

.badge.bg-warning {
    color: #1a1f2e !important;
}

/* === ALERTS === */
.alert {
    color: #e7eaf0 !important;
}

.alert h1, .alert h2, .alert h3, .alert h4, .alert h5, .alert h6 {
    color: #e7eaf0 !important;
}

.alert p, .alert span, .alert div, .alert li {
    color: #e7eaf0 !important;
}

.alert strong {
    color: #e7eaf0 !important;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #3b82f6 !important;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #22c55e !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

/* === LISTS & LIST GROUPS === */
.list-group-item {
    color: #e7eaf0 !important;
}

.list-group-item * {
    color: #e7eaf0 !important;
}

.list-group-item.text-muted,
.list-group-item .text-muted {
    color: #a7b0c2 !important;
}

.list-unstyled {
    color: #e7eaf0 !important;
}

.list-unstyled * {
    color: #e7eaf0 !important;
}

.list-unstyled strong,
.list-unstyled span,
.list-unstyled li {
    color: #e7eaf0 !important;
}

/* === TABLES === */
.table {
    color: #e7eaf0 !important;
}

.table th {
    color: #e7eaf0 !important;
}

.table td {
    color: #e7eaf0 !important;
}

.table .text-muted {
    color: #a7b0c2 !important;
}

/* === MODALS === */
.modal-header {
    color: #e7eaf0 !important;
}

.modal-title {
    color: #e7eaf0 !important;
}

.modal-body {
    color: #e7eaf0 !important;
}

.modal-body * {
    color: #e7eaf0 !important;
}

.modal-body .text-muted {
    color: #a7b0c2 !important;
}

.modal-body h1, .modal-body h2, .modal-body h3, .modal-body h4, .modal-body h5, .modal-body h6 {
    color: #e7eaf0 !important;
}

.modal-footer {
    color: #e7eaf0 !important;
}

/* === DROPDOWNS === */
.dropdown-menu {
    background: #1a1f2e !important;
}

.dropdown-item {
    color: #e7eaf0 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.15) !important;
}

.dropdown-header {
    color: #a7b0c2 !important;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* === ACTIVITY HUB SPECIFIC FIXES === */
/* Activity Hub heading */
.activity-hub .h2,
.activity-feed .h2 {
    color: #e7eaf0 !important;
}

/* Activity Hub filter buttons */
.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-success {
    color: #e7eaf0 !important;
}

.btn-outline-secondary:not(:hover) {
    color: #e7eaf0 !important;
}

.post-toggle {
    color: #e7eaf0 !important;
}

.post-toggle.active {
    color: #ffffff !important;
}

/* Collab opportunity cards in Activity Hub */
.collab-opportunity-card,
.collab-opportunity-card * {
    color: #e7eaf0 !important;
}

.collab-opportunity-card h4,
.collab-opportunity-card h5,
.collab-opportunity-card h6 {
    color: #e7eaf0 !important;
}

.collab-opportunity-card .text-muted {
    color: #a7b0c2 !important;
}

.collab-opportunity-card .small {
    color: #a7b0c2 !important;
}

/* === DIRECTORY SPECIFIC FIXES === */
/* Directory page text */
.directory-container h1,
.directory-container h2,
.directory-container h3,
.directory-container .form-label {
    color: #e7eaf0 !important;
}

/* Creator cards in directory */
.creator-card,
.creator-card * {
    color: #e7eaf0 !important;
}

.creator-card .card-title {
    color: #e7eaf0 !important;
}

.creator-card .card-text {
    color: #e7eaf0 !important;
}

.creator-card .text-muted {
    color: #a7b0c2 !important;
}

/* Creator stats/metrics */
.creator-stats,
.creator-stats * {
    color: #e7eaf0 !important;
}

.stats-label {
    color: #a7b0c2 !important;
}

.stats-value {
    color: #e7eaf0 !important;
    font-weight: 600 !important;
}

/* === MARKETPLACE SPECIFIC FIXES === */
/* Marketplace page */
.marketplace-container h1,
.marketplace-container h2,
.marketplace-container h3 {
    color: #e7eaf0 !important;
}

/* Opportunity cards */
.opportunity-card,
.opportunity-card * {
    color: #e7eaf0 !important;
}

.opportunity-card .card-title {
    color: #e7eaf0 !important;
}

.opportunity-card .card-text {
    color: #e7eaf0 !important;
}

.opportunity-card .text-muted {
    color: #a7b0c2 !important;
}

/* Filter section in marketplace */
.marketplace-filters {
    color: #e7eaf0 !important;
}

.marketplace-filters .form-label {
    color: #e7eaf0 !important;
}

/* === OPPORTUNITY DETAILS SPECIFIC FIXES === */
/* Opportunity detail page */
.opportunity-detail h1,
.opportunity-detail h2,
.opportunity-detail h3,
.opportunity-detail h4 {
    color: #e7eaf0 !important;
}

.opportunity-detail p {
    color: #e7eaf0 !important;
}

.opportunity-detail .text-muted {
    color: #a7b0c2 !important;
}

/* Deliverables section */
.deliverables-section,
.deliverables-section * {
    color: #e7eaf0 !important;
}

.deliverables-section h4,
.deliverables-section h5 {
    color: #e7eaf0 !important;
}

.deliverables-section p,
.deliverables-section li {
    color: #e7eaf0 !important;
}

/* Requirements section */
.requirements-section,
.requirements-section * {
    color: #e7eaf0 !important;
}

.requirements-section h4,
.requirements-section h5 {
    color: #e7eaf0 !important;
}

.requirements-section p,
.requirements-section li {
    color: #e7eaf0 !important;
}

/* === MY APPLICATIONS SPECIFIC FIXES === */
/* My Applications page */
.my-applications h1,
.my-applications h2,
.my-applications h3 {
    color: #e7eaf0 !important;
}

.application-card,
.application-card * {
    color: #e7eaf0 !important;
}

.application-card .card-title,
.application-card h6 {
    color: #e7eaf0 !important;
}

.application-card .card-text,
.application-card p {
    color: #e7eaf0 !important;
}

.application-card .text-muted,
.application-card .small {
    color: #a7b0c2 !important;
}

/* Opportunity title in applications */
.application-card h6 {
    color: #e7eaf0 !important;
}

/* === BREADCRUMBS & NAVIGATION TEXT === */
.breadcrumb {
    background-color: transparent;
    color: #e7eaf0 !important;
}

.breadcrumb-item {
    color: #e7eaf0 !important;
}

.breadcrumb-item a {
    color: #3b82f6 !important;
}

.breadcrumb-item.active {
    color: #a7b0c2 !important;
}

/* === FILTER & SEARCH AREAS === */
.filter-section,
.search-section {
    color: #e7eaf0 !important;
}

.filter-section h5,
.search-section h5 {
    color: #e7eaf0 !important;
}

.filter-section .form-label,
.search-section .form-label {
    color: #e7eaf0 !important;
}

/* Filter buttons */
.filter-btn {
    color: #e7eaf0 !important;
}

.filter-btn:hover {
    color: #ffffff !important;
}

/* === PROGRESS BARS & METRICS === */
.progress-label {
    color: #e7eaf0 !important;
}

.progress-value {
    color: #e7eaf0 !important;
}

.metric-label {
    color: #a7b0c2 !important;
}

.metric-value {
    color: #e7eaf0 !important;
    font-weight: 600 !important;
}

/* === TOOLTIPS & HELP TEXT === */
.tooltip-inner {
    color: #ffffff !important;
}

.form-text,
.help-text {
    color: #a7b0c2 !important;
}

/* === ACCENTS & SPECIAL STATES === */
/* Inactive/disabled text */
.disabled,
:disabled {
    color: #7a8292 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* === MEDIA QUERIES FOR MOBILE === */
@media (max-width: 768px) {
    h1, h2, h3, h4, h5, h6,
    .h1, .h2, .h3, .h4, .h5, .h6 {
        color: #e7eaf0 !important;
    }

    p, span, div, li {
        color: #e7eaf0 !important;
    }

    .form-label {
        color: #e7eaf0 !important;
    }

    .form-control::placeholder,
    .form-select::placeholder {
        color: #a7b0c2 !important;
    }
}

/* === GLASS-SUBTLE CARD OVERRIDES === */
/* Ensure glass-subtle cards maintain dark backgrounds */
.card.glass-subtle {
    background: #141b2d !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3) !important;
}

.card.glass-subtle .card-body,
.card.glass-subtle .card-title,
.card.glass-subtle h5,
.card.glass-subtle p {
    color: #f1f5f9 !important;
}

.card.glass-subtle .text-muted,
.card.glass-subtle small.text-muted {
    color: #94a3b8 !important;
}

.card.glass-subtle .card-text {
    color: #94a3b8 !important;
}

/* === LEGACY BOOTSTRAP OVERRIDES === */
/* Ensure bootstrap defaults don't override */
.text-light {
    color: #e7eaf0 !important;
}

.text-white {
    color: #ffffff !important;
}

.text-dark {
    color: #1a1f2e !important;
}

/* Ensure we don't have hidden text due to color issues */
[style*="color: #333"],
[style*="color: #444"],
[style*="color: #555"] {
    color: #e7eaf0 !important;
}
