/* Accessibility Enhancement CSS for Ebenezer TV Website */
/* WCAG 2.1 AA Compliance Implementation */

/* 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 Management */
*:focus {
    outline: 3px solid #60a5fa;
    outline-offset: 2px;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #1e3a8a;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        background: white;
        color: black;
    }
    
    .bg-gradient-to-r {
        background: #000080 !important;
    }
    
    .text-white {
        color: white !important;
    }
    
    .text-gray-300 {
        color: #cccccc !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-pulse,
    .animate-bounce,
    .animate-spin {
        animation: none !important;
    }
}

/* Color Contrast Enhancements */
.text-gray-600 {
    color: #4a5568 !important;
}

.text-gray-500 {
    color: #718096 !important;
}

/* Button Accessibility */
button, 
.btn,
[role="button"] {
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Accessibility */
input, 
textarea, 
select {
    min-height: 44px;
}

input:invalid,
textarea:invalid,
select:invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

input:valid,
textarea:valid,
select:valid {
    border-color: #059669;
}

/* Required Field Indicators */
input[required]:not(:placeholder-shown):invalid,
textarea[required]:not(:placeholder-shown):invalid,
select[required]:invalid {
    border-color: #dc2626;
}

input[required]:not(:placeholder-shown):valid,
textarea[required]:not(:placeholder-shown):valid,
select[required]:valid {
    border-color: #059669;
}

/* Error Messages */
.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.5rem;
}

/* Success Messages */
.success-message {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.success-message::before {
    content: "✅";
    margin-right: 0.5rem;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Card Accessibility */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover,
.card:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Navigation Accessibility */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

nav a:hover,
nav a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
}

/* Mobile Touch Targets */
@media (max-width: 768px) {
    button,
    .btn,
    [role="button"],
    a {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }
    
    input,
    textarea,
    select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Table Accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f7fafc;
    font-weight: bold;
}

/* Modal Accessibility */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Tooltip Accessibility */
.tooltip {
    position: relative;
}

.tooltip:hover::after,
.tooltip:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a::after {
        content: " (" attr(href) ")";
    }
    
    .bg-gradient-to-r,
    .bg-blue-950 {
        background: white !important;
        color: black !important;
    }
}

/* Image Accessibility */
img {
    max-width: 100%;
    height: auto;
}

img[alt=""] {
    /* Decorative images */
    display: inline-block;
}

/* Video Accessibility */
video {
    max-width: 100%;
    height: auto;
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

/* Breadcrumb Accessibility */
.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin: 0 8px;
    color: #6b7280;
}

/* Status Messages */
.status-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 16px 0;
}

.status-success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.status-error {
    background-color: #fee2e2;
    border: 1px solid #dc2626;
    color: #991b1b;
}

.status-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.status-info {
    background-color: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

/* Live Region for Dynamic Content */
.live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Carousel Accessibility */
.carousel {
    position: relative;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: none;
    cursor: pointer;
}

.carousel-indicator.active {
    background-color: #3b82f6;
}

.carousel-indicator:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* Menu Accessibility */
.menu {
    position: relative;
}

.menu-button:focus + .menu-items,
.menu-items:focus-within {
    display: block;
}

.menu-items {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
}

.menu-item {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
}

.menu-item:hover,
.menu-item:focus {
    background-color: #f9fafb;
}

.menu-item:last-child {
    border-bottom: none;
}