/* Psoft Accessibility - przycisk i panel */

#psoft-a11y-toggle {
    position: fixed;
    bottom: 20px;
    z-index: 999998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--psoft-a11y-btn-bg, #4054b2);
    color: var(--psoft-a11y-btn-icon, #ffffff);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

#psoft-a11y-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#psoft-a11y-toggle svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

#psoft-a11y-toggle.psoft-a11y-left {
    left: 20px;
}

#psoft-a11y-toggle.psoft-a11y-right {
    right: 20px;
}

/* Overlay */
#psoft-a11y-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999998;
}

#psoft-a11y-overlay.psoft-a11y-visible {
    display: block;
}

/* Panel boczny */
#psoft-a11y-panel {
    position: fixed;
    top: 0;
    z-index: 999999;
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#psoft-a11y-panel.psoft-a11y-left {
    left: 0;
    transform: translateX(-100%);
}

#psoft-a11y-panel.psoft-a11y-right {
    right: 0;
    transform: translateX(100%);
}

#psoft-a11y-panel.psoft-a11y-open {
    transform: translateX(0);
}

/* Naglowek panelu */
.psoft-a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--psoft-a11y-btn-bg, #4054b2);
    color: #fff;
}

.psoft-a11y-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.psoft-a11y-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.psoft-a11y-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Lista narzedzi */
.psoft-a11y-tools {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.psoft-a11y-tools li {
    margin: 0;
    padding: 0;
}

.psoft-a11y-tools button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-align: left;
    transition: background 0.15s;
    gap: 12px;
    font-family: inherit;
}

.psoft-a11y-tools button:hover {
    background: #f0f0f0;
}

.psoft-a11y-tools button.psoft-a11y-active {
    background: #e8eaf6;
    color: var(--psoft-a11y-btn-bg, #4054b2);
    font-weight: 600;
}

.psoft-a11y-tools button svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Resize - przyciski A+ / A- */
.psoft-a11y-resize-controls {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 20px;
    gap: 8px;
}

.psoft-a11y-resize-controls span {
    font-size: 14px;
    color: #333;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.psoft-a11y-resize-controls span svg {
    width: 22px;
    height: 22px;
    fill: #333;
    flex-shrink: 0;
}

.psoft-a11y-resize-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.psoft-a11y-resize-btn:hover {
    border-color: var(--psoft-a11y-btn-bg, #4054b2);
    color: var(--psoft-a11y-btn-bg, #4054b2);
}

.psoft-a11y-resize-value {
    font-size: 13px;
    color: #666;
    min-width: 38px;
    text-align: center;
}

/* Separator */
.psoft-a11y-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 20px;
}

/* Reset */
.psoft-a11y-reset {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #d32f2f;
    gap: 12px;
    font-family: inherit;
}

.psoft-a11y-reset:hover {
    background: #ffebee;
}

.psoft-a11y-reset svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ============================
   TRYBY DOSTEPNOSCI
   ============================ */

/* Powiekszenie tekstu - sterowane z JS przez inline style na html */

/* Wysoki kontrast - czarne tlo, zolty tekst, zielone linki */
.psoft-a11y-high-contrast {
    background-color: #000 !important;
}

.psoft-a11y-high-contrast header:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast footer:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast main:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast section:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast nav:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast aside:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast article:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast div:not(#psoft-a11y-panel):not(#psoft-a11y-panel *):not(#psoft-a11y-overlay) {
    background-color: #000 !important;
}

.psoft-a11y-high-contrast h1:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast h2:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast h3:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast h4:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast h5:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast h6:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast p:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast span:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast li:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast td:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast th:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast label:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast strong:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast em:not(#psoft-a11y-panel *),
.psoft-a11y-high-contrast small:not(#psoft-a11y-panel *) {
    color: #ffff00 !important;
}

.psoft-a11y-high-contrast a:not(#psoft-a11y-panel a) {
    color: #00ff00 !important;
}

.psoft-a11y-high-contrast button:not(#psoft-a11y-panel button):not(#psoft-a11y-toggle),
.psoft-a11y-high-contrast input:not(#psoft-a11y-panel input),
.psoft-a11y-high-contrast select:not(#psoft-a11y-panel select),
.psoft-a11y-high-contrast textarea:not(#psoft-a11y-panel textarea) {
    background-color: #333 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Negatyw - filtr inwersji kolorow */
.psoft-a11y-negative-contrast {
    filter: invert(1) hue-rotate(180deg) !important;
}

.psoft-a11y-negative-contrast img:not(#psoft-a11y-panel img),
.psoft-a11y-negative-contrast video:not(#psoft-a11y-panel video),
.psoft-a11y-negative-contrast svg:not(#psoft-a11y-panel svg):not(#psoft-a11y-toggle svg) {
    filter: invert(1) hue-rotate(180deg) !important;
}

.psoft-a11y-negative-contrast #psoft-a11y-panel,
.psoft-a11y-negative-contrast #psoft-a11y-toggle,
.psoft-a11y-negative-contrast #psoft-a11y-overlay {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Skala szarosci */
.psoft-a11y-grayscale {
    filter: grayscale(100%) !important;
}

.psoft-a11y-grayscale #psoft-a11y-panel,
.psoft-a11y-grayscale #psoft-a11y-toggle {
    filter: grayscale(0%) !important;
}

/* Jasne tlo - bialy background, czarny tekst, niebieskie linki */
.psoft-a11y-light-bg {
    background-color: #fff !important;
}

.psoft-a11y-light-bg header:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg footer:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg main:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg section:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg nav:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg aside:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg article:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg div:not(#psoft-a11y-panel):not(#psoft-a11y-panel *):not(#psoft-a11y-overlay) {
    background-color: #fff !important;
}

.psoft-a11y-light-bg h1:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg h2:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg h3:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg h4:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg h5:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg h6:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg p:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg span:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg li:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg td:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg th:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg label:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg strong:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg em:not(#psoft-a11y-panel *),
.psoft-a11y-light-bg small:not(#psoft-a11y-panel *) {
    color: #000 !important;
}

.psoft-a11y-light-bg a:not(#psoft-a11y-panel a) {
    color: #0000ee !important;
}

.psoft-a11y-light-bg button:not(#psoft-a11y-panel button):not(#psoft-a11y-toggle),
.psoft-a11y-light-bg input:not(#psoft-a11y-panel input),
.psoft-a11y-light-bg select:not(#psoft-a11y-panel select),
.psoft-a11y-light-bg textarea:not(#psoft-a11y-panel textarea) {
    background-color: #f5f5f5 !important;
    color: #000 !important;
    border-color: #333 !important;
}

/* Podkreslenie linkow */
.psoft-a11y-links-underline a:not(#psoft-a11y-panel a) {
    text-decoration: underline !important;
}

/* Czytelna czcionka */
.psoft-a11y-readable-font *:not(#psoft-a11y-panel *) {
    font-family: Verdana, Geneva, sans-serif !important;
    letter-spacing: 0.03em !important;
    word-spacing: 0.1em !important;
}

/* Responsywnosc */
@media (max-width: 480px) {
    #psoft-a11y-panel {
        width: 280px;
    }
}
