/* BarriereFrei WP Widget Styles */
#barrierefrei-wp-widget {
    --bfwp-primary-color: #0066cc;
    --bfwp-panel-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 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 */
#bfwp-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

[data-position="left"] #bfwp-toast-container {
    right: auto;
    left: 20px;
}

[data-position="left"] .bfwp-toast {
    animation: bfwp-toast-slide-in-left 0.3s ease-out;
}

[data-position="left"] .bfwp-toast.bfwp-toast-hiding {
    animation: bfwp-toast-slide-out-left 0.3s ease-in forwards;
}

.bfwp-toast {
    background: #333;
    color: white;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    animation: bfwp-toast-slide-in 0.3s ease-out;
    pointer-events: auto;
    font-size: 0.9rem;
}

.bfwp-toast.bfwp-toast-success {
    background: #28a745;
}

.bfwp-toast.bfwp-toast-info {
    background: #17a2b8;
}

.bfwp-toast.bfwp-toast-warning {
    background: #ffc107;
    color: #333;
}

.bfwp-toast.bfwp-toast-error {
    background: #dc3545;
}

.bfwp-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.bfwp-toast-message {
    flex: 1;
}

.bfwp-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;
}

.bfwp-toast-close:hover {
    opacity: 1;
}

.bfwp-toast.bfwp-toast-hiding {
    animation: bfwp-toast-slide-out 0.3s ease-in forwards;
}

@keyframes bfwp-toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bfwp-toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes bfwp-toast-slide-in-left {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bfwp-toast-slide-out-left {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-400px);
        opacity: 0;
    }
}

/* High Contrast Mode: Adjust toast colors */
body.bfwp-high-contrast .bfwp-toast {
    background: #000;
    border: 2px solid #fff;
}

body.bfwp-high-contrast .bfwp-toast.bfwp-toast-warning {
    background: #000;
    color: #fff;
    border-color: #ffc107;
}

#bfwp-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
    box-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"] #bfwp-toggle {
    right: auto;
    left: 20px;
}

#bfwp-toggle:hover {
    background: #444;
}

#bfwp-toggle:focus {
    outline: 2px solid #666;
    outline-offset: 2px;
}

#bfwp-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--bfwp-panel-width);
    height: 100vh;
    background: #ffffff;
    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"] #bfwp-panel {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#bfwp-panel.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    display: flex !important;
}

#bfwp-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;
}

#bfwp-panel.open::before {
    opacity: 1;
    visibility: visible;
}

.bfwp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #333;
    color: white;
}

.bfwp-panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

#bfwp-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#bfwp-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#bfwp-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.bfwp-panel-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-content: start;
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
}

.bfwp-option {
    margin-bottom: 0;
    box-sizing: border-box;
    min-width: 0;
}

.bfwp-option:nth-child(n+10) {
    grid-column: 1 / -1;
}

.bfwp-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
    gap: 12px;
    padding: 12px;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.bfwp-option label span {
    font-size: 0.85rem;
}

.bfwp-option label:hover {
    background: #e8e8e8;
}

.bfwp-option:has(input:checked) label {
    background: #fff;
    border: 1px solid var(--bfwp-primary-color, #666);
}

.bfwp-option:has(input:checked) .option-icon {
    color: var(--bfwp-primary-color, #333);
}

.bfwp-option:has(input:checked) label span {
    font-weight: 500;
    color: var(--bfwp-primary-color, #333);
}

.bfwp-option .option-icon {
    flex-shrink: 0;
    color: #666;
}

.bfwp-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.reset-button {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s;
}

.reset-button:hover {
    background: #e0e0e0;
}

.reset-button:focus {
    outline: 2px solid var(--bfwp-primary-color);
    outline-offset: 2px;
}

.declaration-button {
    width: 100%;
    padding: 12px;
    background: var(--bfwp-primary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    color: white;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.declaration-button:hover {
    background: color-mix(in srgb, var(--bfwp-primary-color) 85%, black);
    filter: brightness(0.9);
}

.declaration-button:focus {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

.bfwp-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(--bfwp-primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--bfwp-primary-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-secondary:hover {
    background: var(--bfwp-primary-color);
    color: white;
}

.btn-secondary:focus {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--bfwp-primary-color);
    border: none;
    border-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 */
.bfwp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.bfwp-modal.open {
    display: flex;
}

.bfwp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.bfwp-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.bfwp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.bfwp-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.bfwp-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #666;
}

.bfwp-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.bfwp-modal-close:focus {
    outline: 2px solid var(--bfwp-primary-color);
    outline-offset: 2px;
}

.bfwp-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.9rem;
}

.bfwp-modal-body h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #333;
}

.bfwp-modal-body h3:first-child {
    margin-top: 0;
}

.bfwp-modal-body p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #555;
}

.bfwp-modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.bfwp-modal-body li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #555;
}

.bfwp-modal-body a {
    color: var(--bfwp-primary-color);
    text-decoration: underline;
}

.bfwp-modal-body a:hover {
    text-decoration: none;
}

.bfwp-modal-body a:focus {
    outline: 2px solid var(--bfwp-primary-color);
    outline-offset: 2px;
}

.bfwp-declaration-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .bfwp-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .bfwp-modal-header {
        padding: 16px;
    }
    
    .bfwp-modal-body {
        padding: 16px;
    }
}

/* BITV Report Styles */
.bfwp-bitv-modal {
    max-width: 900px;
}

.bfwp-bitv-intro {
    background: #f0f8ff;
    padding: 16px;
    border-left: 4px solid var(--bfwp-primary-color);
    margin-bottom: 24px;
}

.bfwp-bitv-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.bfwp-bitv-section:last-of-type {
    border-bottom: none;
}

.bfwp-section-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.bfwp-bitv-criterion {
    margin-bottom: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
}

.bfwp-bitv-criterion label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.bfwp-bitv-criterion input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    float: left;
    margin-top: 2px;
}

.bfwp-criterion-desc {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
    margin-left: 32px;
}

.bfwp-bitv-summary {
    margin-top: 32px;
    padding: 24px;
    background: #f0f8ff;
    border-radius: 8px;
}

.bfwp-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(--bfwp-primary-color);
    margin-bottom: 4px;
}

.stat-item span {
    color: #666;
    font-size: 0.9rem;
}

.bfwp-bitv-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Shortcuts Styles */
.bfwp-shortcuts-modal .bfwp-modal-content {
    max-width: 700px;
}

.bfwp-shortcuts-section {
    margin-bottom: 24px;
}

.bfwp-shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.bfwp-shortcuts-table th,
.bfwp-shortcuts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.bfwp-shortcuts-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.bfwp-shortcuts-table kbd {
    display: inline-block;
    padding: 4px 8px;
    background: #e0e0e0;
    border: 1px solid #999;
    border-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);
}

.bfwp-shortcuts-note {
    margin-top: 24px;
    padding: 16px;
    background: #fff9e6;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
}

.bfwp-shortcuts-note p {
    margin: 0;
}

/* Accessibility Modifications */
:root {
    --bfwp-contrast-bg: #000000;
    --bfwp-contrast-text: #ffffff;
    --bfwp-contrast-link: #ffff00;
}

body.bfwp-high-contrast {
    background: var(--bfwp-contrast-bg) !important;
    color: var(--bfwp-contrast-text) !important;
}

body.bfwp-high-contrast * {
    background-color: transparent !important;
    color: inherit !important;
    border-color: var(--bfwp-contrast-text) !important;
}

body.bfwp-high-contrast .bfwp-modal-overlay,
body.bfwp-high-contrast .bfwp-modal-content,
body.bfwp-high-contrast #bfwp-panel,
body.bfwp-high-contrast .bfwp-panel-header {
    background-color: var(--bfwp-contrast-bg) !important;
}

body.bfwp-high-contrast .bfwp-modal-content {
    border: 2px solid var(--bfwp-contrast-text) !important;
}

body.bfwp-high-contrast a {
    color: var(--bfwp-contrast-link) !important;
    text-decoration: underline !important;
}

body.bfwp-high-contrast button,
body.bfwp-high-contrast input,
body.bfwp-high-contrast select,
body.bfwp-high-contrast textarea {
    background: var(--bfwp-contrast-bg) !important;
    color: var(--bfwp-contrast-text) !important;
    border: 1px solid var(--bfwp-contrast-text) !important;
}

body.bfwp-high-contrast img {
    opacity: 0.8;
    filter: none !important;
}

body.bfwp-increase-text {
    font-size: 120% !important;
}

body.bfwp-increase-text * {
    font-size: inherit !important;
}

body.bfwp-highlight-links a {
    text-decoration: underline !important;
    background: yellow !important;
    color: #000 !important;
    padding: 2px 4px !important;
}

body.bfwp-readable-font,
body.bfwp-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

body.bfwp-pause-animations,
body.bfwp-pause-animations * {
    animation: none !important;
    transition: none !important;
}

body.bfwp-line-height,
body.bfwp-line-height * {
    line-height: 1.8 !important;
}

body.bfwp-letter-spacing,
body.bfwp-letter-spacing * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

body.bfwp-large-cursor,
body.bfwp-large-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="black" stroke="white" stroke-width="1"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 0 0, auto !important;
}

body.bfwp-large-cursor a,
body.bfwp-large-cursor button,
body.bfwp-large-cursor input[type="submit"],
body.bfwp-large-cursor input[type="button"] {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="black" stroke="white" stroke-width="1"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>') 16 16, pointer !important;
}

/* Focus Visibility Enhancement */
body.bfwp-focus-visible *:focus {
    outline: 3px solid #ff6b00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(255, 107, 0, 0.2) !important;
}

body.bfwp-focus-visible a:focus,
body.bfwp-focus-visible button:focus,
body.bfwp-focus-visible input:focus,
body.bfwp-focus-visible select:focus,
body.bfwp-focus-visible textarea:focus,
body.bfwp-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.bfwp-high-contrast.bfwp-focus-visible *:focus {
    outline-color: #ffff00 !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 0, 0.3) !important;
}

@media (max-width: 768px) {
    #bfwp-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .bfwp-panel-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bfwp-option {
        min-height: 44px;
        padding: 10px 12px;
    }
    
    .bfwp-option svg {
        width: 32px;
        height: 32px;
    }
    
    .bfwp-option span {
        font-size: 14px;
    }
    
    #bfwp-toggle {
        width: 48px;
        height: 48px;
    }
    
    #bfwp-toggle svg {
        width: 28px;
        height: 28px;
    }
    
    .bfwp-modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    .bfwp-modal-content h2 {
        font-size: 18px;
    }
    
    .bfwp-modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}
