/* ========================================
   ACCESSIBILITY STYLES
   Making the website accessible for everyone
   ======================================== */

/* Classic cursor style (not macOS/Apple cursor) */
* {
    cursor: auto !important;
}

a, button, input[type="submit"], input[type="button"], .btn,
[role="button"], [onclick] {
    cursor: pointer !important;
}

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], textarea, select {
    cursor: text !important;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-to-main:focus {
    top: 0;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001; /* Higher than navbar (1000) to ensure it's always visible */
}

.accessibility-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.accessibility-toggle:hover,
.accessibility-toggle:focus {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.accessibility-toggle i {
    font-size: 20px;
}

.accessibility-options {
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accessibility-options[hidden] {
    display: none;
}

.accessibility-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accessibility-btn:hover,
.accessibility-btn:focus {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.accessibility-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.accessibility-btn i {
    width: 20px;
    text-align: center;
}

/* Text size adjustments */
body.text-larger {
    font-size: 18px;
}

body.text-larger h1 {
    font-size: 3.2rem;
}

body.text-larger h2 {
    font-size: 2.6rem;
}

body.text-larger h3 {
    font-size: 2rem;
}

body.text-larger p,
body.text-larger a,
body.text-larger button {
    font-size: 1.1rem;
}

body.text-largest {
    font-size: 20px;
}

body.text-largest h1 {
    font-size: 3.5rem;
}

body.text-largest h2 {
    font-size: 2.8rem;
}

body.text-largest h3 {
    font-size: 2.2rem;
}

body.text-largest p,
body.text-largest a,
body.text-largest button {
    font-size: 1.25rem;
}

/* High contrast mode */
body.high-contrast {
    background: #000;
    color: #fff;
}

body.high-contrast .navbar,
body.high-contrast .footer,
body.high-contrast .service-card,
body.high-contrast .testimonial-card,
body.high-contrast .blog-card,
body.high-contrast .dashboard-card {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
}

body.high-contrast a {
    color: #ffff00;
    text-decoration: underline;
}

body.high-contrast button,
body.high-contrast .btn {
    background: #fff;
    color: #000;
    border: 2px solid #fff;
}

body.high-contrast button:hover,
body.high-contrast .btn:hover {
    background: #ffff00;
    color: #000;
}

body.high-contrast .hero {
    background: #000;
    border-bottom: 3px solid #fff;
}

body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
}

/* Underline all links */
body.underline-links a {
    text-decoration: underline;
}

/* Readable font (OpenDyslexic alternative - using Arial for better readability) */
body.readable-font,
body.readable-font * {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
    line-height: 1.8 !important;
}

/* Focus indicators - important for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: 3px solid #4a9960;
    outline-offset: 2px;
}

/* Better focus for high contrast mode */
body.high-contrast a:focus,
body.high-contrast button:focus,
body.high-contrast input:focus,
body.high-contrast textarea:focus,
body.high-contrast select:focus {
    outline: 3px solid #ffff00;
    outline-offset: 2px;
}

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

/* Better color contrast for links */
a {
    color: #2d6e3e;
}

a:hover {
    color: #1a4124;
}

/* Ensure images have alt text reminder in dev mode */
img:not([alt]) {
    border: 3px dashed red;
}

/* Better button states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

/* Responsive accessibility toolbar */
@media (max-width: 1024px) {
    .accessibility-toolbar {
        top: 90px; /* Adjusted for smaller navbar on tablets */
    }
}

@media (max-width: 768px) {
    .accessibility-toolbar {
        top: 85px; /* Adjusted for mobile navbar */
        right: 10px;
    }
    
    .accessibility-toggle {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .accessibility-toggle span {
        display: none;
    }
    
    .accessibility-options {
        min-width: 200px;
        right: 0;
    }
    
    .accessibility-btn {
        font-size: 13px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .accessibility-toolbar {
        top: 80px; /* Adjusted for very small screens */
        right: 5px;
    }
    
    .accessibility-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .accessibility-toggle i {
        font-size: 18px;
    }
}

/* Print styles for accessibility */
@media print {
    .accessibility-toolbar,
    .navbar,
    .footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* Better table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    font-weight: bold;
}

/* Form field improvements */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
}

/* Error states */
.error,
input.error,
textarea.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

/* Success states */
.success {
    color: #28a745;
}

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

/* Language selector for future multilingual support */
.language-selector {
    position: relative;
}

/* Ensure sufficient color contrast */
.text-light {
    color: #666;
}

.text-dark {
    color: #333;
}

/* Better spacing for readability */
p {
    margin-bottom: 1em;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* List improvements */
ul, ol {
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}
