/* Accessibility & Visual Enhancement Styles for NailHub Finds */

/* ============================================================================= */
/* HIGH CONTRAST IMPROVEMENTS */
/* ============================================================================= */

/* Improve text contrast for better readability */
.text-gray-500 {
    color: #6b7280 !important; /* Darker gray for better contrast */
}

.text-gray-400 {
    color: #9ca3af !important; /* Ensure minimum 4.5:1 contrast ratio */
}

/* Enhanced button contrast */
.bg-pink-500:hover {
    background-color: #ec4899 !important;
}

.bg-gray-900:hover {
    background-color: #111827 !important;
}

/* ============================================================================= */
/* FOCUS INDICATORS */
/* ============================================================================= */

/* Enhanced focus indicators for keyboard navigation */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #ec4899 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1) !important;
}

button:focus,
a:focus,
[role="button"]:focus {
    outline: 2px solid #ec4899 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2) !important;
}

/* ============================================================================= */
/* LOADING AND ANIMATION ACCESSIBILITY */
/* ============================================================================= */

/* Respect user's motion preferences */
@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;
    }
    
    .animate-spin {
        animation: none !important;
    }
    
    .animate-fade-in-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================================= */
/* ENHANCED ERROR AND SUCCESS STATES */
/* ============================================================================= */

/* Error state improvements */
.error-state {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error-message {
    color: #dc2626 !important;
    font-weight: 500 !important;
}

/* Success state improvements */
.success-state {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.success-message {
    color: #059669 !important;
    font-weight: 500 !important;
}

/* ============================================================================= */
/* SCREEN READER ENHANCEMENTS */
/* ============================================================================= */

/* Screen reader only text */
.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;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

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

/* ============================================================================= */
/* MOBILE ACCESSIBILITY */
/* ============================================================================= */

/* Larger touch targets for mobile */
@media (max-width: 768px) {
    button,
    a,
    input[type="button"],
    input[type="submit"],
    [role="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Larger text for mobile readability */
    .text-sm {
        font-size: 0.875rem !important;
    }
    
    .text-xs {
        font-size: 0.75rem !important;
    }
}

/* ============================================================================= */
/* HIGH CONTRAST MODE SUPPORT */
/* ============================================================================= */

/* Support for Windows High Contrast mode */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff !important;
        border: 1px solid #000000 !important;
    }
    
    .text-gray-600 {
        color: #000000 !important;
    }
    
    .border-gray-200 {
        border-color: #000000 !important;
    }
    
    .bg-pink-500 {
        background-color: #000080 !important;
        color: #ffffff !important;
    }
}

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

/* Required field indicators */
label[for] .required::after,
label .required::after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
}

/* Form validation states */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

input[aria-invalid="false"],
textarea[aria-invalid="false"],
select[aria-invalid="false"] {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* ============================================================================= */
/* LOADING STATE ACCESSIBILITY */
/* ============================================================================= */

/* Loading states with proper ARIA support */
[aria-busy="true"] {
    position: relative;
}

[aria-busy="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ec4899;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Respect reduced motion for loading spinner */
@media (prefers-reduced-motion: reduce) {
    [aria-busy="true"]::after {
        animation: none;
        border: 2px solid #ec4899;
        border-radius: 0;
        width: 4px;
        height: 20px;
    }
}

/* ============================================================================= */
/* TOAST NOTIFICATION ACCESSIBILITY */
/* ============================================================================= */

/* Toast notifications with proper contrast */
.toast-notification {
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-success {
    background-color: #f0fdf4;
    border-color: #10b981;
    color: #064e3b;
}

.toast-error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #7f1d1d;
}

.toast-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #78350f;
}

.toast-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e3a8a;
}

/* ============================================================================= */
/* PRINT STYLES */
/* ============================================================================= */

@media print {
    /* Hide navigation and interactive elements */
    nav,
    button,
    .fixed,
    .sticky,
    [role="banner"],
    [role="navigation"] {
        display: none !important;
    }
    
    /* Ensure text is black for printing */
    * {
        color: #000000 !important;
        background: transparent !important;
    }
    
    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* ============================================================================= */
/* UTILITY CLASSES */
/* ============================================================================= */

/* Focus trap for modals */
.focus-trap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.focus-trap.active {
    pointer-events: auto;
}

/* Visually hidden but available to screen readers */
.visually-hidden {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden !important;
}