/* ============================================================
   ULTIMATE COLOR ENFORCEMENT
   Nuclear option - Forces correct colors EVERYWHERE
   
   RULE: Dark background = White text
         Light background = Black text
   
   Load this LAST to override everything
   ============================================================ */

/* ============================================================
   GLOBAL DARK BACKGROUNDS = WHITE TEXT
   ============================================================ */

/* Any element with dark background gets white text */
[style*="background: #1e293b"],
[style*="background: #0f172a"],
[style*="background: #001a33"],
[style*="background: #002d4d"],
[style*="background:#1e293b"],
[style*="background:#0f172a"],
[style*="background:#001a33"],
[style*="background:#002d4d"],
[style*="background-color: #1e293b"],
[style*="background-color: #0f172a"],
[style*="background-color: #001a33"],
[style*="background-color: #002d4d"],
section[style*="background: linear-gradient"][style*="#1e293b"],
section[style*="background: linear-gradient"][style*="#0f172a"],
div[style*="background: linear-gradient"][style*="#1e293b"],
div[style*="background: linear-gradient"][style*="#0f172a"] {
    color: #ffffff !important;
}

/* All children of dark backgrounds */
[style*="background: #1e293b"] *,
[style*="background: #0f172a"] *,
[style*="background: #001a33"] *,
[style*="background: #002d4d"] *,
[style*="background:#1e293b"] *,
[style*="background:#0f172a"] *,
[style*="background:#001a33"] *,
[style*="background:#002d4d"] *,
[style*="background-color: #1e293b"] *,
[style*="background-color: #0f172a"] *,
[style*="background-color: #001a33"] *,
[style*="background-color: #002d4d"] *,
section[style*="background: linear-gradient"][style*="#1e293b"] *,
section[style*="background: linear-gradient"][style*="#0f172a"] *,
div[style*="background: linear-gradient"][style*="#1e293b"] *,
div[style*="background: linear-gradient"][style*="#0f172a"] * {
    color: #ffffff !important;
}

/* ============================================================
   SPECIFIC SECTIONS - DARK BACKGROUNDS
   ============================================================ */

/* Hero sections */
.hero,
.hero *,
.hero h1,
.hero h2,
.hero p,
.hero span,
.hero div,
.hero-content,
.hero-content *,
.hero-title,
.hero-subtitle,
.city-hero,
.city-hero * {
    color: #ffffff !important;
}

/* Hero stats */
.hero-stats,
.hero-stats *,
.city-stats,
.city-stats *,
.stat-item,
.stat-item *,
.stat-number,
.stat-label,
.stat-value {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
    background: none !important;
    background-clip: unset !important;
    -webkit-background-clip: unset !important;
}

/* Navigation */
.navbar,
.navbar *,
.nav-links,
.nav-links *,
.nav-link,
.logo-text,
header,
header * {
    color: #ffffff !important;
}

/* FAQ sections */
.faq-section,
.faq-section *,
#faq,
#faq *,
.faq-item,
.faq-item *,
.faq-question,
.faq-question *,
.faq-answer,
.faq-answer *,
.faq-container,
.faq-container * {
    color: #ffffff !important;
}

/* Footer */
.footer,
.footer *,
footer,
footer *,
.footer-content,
.footer-content *,
.footer-links,
.footer-links *,
.footer-section,
.footer-section * {
    color: #ffffff !important;
}

/* CTA sections (usually have colored backgrounds) */
.cta-section,
.cta-section *,
.comparison-cta,
.comparison-cta *,
section[class*="cta"],
section[class*="cta"] * {
    color: #ffffff !important;
}

/* Resources section - FORCE WHITE TEXT */
.resources-section,
.resources-section *,
.resources-section h1,
.resources-section h2,
.resources-section h3,
.resources-section h4,
.resources-section h5,
.resources-section h6,
.resources-section p,
.resources-section span,
.resources-section a,
.resources-section div,
.resources-section .section-title,
.resources-section .section-subtitle,
.resources-section .section-header,
.resources-section .section-header *,
.resources-section .blog-grid,
.resources-section .blog-grid *,
.resources-section .blog-card,
.resources-section .blog-card *,
section.resources-section,
section.resources-section * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* Comparison section - FORCE WHITE TEXT */
.comparison-section,
.comparison-section *,
.comparison-section h2,
.comparison-section .section-title,
.comparison-section .section-subtitle,
.comparison-section .section-header,
.comparison-section .section-header *,
section.comparison-section,
section.comparison-section * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* EXCEPTION: comparison-summary should be BLACK */
.comparison-summary,
.comparison-summary *,
.comparison-summary strong,
.comparison-summary .clinical-tooltip-trigger,
.comparison-summary span {
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
    text-fill-color: #1e293b !important;
}

/* Privacy section - FORCE WHITE TEXT */
.privacy-section,
.privacy-section *,
.privacy-section h2,
.privacy-section h3,
.privacy-section p,
.privacy-section .section-title,
.privacy-section .section-subtitle,
.privacy-section .section-header,
.privacy-section .section-header *,
.privacy-section .privacy-card,
.privacy-section .privacy-card *,
.privacy-section .privacy-guarantee,
.privacy-section .privacy-guarantee *,
section.privacy-section,
section.privacy-section *,
#privacy,
#privacy * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* All sections after privacy - default to WHITE TEXT (catch-all) */
.privacy-section ~ section,
.privacy-section ~ section *,
#privacy ~ section,
#privacy ~ section * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* Trust section, Clinical Quality, Nonprofit, Zara Cares, Support Mission, FAQ - FORCE WHITE TEXT */
.trust-section,
.trust-section *,
.clinical-quality-section,
.clinical-quality-section *,
.nonprofit-section,
.nonprofit-section *,
.zara-cares-section,
.zara-cares-section *,
.support-section,
.support-section *,
.mission-section,
.mission-section *,
.faq-section,
.faq-section *,
section.trust-section,
section.trust-section *,
#clinical-quality,
#clinical-quality *,
#nonprofit,
#nonprofit *,
#zara-cares,
#zara-cares *,
#support,
#support *,
#faq,
#faq * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* Why Coaching Works section - FORCE WHITE TEXT */
.why-coaching-works,
.why-coaching-works *,
.why-coaching-works h1,
.why-coaching-works h2,
.why-coaching-works h3,
.why-coaching-works h4,
.why-coaching-works p,
.why-coaching-works span,
.why-coaching-works div,
.why-coaching-works .section-title,
.why-coaching-works .section-subtitle,
section.why-coaching-works,
section.why-coaching-works * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-fill-color: #ffffff !important;
}

/* Demo section - FORCE WHITE TEXT */
.demo-section,
.demo-section *,
.demo-section h1,
.demo-section h2,
.demo-section h3,
.demo-section h4,
.demo-section p,
section.demo-section,
section.demo-section * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* EXCEPTION: Feature highlights in demo section should be BLACK */
.demo-features .feature-highlight,
.demo-features .feature-highlight *,
.demo-features .feature-highlight strong,
.demo-features .feature-highlight p,
.feature-highlight,
.feature-highlight *,
.feature-highlight strong,
.feature-highlight p {
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
}

/* Problem section - FORCE WHITE TEXT */
.problem-section,
.problem-section *,
section.problem-section,
section.problem-section * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* How It Works section - FORCE WHITE TEXT */
.how-it-works,
.how-it-works *,
section.how-it-works,
section.how-it-works *,
#how-it-works,
#how-it-works * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Features section - FORCE WHITE TEXT */
.features,
.features *,
section.features,
section.features *,
#features,
#features *,
.features-grid,
.features-grid *,
.feature-card,
.feature-card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Disclaimer box - FORCE WHITE TEXT */
.disclaimer-box,
.disclaimer-box *,
.disclaimer-box h1,
.disclaimer-box h2,
.disclaimer-box h3,
.disclaimer-box h4,
.disclaimer-box p,
.disclaimer-box strong,
.disclaimer-box li,
.disclaimer-box ul {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Coaches section - FORCE WHITE TEXT */
.coaches-section,
.coaches-section *,
section.coaches-section,
section.coaches-section *,
#coaches,
#coaches *,
.coaches-grid,
.coaches-grid *,
.coach-card,
.coach-card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Founder/About sections with light backgrounds - FORCE WHITE TEXT */
section[style*="background: linear-gradient(135deg, #f0f9ff"],
section[style*="background: linear-gradient(135deg, #e0f2fe"],
section[style*="background: linear-gradient(135deg, #f0f9ff"] *,
section[style*="background: linear-gradient(135deg, #e0f2fe"] * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ALL buttons should have white text */
.btn-primary,
.btn-primary *,
.btn-secondary,
.btn-secondary *,
.btn-large,
.btn-large *,
button,
button *,
a.btn,
a.btn * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ============================================================
   SPECIFIC SECTIONS - LIGHT BACKGROUNDS
   ============================================================ */

/* Any element with white/light background gets dark text */
[style*="background: white"],
[style*="background: #fff"],
[style*="background: #ffffff"],
[style*="background: #f8fafc"],
[style*="background: #f9fafb"],
[style*="background:white"],
[style*="background:#fff"],
[style*="background:#ffffff"],
[style*="background-color: white"],
[style*="background-color: #fff"],
[style*="background-color: #ffffff"] {
    color: #1e293b !important;
}

/* All children of light backgrounds */
[style*="background: white"] *,
[style*="background: #fff"] *,
[style*="background: #ffffff"] *,
[style*="background: #f8fafc"] *,
[style*="background: #f9fafb"] *,
[style*="background:white"] *,
[style*="background:#fff"] *,
[style*="background:#ffffff"] *,
[style*="background-color: white"] *,
[style*="background-color: #fff"] *,
[style*="background-color: #ffffff"] * {
    color: #1e293b !important;
}

/* Cards and containers (usually white) */
.card,
.card *,
.feature-card,
.feature-card *,
.pricing-card,
.pricing-card *,
.testimonial-card,
.testimonial-card *,
.coach-card,
.coach-card *,
.info-card,
.info-card *,
.demo-features,
.demo-features *,
.feature-highlight,
.feature-highlight * {
    color: #1e293b !important;
}

/* Content sections */
.content,
.content *,
.section-content,
.section-content *,
.privacy-section,
.privacy-section *,
.comparison-section,
.comparison-section * {
    color: #1e293b !important;
}

/* ============================================================
   BUTTONS - Keep Original Colors
   ============================================================ */

/* Primary buttons (keep white text) */
.btn-primary,
.btn-primary *,
button.btn-primary,
button.btn-primary *,
a.btn-primary,
a.btn-primary * {
    color: #ffffff !important;
}

/* Secondary buttons (context-dependent) */
.btn-secondary {
    /* Keep existing styles */
}

/* ============================================================
   EMERGENCY OVERRIDES - Dark Background Classes
   ============================================================ */

/* Any class suggesting dark background */
.bg-dark,
.bg-dark *,
.dark-bg,
.dark-bg *,
.bg-navy,
.bg-navy *,
.bg-blue,
.bg-blue *,
.blue-bg,
.blue-bg *,
.dark-section,
.dark-section *,
section.dark,
section.dark *,
.hero-dark,
.hero-dark * {
    color: #ffffff !important;
}

/* ============================================================
   EMERGENCY OVERRIDES - Light Background Classes  
   ============================================================ */

/* Any class suggesting light background */
.bg-white,
.bg-white *,
.bg-light,
.bg-light *,
.white-bg,
.white-bg *,
.light-bg,
.light-bg *,
.light-section,
.light-section *,
section.light,
section.light * {
    color: #1e293b !important;
}

/* ============================================================
   LINKS - Context Aware
   ============================================================ */

/* Links on dark backgrounds (lighter blue) */
.hero a:not(.btn-primary):not(.btn-secondary),
.navbar a:not(.btn-primary):not(.btn-secondary),
.footer a:not(.btn-primary):not(.btn-secondary),
.faq-answer a:not(.btn-primary):not(.btn-secondary),
.dark-bg a:not(.btn-primary):not(.btn-secondary),
.bg-dark a:not(.btn-primary):not(.btn-secondary) {
    color: #60a5fa !important;
    text-decoration: underline !important;
}

/* Links on light backgrounds (normal blue) */
.bg-white a:not(.btn-primary):not(.btn-secondary),
.bg-light a:not(.btn-primary):not(.btn-secondary),
.content a:not(.btn-primary):not(.btn-secondary),
.card a:not(.btn-primary):not(.btn-secondary) {
    color: #3b82f6 !important;
}

/* ============================================================
   HEADINGS - Inherit from parent context
   ============================================================ */

/* Headings inherit color from their context */
h1, h2, h3, h4, h5, h6 {
    /* Color is inherited - don't override */
}

/* ============================================================
   SPECIAL CASES
   ============================================================ */

/* Crisis banner (red with white text) */
.crisis-banner,
.crisis-banner * {
    background: #dc2626 !important;
    color: #ffffff !important;
}

/* Yellow warning boxes (dark text) */
[style*="background: #fef3c7"],
[style*="background: #fde68a"],
[style*="background: #fbbf24"] {
    color: #1e293b !important;
}

[style*="background: #fef3c7"] *,
[style*="background: #fde68a"] *,
[style*="background: #fbbf24"] * {
    color: #1e293b !important;
}

/* Green success sections (white text) */
[style*="background: #10b981"],
[style*="background: #059669"],
section[style*="background: linear-gradient"][style*="#10b981"],
div[style*="background: linear-gradient"][style*="#10b981"] {
    color: #ffffff !important;
}

[style*="background: #10b981"] *,
[style*="background: #059669"] *,
section[style*="background: linear-gradient"][style*="#10b981"] *,
div[style*="background: linear-gradient"][style*="#10b981"] * {
    color: #ffffff !important;
}

/* Purple sections (white text) */
[style*="background: #667eea"],
[style*="background: #764ba2"],
[style*="background: #8b5cf6"],
section[style*="background: linear-gradient"][style*="#667eea"],
section[style*="background: linear-gradient"][style*="#764ba2"] {
    color: #ffffff !important;
}

[style*="background: #667eea"] *,
[style*="background: #764ba2"] *,
[style*="background: #8b5cf6"] *,
section[style*="background: linear-gradient"][style*="#667eea"] *,
section[style*="background: linear-gradient"][style*="#764ba2"] * {
    color: #ffffff !important;
}

/* Blue sections (white text) */
[style*="background: #3b82f6"],
[style*="background: #2563eb"],
section[style*="background: linear-gradient"][style*="#3b82f6"] {
    color: #ffffff !important;
}

[style*="background: #3b82f6"] *,
[style*="background: #2563eb"] *,
section[style*="background: linear-gradient"][style*="#3b82f6"] * {
    color: #ffffff !important;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    * {
        color: #000000 !important;
        background: #ffffff !important;
    }
}

/* ============================================================
   END OF ULTIMATE COLOR ENFORCEMENT
   ============================================================ */
