/* C2RISK WCAG Accessibility Improvements */
/* Conforms to WCAG 2.1 AA standards */

/* ========================================
   CONTRAST IMPROVEMENTS - WCAG AA Compliant
   ======================================== */

/* High Contrast Text Colors */
:root {
    /* WCAG AA Compliant Colors - 4.5:1 ratio minimum */
    --wcag-text-primary: #1a1a1a;        /* Almost black - 21:1 contrast on white */
    --wcag-text-secondary: #2d2d2d;      /* Dark gray - 12.6:1 contrast on white */
    --wcag-text-muted: #4a4a4a;          /* Medium gray - 7.1:1 contrast on white */
    --wcag-text-light: #6b6b6b;          /* Light gray - 4.5:1 contrast on white */
    
    /* Background Colors */
    --wcag-bg-primary: #ffffff;          /* Pure white */
    --wcag-bg-secondary: #f8f9fa;        /* Light gray */
    --wcag-bg-accent: #e9ecef;           /* Medium light gray */
    
    /* Link Colors - WCAG AA Compliant */
    --wcag-link: #0066cc;                /* Blue - 4.5:1 contrast on white */
    --wcag-link-hover: #004499;          /* Darker blue - 7.1:1 contrast on white */
    --wcag-link-visited: #663399;        /* Purple - 4.5:1 contrast on white */
    
    /* Status Colors - WCAG AA Compliant */
    --wcag-success: #006600;             /* Green - 4.5:1 contrast on white */
    --wcag-warning: #cc6600;             /* Orange - 4.5:1 contrast on white */
    --wcag-error: #cc0000;               /* Red - 4.5:1 contrast on white */
    --wcag-info: #0066cc;                /* Blue - 4.5:1 contrast on white */
    
    /* Button Colors - WCAG AA Compliant */
    --wcag-btn-primary: #0066cc;         /* Blue - 4.5:1 contrast on white */
    --wcag-btn-primary-hover: #004499;   /* Darker blue - 7.1:1 contrast on white */
    --wcag-btn-secondary: #6c757d;       /* Gray - 4.5:1 contrast on white */
    --wcag-btn-secondary-hover: #545b62; /* Darker gray - 7.1:1 contrast on white */
}

/* ========================================
   HERO SECTION ACCESSIBILITY
   ======================================== */

/* Hero Title - High Contrast */
.hero-title {
    color: var(--wcag-text-primary) !important;
    font-weight: 700 !important;
    font-size: 2.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
    text-shadow: none !important;
    /* Remove gradient text for better readability */
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    background: none !important;
}

/* Hero Subtitle - Improved Contrast */
.hero-subtitle {
    color: var(--wcag-text-secondary) !important;
    font-size: 1.3rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin-bottom: 35px !important;
    opacity: 1 !important; /* Remove opacity for better contrast */
}

/* Scientific Title - Override gradient */
.scientific-title {
    color: var(--wcag-text-primary) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
}

/* ========================================
   BUTTON ACCESSIBILITY - WCAG AA
   ======================================== */

/* Primary Buttons - High Contrast */
.btn-scientific {
    background-color: var(--wcag-btn-primary) !important;
    color: #ffffff !important;
    border: 2px solid var(--wcag-btn-primary) !important;
    border-radius: 8px !important;
    padding: 14px 28px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    min-height: 48px !important; /* WCAG AA minimum touch target */
    min-width: 48px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: visible !important; /* Ensure focus indicators are visible */
}

/* Button Hover State */
.btn-scientific:hover {
    background-color: var(--wcag-btn-primary-hover) !important;
    border-color: var(--wcag-btn-primary-hover) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Button Focus State - WCAG AA Compliant */
.btn-scientific:focus {
    outline: 3px solid #ffdd44 !important; /* High contrast yellow outline */
    outline-offset: 2px !important;
    background-color: var(--wcag-btn-primary-hover) !important;
    border-color: var(--wcag-btn-primary-hover) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Button Active State */
.btn-scientific:active {
    background-color: var(--wcag-btn-primary-hover) !important;
    border-color: var(--wcag-btn-primary-hover) !important;
    color: #ffffff !important;
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Remove all gradient and shimmer effects for accessibility */
.btn-scientific::before,
.btn-scientific::after {
    display: none !important;
}

/* ========================================
   TEXT ACCESSIBILITY
   ======================================== */

/* Body Text - High Contrast */
body {
    color: var(--wcag-text-primary) !important;
    background-color: var(--wcag-bg-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    line-height: 1.6 !important;
}

/* Headings - High Contrast */
h1, h2, h3, h4, h5, h6 {
    color: var(--wcag-text-primary) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
}

/* Paragraphs */
p {
    color: var(--wcag-text-secondary) !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

/* Links - WCAG AA Compliant */
a {
    color: var(--wcag-link) !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
}

a:hover {
    color: var(--wcag-link-hover) !important;
    text-decoration: underline !important;
}

a:focus {
    outline: 3px solid #ffdd44 !important;
    outline-offset: 2px !important;
    color: var(--wcag-link-hover) !important;
    text-decoration: underline !important;
}

a:visited {
    color: var(--wcag-link-visited) !important;
}

/* ========================================
   CARD ACCESSIBILITY
   ======================================== */

/* Feature Cards */
.feature-card,
.module-card-compact,
.climate-data-card {
    background-color: var(--wcag-bg-primary) !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.feature-card:hover,
.module-card-compact:hover,
.climate-data-card:hover {
    border-color: var(--wcag-btn-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Card Titles */
.feature-card h4,
.module-card-compact h4,
.climate-data-card h4 {
    color: var(--wcag-text-primary) !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
}

/* Card Text */
.feature-card p,
.module-card-compact p,
.climate-data-card p {
    color: var(--wcag-text-secondary) !important;
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
}

/* ========================================
   NAVIGATION ACCESSIBILITY
   ======================================== */

/* Navigation Links */
.nav-link {
    color: var(--wcag-text-primary) !important;
    font-weight: 500 !important;
    padding: 12px 16px !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    min-height: 44px !important; /* WCAG AA minimum touch target */
    display: flex !important;
    align-items: center !important;
}

.nav-link:hover {
    background-color: var(--wcag-bg-accent) !important;
    color: var(--wcag-link-hover) !important;
    text-decoration: none !important;
}

.nav-link:focus {
    outline: 3px solid #ffdd44 !important;
    outline-offset: 2px !important;
    background-color: var(--wcag-bg-accent) !important;
    color: var(--wcag-link-hover) !important;
    text-decoration: none !important;
}

.nav-link.active {
    background-color: var(--wcag-btn-primary) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* ========================================
   FORM ACCESSIBILITY
   ======================================== */

/* Form Controls */
.form-control,
.form-select {
    border: 2px solid #d0d0d0 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: var(--wcag-text-primary) !important;
    background-color: var(--wcag-bg-primary) !important;
    min-height: 44px !important; /* WCAG AA minimum touch target */
}

.form-control:focus,
.form-select:focus {
    border-color: var(--wcag-btn-primary) !important;
    outline: 3px solid rgba(0, 102, 204, 0.2) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

/* Labels */
.form-label {
    color: var(--wcag-text-primary) !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    font-size: 1rem !important;
}

/* ========================================
   RESPONSIVE ACCESSIBILITY
   ======================================== */

/* Mobile Accessibility */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
        line-height: 1.5 !important;
    }
    
    .btn-scientific {
        padding: 16px 24px !important;
        font-size: 1rem !important;
        min-height: 52px !important; /* Larger touch targets on mobile */
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    /* Stack buttons vertically on mobile */
    .hero-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .hero-buttons .btn-scientific {
        margin-right: 0 !important;
    }
}

/* ========================================
   ACCESSIBILITY UTILITIES
   ======================================== */

/* Screen Reader Only Text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip Links */
.skip-link {
    position: absolute !important;
    top: -40px !important;
    left: 6px !important;
    background: var(--wcag-btn-primary) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    z-index: 9999 !important;
    font-weight: 600 !important;
}

.skip-link:focus {
    top: 6px !important;
    outline: 3px solid #ffdd44 !important;
    outline-offset: 2px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --wcag-text-primary: #000000;
        --wcag-text-secondary: #000000;
        --wcag-bg-primary: #ffffff;
        --wcag-btn-primary: #0000ff;
        --wcag-btn-primary-hover: #000080;
    }
}

/* 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;
    }
    
    .btn-scientific:hover,
    .feature-card:hover,
    .module-card-compact:hover {
        transform: none !important;
    }
}

/* ========================================
   FOCUS MANAGEMENT
   ======================================== */

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid #ffdd44 !important;
    outline-offset: 2px !important;
}

/* Remove default focus outline and use custom */
*:focus:not(:focus-visible) {
    outline: none !important;
}

/* ========================================
   PRINT ACCESSIBILITY
   ======================================== */

@media print {
    .hero-title,
    .hero-subtitle,
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
        background: none !important;
        -webkit-text-fill-color: unset !important;
        text-shadow: none !important;
    }
    
    .btn-scientific {
        background: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
    }
    
    a {
        color: #000000 !important;
        text-decoration: underline !important;
    }
}
