/* Accessibility CSS for Nilesh Sarda Website */

/* Skip Navigation */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2a5298;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 100;
    font-weight: bold;
}

.skip-nav:focus {
    top: 6px;
    outline: 2px solid white;
}

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

/* Focus Indicators */
.keyboard-nav *:focus {
    outline: 3px solid #ff6b6b !important;
    outline-offset: 2px !important;
}

.keyboard-nav button:focus,
.keyboard-nav a:focus,
.keyboard-nav input:focus,
.keyboard-nav select:focus,
.keyboard-nav textarea:focus {
    outline: 3px solid #ff6b6b !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px white, 0 0 0 5px #ff6b6b !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero {
        background: #000080 !important;
        color: white !important;
    }
    
    .service-card,
    .blog-card,
    .feature-card {
        border: 3px solid black !important;
        background: white !important;
    }
    
    .cta-button,
    .submit-btn,
    .period-btn {
        border: 3px solid black !important;
        background: white !important;
        color: black !important;
    }
    
    .cta-button:hover,
    .cta-button:focus,
    .submit-btn:hover,
    .submit-btn:focus {
        background: black !important;
        color: white !important;
    }
    
    .data-table th {
        background: black !important;
        color: white !important;
        border: 2px solid white !important;
    }
    
    .data-table td {
        border: 1px solid black !important;
    }
}

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

/* Large Text Support */
@media (min-resolution: 192dpi) {
    body {
        font-size: 1.1rem;
        line-height: 1.7;
    }
}

/* Touch Target Size */
@media (pointer: coarse) {
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    .hamburger {
        min-height: 48px;
        min-width: 48px;
    }
    
    .period-btn {
        min-height: 48px;
        padding: 1rem 1.5rem;
    }
}

/* Color Blind Friendly */
.success {
    background: #0066cc;
    color: white;
}

.warning {
    background: #ffcc00;
    color: black;
}

.error {
    background: #cc0000;
    color: white;
}

/* Better Focus Management */
.focus-trap:focus {
    outline: none;
}

.focus-trap:focus-visible {
    outline: 3px solid #ff6b6b;
    outline-offset: 2px;
}

/* Enhanced Button States */
button:disabled,
input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover,
input:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Form Enhancement */
label {
    cursor: pointer;
}

input:invalid {
    border-color: #cc0000;
}

input:valid {
    border-color: #0066cc;
}

/* Table Accessibility */
.data-table caption {
    font-weight: bold;
    padding: 1rem;
    caption-side: top;
}

.data-table th[scope="col"] {
    text-align: center;
}

.data-table th[scope="row"] {
    text-align: left;
}

/* Language Support */
:lang(hi) {
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
}

/* Print Styles */
@media print {
    .skip-nav,
    .hamburger,
    nav,
    .cta-button,
    .submit-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .data-table {
        border-collapse: collapse;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    body {
        background: var(--bg-color);
        color: var(--text-color);
    }
    
    .service-card,
    .content-section,
    .blog-card {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
    }
    
    .data-table td {
        background: var(--card-bg);
        border-color: var(--border-color);
    }
}

/* Animation Control */
.prefers-reduced-motion {
    animation: none !important;
    transition: none !important;
}

/* Error States */
.error-message {
    color: #cc0000;
    font-weight: bold;
    role: alert;
}

.success-message {
    color: #0066cc;
    font-weight: bold;
    role: status;
}

/* Loading States */
.loading {
    cursor: wait;
}

.loading * {
    pointer-events: none;
}

/* Aria Live Regions */
[aria-live="polite"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Better Link Indication */
a {
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}

a:hover,
a:focus {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Icon Accessibility */
[role="img"] {
    display: inline-block;
}

/* Better Table Reading */
.data-table tr:hover {
    background: #e8f4f8 !important;
}

.data-table tr:focus-within {
    outline: 3px solid #ff6b6b;
    outline-offset: -3px;
}

/* Mobile Accessibility */
@media (max-width: 768px) {
    body {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    button,
    .cta-button,
    .period-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 1rem;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .skip-nav {
        font-size: 1rem;
        padding: 1rem;
    }
}