/**
 * Accessibility Enhancements for PascoWeather.com
 * Improves accessibility for all users, including those with disabilities
 */

/* Focus Styles */
:focus {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
    border-radius: 0 0 4px 0;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.5);
}

/* High Contrast Mode */
.high-contrast {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Light high contrast colors */
    --bg-color: #ffffff;
    --bg-secondary: #f0f0f0;
    --text-color: #000000;
    --text-muted: #333333;
    --border-color: #000000;
    --card-bg: #ffffff;
    --navbar-bg: #000000;
    --navbar-text: #ffffff;
}

.high-contrast[data-theme="dark"] {
    /* Dark high contrast colors */
    --bg-color: #000000;
    --bg-secondary: #222222;
    --text-color: #ffffff;
    --text-muted: #dddddd;
    --border-color: #ffffff;
    --card-bg: #000000;
    --navbar-bg: #000000;
    --navbar-text: #ffffff;
}

/* Increased Contrast for Alert Severity */
.high-contrast .alert-danger,
.high-contrast .bg-danger,
.high-contrast .border-danger,
.high-contrast .btn-danger,
.high-contrast .timeline-header.severe,
.high-contrast .timeline-dot.severe {
    background-color: #ff0000 !important;
    border-color: #ff0000 !important;
    color: #ffffff !important;
}

.high-contrast .alert-warning,
.high-contrast .bg-warning,
.high-contrast .border-warning,
.high-contrast .btn-warning,
.high-contrast .timeline-header.moderate,
.high-contrast .timeline-dot.moderate {
    background-color: #ffcc00 !important;
    border-color: #000000 !important;
    color: #000000 !important;
}

.high-contrast .alert-info,
.high-contrast .bg-info,
.high-contrast .border-info,
.high-contrast .btn-info,
.high-contrast .timeline-header.minor,
.high-contrast .timeline-dot.minor {
    background-color: #00ccff !important;
    border-color: #00ccff !important;
    color: #000000 !important;
}

/* Increased Font Size Mode */
.large-text {
    font-size: 120% !important;
}

.large-text h1, .large-text .h1 {
    font-size: 2.5rem !important;
}

.large-text h2, .large-text .h2 {
    font-size: 2rem !important;
}

.large-text h3, .large-text .h3 {
    font-size: 1.75rem !important;
}

.large-text h4, .large-text .h4 {
    font-size: 1.5rem !important;
}

.large-text h5, .large-text .h5 {
    font-size: 1.25rem !important;
}

.large-text h6, .large-text .h6 {
    font-size: 1.1rem !important;
}

.large-text .btn {
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
}

.large-text .btn-sm {
    font-size: 0.9rem !important;
    padding: 0.4rem 0.8rem !important;
}

.large-text .small, 
.large-text small {
    font-size: 90% !important;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
    
    .alert-banner {
        animation: none !important;
    }
    
    .forecast-card:hover {
        transform: none !important;
    }
    
    .timeline-item {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Improved Alert Readability */
.alert {
    border-width: 2px;
}

.alert-danger, .bg-danger {
    color: #ffffff !important;
}

.alert-warning, .bg-warning {
    color: #000000 !important;
}

.alert-info, .bg-info {
    color: #000000 !important;
}

/* Accessibility Controls */
.accessibility-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accessibility-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    transition: transform 0.2s ease;
}

.accessibility-toggle:hover {
    transform: scale(1.1);
}

.accessibility-menu {
    position: absolute;
    bottom: 50px;
    left: 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    width: 250px;
    display: none;
    border: 1px solid var(--border-color);
}

.accessibility-menu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.accessibility-menu h6 {
    margin-bottom: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.accessibility-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.accessibility-option:last-child {
    margin-bottom: 0;
}

.accessibility-option label {
    margin-left: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Keyboard Navigation Indicator */
body:not(.using-mouse) button:focus,
body:not(.using-mouse) [tabindex]:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.5) !important;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}