/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10002;
    font-weight: bold;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Focus Indicators */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
.cta-button:focus-visible,
.filter-btn:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --text-light: #333333;
        --bg-glass: rgba(255, 255, 255, 0.9);
        --bg-glass-hover: rgba(255, 255, 255, 1);
    }
    
    .cta-button.secondary {
        border: 3px solid var(--primary-color);
    }
    
    .portfolio-item {
        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;
    }
    
    .floating-shape {
        animation: none;
    }
    
    .particle-canvas {
        display: none;
    }
    
    .warm-glow {
        animation: none;
    }
    
    .typewriter {
        animation: none;
    }
}

/* Screen Reader Only Content */
.sr-only {
    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;
}

/* Ensure minimum touch target size */
@media (pointer: coarse) {
    button,
    .cta-button,
    .filter-btn,
    .nav-item,
    .portfolio-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    .filter-btn {
        padding: 1rem 1.5rem;
    }
    
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Color Blind Friendly Colors */
.color-blind-safe {
    --primary-color: #0066cc;
    --secondary-color: #ff6600;
    --accent-color: #009900;
    --error-color: #cc0000;
    --warning-color: #ff9900;
    --success-color: #00cc00;
}

/* Dark Mode Accessibility */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e2e8f0;
        --text-light: #a0aec0;
        --bg-color: #1a202c;
        --bg-glass: rgba(45, 55, 72, 0.8);
        --bg-glass-hover: rgba(45, 55, 72, 0.9);
    }
    
    body {
        background: linear-gradient(135deg, 
            rgba(26, 32, 44, 0.95) 0%, 
            rgba(45, 55, 72, 0.95) 50%,
            rgba(74, 85, 104, 0.95) 100%);
    }
    
    .service-card,
    .pricing-card,
    .testimonial-card,
    .contact-info,
    .contact-form {
        background: rgba(45, 55, 72, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .form-group input,
    .form-group textarea {
        background: rgba(26, 32, 44, 0.8);
        border: 2px solid rgba(255, 255, 255, 0.2);
        color: var(--text-color);
    }
    
    .form-group input:focus,
    .form-group textarea:focus {
        border-color: var(--primary-color);
        background: rgba(26, 32, 44, 0.9);
    }
}

/* Keyboard Navigation Indicators */
.keyboard-navigation .portfolio-item:focus,
.keyboard-navigation .service-card:focus,
.keyboard-navigation .pricing-card:focus {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large), 0 0 0 3px var(--primary-color);
}

/* Error States for Form Accessibility */
.form-group.error input,
.form-group.error textarea {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.form-group.error label {
    color: #dc3545;
}

.form-error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-error-message::before {
    content: "⚠️";
    font-size: 0.875rem;
}

/* Success States */
.form-group.success input,
.form-group.success textarea {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.form-success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-success-message::before {
    content: "✅";
    font-size: 0.875rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Tooltip for better UX */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

/* Print Accessibility */
@media print {
    .skip-link,
    .floating-elements,
    #particles-canvas,
    .scroll-indicator,
    .lightbox,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .portfolio-item {
        break-inside: avoid;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
