/* accessibility.css */

/* Toolbar Styles */
.a11y-toolbar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse; /* Zmiana kierunku na pionowy (odwrócony) */
    align-items: flex-start;       /* Wyrównanie do lewej */
    gap: 10px;
    pointer-events: none; /* Naprawa: Kontener przepuszcza kliknięcia */
}

.a11y-toolbar-toggle {
    min-width: 50px; /* Zamiast sztywnego width */
    height: 50px;
    border-radius: 25px; /* Pigułka (połowa wysokości) */
    background-color: var(--primary-color);
    color: white;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s ease; /* Animujemy wszystkie właściwości */
    padding: 0;
    overflow: hidden;
    pointer-events: auto; /* Przywracamy klikalność dla przycisku */
}

.a11y-toolbar-toggle:hover {
    transform: scale(1.05);
}

/* Styl tekstu "Dostępność" */
.a11y-toggle-label {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Rozwijanie przycisku po najechaniu lub gdy aktywny */
.a11y-toolbar-toggle:hover,
.a11y-toolbar-toggle[aria-expanded="true"] {
    padding: 0 20px;
    gap: 10px;
}

.a11y-toolbar-toggle:hover .a11y-toggle-label,
.a11y-toolbar-toggle[aria-expanded="true"] .a11y-toggle-label {
    max-width: 150px;
    opacity: 1;
}

.a11y-toolbar-menu {
    display: flex;
    flex-direction: column; /* Ustawienie przycisków w pionie */
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid #ddd;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom left;
    min-width: 220px; /* Minimalna szerokość menu dla czytelności tekstu */
    pointer-events: auto; /* Przywracamy klikalność dla menu */
}

.a11y-toolbar-menu.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.a11y-btn {
    width: 100%; /* Przycisk zajmuje całą szerokość menu */
    height: auto;
    min-height: 45px;
    padding: 8px 15px; /* Odstępy wewnętrzne */
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Wyrównanie do lewej */
    gap: 12px; /* Odstęp między ikoną a tekstem */
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.a11y-btn:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.a11y-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.a11y-btn i {
    font-size: 1.4rem; /* Rozmiar ikony */
    flex-shrink: 0;
}

.a11y-reset-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Accessibility Feature Styles */

/* Font Size */
html.a11y-font-plus { font-size: 110%; }
html.a11y-font-plus-plus { font-size: 120%; }
html.a11y-font-minus { font-size: 90%; }

/* High Contrast - Żółty na Czarnym (Yellow on Black) */
html.a11y-high-contrast,
html.a11y-high-contrast body {
    background-color: #000 !important;
    color: #ffff00 !important;
}

html.a11y-high-contrast * {
    background-color: transparent !important;
    background-image: none !important; /* Usuwa gradienty i tła obrazkowe */
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Elementy blokowe - czarne tło (żeby zakryć białe tło strony) */
html.a11y-high-contrast header,
html.a11y-high-contrast footer,
html.a11y-high-contrast .main-container,
html.a11y-high-contrast .news-card,
html.a11y-high-contrast .widget,
html.a11y-high-contrast .modal-content,
html.a11y-high-contrast .a11y-toolbar-menu,
html.a11y-high-contrast .submenu,
html.a11y-high-contrast .pinned-carousel,
html.a11y-high-contrast .pinned-content {
    background-color: #000 !important;
}

/* Linki */
html.a11y-high-contrast a,
html.a11y-high-contrast a:hover,
html.a11y-high-contrast a:visited {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

/* Formularze i przyciski */
html.a11y-high-contrast input,
html.a11y-high-contrast textarea,
html.a11y-high-contrast select,
html.a11y-high-contrast button,
html.a11y-high-contrast .a11y-btn {
    background-color: #000 !important;
    border: 1px solid #ffff00 !important;
}

/* Media - przywracamy widoczność (często w tym trybie robi się je czarno-białe) */
html.a11y-high-contrast img,
html.a11y-high-contrast video,
html.a11y-high-contrast iframe {
    filter: grayscale(100%) contrast(1.2);
    border: none !important;
    opacity: 1 !important;
}

/* Toolbar aktywny - odwrócone kolory dla czytelności */
html.a11y-high-contrast .a11y-btn.active {
    background-color: #ffff00 !important;
    color: #000 !important;
}
html.a11y-high-contrast .a11y-btn.active i {
    color: #000 !important;
}

/* Grayscale */
html.a11y-grayscale {
    filter: grayscale(100%);
}

/* Underline Links */
body.a11y-underline-links a {
    text-decoration: underline !important;
}

/* Line Height (Interlinia) */
html.a11y-line-height-plus,
html.a11y-line-height-plus body,
html.a11y-line-height-plus p,
html.a11y-line-height-plus li,
html.a11y-line-height-plus a {
    line-height: 1.8 !important;
}

/* Text Spacing (Odstępy między literami) */
html.a11y-text-spacing body,
html.a11y-text-spacing p,
html.a11y-text-spacing li,
html.a11y-text-spacing h1,
html.a11y-text-spacing h2,
html.a11y-text-spacing h3,
html.a11y-text-spacing a {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

/* Readable Font (Czytelna czcionka) */
html.a11y-readable-font body {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Stop Animations (Zatrzymaj animacje) */
html.a11y-stop-animations *,
html.a11y-stop-animations *::before,
html.a11y-stop-animations *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}