/* ===========================
   ACCESSIBILITY ENHANCEMENTS
   =========================== */

/* Focus indicators with high contrast */
:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Enhanced focus for buttons */
.btn:focus,
button:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Focus for form controls */
.form-control:focus,
.form-select:focus {
    border-color: #005fcc;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 2px solid #005fcc;
    outline-offset: 1px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 6px;
    outline: 3px solid #fff;
    color: #fff;
}

/* High contrast for map controls */
.leaflet-control-zoom,
.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #333 !important;
    border-radius: 6px !important;
}

.leaflet-control-zoom a {
    background: #fff !important;
    border: 1px solid #333 !important;
    color: #000 !important;
    font-weight: bold !important;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
    background: #005fcc !important;
    color: #fff !important;
    outline: 3px solid #ff6b35 !important;
    outline-offset: 2px;
}

/* Enhanced map controls styling */
.map-controls .btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #333;
    color: #000;
    font-weight: 600;
    min-height: 44px; /* WCAG touch target minimum */
    min-width: 44px;
    transition: all 0.2s ease;
}

.map-controls .btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.map-controls .btn:focus {
    background: #005fcc;
    color: #fff;
    outline: 3px solid #ff6b35;
    outline-offset: 2px;
}

.map-controls .btn.btn-primary {
    background: #005fcc;
    color: #fff;
    border-color: #004494;
}

.map-controls .btn.btn-primary:hover {
    background: #004494;
}

.map-controls .btn.btn-primary:focus {
    background: #003d82;
    outline: 3px solid #ff6b35;
}

/* Enhanced icon contrast */
.map-controls .btn i {
    font-size: 1.1em;
    filter: contrast(1.2);
}

/* Spinner accessibility */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Screen reader only text */
.sr-only,
.visually-hidden {
    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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
        border-color: #000;
    }
    
    .navbar {
        border-bottom: 3px solid #000;
    }
    
    .form-control, .form-select {
        border-width: 2px;
        border-color: #000;
    }
}

/* 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;
    }
    
    .spin {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .map-controls .btn {
        background: rgba(45, 55, 72, 0.95);
        border-color: #718096;
        color: #f7fafc;
    }
    
    .map-controls .btn:hover {
        background: rgba(45, 55, 72, 1);
    }
    
    .map-controls .btn:focus {
        background: #3182ce;
        outline-color: #ffa726;
    }
}

/* Toast accessibility improvements */
.blazored-toast {
    border: 2px solid transparent;
}

.blazored-toast:focus-within {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

.blazored-toast-close-button:focus {
    outline: 2px solid #005fcc;
    outline-offset: 1px;
}

/* Form validation improvements */
.field-validation-error {
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.25rem;
}

.input-validation-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

/* Loading state accessibility */
[aria-busy="true"] {
    cursor: wait;
    pointer-events: none;
}

/* Enhanced touch targets for mobile */
@media (max-width: 767.98px) {
    .btn, button, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        padding: 12px 16px;
    }
}

/* Live region for announcements */
#accessibility-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
