/* Accessibility Helper Widget Styles */

main {
    overflow:hidden;

}
#accessibility-helper-widget,
html > #accessibility-helper-widget {
    font-family: var(--ah-font-family);
    background: transparent;
    border-radius: var(--ah-radius);
    font-size: var(--ah-font-size);
}

/* 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-width: 0;
}

/* Toast Notifications */
#ah-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

[data-position="left"] #ah-toast-container {
    right: auto;
    left: 20px;
}

[data-position="left"] .ah-toast {
    animation: ah-toast-slide-in-left 0.3s ease-out;
}

[data-position="left"] .ah-toast.ah-toast-hiding {
    animation: ah-toast-slide-out-left 0.3s ease-in forwards;
}

.ah-toast {
    background: #333;
    color: white;
    padding: 14px 18px;
    border-radius: var(--ah-radius, 6px);
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
     font-size: 11px;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    animation: ah-toast-slide-in 0.3s ease-out;
    pointer-events: auto;
    font-size: 0.9rem;
}

.ah-toast.ah-toast-success {
    background: #28a745;
}

.ah-toast.ah-toast-info {
    background: #17a2b8;
}

.ah-toast.ah-toast-warning {
    background: #ffc107;
    color: #333;
}

.ah-toast.ah-toast-error {
    background: #dc3545;
}

.ah-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.ah-toast-message {
    flex: 1;
}

.ah-toast-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ah-toast-close:hover {
    opacity: 1;
}

.ah-toast.ah-toast-hiding {
    animation: ah-toast-slide-out 0.3s ease-in forwards;
}

@keyframes ah-toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ah-toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes ah-toast-slide-in-left {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ah-toast-slide-out-left {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-400px);
        opacity: 0;
    }
}

/* High Contrast Mode: Adjust toast colors */
body.ah-high-contrast .ah-toast {
    background: #000;
    border: 2px solid #fff;
}

body.ah-high-contrast .ah-toast.ah-toast-warning {
    background: #000;
    color: #fff;
    border-color: #ffc107;
}

#accessibility-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: var(--ah-radius);
    background: var(--ah-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--ah-shadow, 0 2px 8px rgba(0,0,0,0.1));
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

[data-position="left"] #accessibility-toggle {
    right: auto;
    left: 20px;
}

#accessibility-toggle:hover {
    background: #444;
}

#accessibility-toggle:focus {
    outline: 2px solid #666;
    outline-offset: 2px;
}

#accessibility-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--ah-panel-size);
    height: 100vh;
    background: var(--ah-bg);
    color: var(--ah-text);
    font-family: var(--ah-font-family);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
}

[data-position="left"] #accessibility-panel {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

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

#accessibility-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: -1;
}

#accessibility-panel.open::before {
    opacity: 1;
    visibility: visible;
}

.accessibility-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: var(--ah-primary);
    color: #fff;
}

.accessibility-panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

#accessibility-close {
    background: transparent;
    border: none;
        font-size: 11px;
        padding: 4px 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ah-radius, 4px);
    cursor: pointer;
}

#accessibility-close svg {
    stroke: #fff !important;
    color: #fff !important;
    fill: none !important;
}

#accessibility-close svg line {
    stroke: #fff !important;
}


#accessibility-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#accessibility-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.accessibility-panel-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
    background: var(--ah-bg);
    color: var(--ah-text);
    font-family: var(--ah-font-family);
    box-sizing: border-box;
    width: 100%;
}

.accessibility-panel-footer {
    padding: 12px 20px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.accessibility-panel-footer strong {
    color: #333;
}

.accessibility-option {
    margin-bottom: 0;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: var(--ah-radius, 4px);
    background: #fff;
}

.accessibility-option:nth-child(n+12) {
    grid-column: 1 / -1;
}

/* Color Blind Mode Option - Full Width */
.accessibility-option.ah-color-blind-option {
    grid-column: 1 / -1;
}

.accessibility-option.ah-color-blind-option label {
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 16px 12px;
}

.accessibility-option.ah-color-blind-option select {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.accessibility-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    color: #333;
    gap: 10px;
    padding: 14px 12px;
    border-radius: var(--ah-radius, 4px);
    transition: background 0.2s;
    box-sizing: border-box;
    font-size: 14px;
    min-width: 0;
    width: 100%;
    min-height: 56px;
}

.accessibility-option label span {
    font-size: 14px;
    line-height: 1.3;
    word-break: break-word;
}

.accessibility-option label:hover {
    background: #e8e8e8;
}

.accessibility-option:has(input:checked) label {
    background: #fff;
    border: 1px solid var(--ah-primary, #666);
}

.accessibility-option:has(input:checked) .option-icon {
    color: var(--ah-primary, #333);
}

.accessibility-option:has(input:checked) label span {
    font-weight: 500;
    color: var(--ah-primary, #333);
}

.accessibility-option .option-icon {
    flex-shrink: 0;
    color: var(--ah-option-icon-color, #666);
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
}

.accessibility-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.accessibility-option select {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: var(--ah-radius, 4px);
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.accessibility-option select:hover {
    border-color: var(--ah-primary);
}

.accessibility-option select:focus {
    outline: none;
    border-color: var(--ah-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.accessibility-option select option {
    padding: 8px;
}

.reset-button {
    width: 100%;
    padding: 14px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: var(--ah-radius, 4px);
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: background 0.2s;
    min-height: 48px;
    box-sizing: border-box;
}

.reset-button:hover {
    background: #e0e0e0;
}

.reset-button:focus {
    outline: 2px solid var(--ah-primary);
    outline-offset: 2px;
}

.declaration-button {
    width: 100%;
    padding: 14px 12px;
    background: var(--ah-primary);
    border: none;
    border-radius: var(--ah-radius, 4px);
    cursor: pointer;
    font-size: 15px;
    color: white;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    box-sizing: border-box;
}

.declaration-button:hover {
    background: color-mix(in srgb, var(--ah-primary) 85%, black);
    filter: brightness(0.9);
}

.declaration-button:focus {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

.ah-declaration-link {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: white;
    border: 1px solid var(--ah-primary);
    border-radius: var(--ah-radius, 4px);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--ah-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-secondary:hover {
    background: var(--ah-primary);
    color: white;
}

.btn-secondary:focus {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--ah-primary);
    border: none;
    border-radius: var(--ah-radius, 4px);
    cursor: pointer;
    font-size: 0.95rem;
    color: white;
    transition: background 0.2s;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-primary:focus {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

/* Modal Styles */
.ah-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ah-modal.open {
    display: flex;
}

.ah-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.ah-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--ah-radius, 8px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.ah-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}
     
.ah-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.ah-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ah-radius, 4px);
    color: #666;
}

.ah-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.ah-modal-close:focus {
    outline: 2px solid var(--ah-primary);
    outline-offset: 2px;
}

.ah-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ah-modal-body h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: #333;
}

.ah-modal-body h3:first-child {
        font-size: 16px !important;
        padding: 2px 4px !important;
        min-width: 100% !important;
        max-width: 120px !important;
        word-break: break-word;
        white-space: normal;
}

.ah-modal-body p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #222;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.ah-modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.ah-modal-body li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #222;
    font-size: 1rem;
}

.ah-modal-body a {
    color: var(--ah-primary);
    text-decoration: underline;
}

.ah-modal-body a:hover {
    text-decoration: none;
}

.ah-modal-body a:focus {
    outline: 2px solid var(--ah-primary);
    outline-offset: 2px;
}

.ah-declaration-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .ah-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .ah-modal-header {
        padding: 16px;
    }
    
    .ah-modal-body {
        padding: 16px;
    }
}

/* BITV Report Styles */
.ah-bitv-modal {
    max-width: 900px;
}

.ah-bitv-intro {
    background: #f0f8ff;
    padding: 16px;
    border-left: 4px solid var(--ah-primary);
    margin-bottom: 24px;
}

.ah-bitv-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.ah-bitv-section:last-of-type {
    border-bottom: none;
}

.ah-section-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.ah-bitv-criterion {
    margin-bottom: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: var(--ah-radius, 4px);
}

.ah-bitv-criterion label {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    cursor: pointer;
}

.ah-bitv-criterion input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.ah-criterion-desc {
    display: block;
    width: 100%;
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
    margin-left: 30px;
}

.ah-bitv-summary {
    margin-top: 32px;
    padding: 24px;
    background: #f0f8ff;
    border-radius: var(--ah-radius, 8px);
}

.ah-bitv-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 2rem;
    color: var(--ah-primary);
    margin-bottom: 4px;
}

.stat-item span {
    color: #666;
    font-size: 0.9rem;
}

.ah-bitv-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Shortcuts Styles */
.ah-shortcuts-modal .ah-modal-content {
    max-width: 700px;
}

.ah-shortcuts-section {
    margin-bottom: 24px;
}

.ah-shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.ah-shortcuts-table th,
.ah-shortcuts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #222;
    font-size: 1rem;
}

.ah-shortcuts-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #000;
}

.ah-shortcuts-table kbd {
    display: inline-block;
    padding: 4px 8px;
    background: #e0e0e0;
    border: 1px solid #999;
    border-radius: var(--ah-radius, 4px);
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

.ah-shortcuts-note {
    margin-top: 24px;
    padding: 16px;
    background: #fff9e6;
    border-left: 4px solid #ff9800;
    border-radius: var(--ah-radius, 4px);
}

.ah-shortcuts-note p {
    margin: 0;
    color: #222;
    font-size: 1rem;
    line-height: 1.6;
}

.ah-shortcuts-note strong {
    color: #000;
}

/* Accessibility Modifications */
body.ah-high-contrast {
    background: var(--ah-high-contrast-bg, #000) !important;
    color: var(--ah-high-contrast-text, #fff) !important;
}

body.ah-high-contrast * {
    background-color: transparent !important;
    color: inherit !important;
    border-color: var(--ah-high-contrast-text, #fff) !important;
}

body.ah-high-contrast .ah-modal-overlay,
body.ah-high-contrast .ah-modal-content,
body.ah-high-contrast #accessibility-panel,
body.ah-high-contrast .accessibility-panel-header,
body.ah-high-contrast .accessibility-panel-footer {
    background-color: var(--ah-high-contrast-bg, #000) !important;
}

body.ah-high-contrast .ah-modal-content {
    border: 2px solid var(--ah-high-contrast-text, #fff) !important;
}

body.ah-high-contrast a {
    color: var(--ah-high-contrast-link, #eb7305) !important;
    text-decoration: underline !important;
}

body.ah-high-contrast a.btn {
    color:white !important;
}

body.ah-high-contrast button,
body.ah-high-contrast input,
body.ah-high-contrast select,
body.ah-high-contrast textarea {
    background: #333 !important;
    color: var(--ah-high-contrast-text, #fff) !important;
    border: 1px solid var(--ah-high-contrast-text, #fff) !important;
}

body.ah-high-contrast img {
    /* opacity: 0.8; */
    filter: none !important;
}

body.ah-high-contrast .navbar,
body.ah-high-contrast .navbar.blur {
    background-color: rgba(0, 0, 0, 1) !important;
    backdrop-filter: blur(5px);
}

body.ah-high-contrast header .burgermenu span {
    background: #fff !important;
}

body.ah-high-contrast .hamburger .line {
    background-color: #fff !important;
}

body.ah-increase-text {
    font-size: var(--ah-text-size-increase, 120%) !important;
}
body.ah-highlight-links .navbar .logo, 
 body.ah-high-contrast .navbar .logo, body.ah-high-contrast .sidemenu a.logo img, body.ah-high-contrast .overlaymenu a.logo img {
    filter:brightness(0) invert(1) !important;
 }

body.ah-increase-text * {
    font-size: inherit !important;
}

body.ah-highlight-links a {
    text-decoration: underline !important;
    background: var(--ah-link-highlight-bg, #eb7305) !important;
    color: var(--ah-link-highlight-text, #fff) !important;
    /* padding: inherit !important;
    display: inline-block !important; */
}

body.ah-readable-font,
body.ah-readable-font * {
    font-family: var(--ah-readable-font, Arial, Helvetica, sans-serif) !important;
}

body.ah-pause-animations,
body.ah-pause-animations * {
    animation: none !important;
    transition: none !important;
}

body.ah-line-height,
body.ah-line-height * {
    line-height: var(--ah-line-height, 1.8) !important;
}

body.ah-letter-spacing,
body.ah-letter-spacing * {
    letter-spacing: var(--ah-letter-spacing, 0.12em) !important;
    word-spacing: var(--ah-word-spacing, 0.16em) !important;
}

/* Large Cursor - Dynamically generated via JavaScript using --ah-cursor-size variable */
/* See script.js updateLargeCursorStyles() function */

/* ===== COLOR BLINDNESS FILTERS ===== */
/* Apply filters to all body children except the accessibility widget */
body.ah-color-blind-protanopia > *:not(#accessibility-helper-widget):not(style):not(script) {
    filter: hue-rotate(-15deg) saturate(0.7) brightness(1.05);
}

body.ah-color-blind-deuteranopia > *:not(#accessibility-helper-widget):not(style):not(script) {
    filter: hue-rotate(180deg) saturate(0.6) brightness(1.1);
}

body.ah-color-blind-tritanopia > *:not(#accessibility-helper-widget):not(style):not(script) {
    filter: hue-rotate(90deg) saturate(0.5) brightness(1.2);
}

body.ah-color-blind-achromatopsia > *:not(#accessibility-helper-widget):not(style):not(script) {
    filter: grayscale(100%) contrast(1.1);
}

/* Ensure accessibility widget remains visible during color blind modes */
body[class*="ah-color-blind-"] #accessibility-toggle,
body[class*="ah-color-blind-"] #accessibility-panel,
body[class*="ah-color-blind-"] .ah-tts-toolbar {
    filter: none !important;
}

/* Focus Visibility Enhancement */
body.ah-focus-visible *:focus {
    outline: var(--ah-focus-outline-width, 3px) solid var(--ah-focus-outline-color, #ff6b00) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px var(--ah-focus-shadow-color, rgba(255, 107, 0, 0.2)) !important;
}

body.ah-focus-visible a:focus,
body.ah-focus-visible button:focus,
body.ah-focus-visible input:focus,
body.ah-focus-visible select:focus,
body.ah-focus-visible textarea:focus,
body.ah-focus-visible [tabindex]:focus {
    outline: 3px solid #ff6b00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(255, 107, 0, 0.2) !important;
}

/* High Contrast Mode: Adjust focus color */
body.ah-high-contrast.ah-focus-visible *:focus {
    outline-color: #eb7305 !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 0, 0.3) !important;
}

/* ===== TEXT-TO-SPEECH TOOLBAR ===== */
.ah-tts-toolbar {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: #ffffff;
    color: #333;
    border-radius: var(--ah-radius, 12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    z-index: 9997;
    padding: 16px;
    min-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-position="left"] .ah-tts-toolbar {
    right: auto;
    left: 20px;
}

.ah-tts-toolbar.ah-tts-visible {
    opacity: 1;
    transform: translateY(0);
}

.ah-tts-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.ah-tts-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.ah-tts-status svg {
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ah-tts-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-tts-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    width: 36px;
    height: 36px;
    border-radius: var(--ah-radius, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ah-tts-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: scale(1.05);
}

.ah-tts-btn:active {
    transform: scale(0.95);
}

.ah-tts-btn:focus {
    outline: 2px solid var(--ah-primary);
    outline-offset: 2px;
}

.ah-tts-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: var(--ah-radius, 8px);
    min-width: 110px;
    border: 1px solid #e0e0e0;
}

.ah-tts-speed input[type="range"] {
    width: 60px;
    height: 4px;
    background: #ddd;
    border-radius: var(--ah-radius, 2px);
    outline: none;
    
}

.ah-tts-speed input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--ah-primary);
    border-radius: 50%;
    cursor: pointer;
}

.ah-tts-speed input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--ah-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.ah-tts-speed input[type="range"]:focus {
    outline: none;
}

.ah-tts-speed input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.ah-tts-speed input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

#ah-tts-speed-value {
    font-size: 12px;
    font-weight: 600;
    min-width: 35px;
    color: #333;
}

.ah-tts-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ah-radius, 4px);
    transition: background 0.2s;
    position: absolute;
    top: -8px;
    right: -8px;
}

.ah-tts-close:hover {
    background: #f0f0f0;
    color: #333;
}

.ah-tts-close:focus {
    outline: 2px solid var(--ah-primary);
    outline-offset: 2px;
}

/* High Contrast Mode: TTS Toolbar */
body.ah-high-contrast .ah-tts-toolbar {
    background: #000;
    border: 2px solid #fff;
}

body.ah-high-contrast .ah-tts-btn {
    background: #000;
    border: 2px solid #fff;
}

body.ah-high-contrast .ah-tts-btn:hover {
    background: #333;
}




body.ah-high-contrast .card .card-body {
    background: #000 !important;
}

body.ah-high-contrast footer{
    background:#000;
} 

/* Mobile Responsive for TTS Toolbar */
@media (max-width: 768px) {
    .ah-tts-toolbar {
        bottom: 70px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 12px;
    }
    
    [data-position="left"] .ah-tts-toolbar {
        left: 10px;
        right: 10px;
    }
    
    .ah-tts-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ah-tts-status {
        width: 100%;
        font-size: 13px;
    }
    
    .ah-tts-controls {
        flex: 1;
        justify-content: flex-start;
    }
    
    .ah-tts-btn {
        width: 32px;
        height: 32px;
    }
    
    .ah-tts-speed {
        min-width: auto;
    }
}
/* ===== END TEXT-TO-SPEECH TOOLBAR ===== */

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    /* Panel auf volle Breite */
    #accessibility-panel {
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    /* Toggle Button kleiner und mit mehr Abstand vom Rand */
    #accessibility-toggle {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }
    
    [data-position="left"] #accessibility-toggle {
        left: 16px;
        right: auto;
    }
    
    #accessibility-toggle svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Panel Header */
    .accessibility-panel-header {
        padding: 16px;
    }
    
    .accessibility-panel-header h2 {
        font-size: 1.1rem;
    }
    
    #accessibility-close {
        padding: 8px;
    }
    
    /* Panel Content - Einzelne Spalte */
    .accessibility-panel-content {
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 16px;
    }
    
    /* Optionen größer für Touch */
    .accessibility-option {
        width: 100%;
    }
    
    .accessibility-option label {
        min-height: 60px;
        padding: 12px 10px;
        gap: 8px;
    }
    
    .accessibility-option .option-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
    }
    
    .accessibility-option label span {
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* Checkbox größer für Touch */
    .accessibility-option input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
    
    /* Tab-Navigation */
    .ah-tabs {
        gap: 8px;
    }
    
    .ah-tab {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Farbblindheitsmodi */
    .ah-colorblind-options {
        gap: 8px;
    }
    
    .ah-colorblind-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .ah-colorblind-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Footer */
    .accessibility-panel-footer {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Modals auf Mobile anpassen */
    .ah-modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        margin: 5vh auto;
        padding: 0;
    }
    
    .ah-modal-header {
        padding: 14px 16px;
    }
    
    .ah-modal-header h2 {
        font-size: 1.1rem;
    }
    
    .ah-modal-body {
        padding: 16px;
        font-size: 14px;
    }
    
    .ah-modal-close {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .ah-modal-close svg {
        width: 20px;
        height: 20px;
    }
    
    /* BITV Report auf Mobile */
    .ah-bitv-criterion {
        padding: 10px;
        font-size: 14px;
    }
    
    .ah-bitv-criterion label {
        gap: 10px;
    }
    
    .ah-bitv-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* Shortcuts-Hilfe */
    .ah-shortcut-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ah-shortcut {
        padding: 10px;
    }
    
    /* Toast Notifications */
    #ah-toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    [data-position="left"] #ah-toast-container {
        left: 10px;
        right: 10px;
    }
    
    .ah-toast {
        min-width: auto;
        max-width: 100%;
        font-size: 14px;
        padding: 12px 14px;
    }
}

/* Extra kleine Geräte (unter 400px) */
@media (max-width: 400px) {
    #accessibility-toggle {
        width: 48px;
        height: 48px;
        bottom: 12px;
        right: 12px;
    }
    
    [data-position="left"] #accessibility-toggle {
        left: 12px;
    }
    
    .accessibility-panel-header {
        padding: 12px;
    }
    
    .accessibility-panel-header h2 {
        font-size: 1rem;
    }
    
    .accessibility-option label {
        min-height: 56px;
        padding: 10px 8px;
        gap: 6px;
    }
    
    .accessibility-option .option-icon {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
    }
    
    .accessibility-option label span {
        font-size: 13px;
    }
    
    .ah-tab {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Landscape Mode auf kleinen Geräten */
@media (max-height: 500px) and (orientation: landscape) {
    #accessibility-panel {
        height: 100vh;
    }
    
    .accessibility-panel-content {
        padding: 12px;
    }
    
    .accessibility-option {
        min-height: 44px;
        padding: 8px 12px;
    }
    
    .accessibility-panel-header {
        padding: 12px;
    }
    
    .ah-modal-content {
        max-height: 95vh;
    }
}
/* ===== END MOBILE RESPONSIVE STYLES ===== */
