/* Accessibility Improvements - High Contrast and ARIA Support */

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Improved contrast for better accessibility */
@media (prefers-contrast: high) {

    /* High contrast mode adjustments */
    .text-green-600 {
        color: #047857 !important;
    }

    .text-gray-600 {
        color: #374151 !important;
    }
}

/* Enhanced contrast for specific elements identified in audit */
body.font-inter {
    color: #111827 !important;
    background-color: #ffffff !important;
}

/* Improve contrast for feature list items */
.text-green-600 span {
    color: #047857 !important;
    font-weight: 600 !important;
}

/* Improve Save BMI button contrast */
#saveBMIBtn {
    background-color: #047857 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

#saveBMIBtn:hover {
    background-color: #065f46 !important;
}

/* Improve footer link contrast */
footer a {
    color: #047857 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}

footer a:hover {
    color: #065f46 !important;
    text-decoration: underline !important;
}

/* Improve general footer contrast */
footer {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

/* Enhanced focus indicators for better accessibility */
button:focus,
select:focus,
input:focus,
.faq-question:focus {
    outline: 3px solid #059669 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2) !important;
}

/* Improve button contrast across the site */
button {
    font-weight: 600 !important;
}

/* Ensure minimum contrast ratios */
.text-xs,
.text-sm {
    color: #374151 !important;
}

/* High contrast for interactive elements */
.hover\:bg-green-200:hover {
    background-color: #a7f3d0 !important;
    color: #065f46 !important;
}

/* Improve visibility of icons */
[data-lucide] {
    stroke-width: 2.5 !important;
}

/* Better contrast for form labels */
label {
    color: #111827 !important;
    font-weight: 600 !important;
}

/* Enhanced placeholder text visibility */
input::placeholder,
select::placeholder {
    color: #6b7280 !important;
    opacity: 0.8 !important;
}

/* Ensure proper contrast for disabled states */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Improved error and success states */
.form-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.form-success {
    border-color: #059669 !important;
    background-color: #ecfdf5 !important;
}

/* Better visual hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #111827 !important;
    font-weight: 700 !important;
}

/* Ensure proper color contrast for all text elements */
p,
span,
div {
    color: inherit;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print accessibility */
@media print {
    * {
        background: white !important;
        color: black !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }

    a,
    a:visited {
        color: #000 !important;
        text-decoration: underline !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}