/**
 * Font Visibility Fixes - HIPAA Auditors
 * Comprehensive contrast and visibility improvements for light and dark modes
 * Addresses WCAG AA compliance (4.5:1 minimum contrast ratio)
 * Version: 1.0
 */

/* ===========================================
   GLOBAL TEXT CONTRAST FIXES
   =========================================== */

/* Ensure all text has proper contrast in both modes */
body {
    color: var(--theme-text-primary) !important;
}

/* All paragraph text */
p {
    color: var(--theme-text-secondary) !important;
}

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

/* ===========================================
   HERO SECTION FIXES
   =========================================== */

/* Hero titles - ensure gradient doesn't reduce visibility */
.hero-title-enterprise {
    /* Fallback for browsers that don't support gradient text */
    color: var(--theme-text-primary);
}

/* Hero subtitle - must always be visible */
.hero-subtitle-enterprise,
.hero-description,
.hero-subtitle {
    color: var(--theme-text-secondary) !important;
}

/* Alternative hero content class */
.hero-content p,
.hero-content-enterprise p {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   BUTTON FIXES - CRITICAL
   =========================================== */

/* Primary buttons - ensure white text on colored background */
.btn-primary-enterprise,
.btn-primary,
.btn.btn-primary {
    background: var(--theme-gradient-primary) !important;
    color: #ffffff !important;
    border: none !important;
}

/* Secondary buttons */
.btn-secondary-enterprise,
.btn-secondary,
.btn.btn-secondary {
    background: var(--glass-bg) !important;
    color: var(--theme-text-primary) !important;
    border: 2px solid var(--theme-border-accent) !important;
}

/* Outline buttons */
.btn-outline,
.btn.btn-outline {
    background: transparent !important;
    color: var(--theme-text-primary) !important;
    border: 2px solid var(--theme-border-accent) !important;
}

/* White outline buttons in dark sections */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn.btn-outline {
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-text-primary) !important;
}

/* All link-style buttons */
a.btn {
    text-decoration: none !important;
}

/* Hero action buttons */
.hero-actions button,
.hero-actions a,
.hero-actions-enterprise button,
.hero-actions-enterprise a,
.hero-cta-group button,
.hero-cta-group a {
    color: #ffffff !important;
}

.hero-actions .btn-outline,
.hero-actions-enterprise .btn-outline,
.hero-cta-group .btn-outline {
    color: var(--theme-text-primary) !important;
}

/* ===========================================
   NAVBAR FIXES
   =========================================== */

/* Navbar links - ensure proper contrast */
.navbar-nav .nav-link,
.header-nav a,
nav a {
    color: var(--theme-text-primary) !important;
}

.navbar-nav .nav-link:hover,
.header-nav a:hover,
nav a:hover {
    color: var(--theme-text-accent) !important;
}

/* Navbar background */
.navbar,
.header,
header {
    background-color: var(--theme-bg-primary) !important;
}

/* Dark mode navbar - ensure it's dark */
[data-theme="dark"] .navbar,
[data-theme="dark"] .header,
[data-theme="dark"] header {
    background-color: var(--theme-bg-primary) !important;
}

/* ===========================================
   FOOTER FIXES - CRITICAL
   =========================================== */

/* Footer always has dark background in both modes */
footer,
.footer,
.footer-modern {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Footer headings */
footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6,
.footer h1,
.footer h2,
.footer h3,
.footer h4,
.footer h5,
.footer h6,
.footer-title {
    color: #f8fafc !important;
}

/* Footer text */
footer p,
footer span,
footer div,
.footer p,
.footer span,
.footer div,
.footer-description,
.footer-text {
    color: #cbd5e1 !important;
}

/* Footer links */
footer a,
.footer a,
.footer-link {
    color: #cbd5e1 !important;
}

footer a:hover,
.footer a:hover,
.footer-link:hover {
    color: #f8fafc !important;
}

/* Footer copyright */
.footer-copyright,
.copyright {
    color: #94a3b8 !important;
}

/* ===========================================
   TRUST BADGES FIXES
   =========================================== */

.trust-badge,
.trust-badge-enterprise {
    background: var(--glass-bg) !important;
}

.trust-badge span,
.trust-badge-enterprise span,
.trust-text {
    color: var(--theme-text-secondary) !important;
}

.trust-icon {
    color: var(--premium-green) !important;
}

/* ===========================================
   SERVICE CARDS FIXES
   =========================================== */

.service-card,
.service-card-enterprise {
    background: var(--glass-bg) !important;
}

.service-title,
.service-title-enterprise {
    color: var(--theme-text-primary) !important;
}

.service-description,
.service-description-enterprise {
    color: var(--theme-text-secondary) !important;
}

.service-link {
    color: var(--theme-text-accent) !important;
}

/* Feature tags */
.feature-tag,
.feature-tag-enterprise {
    background: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-accent) !important;
}

/* ===========================================
   FORM FIXES
   =========================================== */

/* Form labels */
.form-label,
label {
    color: var(--theme-text-primary) !important;
}

/* Form inputs */
.form-input,
.form-control,
input,
textarea,
select {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
    border: 1px solid var(--theme-border-primary) !important;
}

.form-input:focus,
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--theme-border-accent) !important;
    color: var(--theme-text-primary) !important;
}

/* Placeholder text */
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--theme-text-tertiary) !important;
    opacity: 0.7;
}

/* ===========================================
   STATS SECTION FIXES
   =========================================== */

.stat-label {
    color: var(--theme-text-secondary) !important;
}

.stat-number {
    /* Ensure gradient has fallback */
    color: var(--theme-text-primary);
}

/* Impact numbers */
.impact-number {
    color: var(--theme-text-primary) !important;
}

/* ===========================================
   SECTION CONTENT FIXES
   =========================================== */

/* Section headers */
.section-title,
.section-title-enterprise {
    color: var(--theme-text-primary) !important;
}

.section-subtitle,
.section-subtitle-enterprise,
.section-description {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   TESTIMONIAL FIXES
   =========================================== */

.testimonial-quote {
    color: var(--theme-text-secondary) !important;
}

.author-name {
    color: var(--theme-text-primary) !important;
}

.author-title,
.author-organization {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   PRICING CARD FIXES
   =========================================== */

.pricing-card {
    background: var(--glass-bg) !important;
}

.pricing-title {
    color: var(--theme-text-primary) !important;
}

.pricing-description,
.pricing-value,
.value-label {
    color: var(--theme-text-secondary) !important;
}

.price-amount {
    color: var(--theme-text-accent) !important;
}

/* ===========================================
   FAQ SECTION FIXES
   =========================================== */

.faq-question {
    color: var(--theme-text-primary) !important;
}

.faq-answer,
.faq-answer p {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   CTA SECTION FIXES
   =========================================== */

.cta-section {
    background: var(--theme-gradient-primary) !important;
}

.cta-title {
    color: #ffffff !important;
}

.cta-description {
    color: rgba(255, 255, 255, 0.9) !important;
}

.cta-section .btn-outline {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.cta-section .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ===========================================
   DARK MODE SPECIFIC OVERRIDES
   =========================================== */

[data-theme="dark"] {
    /* Ensure body text is light */
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] p {
    color: var(--theme-text-secondary) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--theme-text-primary) !important;
}

/* Ensure service descriptions are visible in dark mode */
[data-theme="dark"] .service-description,
[data-theme="dark"] .service-description-enterprise {
    color: var(--theme-text-secondary) !important;
}

/* Ensure all paragraphs in cards are visible */
[data-theme="dark"] .service-card p,
[data-theme="dark"] .service-card-enterprise p,
[data-theme="dark"] .pricing-card p,
[data-theme="dark"] .testimonial-card p {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   LINK CONTRAST FIXES
   =========================================== */

/* All links */
a {
    color: var(--theme-text-accent);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--premium-purple);
}

/* Links in dark backgrounds */
[data-theme="dark"] a:not(.btn) {
    color: var(--theme-text-accent);
}

/* ===========================================
   TABLE FIXES (if any)
   =========================================== */

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

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

td {
    color: var(--theme-text-secondary) !important;
}

/* ===========================================
   BADGE & TAG FIXES
   =========================================== */

.badge,
.tag {
    background: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

/* ===========================================
   ACCESSIBILITY: FOCUS STATES
   =========================================== */

/* Ensure focus states are visible */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--theme-border-accent) !important;
    outline-offset: 2px;
}

/* ===========================================
   RESPONSIVE TEXT VISIBILITY
   =========================================== */

@media (max-width: 768px) {

    /* Ensure mobile text is also visible */
    body,
    p,
    a,
    span,
    div {
        color: inherit;
    }

    /* Mobile buttons */
    .btn-primary,
    .btn-primary-enterprise {
        color: #ffffff !important;
    }
}

/* ===========================================
   PRINT MODE (bonus)
   =========================================== */

@media print {
    body {
        background: white !important;
        color: black !important;
    }

    * {
        background: transparent !important;
        color: black !important;
    }
}