/**
 * NHFTB Accessibility Styles
 * Styles for blind mode and enhanced accessibility features
 */

/* Skip Links */
.skip-links {
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #000;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    color: #fff;
    background: #000;
    padding: 10px;
    text-decoration: none;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    left: 0;
    display: inline-block;
    margin: 10px;
    border: 2px solid #fff;
    outline: 3px solid #4d90fe;
}

/* Screen Reader Only Content */
.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;
}

/* Accessibility Controls */
.accessibility-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Accessibility Suggestion */
.accessibility-suggestion {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.suggestion-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2rem;
}

.suggestion-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.suggestion-actions button {
    flex: 1;
}

/* Focus Indicators */
.user-is-tabbing *:focus {
    outline: 3px solid #4d90fe !important;
    outline-offset: 2px !important;
}

/* Blind Mode Styles */
body.blind-mode {
    font-size: 1.2em;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

body.blind-mode * {
    animation: none !important;
    transition: none !important;
}

/* High Contrast Mode */
body.blind-mode {
    background: #000 !important;
    color: #fff !important;
}

body.blind-mode a {
    color: #4d90fe !important;
    text-decoration: underline !important;
}

body.blind-mode a:hover,
body.blind-mode a:focus {
    color: #8bb3f7 !important;
    background: rgba(77, 144, 254, 0.2) !important;
}

body.blind-mode button,
body.blind-mode .btn {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
}

body.blind-mode button:hover,
body.blind-mode button:focus,
body.blind-mode .btn:hover,
body.blind-mode .btn:focus {
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px #4d90fe !important;
}

body.blind-mode input,
body.blind-mode select,
body.blind-mode textarea {
    background: #fff !important;
    color: #000 !important;
    border: 3px solid #fff !important;
    font-size: 1.1em !important;
    padding: 10px !important;
}

body.blind-mode input:focus,
body.blind-mode select:focus,
body.blind-mode textarea:focus {
    border-color: #4d90fe !important;
    box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.5) !important;
}

/* Icon Text Replacements */
.blind-mode .icon-text-replacement {
    display: inline-block;
    margin-left: 5px;
    font-weight: normal;
    text-transform: capitalize;
}

.blind-mode i[aria-hidden="true"] {
    display: none;
}

/* Enhanced Form Labels */
.blind-mode label {
    font-weight: bold !important;
    display: block !important;
    margin-bottom: 5px !important;
}

.blind-mode .required::after {
    content: " (required)";
    color: #ff6b6b;
    font-weight: normal;
}

/* Results Enhancement */
.blind-mode .result-card {
    border: 3px solid #fff !important;
    margin-bottom: 20px !important;
    padding: 20px !important;
}

.blind-mode .result-card:focus-within {
    box-shadow: 0 0 0 3px #4d90fe !important;
}

/* Voice Input Indicator */
.voice-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff3333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: pulse 1.5s infinite;
}

.voice-indicator.active {
    display: flex;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 51, 51, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0);
    }
}

.voice-indicator::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

/* Large Print Mode */
body.large-print {
    font-size: 1.5em !important;
}

body.large-print h1 {
    font-size: 2.5em !important;
}

body.large-print h2 {
    font-size: 2.2em !important;
}

body.large-print h3 {
    font-size: 1.9em !important;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        background: #000 !important;
        color: #fff !important;
    }
    
    a {
        color: #4d90fe !important;
        text-decoration: underline !important;
    }
    
    button, .btn {
        border: 2px solid !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body:not(.blind-mode) {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    body:not(.blind-mode) .card {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
}

/* Keyboard Navigation Indicators */
.keyboard-nav-hint {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
}

.keyboard-nav-hint.visible {
    opacity: 1;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    padding: 10px;
    display: none;
    justify-content: center;
    gap: 10px;
    z-index: 999;
}

body.blind-mode .accessibility-toolbar {
    display: flex;
    background: #000;
    border-top-color: #fff;
}

.accessibility-toolbar button {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    font-size: 0.9em;
}

.accessibility-toolbar button:hover,
.accessibility-toolbar button:focus {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Loading States for Screen Readers */
.loading-announcement {
    position: absolute;
    left: -9999px;
}

.loading-announcement[aria-busy="true"]::after {
    content: "Loading, please wait...";
}

/* Error Messages Enhancement */
.blind-mode .error-message,
.blind-mode .alert-danger {
    border: 3px solid #ff3333 !important;
    background: #330000 !important;
    color: #ff9999 !important;
    padding: 15px !important;
    margin: 10px 0 !important;
}

/* Success Messages Enhancement */
.blind-mode .success-message,
.blind-mode .alert-success {
    border: 3px solid #33ff33 !important;
    background: #003300 !important;
    color: #99ff99 !important;
    padding: 15px !important;
    margin: 10px 0 !important;
}

/* Form Validation States */
.blind-mode input:invalid,
.blind-mode select:invalid,
.blind-mode textarea:invalid {
    border-color: #ff3333 !important;
}

.blind-mode input:valid:not(:placeholder-shown),
.blind-mode select:valid,
.blind-mode textarea:valid:not(:placeholder-shown) {
    border-color: #33ff33 !important;
}

/* Progress Indicators */
.blind-mode .progress {
    height: 30px !important;
    border: 2px solid #fff !important;
}

.blind-mode .progress-bar {
    background: #4d90fe !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 1.1em !important;
}

/* Table Enhancement */
.blind-mode table {
    border: 2px solid #fff !important;
}

.blind-mode th {
    background: #333 !important;
    color: #fff !important;
    padding: 15px !important;
    font-size: 1.1em !important;
}

.blind-mode td {
    padding: 12px !important;
    border: 1px solid #666 !important;
}

.blind-mode tr:hover {
    background: #111 !important;
}

/* Badge Enhancement */
.blind-mode .badge {
    font-size: 0.9em !important;
    padding: 5px 10px !important;
    font-weight: bold !important;
    border: 2px solid !important;
}