/* UI Error Fixes and Improvements */

/* Force light background and dark text everywhere */
body {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* Ensure all card text is readable */
.card {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.card-body {
    background: #ffffff !important;
    color: #1f2937 !important;
}

/* Fix modal text colors */
.modal-body {
    color: #1f2937 !important;
}

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

/* Fix form labels in modals */
.modal .form-label {
    color: #1f2937 !important;
}

.modal .form-check-label {
    color: #1f2937 !important;
}

/* Fix export modal button text */
.export-format-btn,
.filter-option-btn,
.field-toggle-btn {
    color: #1f2937 !important;
}

.export-format-btn span,
.filter-option-btn span,
.field-toggle-btn span {
    color: #1f2937 !important;
}

/* Fix compact cards text */
.compact-header-card,
.compact-filter-card {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.compact-header-card h4 {
    color: #1f2937 !important;
}

/* Fix stats card text */
.stats-card {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.stats-card h3 {
    color: #1f2937 !important;
}

/* Fix page header */
.page-header {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.page-header h2 {
    color: #1f2937 !important;
}

/* Fix sidebar - keep white */
.sidebar,
.sidebar * {
    color: #ffffff !important;
}

.nav-item {
    color: #e2e8f0 !important;
}

/* Fix button text visibility */
.btn {
    color: #ffffff !important;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-secondary {
    color: #ffffff !important;
}

/* Fix outline buttons */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger {
    color: #1f2937 !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
    color: #ffffff !important;
}

/* Fix table header */
.table thead th {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    color: #ffffff !important;
}

.table-container {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

.table tbody tr {
    background: #ffffff !important;
    color: #1f2937 !important;
}

/* Fix empty state */
.empty-state {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.empty-state h3 {
    color: #1f2937 !important;
}

/* Fix alert text */
.alert {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

/* Fix small text */
small {
    color: #6b7280 !important;
}

/* Fix text utilities */
.text-muted {
    color: #6b7280 !important;
}

/* Fix card headers - keep white */
.card-header {
    color: #ffffff !important;
}

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

/* Fix input placeholders */
input::placeholder,
textarea::placeholder {
    color: #9ca3af !important;
}

/* Fix form controls */
.form-control,
.form-select {
    color: #1f2937 !important;
    background: #ffffff !important;
}

/* Fix checkboxes and radios labels */
.form-check-label {
    color: #1f2937 !important;
}

/* Fix field selector */
.field-selector {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.field-selector .form-check-label {
    color: #1f2937 !important;
}

/* Fix error filter buttons */
.error-filter-btn {
    color: #1f2937 !important;
    background: #fef3c7 !important;
    border-color: #fbbf24 !important;
}

/* Fix compact stat labels */
.stat-label {
    color: #6b7280 !important;
}

/* Fix links */
a {
    color: #2563eb !important;
}

a:hover {
    color: #1d4ed8 !important;
}

/* Fix dropdown menus */
.dropdown-menu {
    background: #ffffff !important;
    color: #1f2937 !important;
}

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

/* Ensure icons are visible */
i {
    opacity: 1 !important;
}

/* Fix modal backgrounds */
.modal-content {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.modal-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    border-bottom: none !important;
}

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

.modal-body {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.modal-footer {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Fix export modal specific issues */
#exportModal .modal-body {
    background: #ffffff !important;
}

#exportModal .form-label {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

/* Fix active states */
.filter-option-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
}

.field-toggle-btn.active {
    background: #22c55e !important;
    color: #ffffff !important;
}

/* Fix search input */
#searchInput {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
}

.input-group-text {
    background: #f9fafb !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
}

/* Fix button groups */
.btn-group .btn {
    color: #1f2937 !important;
}

.btn-group .btn.active {
    color: #ffffff !important;
}

/* Fix badges */
.badge {
    color: #ffffff !important;
}

/* Fix status badges in validation table */
.status-badge {
    color: inherit !important;
}

.status-badge.status-valid {
    color: #166534 !important;
}

.status-badge.status-invalid {
    color: #991b1b !important;
}

/* Force main content area to be light */
.main-content {
    background: #f3f4f6 !important;
}

.content-wrapper {
    background: transparent !important;
}

/* Override any dark backgrounds */
.app-wrapper {
    background: #f3f4f6 !important;
}

/* Fix compact stats */
.compact-stat {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.stat-value {
    color: #2563eb !important;
}

.compact-stat.success .stat-value {
    color: #22c55e !important;
}

.compact-stat.danger .stat-value {
    color: #ef4444 !important;
}
