/* Text Contrast Fixes - Ensuring readability across all backgrounds */

/* Default text colors for better contrast */
body {
    color: #2C2C2C; /* Dark charcoal for main text */
}

/* Headings should be dark by default */
h1, h2, h3, h4, h5, h6 {
    color: #1C1C1C !important; /* Very dark for maximum contrast */
}

/* Paragraphs and general text */
p, span:not(.text-white):not(.text-primary):not(.text-secondary):not(.text-accent) {
    color: #4A4A4A; /* Medium gray for body text */
}

/* Text on dark backgrounds */
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-secondary h1, .bg-secondary h2, .bg-secondary h3, .bg-secondary h4, .bg-secondary h5, .bg-secondary h6,
.bg-accent h1, .bg-accent h2, .bg-accent h3, .bg-accent h4, .bg-accent h5, .bg-accent h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-gray-800 h1, .bg-gray-800 h2, .bg-gray-800 h3, .bg-gray-800 h4, .bg-gray-800 h5, .bg-gray-800 h6,
.bg-gray-900 h1, .bg-gray-900 h2, .bg-gray-900 h3, .bg-gray-900 h4, .bg-gray-900 h5, .bg-gray-900 h6 {
    color: #FFFFFF !important;
}

.bg-primary p, .bg-primary span,
.bg-secondary p, .bg-secondary span,
.bg-accent p, .bg-accent span,
.bg-dark p, .bg-dark span,
.bg-gray-800 p, .bg-gray-800 span,
.bg-gray-900 p, .bg-gray-900 span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Service boxes with gradient backgrounds */
.bento-box-large h3,
.bento-box-medium h3,
.bento-box-small h3,
.bento-item h3 {
    color: #1C1C1C !important; /* Dark text for light gradient backgrounds */
}

/* Ensure service box descriptions are readable */
.bento-box-large p,
.bento-box-medium p,
.bento-box-small p,
.bento-item p {
    color: #4A4A4A !important;
    opacity: 0.9;
}

/* Dark gradient backgrounds need white text */
.bg-gradient-to-br[class*="from-gray-900"] h1,
.bg-gradient-to-br[class*="from-gray-900"] h2,
.bg-gradient-to-br[class*="from-gray-900"] h3,
.bg-gradient-to-br[class*="from-gray-900"] h4,
.bg-gradient-to-br[class*="from-gray-900"] h5,
.bg-gradient-to-br[class*="from-gray-900"] h6,
.bg-gradient-to-br[class*="from-gray-800"] h1,
.bg-gradient-to-br[class*="from-gray-800"] h2,
.bg-gradient-to-br[class*="from-gray-800"] h3,
.bg-gradient-to-br[class*="from-gray-800"] h4,
.bg-gradient-to-br[class*="from-gray-800"] h5,
.bg-gradient-to-br[class*="from-gray-800"] h6 {
    color: #FFFFFF !important;
}

/* Hero sections typically have dark backgrounds */
.hero h1, .hero h2, .hero h3,
.hero-section h1, .hero-section h2, .hero-section h3,
#hero h1, #hero h2, #hero h3 {
    color: #FFFFFF !important;
}

.hero p, .hero span,
.hero-section p, .hero-section span,
#hero p, #hero span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Footer typically has dark background */
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
    color: #FFFFFF !important;
}

footer p, footer span, footer a:not(.btn) {
    color: rgba(255, 255, 255, 0.8) !important;
}

footer a:not(.btn):hover {
    color: #EE6352 !important; /* Orange on hover */
}

/* Cookie banner text */
#cookie-banner p,
#cookie-banner span {
    color: #2A2420 !important; /* Dark text for white background */
}

/* Form labels and inputs */
label {
    color: #2C2C2C !important;
    font-weight: 500;
}

input:not([type="submit"]):not([type="button"]),
textarea,
select {
    color: #2C2C2C !important;
    background-color: #FFFFFF !important;
    border-color: #D0D0D0 !important;
}

input::placeholder,
textarea::placeholder {
    color: #999999 !important;
}

/* Card components */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.card-body h1, .card-body h2, .card-body h3, .card-body h4, .card-body h5, .card-body h6 {
    color: #1C1C1C !important;
}

.card p, .card span,
.card-body p, .card-body span {
    color: #4A4A4A !important;
}

/* Navigation links */
nav a:not(.btn),
.navbar a:not(.btn),
header nav a:not(.btn) {
    color: #1F5C63 !important; /* Dark teal */
}

nav a:not(.btn):hover,
.navbar a:not(.btn):hover,
header nav a:not(.btn):hover {
    color: #EE6352 !important; /* Orange on hover */
}

/* Utility classes for manual override */
.text-dark-contrast {
    color: #1C1C1C !important;
}

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

.text-medium-contrast {
    color: #4A4A4A !important;
}

/* Fix for elements with opacity affecting text readability */
.opacity-90 {
    opacity: 1 !important;
}

.opacity-80 {
    opacity: 0.95 !important;
}

.opacity-70 {
    opacity: 0.9 !important;
}

/* Ensure links are always visible */
a:not(.btn):not(.text-white) {
    color: #1F5C63 !important;
}

a:not(.btn):not(.text-white):hover {
    color: #EE6352 !important;
    text-decoration: underline;
}

/* Special sections that might have background images */
.bg-cover h1, .bg-cover h2, .bg-cover h3,
.bg-contain h1, .bg-contain h2, .bg-contain h3,
[style*="background-image"] h1,
[style*="background-image"] h2,
[style*="background-image"] h3 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Ensure text is readable on semi-transparent overlays */
.bg-black\/50 *, .bg-white\/50 * {
    color: inherit;
}

/* Fix for stats/counter sections */
.counter, .stat-box .counter {
    color: inherit !important;
    font-weight: 700;
}

/* Alert and notification text */
.alert, .notification {
    color: #2C2C2C !important;
}

.alert.alert-danger, .notification.notification-error {
    color: #721C24 !important;
}

.alert.alert-success, .notification.notification-success {
    color: #155724 !important;
}

.alert.alert-warning, .notification.notification-warning {
    color: #856404 !important;
}

/* Print styles */
@media print {
    * {
        color: #000000 !important;
        background: transparent !important;
    }
}
