/* Accessibility Improvements for AZNerds Website */

/* Enhanced Focus Indicators */
*:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content:focus {
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 12px 16px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 4px 0;
}

/* Button focus improvements */
button:focus,
.btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px white, 0 0 0 5px var(--accent-color);
}

/* Navigation focus improvements */
nav a:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    background-color: rgba(0, 120, 212, 0.1);
    border-radius: 4px;
}

/* Mobile navigation toggle focus */
.mobile-nav-toggle:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    background-color: rgba(0, 120, 212, 0.1);
    border-radius: 4px;
}

/* Link focus improvements */
a:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    background-color: rgba(0, 120, 212, 0.1);
    border-radius: 2px;
    text-decoration: underline;
}

/* Card focus improvements for keyboard navigation */
.service-card:focus-within,
.user-group-card:focus-within,
.additional-service-item:focus-within {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #B8860B;
        --accent-color: #0066CC;
        --text-color: #000000;
        --background-color: #FFFFFF;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .service-card,
    .user-group-card {
        border: 2px solid var(--text-color);
    }
}

/* 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;
    }
    
    .service-card:hover,
    .user-group-card:hover,
    .additional-service-item:hover {
        transform: none;
    }
}

/* 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;
}

/* Ensure sufficient color contrast for text */
.hero p,
.cta p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Improve visibility of active navigation items */
nav ul li a[aria-current="page"] {
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    padding: 8px 12px;
}

/* Focus management for mobile navigation */
.mobile-nav-toggle[aria-expanded="true"] + nav ul {
    display: flex;
}

/* Ensure interactive elements have minimum touch target size */
@media (max-width: 768px) {
    .btn,
    .mobile-nav-toggle,
    nav ul li a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    nav ul li a {
        padding: 12px;
    }
}

/* Improve form accessibility (for future forms) */
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px white, 0 0 0 5px var(--accent-color);
}

/* Error states for forms */
.form-error {
    color: #d32f2f;
    font-weight: bold;
    margin-top: 4px;
}

input.error,
textarea.error,
select.error {
    border-color: #d32f2f;
    outline-color: #d32f2f;
}

/* Success states for forms */
.form-success {
    color: #2e7d32;
    font-weight: bold;
    margin-top: 4px;
}

/* Ensure social icons are accessible */
.social-icon:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    transform: translateY(-3px);
}

/* Improve heading hierarchy visibility for screen readers */
h1, h2, h3, h4, h5, h6 {
    position: relative;
}

/* Add visual indicators for required fields (for future forms) */
.required::after {
    content: " *";
    color: #d32f2f;
    font-weight: bold;
}

/* Ensure sufficient spacing for touch targets */
.footer-links a {
    padding: 8px;
    margin: 0 4px;
    border-radius: 4px;
}

.footer-links a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}