/* Global Text Contrast Fix for WCAG AA Accessibility */
/* This file ensures all text meets minimum contrast standards */

/* ========================================
   UNIVERSAL CONTRAST RULES
   ======================================== */

/* Rule 1: Dark text on ALL light backgrounds */
body,
.bg-white,
.bg-light,
.bg-secondary,
.bg-info,
.bg-warning,
.card,
.alert-light,
.alert-info,
.alert-warning,
[style*="background: white"],
[style*="background: #fff"],
[style*="background: #f"],
[style*="background-color: white"],
[style*="background-color: #fff"],
[style*="background-color: #f"],
[style*="background: linear-gradient(135deg, #f"] {
    color: #000000 !important;
}

/* All text elements on light backgrounds must be dark */
.bg-white p,
.bg-white h1,
.bg-white h2,
.bg-white h3,
.bg-white h4,
.bg-white h5,
.bg-white h6,
.bg-white .lead,
.bg-white span,
.bg-white div,
.bg-light p,
.bg-light h1,
.bg-light h2,
.bg-light h3,
.bg-light h4,
.bg-light h5,
.bg-light h6,
.bg-light .lead,
.bg-light span,
.bg-light div,
.card p,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card .lead,
.card span,
.card-body *:not(.btn):not(a) {
    color: #000000 !important;
}

/* Rule 2: White text on ALL dark backgrounds */
.bg-primary,
.bg-dark,
.bg-danger,
.bg-success,
.page-header,
.navbar-dark,
[style*="background: #2563eb"],
[style*="background: #1e40af"],
[style*="background: linear-gradient(135deg, #1e40af"],
[style*="background: linear-gradient(135deg, #2563eb"],
[style*="background-color: #0"],
[style*="background-color: #1"],
[style*="background-color: #2"] {
    color: #ffffff !important;
}

/* All text elements on dark backgrounds must be white */
.bg-primary p,
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6,
.bg-primary .lead,
.bg-primary span,
.bg-primary div,
.bg-dark p,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-dark .lead,
.bg-dark span,
.bg-dark div {
    color: #ffffff !important;
}

/* ========================================
   BOOTSTRAP UTILITY CLASS OVERRIDES
   ======================================== */

/* Bootstrap text utilities - force proper contrast */
.text-muted {
    color: #000000 !important;
}

.text-secondary {
    color: #000000 !important;
}

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

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

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

/* Only use text-primary on light backgrounds */
.text-primary {
    color: #1e40af !important;
}

/* ========================================
   TYPOGRAPHY CLASSES
   ======================================== */

/* Paragraph text */
p {
    color: #000000 !important;
}

/* Override for dark backgrounds */
.bg-primary p,
.bg-dark p,
.page-header p,
[style*="background: #2563eb"] p,
[style*="background: #1e40af"] p {
    color: #ffffff !important;
}

/* Lead text */
.lead {
    color: #000000 !important;
}

.bg-primary .lead,
.bg-dark .lead,
.page-header .lead {
    color: #ffffff !important;
}

/* Small text */
small,
.small {
    color: #000000 !important;
}

.bg-primary small,
.bg-dark small {
    color: #ffffff !important;
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

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

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

.card-subtitle {
    color: #000000 !important;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-label {
    color: #000000 !important;
    font-weight: 600;
}

.form-control {
    color: #000000 !important;
    background-color: #ffffff !important;
}

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

.form-control::placeholder {
    color: #666666 !important;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-link {
    color: #000000 !important;
}

.nav-link:hover {
    color: #1e40af !important;
}

.navbar-light .nav-link {
    color: #000000 !important;
}

.navbar-dark .nav-link {
    color: #ffffff !important;
}

/* ========================================
   BUTTONS
   ======================================== */

/* Primary buttons - white text on dark background */
.btn-primary {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
}

/* Secondary buttons - dark text on light background */
.btn-secondary {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.btn-outline-primary {
    color: #1e40af !important;
    border-color: #1e40af !important;
}

.btn-outline-primary:hover {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

/* Warning/CTA buttons */
.btn-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

.btn-warning:hover {
    background-color: #b45309 !important;
    color: #ffffff !important;
}

/* ========================================
   HERO SECTION SPECIFIC
   ======================================== */

/* Hero section styles removed - now controlled by inline styles */

/* ========================================
   LINKS
   ======================================== */

/* Links on light backgrounds */
a {
    color: #1e40af !important;
}

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

/* Links on dark backgrounds */
.bg-primary a,
.bg-dark a,
.page-header a {
    color: #facc15 !important;
}

.bg-primary a:hover,
.bg-dark a:hover {
    color: #fde047 !important;
}

/* Links in cards */
.card a {
    color: #1e40af !important;
}

/* ========================================
   FOOTER - REMOVED (now white background)
   ======================================== */

/* ========================================
   SERVICE SECTIONS
   ======================================== */

.service-title-modern {
    color: #000000 !important;
}

.service-desc-modern {
    color: #000000 !important;
}

/* ========================================
   SPECIFIC COMPONENT FIXES
   ======================================== */

/* Conversion benefits in hero */
.conversion-benefits,
.conversion-benefits .benefit-item,
.conversion-benefits strong,
.conversion-benefits span {
    color: #ffffff !important;
}

/* Trust indicators */
.trust-item {
    color: #000000 !important;
}

.hero-section .trust-item {
    color: #ffffff !important;
}

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

.badge.bg-light {
    color: #000000 !important;
}

/* Alerts */
.alert {
    color: #000000 !important;
}

.alert-dark {
    color: #ffffff !important;
}

/* ========================================
   RESPONSIVE OVERRIDES
   ======================================== */

@media (max-width: 768px) {
    /* Ensure mobile text remains compliant */
    p,
    h1, h2, h3, h4, h5, h6,
    .lead,
    span {
        color: #000000 !important;
    }
    
    .bg-primary p,
    .bg-primary h1, .bg-primary h2, .bg-primary h3,
    .bg-dark p,
    .bg-dark h1, .bg-dark h2, .bg-dark h3,
    .hero-section p,
    .hero-section h1, .hero-section h2 {
        color: #ffffff !important;
    }
}

/* ========================================
   ACCESSIBILITY STATES
   ======================================== */

/* Focus states */
*:focus-visible {
    outline: 3px solid #1e40af !important;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        color: #000000 !important;
        background-color: #ffffff !important;
    }
    
    .bg-primary,
    .bg-dark {
        background: #000000 !important;
        color: #ffffff !important;
    }
    
    .btn-primary {
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #ffffff !important;
    }
}
