/* Accessibility Improvements for Color Contrast */

/* Improve contrast for light gray text on white backgrounds */
.text-gray-400 {
    color: #6b7280 !important; /* Changed from #9ca3af to meet WCAG AA */
}

.text-gray-500 {
    color: #4b5563 !important; /* Changed from #6b7280 to meet WCAG AA */
}

/* Ensure footer links have sufficient contrast */
footer .text-gray-500 {
    color: #4b5563 !important;
}

footer .text-gray-500:hover {
    color: #1f2937 !important;
}

footer .text-gray-600 {
    color: #4b5563 !important;
}

/* Improve contrast for disabled form elements */
input:disabled,
button:disabled {
    opacity: 0.7 !important; /* Increased from default 0.5 */
    color: #4b5563 !important;
}

/* Status indicator with text fallback for colorblind users */
.status-indicator::after {
    content: " (Online)";
    font-size: 0.875rem;
    color: #059669;
    margin-left: 0.25rem;
}

/* Ensure gradient text maintains minimum contrast */
.bg-gradient-to-r.from-indigo-500.to-indigo-600 {
    background: linear-gradient(to right, #6366f1, #4f46e5) !important;
}

/* Improve button focus states for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #6366f1 !important;
    outline-offset: 2px !important;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #4f46e5;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 1rem;
}

/* Ensure interactive elements have minimum size */
button,
a,
input[type="checkbox"],
input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
}

/* Exception for inline text links */
a:not([class*="btn"]):not([class*="button"]) {
    min-height: auto;
    min-width: auto;
}

/* Improve focus indicators for form elements */
.peer:focus ~ div {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}

/* Ensure sufficient contrast for placeholder text */
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-400,
    .text-gray-500,
    .text-gray-600 {
        color: #1f2937 !important;
    }
    
    .bg-gray-100 {
        background-color: #e5e7eb !important;
    }
    
    .border-gray-200 {
        border-color: #9ca3af !important;
    }
}

/* Reduced motion support */
@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 styles for better readability */
@media print {
    .text-gray-400,
    .text-gray-500,
    .text-gray-600 {
        color: #000 !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
}