/* Accessibility Fixes - WCAG 2.1 AA Compliance */

:root {
    /* High Contrast Color Palette - WCAG AA Compliant */
    --text-primary: #1a1a1a; /* Contrast ratio: 15.3:1 on white */
    --text-secondary: #4a4a4a; /* Contrast ratio: 8.6:1 on white */
    --text-light: #595959; /* Contrast ratio: 7.0:1 on white */
    --text-on-dark: #ffffff; /* For dark backgrounds */
    
    /* Primary colors with better contrast */
    --primary-color: #7b1fa2; /* Darker purple for better contrast */
    --secondary-color: #c2185b; /* Darker pink */
    --accent-color: #d84315; /* Darker orange for links */
    
    /* Background colors */
    --bg-light: #ffffff;
    --bg-dark: #1a1a1a;
    --bg-gray: #f5f5f5;
    
    /* Focus indicators */
    --focus-color: #0066cc;
    --focus-outline: 3px solid var(--focus-color);
    --focus-offset: 2px;
}

/* Ensure minimum contrast ratios */
body {
    color: var(--text-primary);
    background: var(--bg-light);
}

/* Links with sufficient contrast */
a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

a:hover {
    text-decoration: none;
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

a:visited {
    color: #8e24aa; /* Different color for visited links */
}

/* Touch target sizes - minimum 44x44px for mobile */
button, 
a.btn,
.btn-ticket,
input[type="button"],
input[type="submit"],
.event-card,
.nav-link,
.filter-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Spacing between interactive elements */
.nav-menu li {
    margin: 0 8px; /* Add spacing between nav items */
}

.event-grid {
    gap: 30px; /* Increase gap for better touch spacing */
}

/* Focus indicators for keyboard navigation */
*:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.25);
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

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

/* High contrast mode for important elements */
.event-price {
    color: #c62828; /* Darker red for better contrast */
    font-weight: 700;
}

.event-date {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    font-weight: 600;
    padding: 6px 12px;
}

.event-category {
    background: rgba(0, 0, 0, 0.85); /* Darker background */
    color: #ffffff;
    font-weight: 500;
}

/* Form elements with better contrast */
input, select, textarea {
    border: 2px solid #666;
    background: #fff;
    color: var(--text-primary);
    font-size: 16px; /* Prevent zoom on iOS */
}

input::placeholder {
    color: #666; /* WCAG AA compliant */
}

/* Error and success messages */
.error {
    color: #b71c1c;
    background: #ffebee;
    border: 2px solid #b71c1c;
    padding: 12px;
    font-weight: 600;
}

.success {
    color: #1b5e20;
    background: #e8f5e9;
    border: 2px solid #1b5e20;
    padding: 12px;
    font-weight: 600;
}

/* Improve readability */
p, li {
    line-height: 1.7;
    letter-spacing: 0.02em;
}

/* 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 trap for modals */
.modal:focus-within {
    outline: 4px solid var(--focus-color);
}

/* Improved button contrast */
.btn-primary,
.btn-ticket {
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
}

.btn-primary:hover,
.btn-ticket:hover {
    background: #5e1480;
    transform: none; /* Remove motion for accessibility */
}

/* Reduce motion for users who prefer it */
@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;
    }
    
    .event-card:hover {
        transform: none;
    }
    
    .floating-btn {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --bg-light: #ffffff;
        --primary-color: #6a0dad;
        --accent-color: #cc0000;
    }
    
    * {
        border-width: 2px !important;
    }
}

/* Dark mode with accessible colors */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f0f0f0;
        --text-secondary: #d0d0d0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --bg-dark: #000000;
        --bg-gray: #2a2a2a;
    }
    
    body {
        background: var(--bg-light);
        color: var(--text-primary);
    }
    
    .event-card {
        background: var(--bg-gray);
        border: 1px solid #444;
    }
    
    a {
        color: #66b3ff; /* Light blue for dark mode */
    }
}

/* Ensure interactive elements are distinguishable */
button:not(:disabled),
a[href],
input:not(:disabled),
select:not(:disabled),
textarea:not(:disabled),
[tabindex]:not([tabindex="-1"]) {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(0.5);
}

/* Mobile specific touch targets */
@media (max-width: 768px) {
    .nav-link,
    .filter-btn,
    button,
    .event-card {
        min-height: 48px; /* Even larger on mobile */
        padding: 14px 20px;
    }
    
    .event-grid {
        gap: 40px; /* More space between cards */
    }
}

/* Skip link removed per user request */
.skip-to-main,
a[href="#main"]:first-child {
    display: none !important;
    visibility: hidden !important;
}