/* wp-content/plugins/pixelbarrierefrei/assets/css/style.css */

/* --- CSS-Variablen für anpassbare Farben --- */
:root {
    --pb-primary-color: #203c4b; /* Standardwert: Dunkelblau (für Buttons, Slider etc.) */
    --pb-secondary-color: #d9534f; /* Standardwert: Rot (für den Haupt-Toggle-Button) */
    --pb-text-color: #333333; /* Standardwert: Dunkles Grau (für Haupttexte im Widget) */
    --pb-light-text-color: #555555; /* Standardwert: Mittleres Grau (für Labels, etc.) */
    --pb-border-color: #e0e0e0; /* Standardwert: Helles Grau (für Widget-Rand) */
    --pb-separator-color: #f0f0f0; /* Standardwert: Sehr helles Grau (für Trennlinien) */
    --pb-highlight-link-bg: yellow; /* Hintergrundfarbe für hervorgehobene Links */
    --pb-highlight-link-text: black; /* Textfarbe für hervorgehobene Links */
    --pb-focus-outline-color: #ff00ff; /* Farbe für Umrissfokus */
}


/* --- Haupt-Toggle-Button (das Barrierefreiheits-Icon) --- */
#pb-toggle-button {
    position: fixed;
    bottom: 70px;
    right: 25px;
    background-color: var(--pb-secondary-color); /* Verwendet die Sekundärfarbe */
    color: #ffffff;
    border: none;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
	padding: 20px !important;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition: background-color 0.3s ease, transform 0.3s ease;

    background-image: var(--pb-icon-barrierefrei);
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
}

#pb-toggle-button:hover {
    background-color: #c34844; /* Abgedunkelte Sekundärfarbe (ursprünglich darken(var(--pb-secondary-color), 10%)) */
    transform: scale(1.05);
}

/* Stil für den Haupt-Toggle-Button, wenn das Widget geöffnet ist */
#pb-accessibility-widget.pb-widget-open + #pb-toggle-button {
    background-color: var(--pb-secondary-color);
    transform: none;
}

#pb-accessibility-widget.pb-widget-open + #pb-toggle-button:hover {
    background-color: #c34844; /* Abgedunkelte Sekundärfarbe (ursprünglich darken(var(--pb-secondary-color), 10%)) */
    transform: scale(1.05);
}

/* --- Allgemeine Widget-Container und Basiseinstellungen --- */
#pb-accessibility-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #ffffff; /* Widget-Hintergrund bleibt weiß, da das eine feste UI-Komponente ist */
    border: 1px solid var(--pb-border-color); /* Verwendet die Rahmenfarbe */
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 15px 20px;
    z-index: 100000;
    font-family: 'PT Sans Narrow', Arial, sans-serif; /* Schrift anpassen */
    max-width: 320px;
    text-align: left;
    box-sizing: border-box;
    transform: translateX(calc(100% + 25px + 70px + 25px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

#pb-accessibility-widget.pb-widget-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* --- Widget Header (im Widget selbst) --- */
.pb-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--pb-text-color); /* Verwendet die Textfarbe */
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pb-separator-color); /* Verwendet die Trennlinienfarbe */
    user-select: none;
}

.pb-widget-header h3 {
    margin: 0 !important;
    font-size: 1em !important;
}

.pb-widget-header .pb-icon {
    margin-right: 12px;
    font-size: 1.6em;
    color: var(--pb-primary-color); /* Verwendet die Primärfarbe */
    width: 28px;
    height: 28px;
}

/* --- Schließen-Button im Header (der "X"-Button) --- */
#pb-close-button {
    background: none;
    border: none;
    color: #888;
    font-size: 1.3em;
    cursor: pointer;
    padding: 5px;
    width: auto;
    margin: 0;
    transition: color 0.2s ease;
    line-height: 1;
}

#pb-close-button .pb-icon {
    width: 20px;
    height: 20px;
    margin: 0;
    background-image: var(--pb-icon-times);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999px;
    overflow: hidden;
    font-family: 'unset' !important;
    content: none !important;
}

#pb-close-button:hover {
    color: #555;
}

/* --- Widget Inhalt (Optionen-Liste) --- */
#pb-widget-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

#pb-accessibility-widget.pb-widget-open #pb-widget-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
    transition: max-height 0.6s ease-in-out;
}

/* Scrollbar Styling (Webkit - Chrome, Safari) */
#pb-accessibility-widget.pb-widget-open #pb-widget-content::-webkit-scrollbar {
    width: 8px;
}

#pb-accessibility-widget.pb-widget-open #pb-widget-content::-webkit-scrollbar-track {
    background: var(--pb-separator-color);
    border-radius: 10px;
}

#pb-accessibility-widget.pb-widget-open #pb-widget-content::-webkit-scrollbar-thumb {
    background: #cecece; /* Abgedunkelt von var(--pb-separator-color) um 15% */
    border-radius: 10px;
}

#pb-accessibility-widget.pb-widget-open #pb-widget-content::-webkit-scrollbar-thumb:hover {
    background: #9f9f9f; /* Abgedunkelt von var(--pb-separator-color) um 30% */
}

/* --- Sektions-Überschriften (z.B. "Textanpassungen") --- */
.pb-option-group h4 {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--pb-text-color); /* Verwendet die Textfarbe */
    margin-top: 25px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pb-separator-color); /* Verwendet die Trennlinienfarbe */
}

/* --- Container für Optionen innerhalb einer Sektion --- */
.pb-option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* --- Einzelne Option (Toggle Switch, Dropdown, Slider, Button) --- */
.pb-option-item {
    flex: 1 1 calc(50% - 7.5px);
    min-width: 140px;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

/* --- Allgemeine Styling für Icons in Labels --- */
.pb-option-item .pb-icon {
    margin-right: 10px;
    color: var(--pb-primary-color); /* Verwendet die Primärfarbe für Icons */
    width: 20px;
    height: 20px;
    min-width: 20px;
    text-align: center;
}

/* Icon für den Reset Button */
.pb-icon.icon-refresh {
    background-image: var(--pb-icon-zuruecksetzen);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999px;
    overflow: hidden;
    font-family: 'unset' !important;
    content: none !important;
}

/* Font Awesome Icons (Wenn Sie diese noch verwenden, sonst entfernen) */
.pb-icon.icon-font::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f031"; }
.pb-icon.icon-palette::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f53f"; }
.pb-icon.icon-mask::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f562"; }
.pb-icon.icon-image::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f03e"; }
.pb-icon.icon-pause::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f04c"; }
.pb-icon.icon-focus::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f1e5"; }
.pb-icon.icon-link::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f0c1"; }
.pb-icon.icon-align-left::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f036"; }
.pb-icon.icon-line-height::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f87e"; }
.pb-icon.icon-sitemap::before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f0e8"; }


/* --- Styling für den Toggle Switch --- */
.pb-toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 34px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--pb-light-text-color); /* Verwendet die hellere Textfarbe */
    user-select: none;
    box-sizing: border-box;
    justify-content: space-between;
}

.pb-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pb-toggle-slider {
    position: relative;
    flex-shrink: 0;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
    margin-left: auto;
}

.pb-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .pb-toggle-slider {
    background-color: var(--pb-primary-color); /* Verwendet die Primärfarbe */
}

input:focus + .pb-toggle-slider {
    box-shadow: 0 0 1px var(--pb-primary-color); /* Verwendet die Primärfarbe */
}

input:checked + .pb-toggle-slider:before {
    transform: translateX(24px);
}

.pb-toggle-slider.round {
    border-radius: 26px;
}

.pb-toggle-slider.round:before {
    border-radius: 50%;
}

.pb-toggle-text {
    display: flex;
    align-items: center;
    line-height: 1.4;
}


/* --- Styling für den Textgrößen-Schieberegler (Range Slider) --- */
.pb-font-size-slider-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.pb-font-size-slider-group label {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--pb-light-text-color); /* Verwendet die hellere Textfarbe */
    display: flex;
    align-items: center;
}

.pb-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

#pb-font-size-range {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: calc(100% - 50px);
    height: 8px;
    background: var(--pb-separator-color); /* Verwendet die Trennlinienfarbe */
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 5px;
    flex-grow: 1;
}

#pb-font-size-range:hover {
    opacity: 1;
}

/* Styling des Schieberegler-Daumens (Thumb) */
#pb-font-size-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--pb-primary-color); /* Verwendet die Primärfarbe */
    cursor: grab;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-top: -6px;
}

#pb-font-size-range::-moz-range-thumb {
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--pb-primary-color); /* Verwendet die Primärfarbe */
    cursor: grab;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pb-slider-value {
    margin-left: 10px;
    font-size: 0.85em;
    color: var(--pb-light-text-color); /* Verwendet die hellere Textfarbe */
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}


/* --- Button-Stil (für alle Buttons in Option-Items) --- */
.pb-option-item button {
    background-color: var(--pb-primary-color); /* Verwendet die Primärfarbe */
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 0.95em;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pb-option-item button:hover {
    background-color: #1a303b; /* Abgedunkelte Primärfarbe (ursprünglich darken(var(--pb-primary-color), 10%)) */
    transform: translateY(-1px);
}

.pb-option-item button .pb-icon {
    color: #ffffff;
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

/* --- Spezifisches Styling für den Reset-Button im Footer --- */
#pb-reset-button {
    background-color: var(--pb-primary-color); /* Verwendet die Primärfarbe */
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 0.95em;
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#pb-reset-button:hover {
    background-color: #1a303b; /* Abgedunkelte Primärfarbe (ursprünglich yellow, jetzt angepasst) */
    transform: translateY(-1px);
}

/* --- Text am Ende des Widgets (im Footer) --- */
.pb-widget-footer {
    text-align: center;
    padding-top: 15px;
    margin-top: 20px;
    border-top: 1px solid var(--pb-separator-color); /* Verwendet die Trennlinienfarbe */
}

.pb-widget-footer p {
    font-size: 0.8em;
    color: #888888; /* Dieser Wert könnte auch eine Variable sein, falls gewünscht */
    margin-top: 10px;
}

.pb-widget-footer p a {
    color: var(--pb-primary-color); /* Verwendet die Primärfarbe für Links im Footer */
    text-decoration: none;
    font-weight: bold;
}

.pb-widget-footer p a:hover {
    text-decoration: underline;
}

/* --- Responsive Anpassung für kleinere Bildschirme --- */
@media (max-width: 768px) {
    #pb-toggle-button {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        background-size: 60%;
    }

    #pb-accessibility-widget {
        bottom: 80px;
        left: 15px;
        right: 15px;
        max-width: none;
        border-radius: 8px;
        padding: 10px 15px;
        transform: translateY(calc(100% + 80px));
        opacity: 0;
    }

    #pb-accessibility-widget.pb-widget-open {
        transform: translateY(0);
        opacity: 1;
    }

    .pb-option-item {
        flex: 1 1 100%;
        min-width: unset;
    }

    .pb-widget-header {
        font-size: 1em;
    }

    .pb-widget-header .pb-icon {
        font-size: 1.4em;
    }
}

/* --- GLOBALE BODY/HTML-KLASSEN für Barrierefreiheits-Effekte --- */

body {
    --pb-font-size-factor: 1.0;
    font-size: calc(16px * var(--pb-font-size-factor));
}

body h1 { font-size: calc(2.2em * var(--pb-font-size-factor)); }
body h2 { font-size: calc(1.8em * var(--pb-font-size-factor)); }
body h3 { font-size: calc(1.5em * var(--pb-font-size-factor)); }
body h4 { font-size: calc(1.2em * var(--pb-font-size-factor)); }
body h5 { font-size: calc(1.1em * var(--pb-font-size-factor)); }
body h6 { font-size: calc(1.0em * var(--pb-font-size-factor)); }
body p, body li, body a, body span { font-size: calc(1em * var(--pb-font-size-factor)); }

html.pb-high-contrast { filter: contrast(150%) brightness(120%); }
html.pb-greyscale { filter: grayscale(100%); }
html.pb-invert-colors { filter: invert(100%); }

body.pb-reading-mask {
    background-color: #333 !important;
    color: #f0f0f0 !important;
}
body.pb-hide-images img { display: none !important; }

body.pb-pause-animations *, body.pb-pause-animations *::before, body.pb-pause-animations *::after {
    animation-play-state: paused !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
}

body.pb-highlight-focus *:focus {
    outline: 3px solid var(--pb-focus-outline-color) !important; /* Verwendet Fokus-Outline-Farbe */
    outline-offset: 2px;
}

/* LINKS HERVORHEBEN: NEUE FARBVARIABLEN */
body.pb-highlight-links a,
body.pb-highlight-links a:link,
body.pb-highlight-links a:visited,
body.pb-highlight-links a:hover,
body.pb-highlight-links a:active,
body.pb-highlight-links a *,
body.pb-highlight-links a:link *,
body.pb-highlight-links a:visited *,
body.pb-highlight-links a:hover *,
body.pb-highlight-links a:active * {
    background-color: var(--pb-highlight-link-bg) !important;
    color: var(--pb-highlight-link-text) !important;
    font-weight: bold !important;
    text-decoration: underline !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

body.pb-readable-font { font-family: 'Open Sans', Arial, sans-serif !important; }

body.pb-larger-line-height p, body.pb-larger-line-height li, body.pb-larger-line-height div { line-height: 1.8 !important; }

body.pb-text-alignment p, body.pb-text-alignment div, body.pb-text-alignment li { text-align: left !important; }

body.pb-show-structure-active h1, body.pb-show-structure-active h2, body.pb-show-structure-active h3, body.pb-show-structure-active h4, body.pb-show-structure-active h5, body.pb-show-structure-active h6 {
    border: 2px solid #00f !important; /* Diese Farbe könnte auch eine Variable werden, wenn gewünscht */
    padding: 5px !important;
    margin-bottom: 10px !important;
    background-color: rgba(0, 0, 255, 0.1) !important;
}