/* 
 * LoftInspectorPro Centralized Theme System
 * This file provides consistent theming across all applications
 * Theme colors are dynamically loaded from company settings
 */

/* CSS Custom Properties for Dynamic Theming */
:root {
    /* Default theme colors - will be overridden by JavaScript */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --primary-rgb: 102, 126, 234;
    --secondary-rgb: 118, 75, 162;
    
    /* Gradient backgrounds */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-dark: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(var(--primary-rgb), 0.95));
    --gradient-light: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.1));
    
    /* Semantic colors */
    --background-primary: var(--gradient-dark);
    --background-card: rgba(255, 255, 255, 0.15);
    --background-card-hover: rgba(255, 255, 255, 0.25);
    --text-primary: white;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.2);
    --border-color-hover: rgba(255, 255, 255, 0.4);
    
    /* Shadows */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
}

/* Base styles that apply to all pages */
body {
    background: var(--background-primary) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-family) !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

html {
    background: var(--background-primary) !important;
}

/* Universal text color fixes - override all gray/muted text */
p, span, div, td, th, li, label, small, .text-muted, .text-secondary {
    color: var(--text-secondary) !important;
}

h1, h2, h3, h4, h5, h6, .text-primary, strong, b {
    color: var(--text-primary) !important;
}

/* Fix Bootstrap's muted text classes */
.text-muted {
    color: var(--text-muted) !important;
}

/* Fix any remaining gray text */
.text-gray, .text-gray-600, .text-gray-700, .text-gray-800 {
    color: var(--text-secondary) !important;
}

/* Ensure links are visible */
a {
    color: var(--primary-color) !important;
}

a:hover {
    color: var(--secondary-color) !important;
}

/* Comprehensive text contrast fixes */
.card-text, .card-body p, .card-body span,
.list-group-item, .dropdown-item,
.form-text, .help-text, .description,
.subtitle, .meta, .info {
    color: var(--text-secondary) !important;
}

/* Fix input placeholders */
input::placeholder, textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Fix table text */
.table td, .table th {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.table th {
    color: var(--text-primary) !important;
}

/* Fix any hardcoded gray colors */
[style*="color: #666"], [style*="color: #777"], [style*="color: #888"],
[style*="color: #999"], [style*="color: #aaa"], [style*="color: #6c757d"] {
    color: var(--text-secondary) !important;
}

/* Universal app compatibility - override common patterns */
.container, .container-fluid, .row, .col,
.main-content, .content, .wrapper,
.app-container, .page-content {
    color: inherit !important;
}

/* Ensure all text elements inherit proper colors */
* {
    color: inherit;
}

/* But override specific elements that need theme colors */
body * {
    color: var(--text-secondary);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
}

/* Universal status badges and indicators - fix contrast issues */
.badge, .status-badge, .status-indicator, .outcome-badge,
[class*="status-"], [class*="outcome-"], [class*="badge-"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color-hover) !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: var(--shadow-light) !important;
}

/* Travel indicators and similar small badges */
.travel-indicator, .travel-badge, .travel-from-home, .travel-from-previous, .travel-to-home,
[class*="travel-"], [class*="from-"], [class*="to-"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color-hover) !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 500 !important;
    font-size: 0.7rem !important;
    backdrop-filter: blur(10px) !important;
    margin: 2px !important;
}

/* Specific status colors with good contrast */
.status-scheduled, [class*="scheduled"] {
    background: linear-gradient(135deg, rgba(251, 188, 5, 0.2), rgba(251, 188, 5, 0.3)) !important;
    color: #fff !important;
    border-color: rgba(251, 188, 5, 0.5) !important;
}

.status-completed, [class*="completed"] {
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.2), rgba(52, 168, 83, 0.3)) !important;
    color: #fff !important;
    border-color: rgba(52, 168, 83, 0.5) !important;
}

.status-in-progress, [class*="progress"] {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(66, 133, 244, 0.3)) !important;
    color: #fff !important;
    border-color: rgba(66, 133, 244, 0.5) !important;
}

.status-cancelled, [class*="cancelled"] {
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.2), rgba(234, 67, 53, 0.3)) !important;
    color: #fff !important;
    border-color: rgba(234, 67, 53, 0.5) !important;
}

/* Keep semantic colors but ensure they're visible */
[class*="text-success"], [class*="text-danger"], [class*="text-warning"], [class*="text-info"] {
    color: inherit !important;
}

/* AGGRESSIVE: Fix ALL light colored backgrounds that cause contrast issues */
[style*="background-color: #e8f0fe"], [style*="background-color: #f1f3f4"],
[style*="background-color: #fef6e0"], [style*="background-color: #fff3cd"],
[style*="background: #e8f0fe"], [style*="background: #f1f3f4"],
[style*="background: #fef6e0"], [style*="background: #fff3cd"],
[style*="background-color: #e9ecef"], [style*="background-color: #f8f9fa"],
[style*="background-color: #f5f5f5"], [style*="background-color: #eeeeee"],
[style*="background-color: #e0e0e0"], [style*="background-color: #d0d0d0"],
[style*="background: #e9ecef"], [style*="background: #f8f9fa"],
[style*="background: #f5f5f5"], [style*="background: #eeeeee"],
[style*="background: #e0e0e0"], [style*="background: #d0d0d0"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color-hover) !important;
}

/* NUCLEAR OPTION: Override any element with light gray RGB values */
[style*="background-color: rgb(248, 249, 250)"], [style*="background-color: rgb(241, 243, 244)"],
[style*="background-color: rgb(232, 240, 254)"], [style*="background-color: rgb(254, 246, 224)"],
[style*="background-color: rgb(233, 236, 239)"], [style*="background-color: rgb(245, 245, 245)"],
[style*="background: rgb(248, 249, 250)"], [style*="background: rgb(241, 243, 244)"],
[style*="background: rgb(232, 240, 254)"], [style*="background: rgb(254, 246, 224)"],
[style*="background: rgb(233, 236, 239)"], [style*="background: rgb(245, 245, 245)"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color-hover) !important;
}

/* Universal small text indicators */
.label, .tag, .chip, .pill, .indicator,
.outcome, .result, .type, .category,
[class*="label-"], [class*="tag-"], [class*="chip-"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 2px 8px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
    margin: 1px !important;
    backdrop-filter: blur(10px) !important;
}

/* Distance/mileage indicators */
.distance, .mileage, .duration, .time-indicator,
[class*="distance-"], [class*="mileage-"], [class*="duration-"] {
    background: var(--background-card) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 2px 6px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.65rem !important;
    font-weight: 400 !important;
}

/* Priority indicators */
.priority, .urgent, .high, .medium, .low,
[class*="priority-"], [class*="urgent"], [class*="high"], [class*="medium"], [class*="low"] {
    background: var(--background-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color-hover) !important;
    padding: 2px 8px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
}

/* Universal empty state styling - fix contrast issues */
.empty-state, .no-data, .no-results, .no-projects, .no-items,
[class*="empty"], [class*="no-data"], [class*="no-results"] {
    background: var(--background-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--spacing-xl) var(--spacing-lg) !important;
    text-align: center !important;
    backdrop-filter: blur(10px) !important;
}

.empty-state h1, .empty-state h2, .empty-state h3, 
.empty-state h4, .empty-state h5, .empty-state h6,
.no-data h1, .no-data h2, .no-data h3, 
.no-data h4, .no-data h5, .no-data h6,
.no-results h1, .no-results h2, .no-results h3,
.no-results h4, .no-results h5, .no-results h6 {
    color: var(--text-primary) !important;
    margin-bottom: var(--spacing-sm) !important;
}

.empty-state p, .empty-state span, .empty-state div,
.no-data p, .no-data span, .no-data div,
.no-results p, .no-results span, .no-results div {
    color: var(--text-secondary) !important;
    margin-bottom: var(--spacing-sm) !important;
}

.empty-state .icon, .empty-state i,
.no-data .icon, .no-data i,
.no-results .icon, .no-results i,
.empty-icon {
    color: var(--text-muted) !important;
    font-size: 3rem !important;
    margin-bottom: var(--spacing-md) !important;
    opacity: 0.7 !important;
}

/* Fix any light gray backgrounds that cause contrast issues */
[style*="background-color: #f9f9f9"], [style*="background-color: #f8f9fa"],
[style*="background-color: #f5f5f5"], [style*="background-color: #fafafa"],
[style*="background: #f9f9f9"], [style*="background: #f8f9fa"],
[style*="background: #f5f5f5"], [style*="background: #fafafa"] {
    background: var(--background-card) !important;
    border: 1px solid var(--border-color) !important;
}

/* Universal message/notification styling */
.message, .notification, .info-box, .alert-info,
.placeholder, .placeholder-text, .loading-text {
    background: var(--background-card) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--spacing-md) !important;
}

/* Calendar/grid empty cells */
.calendar-cell, .grid-cell, .day-cell, .time-slot {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.calendar-cell.empty, .grid-cell.empty, .day-cell.empty {
    background: var(--background-card) !important;
    opacity: 0.7 !important;
}

/* Loading states */
.loading, .spinner, .skeleton {
    background: var(--background-card) !important;
    color: var(--text-secondary) !important;
}

/* Remove rainbow/colored stripes and decorative elements */
body::before, html::before, 
[class*="stripe"], [class*="rainbow"], [class*="decoration"],
*[style*="linear-gradient(to right, #4285f4"], 
*[style*="background: linear-gradient(to right, #4285f4"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
}

/* Remove any top decorative bars */
.top-bar, .header-stripe, .decoration-bar,
*[style*="height: 5px"][style*="linear-gradient"],
*[style*="height: 3px"][style*="linear-gradient"],
*[style*="height: 2px"][style*="linear-gradient"] {
    display: none !important;
}

/* Universal card styling */
.theme-card, .card, .option-button, .app-card {
    background: var(--background-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-medium) !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
}

.theme-card:hover, .card:hover, .option-button:hover, .app-card:hover {
    background: var(--background-card-hover) !important;
    border-color: var(--border-color-hover) !important;
    box-shadow: var(--shadow-heavy) !important;
    transform: translateY(-2px) !important;
}

/* Universal button styling */
.theme-btn, .btn-primary, .primary-button {
    background: var(--gradient-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: white !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.theme-btn:hover, .btn-primary:hover, .primary-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-medium) !important;
    opacity: 0.9 !important;
}

/* Universal header styling */
.theme-header, .app-header, .minimal-header {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-medium) !important;
    color: var(--text-primary) !important;
}

/* Universal form styling */
.theme-input, .form-control, .form-select {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
}

.theme-input:focus, .form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2) !important;
    outline: none !important;
}

/* Fix dropdown option visibility */
.form-select option {
    background: #1a1a1a !important;
    color: white !important;
    padding: 8px !important;
}

.form-select option:hover,
.form-select option:focus,
.form-select option:checked {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Fix project tile text visibility */
.project-tile .project-travel,
.project-tile .project-travel span,
.project-tile .project-travel .travel-origin,
.project-tile .project-travel .travel-from-previous,
.project-tile .project-return-trip,
.project-tile .project-outcome {
    color: var(--text-secondary) !important;
}

.project-tile .project-travel i,
.project-tile .project-return-trip i,
.project-tile .project-outcome i {
    color: var(--text-muted) !important;
    margin-right: 4px !important;
}

/* Ensure project info text is visible */
.project-tile .project-info p,
.project-tile .project-info span,
.project-tile .project-time,
.project-tile .project-address,
.project-tile .project-phone {
    color: var(--text-secondary) !important;
}

/* Fix text-muted visibility in project tiles */
.project-tile .text-muted {
    color: var(--text-muted) !important;
}

/* Override hardcoded colors in project tiles */
.project-tile h3 {
    color: var(--text-primary) !important;
}

.project-tile .project-travel {
    color: var(--text-secondary) !important;
    border-top-color: var(--border-color) !important;
}

.project-tile .project-travel span {
    color: var(--text-secondary) !important;
}

.project-tile .project-travel i {
    color: var(--primary-color) !important;
}

/* Fix any remaining hardcoded text colors */
.project-tile * {
    color: inherit !important;
}

.project-tile {
    color: var(--text-primary) !important;
}

/* CONTRAST AUDIT: High-visibility fixes for low contrast elements */

/* Fix small text that's hard to read */
.small, .text-small, small {
    color: var(--text-secondary) !important;
    font-weight: 500 !important; /* Add weight for better visibility */
}

/* Fix muted text combinations that are too low contrast */
.text-muted.small, .small.text-muted,
.text-muted small, small.text-muted {
    color: var(--text-secondary) !important; /* Use secondary instead of muted for small text */
    font-weight: 500 !important;
}

/* Specific fix for project travel spans without explicit classes */
.project-tile .project-travel span:not([class]) {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

/* Fix any span inside project-travel that might be low contrast */
.project-travel span {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

/* Ensure distance and time text is highly visible */
.project-travel span:contains('mi'),
.project-travel span:contains('min'),
[class*="distance"], [class*="mileage"], [class*="duration"] {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* Fix any remaining low contrast issues */
.text-gray-400, .text-gray-500, .text-gray-600 {
    color: var(--text-secondary) !important;
}

/* Override any inline styles that might cause low contrast */
[style*="color: rgba(255, 255, 255, 0.7)"],
[style*="color: rgba(255, 255, 255, 0.6)"],
[style*="color: rgba(255, 255, 255, 0.5)"] {
    color: var(--text-secondary) !important;
}

/* COMPREHENSIVE CONTRAST AUDIT SYSTEM */

/* Ensure all potentially problematic elements have good contrast */
.opacity-75, .opacity-70, .opacity-60, .opacity-50 {
    opacity: 0.9 !important; /* Increase opacity for better visibility */
}

/* Fix any elements that might be using low-opacity colors */
*[style*="opacity: 0.7"], *[style*="opacity: 0.6"], *[style*="opacity: 0.5"] {
    opacity: 0.9 !important;
}

/* Ensure all text in cards and containers is visible */
.card *, .container *, .row *, .col * {
    color: inherit;
}

/* Fix any remaining Bootstrap utility classes that might cause issues */
.text-black-50, .text-white-50 {
    color: var(--text-secondary) !important;
}

/* Ensure all icons are visible */
i, .fa, .fas, .far, .fab, .fal {
    color: inherit;
}

/* Fix any CSS that might be setting low contrast programmatically */
*:not(.btn):not(.badge):not(.alert) {
    color: inherit;
}

/* Emergency high-contrast override for critical elements */
.project-tile .project-travel,
.project-tile .project-travel *,
.project-tile .project-return-trip,
.project-tile .project-return-trip *,
.mileage-info, .distance-info, .travel-info {
    color: var(--text-primary) !important; /* Bright white text */
    font-weight: 600 !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8) !important; /* Dark shadow for white text on semi-transparent background */
    background: rgba(0, 0, 0, 0.3) !important; /* Add dark semi-transparent background for better contrast */
    padding: 2px 4px !important;
    border-radius: 3px !important;
    margin: 2px 0 !important;
}

/* Keep project tile with dark theme but fix mileage contrast */
.project-tile {
    background: var(--background-card) !important; /* Keep original dark theme */
    color: var(--text-primary) !important; /* White text */
    border: 1px solid var(--border-color) !important;
}

/* Ensure all project tile text uses proper theme colors */
.project-tile h3,
.project-tile .project-info,
.project-tile .project-info p,
.project-tile .project-info span,
.project-tile .project-time,
.project-tile .project-address,
.project-tile .project-phone {
    color: var(--text-primary) !important; /* Bright white text */
}

/* Make icons visible with theme colors */
.project-tile i {
    color: var(--primary-color) !important;
}

/* Universal table styling */
.theme-table, .table {
    background: var(--background-card) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden !important;
    color: var(--text-primary) !important;
}

.theme-table th, .table th {
    background: rgba(0, 0, 0, 0.2) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.theme-table td, .table td {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.theme-table tr:hover, .table tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Utility classes */
.theme-text-primary { color: var(--text-primary) !important; }
.theme-text-secondary { color: var(--text-secondary) !important; }
.theme-text-muted { color: var(--text-muted) !important; }
.theme-bg-card { background: var(--background-card) !important; }
.theme-bg-primary { background: var(--gradient-primary) !important; }
.theme-border { border: 1px solid var(--border-color) !important; }
.theme-shadow { box-shadow: var(--shadow-medium) !important; }
.theme-radius { border-radius: var(--radius-lg) !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --spacing-md: 12px;
        --spacing-lg: 18px;
        --spacing-xl: 24px;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .theme-card, .card {
        background: white !important;
        border: 1px solid #ddd !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.6);
        --background-card: rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== MODAL STYLING ===== */
/* Bootstrap Modal Overrides */
.modal {
    backdrop-filter: blur(5px) !important;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.modal-content {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid var(--border-color-hover) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(15px) !important;
    color: var(--text-primary) !important;
}

.modal-header {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.modal-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.modal-header .btn-close {
    filter: invert(1) !important;
    opacity: 0.8 !important;
}

.modal-header .btn-close:hover {
    opacity: 1 !important;
}

.modal-body {
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: var(--spacing-lg) !important;
}

.modal-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

/* Modal text elements */
.modal-body p, .modal-body span, .modal-body div, 
.modal-body li, .modal-body label, .modal-body small {
    color: var(--text-secondary) !important;
}

.modal-body h1, .modal-body h2, .modal-body h3, 
.modal-body h4, .modal-body h5, .modal-body h6 {
    color: var(--text-primary) !important;
}

.modal-body .text-muted {
    color: var(--text-muted) !important;
}

.modal-body .text-danger {
    color: #ff6b6b !important;
}

.modal-body .text-success {
    color: #51cf66 !important;
}

.modal-body .text-info {
    color: #74c0fc !important;
}

.modal-body .text-warning {
    color: #ffd43b !important;
}

/* Modal form elements */
.modal-body .form-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
}

.modal-body .form-control:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    color: var(--text-primary) !important;
}

.modal-body .form-control::placeholder {
    color: var(--text-muted) !important;
}

.modal-body .form-label {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

.modal-body .form-check-label {
    color: var(--text-secondary) !important;
}

.modal-body .form-select {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Modal buttons */
.modal-footer .btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 500 !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
}

.modal-footer .btn-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.modal-footer .btn-primary:hover {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.modal-footer .btn-secondary {
    background: var(--background-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
}

/* Specific modal content styling */
.modal-body .list-group-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    margin-bottom: var(--spacing-xs) !important;
    border-radius: var(--radius-sm) !important;
}

.modal-body .table {
    color: var(--text-secondary) !important;
}

.modal-body .table th {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.modal-body .table td {
    border-color: var(--border-color) !important;
}

/* Loading states in modals */
.modal-body .text-center {
    color: var(--text-secondary) !important;
}

/* Qualification modal specific styling */
#projectQualificationModal .modal-body,
#projectQualificationModalBody {
    color: var(--text-secondary) !important;
}

#projectQualificationModal .modal-body p,
#projectQualificationModalBody p {
    color: var(--text-secondary) !important;
    margin-bottom: var(--spacing-sm) !important;
}

#projectQualificationModal .modal-body .text-muted,
#projectQualificationModalBody .text-muted {
    color: var(--text-muted) !important;
}

#projectQualificationModal .modal-body .text-danger,
#projectQualificationModalBody .text-danger {
    color: #ff6b6b !important;
}

/* Any dynamically created content in modals */
.modal-body * {
    color: inherit !important;
}

.modal-body h1, .modal-body h2, .modal-body h3, 
.modal-body h4, .modal-body h5, .modal-body h6,
.modal-body strong, .modal-body b {
    color: var(--text-primary) !important;
}
