/* Text Contrast Improvements for Poseidon Rental Pro */

/* ----------------------------------------------------------
   Headings + paragraphs inside DARK sections.
   Any container with `text-white`, `bg-[#080b14]`, `bg-[#28125f]`,
   or a dark Tailwind gradient (slate-900 / blue-900) gets light text.
   ---------------------------------------------------------- */
.text-white,
.text-white .pf-title,
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
[class*="bg-[#080b14]"] .pf-title,
[class*="bg-[#080b14]"] h1, [class*="bg-[#080b14]"] h2, [class*="bg-[#080b14]"] h3,
[class*="bg-[#28125f]"] .pf-title,
[class*="bg-[#28125f]"] h1, [class*="bg-[#28125f]"] h2, [class*="bg-[#28125f]"] h3,
[class*="from-slate-900"] .pf-title,
[class*="from-slate-900"] h1, [class*="from-slate-900"] h2, [class*="from-slate-900"] h3,
[class*="to-slate-900"] .pf-title,
[class*="via-blue-900"] .pf-title,
[class*="via-blue-900"] h1, [class*="via-blue-900"] h2, [class*="via-blue-900"] h3,
[class*="to-slate-800"] .pf-title,
[class*="to-slate-800"] h1, [class*="to-slate-800"] h2, [class*="to-slate-800"] h3,
footer .pf-title,
footer h1, footer h2, footer h3, footer h4, footer h5 {
    color: #ffffff !important;
}

/* Paragraphs / supporting text inside dark hero sections */
[class*="bg-[#080b14]"] p:not([class*="text-"]),
[class*="bg-[#28125f]"] p:not([class*="text-"]),
[class*="from-slate-900"] p:not([class*="text-"]),
[class*="via-blue-900"] p:not([class*="text-"]),
[class*="to-slate-800"] p:not([class*="text-"]) {
    color: rgba(255,255,255,.85) !important;
}

/* Tailwind text-gray-{300..700} inside dark hero sections should be lightened */
[class*="from-slate-900"] .text-gray-300,
[class*="from-slate-900"] .text-gray-400,
[class*="from-slate-900"] .text-gray-500,
[class*="from-slate-900"] .text-gray-600,
[class*="from-slate-900"] .text-gray-700,
[class*="via-blue-900"] .text-gray-300,
[class*="via-blue-900"] .text-gray-400,
[class*="via-blue-900"] .text-gray-500,
[class*="via-blue-900"] .text-gray-600,
[class*="via-blue-900"] .text-gray-700,
[class*="bg-[#080b14]"] .text-gray-500,
[class*="bg-[#080b14]"] .text-gray-600,
[class*="bg-[#080b14]"] .text-gray-700,
[class*="bg-[#28125f]"] .text-gray-500,
[class*="bg-[#28125f]"] .text-gray-600,
[class*="bg-[#28125f]"] .text-gray-700 {
    color: rgba(255,255,255,.78) !important;
}

/* -----------------------------------------------------------------
   EXCEPTIONS: when a LIGHT card sits inside a DARK section, the rules
   above must NOT bleed into the card. Restore Tailwind grays.
   ----------------------------------------------------------------- */
.pf-card .text-gray-300,
.pf-card .text-gray-400,
.pf-card .text-gray-500,
.pf-card .text-gray-600,
.pf-card .text-gray-700,
.pf-surface .text-gray-300,
.pf-surface .text-gray-400,
.pf-surface .text-gray-500,
.pf-surface .text-gray-600,
.pf-surface .text-gray-700,
.bg-white .text-gray-600,
.bg-white .text-gray-700,
.bg-gray-50 .text-gray-600,
.bg-gray-50 .text-gray-700,
.bg-gray-100 .text-gray-600,
.bg-gray-100 .text-gray-700 {
    color: #4b5563 !important;
}

.pf-card .text-gray-800,
.pf-card .text-gray-900,
.pf-card .text-gray-950,
.pf-surface .text-gray-800,
.pf-surface .text-gray-900,
.pf-surface .text-gray-950,
.bg-white .text-gray-800,
.bg-white .text-gray-900,
.bg-white .text-gray-950 {
    color: #0f172a !important;
}

/* Links inside a light card should not inherit white from a dark ancestor */
.pf-card a:not([class*="text-"]):not(.pf-btn),
.pf-surface a:not([class*="text-"]):not(.pf-btn),
.bg-white a:not([class*="text-"]):not(.pf-btn),
.bg-gray-50 a:not([class*="text-"]):not(.pf-btn),
.bg-gray-100 a:not([class*="text-"]):not(.pf-btn) {
    color: #1f2937;
}

/* Global anti-blend safeguards */
.bg-white .text-white,
.bg-gray-50 .text-white,
.bg-gray-100 .text-white,
.bg-slate-50 .text-white,
.bg-blue-50 .text-white,
[class*="to-blue-50"] > .text-white {
    color: #0f172a !important;
}

.bg-white .text-gray-100,
.bg-white .text-gray-200,
.bg-white .text-gray-300,
.bg-gray-50 .text-gray-100,
.bg-gray-50 .text-gray-200,
.bg-gray-50 .text-gray-300,
.bg-blue-50 .text-gray-100,
.bg-blue-50 .text-gray-200,
.bg-blue-50 .text-gray-300,
[class*="from-slate-50"] > .text-gray-100,
[class*="from-slate-50"] > .text-gray-200,
[class*="from-slate-50"] > .text-gray-300,
[class*="to-blue-50"] > .text-gray-100,
[class*="to-blue-50"] > .text-gray-200,
[class*="to-blue-50"] > .text-gray-300 {
    color: #334155 !important;
}

.text-white\/60 { color: rgba(255,255,255,.72) !important; }
.text-white\/65 { color: rgba(255,255,255,.76) !important; }
.text-white\/70 { color: rgba(255,255,255,.82) !important; }
.text-white\/75 { color: rgba(255,255,255,.86) !important; }
.text-white\/78 { color: rgba(255,255,255,.88) !important; }
.text-white\/82 { color: rgba(255,255,255,.9) !important; }


/* Main text contrast fixes ONLY for light backgrounds (not footer) */
body:not(footer) .text-gray-600,
.bg-white .text-gray-600,
.bg-gray-50 .text-gray-600,
.bg-gray-100 .text-gray-600 {
    color: #374151 !important; /* gray-700 - much better contrast */
}

body:not(footer) .text-gray-500,
.bg-white .text-gray-500,
.bg-gray-50 .text-gray-500,
.bg-gray-100 .text-gray-500 {
    color: #4b5563 !important; /* gray-600 - better contrast */
}

body:not(footer) .text-gray-400,
.bg-white .text-gray-400,
.bg-gray-50 .text-gray-400,
.bg-gray-100 .text-gray-400 {
    color: #6b7280 !important; /* gray-500 - better contrast */
}

/* Footer keeps original colors for dark background */
footer .text-gray-100 {
    color: #f3f4f6 !important; /* Keep light for dark background */
}

footer .text-gray-200 {
    color: #e5e7eb !important; /* Keep light for dark background */
}

footer .text-gray-300 {
    color: #d1d5db !important; /* Keep light for dark background */
}

footer .text-gray-400 {
    color: #9ca3af !important; /* Keep original for dark background */
}

footer .text-gray-500 {
    color: #6b7280 !important; /* Keep original for dark background */
}

/* Override light text colors on gradient backgrounds */
.gradient-bg .text-blue-100,
.gradient-bg .text-blue-200,
.gradient-bg .text-blue-300 {
    color: #e5e7eb !important; /* gray-200 - much more visible */
}

.gradient-bg .text-gray-100,
.gradient-bg .text-gray-200 {
    color: #e5e7eb !important; /* gray-200 */
}

.gradient-bg .text-gray-300 {
    color: #d1d5db !important; /* gray-300 */
}

footer .text-blue-100,
footer .text-blue-200,
footer .text-blue-300 {
    color: #e5e7eb !important; /* gray-200 */
}

footer .text-gray-200 {
    color: #e5e7eb !important; /* gray-200 */
}

footer .text-gray-300 {
    color: #d1d5db !important; /* gray-300 */
}

/* Newsletter and CTA sections */
.bg-gradient-to-r .text-blue-200,
.bg-gradient-to-r .text-gray-200 {
    color: #e5e7eb !important; /* gray-200 */
}

.bg-gradient-to-r .text-blue-300,
.bg-gradient-to-r .text-gray-300 {
    color: #d1d5db !important; /* gray-300 */
}

/* Hero sections */
.hero-section .text-blue-100,
.hero-section .text-blue-200 {
    color: #e5e7eb !important; /* gray-200 */
}

/* Stats sections */
.stats-section .text-blue-200 {
    color: #d1d5db !important; /* gray-300 */
}

/* Card text on dark backgrounds */
.bg-primary .text-blue-200,
.bg-primary .text-gray-200 {
    color: #e5e7eb !important; /* gray-200 */
}

.bg-primary .text-blue-300,
.bg-primary .text-gray-300 {
    color: #d1d5db !important; /* gray-300 */
}

/* Ensure minimum contrast ratio */
.text-contrast-high {
    color: #f3f4f6 !important; /* gray-100 - highest contrast */
}

.text-contrast-medium {
    color: #e5e7eb !important; /* gray-200 - medium contrast */
}

.text-contrast-low {
    color: #d1d5db !important; /* gray-300 - lower contrast but still readable */
}

/* Dark background text improvements */
.bg-dark .text-light,
.bg-gradient .text-light {
    color: #f9fafb !important; /* gray-50 - very light */
}

/* Mobile responsive text contrast */
@media (max-width: 768px) {
    .gradient-bg .text-blue-200,
    .gradient-bg .text-gray-200 {
        color: #f3f4f6 !important; /* Even lighter on mobile for better readability */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gradient-bg .text-blue-200,
    .gradient-bg .text-gray-200,
    footer .text-blue-200,
    footer .text-gray-200 {
        color: #ffffff !important; /* Pure white for high contrast */
    }
}

/* Print styles - ensure dark text on white background */
@media print {
    .gradient-bg .text-blue-200,
    .gradient-bg .text-gray-200,
    footer .text-blue-200,
    footer .text-gray-200 {
        color: #1f2937 !important; /* Dark gray for print */
    }
}
