/**
 * Style dostępności dla gry edukacyjnej o wężach
 * Zgodne z WCAG 2.1 AA i wymaganiami dostępności
 */

/* Wysoki kontrast */
.high-contrast {
    filter: contrast(200%) brightness(150%);
}

.high-contrast * {
    border-color: #000000 !important;
}

.high-contrast .game-container {
    background: #000000 !important;
    color: #ffffff !important;
}

.high-contrast .main-menu,
.high-contrast .level-select,
.high-contrast .game-interface {
    background: #000000 !important;
    color: #ffffff !important;
    border: 3px solid #ffffff !important;
}

.high-contrast .menu-btn,
.high-contrast .control-btn,
.high-contrast .submit-btn {
    background: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
    font-weight: bold !important;
}

.high-contrast .level-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
}

.high-contrast .level-card.available {
    border-color: #00ff00 !important;
}

.high-contrast .level-card.completed {
    border-color: #ffff00 !important;
    background: #ffff00 !important;
    color: #000000 !important;
}

.high-contrast .level-card.locked {
    background: #808080 !important;
    color: #000000 !important;
}

.high-contrast .snake-visualization,
.high-contrast .level1-game-area {
    background: #ffffff !important;
    border: 3px solid #000000 !important;
}

.high-contrast .image-item,
.high-contrast .snake-section {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.high-contrast .image-item:hover,
.high-contrast .snake-section:hover {
    background: #ffff00 !important;
    color: #000000 !important;
}

.high-contrast .instructions {
    background: #ffffff !important;
    color: #000000 !important;
    border-left: 5px solid #000000 !important;
}

/* Duży tekst */
.large-text {
    font-size: 1.25rem !important;
    line-height: 1.6 !important;
}

.large-text .menu-header h1 {
    font-size: 3rem !important;
    line-height: 1.2 !important;
}

.large-text .menu-header p {
    font-size: 1.5rem !important;
    line-height: 1.6 !important;
}

.large-text .level-select h2 {
    font-size: 2.5rem !important;
}

.large-text .menu-btn {
    font-size: 1.4rem !important;
    padding: 20px 35px !important;
    min-height: 60px !important;
}

.large-text .level-card h3 {
    font-size: 1.8rem !important;
}

.large-text .level-card p {
    font-size: 1.3rem !important;
}

.large-text .game-info span {
    font-size: 1.2rem !important;
    padding: 12px 20px !important;
}

.large-text .control-btn {
    font-size: 1.1rem !important;
    padding: 12px 20px !important;
}

.large-text .snake-section input {
    font-size: 1.2rem !important;
    padding: 15px !important;
}

.large-text .submit-btn {
    font-size: 1.3rem !important;
    padding: 20px !important;
}

.large-text .instructions h3 {
    font-size: 1.5rem !important;
}

.large-text .instructions p {
    font-size: 1.2rem !important;
}

/* Wsparcie dla czytników ekranu */
.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* ARIA live regions */
.aria-live {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Focus indicators */
*:focus {
    outline: 4px solid #ffd700 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.5) !important;
}

/* Keyboard navigation */
.keyboard-nav .menu-btn:focus,
.keyboard-nav .control-btn:focus,
.keyboard-nav .level-card:focus {
    outline: 4px solid #ff6b6b !important;
    outline-offset: 3px !important;
    transform: scale(1.05) !important;
}

.keyboard-nav .image-item:focus,
.keyboard-nav .snake-section:focus {
    outline: 4px solid #4ecdc4 !important;
    outline-offset: 3px !important;
    transform: scale(1.02) !important;
}

/* Wsparcie dla technologii asystujących */
[role="button"] {
    cursor: pointer;
}

[role="button"]:focus {
    outline: 4px solid #ffd700 !important;
    outline-offset: 3px !important;
}

[aria-pressed="true"] {
    background: #4ecdc4 !important;
    color: white !important;
}

[aria-expanded="true"] {
    background: #45b7aa !important;
}

/* Animacje dostępności */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .loading-spinner {
        animation: none !important;
    }
    
    .fade-in,
    .slide-in {
        animation: none !important;
    }
    
    .menu-btn:hover,
    .control-btn:hover,
    .level-card:hover {
        transform: none !important;
    }
}

/* Wsparcie dla daltonizmu */
.colorblind-friendly .level-card.available {
    border-left: 8px solid #00ff00;
}

.colorblind-friendly .level-card.completed {
    border-left: 8px solid #ffff00;
}

.colorblind-friendly .level-card.locked {
    border-left: 8px solid #ff0000;
}

.colorblind-friendly .menu-btn.primary {
    border-left: 8px solid #0066cc;
}

.colorblind-friendly .submit-btn {
    border-left: 8px solid #00aa00;
}

/* Kontrast dla różnych typów daltonizmu */
.protanopia-friendly {
    filter: hue-rotate(30deg);
}

.deuteranopia-friendly {
    filter: hue-rotate(-30deg);
}

.tritanopia-friendly {
    filter: hue-rotate(180deg);
}

/* Wsparcie dla osób z trudnościami poznawczymi */
.cognitive-friendly {
    font-family: 'Arial', sans-serif !important;
    line-height: 1.8 !important;
}

.cognitive-friendly .menu-btn,
.cognitive-friendly .control-btn,
.cognitive-friendly .submit-btn {
    border-radius: 15px !important;
    border: 3px solid currentColor !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.cognitive-friendly .instructions {
    border: 3px solid #0066cc !important;
    background: #e6f3ff !important;
    padding: 25px !important;
}

.cognitive-friendly .instructions h3 {
    color: #0066cc !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Wsparcie dla osób z trudnościami ruchowymi */
.motor-friendly .menu-btn,
.motor-friendly .control-btn,
.motor-friendly .submit-btn,
.motor-friendly .level-card {
    min-height: 60px !important;
    min-width: 120px !important;
    padding: 20px !important;
    margin: 10px !important;
}

.motor-friendly .image-item {
    min-height: 120px !important;
    min-width: 120px !important;
    padding: 20px !important;
}

.motor-friendly .snake-section input {
    min-height: 50px !important;
    padding: 15px !important;
    font-size: 1.2rem !important;
}

/* Wsparcie dla napisów */
.subtitles {
    position: relative;
}

.subtitles::after {
    content: attr(data-subtitle);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Wsparcie dla sygnałów dźwiękowych */
.sound-cues {
    position: relative;
}

.sound-cues::before {
    content: "🔊";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
    z-index: 1000;
}

/* Wsparcie dla migających elementów */
.no-flash * {
    animation: none !important;
}

/* Wsparcie dla zoomu */
.zoom-friendly {
    font-size: 1.2rem !important;
}

.zoom-friendly .game-container {
    max-width: none !important;
    padding: 40px !important;
}

.zoom-friendly .main-menu,
.zoom-friendly .level-select,
.zoom-friendly .game-interface {
    padding: 40px !important;
    margin: 20px 0 !important;
}

/* Wsparcie dla kontrastu tekstu */
.text-contrast {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.text-contrast-light {
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Wsparcie dla outline */
.strong-outline * {
    outline: 3px solid #ff0000 !important;
    outline-offset: 2px !important;
}

/* Wsparcie dla focus management */
.focus-trap {
    position: relative;
}

.focus-trap::before,
.focus-trap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

/* Wsparcie dla screen reader navigation */
.nav-landmark {
    border: 2px dashed #ffd700;
    padding: 10px;
    margin: 10px 0;
}

.nav-landmark::before {
    content: "Landmark: " attr(aria-label);
    position: absolute;
    top: -25px;
    left: 0;
    background: #ffd700;
    color: #000;
    padding: 2px 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Wsparcie dla error states */
.error-state {
    border: 3px solid #ff0000 !important;
    background: #ffe6e6 !important;
    color: #cc0000 !important;
}

.error-state::after {
    content: "Błąd: " attr(data-error);
    position: absolute;
    top: -30px;
    left: 0;
    background: #ff0000;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Wsparcie dla success states */
.success-state {
    border: 3px solid #00aa00 !important;
    background: #e6ffe6 !important;
    color: #006600 !important;
}

.success-state::after {
    content: "Sukces: " attr(data-success);
    position: absolute;
    top: -30px;
    left: 0;
    background: #00aa00;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Wsparcie dla loading states */
.loading-state {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading-state::before {
    content: "Ładowanie...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
}

/* Wsparcie dla touch targets */
.touch-friendly {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 12px !important;
    margin: 8px !important;
}

/* Wsparcie dla voice control */
.voice-control {
    position: relative;
}

.voice-control::after {
    content: "🎤";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    z-index: 1000;
}

/* Wsparcie dla switch control */
.switch-control {
    position: relative;
}

.switch-control::after {
    content: "↕️";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    z-index: 1000;
}

/* Wsparcie dla eye tracking */
.eye-tracking {
    position: relative;
}

.eye-tracking::after {
    content: "👁️";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    z-index: 1000;
}

/* Wsparcie dla head tracking */
.head-tracking {
    position: relative;
}

.head-tracking::after {
    content: "👤";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    z-index: 1000;
}
