/* Custom styles for Hearing Help Hub */

/* Font family override */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Button hover effects */
.btn-primary {
    @apply bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 focus:ring-4 focus:ring-blue-200 transition-all duration-200;
}

.btn-secondary {
    @apply bg-gray-100 text-gray-700 px-6 py-3 rounded-lg font-medium hover:bg-gray-200 focus:ring-4 focus:ring-gray-200 transition-all duration-200;
}

/* Table styles */
.sortable:hover {
    background-color: #f8fafc;
}

.sort-asc::after {
    content: ' ↑';
    color: #3b82f6;
}

.sort-desc::after {
    content: ' ↓';
    color: #3b82f6;
}

/* FAQ accordion animations */
.faq-button.active .fas {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.faq-content.show {
    max-height: 200px;
    transition: max-height 0.3s ease-in-out;
}

/* Card hover effects */
.offer-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile table scrolling */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-container table {
        min-width: 800px;
    }
}

/* Performance optimizations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff;
    }
    
    .text-gray-600 {
        color: #000000;
    }
    
    .border-gray-200 {
        border-color: #000000;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Custom utility classes */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive text sizing */
@media (max-width: 640px) {
    .responsive-text-xl {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
    
    .responsive-text-3xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    .responsive-text-4xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

/* Skeleton loading for tables */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ensure proper contrast ratios for WCAG AA compliance */
.text-blue-600 {
    color: #1d4ed8; /* Darker blue for better contrast */
}

.bg-blue-600 {
    background-color: #1d4ed8; /* Darker blue for better contrast */
}

.hover\:bg-blue-700:hover {
    background-color: #1e40af;
}

/* Sticky navigation enhancement */
.sticky-nav {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Enhanced focus states for keyboard navigation */
.nav-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Better table readability */
.table-striped tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.table-hover tbody tr:hover {
    background-color: #e2e8f0;
}
