/*
* Text Readability and Contrast Fixes
* Ensures WCAG 2.1 AA compliance and optimal readability
*/

/* ===== HIGH CONTRAST TEXT COLORS ===== */

/* Ensure dark text on light backgrounds */
body {
    color: #212529; /* Darker text for better contrast */
    background-color: #ffffff; /* Pure white background */
}

/* Heading colors with high contrast */
h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a; /* Very dark for maximum contrast */
}

/* Paragraph text with optimal contrast */
p, .text-content, .content-text {
    color: #2c3e50; /* Dark blue-gray for readability */
    line-height: 1.7; /* Improved line spacing */
}

/* Link colors with sufficient contrast */
a {
    color: #0056b3; /* Darker blue for better contrast */
}

a:hover {
    color: #c4272f; /* Mongolia red on hover */
    text-decoration: underline;
}

/* ===== BACKGROUND AND CONTAINER FIXES ===== */

/* Ensure white backgrounds for content areas */
.container, .content-area, .main-content {
    background-color: #ffffff;
    color: #212529;
}

/* Card and section backgrounds */
.card, .section, .content-section {
    background-color: #ffffff;
    color: #212529;
    border: 1px solid #dee2e6;
}

/* Fix white text on white background issues */
.text-white {
    background-color: #2c3e50; /* Dark background for white text */
    padding: 0.5rem;
    border-radius: 0.25rem;
}

/* ===== NAVIGATION AND MENU FIXES ===== */

/* Navigation text contrast */
.navbar, .nav-link {
    color: #212529 !important; /* Ensure dark text on navbar */
}

.navbar-light .navbar-nav .nav-link {
    color: #212529 !important;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: #c4272f !important;
}

/* Dropdown menu readability */
.dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.dropdown-item {
    color: #212529;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #c4272f;
}

/* ===== BUTTON AND FORM FIXES ===== */

/* Button text contrast */
.btn {
    font-weight: 500;
}

.btn-primary {
    background-color: #c4272f;
    border-color: #c4272f;
    color: #ffffff;
}

.btn-secondary {
    background-color: #0066b3;
    border-color: #0066b3;
    color: #ffffff;
}

.btn-outline-primary {
    color: #c4272f;
    border-color: #c4272f;
}

.btn-outline-primary:hover {
    background-color: #c4272f;
    color: #ffffff;
}

/* Form input readability */
.form-control {
    color: #212529;
    background-color: #ffffff;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: #c4272f;
    box-shadow: 0 0 0 0.2rem rgba(196, 39, 47, 0.25);
}

/* Form labels */
.form-label, label {
    color: #212529;
    font-weight: 500;
}

/* ===== TABLE AND LIST FIXES ===== */

/* Table readability */
.table {
    color: #212529;
    background-color: #ffffff;
}

.table th {
    background-color: #f8f9fa;
    color: #212529;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    border-top: 1px solid #dee2e6;
}

/* List item readability */
ul, ol, li {
    color: #2c3e50;
}

/* ===== ALERT AND NOTIFICATION FIXES ===== */

/* Alert text contrast */
.alert {
    border: 1px solid;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* ===== MOBILE READABILITY IMPROVEMENTS ===== */

@media (max-width: 768px) {
    /* Larger text on mobile */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Better touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Improved spacing */
    p {
        margin-bottom: 1.25rem;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus indicators */
*:focus {
    outline: 2px solid #c4272f;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #c4272f;
    color: #ffffff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background-color: #ffffff;
        color: #000000;
    }
    
    a {
        color: #0000ff;
    }
    
    .btn-primary {
        background-color: #000000;
        color: #ffffff;
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}

