/* ============================================
   WordPress Accessibility Module - CSS
   Extracted from original HTML module
   ============================================ */

/* ============================================
   RESET & BASE STYLES
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-blue: #3b82f6;
    --secondary-color: #64748b;
    --bg-color: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   ACCESSIBILITY TOOLBAR STYLES
   ============================================ */
.accessibility-toolbar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.toolbar-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.toolbar-button:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.toolbar-button:active {
    transform: scale(0.95);
}

.toolbar-button::before {
    content: '';
}

.toolbar-button svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* ============================================
   DRAWER MENU STYLES
   ============================================ */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    max-width: 90vw;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: scroll !important;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #e5e7eb;
    isolation: isolate;
    filter: none !important;
    -webkit-filter: none !important;
    will-change: transform;
}

.drawer.active {
    transform: translateX(0);
}

/* ============================================
   DRAWER HEADER (BLUE SECTION)
   ============================================ */
.drawer-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-color));
    color: white;
    padding: 1.5rem;
    position: relative;
}

.drawer-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.language-selector:hover {
    background: rgba(255, 255, 255, 0.3);
}

.language-selector select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    padding-right: 1.5rem;
}

.language-selector select option {
    color: var(--text-color);
    background: white;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    display: inline-block;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.flag-icon.en { background: linear-gradient(to bottom, #012169 0%, #012169 33%, #fff 33%, #fff 66%, #C8102E 66%); }
.flag-icon.de { background: linear-gradient(to bottom, #000 0%, #000 33%, #DD0000 33%, #DD0000 66%, #FFCE00 66%); }
.flag-icon.es { background: linear-gradient(to bottom, #AA151B 0%, #AA151B 25%, #F1BF00 25%, #F1BF00 75%, #AA151B 75%); }
.flag-icon.fr { background: linear-gradient(to right, #002654 0%, #002654 33%, #fff 33%, #fff 66%, #ED2939 66%); }
.flag-icon.it { background: linear-gradient(to right, #009246 0%, #009246 33%, #fff 33%, #fff 66%, #CE2B37 66%); }
.flag-icon.pl { background: linear-gradient(to bottom, #fff 0%, #fff 50%, #DC143C 50%); }
.flag-icon.pt { background: linear-gradient(to right, #006600 0%, #006600 40%, #FF0000 40%, #FF0000 60%, #FF0000 60%, #FFD700 60%); }

.drawer-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    font-weight: 300;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.drawer-header-content {
    text-align: center;
    padding: 1rem 0;
}

.accessibility-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.accessibility-icon svg {
    width: 32px;
    height: 32px;
}

.drawer-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.drawer-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drawer-subtitle a {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

.drawer-subtitle a:hover {
    opacity: 0.8;
}

/* ============================================
   DRAWER CONTENT (WHITE SECTION)
   ============================================ */
.drawer-content {
    padding: 1.5rem;
    flex: 1;
    background: white;
}

.drawer-section {
    margin-bottom: 2rem;
}

.drawer-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   GRID BUTTON LAYOUT
   ============================================ */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.options-grid.colors {
    grid-template-columns: repeat(3, 1fr);
}

.options-grid.orientation {
    grid-template-columns: repeat(3, 1fr);
}

.option-button {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    min-height: 100px;
}

.option-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-button.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.option-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-color);
}

.option-icon svg {
    width: 100%;
    height: 100%;
}

.option-label {
    font-size: 0.75rem;
    color: var(--text-color);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

.option-dash {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    border-top: 1px dashed var(--border-color);
}

/* ============================================
   PROGRESSIVE STATE BARS
   ============================================ */
.option-bars {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
    width: 60%;
}

.option-bar {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: var(--transition);
    max-width: 12px;
}

.option-bar.active {
    background: var(--primary-color);
}

.option-button.active.level-1 .option-bar:nth-child(1) {
    background: var(--primary-color);
}

.option-button.active.level-2 .option-bar:nth-child(1),
.option-button.active.level-2 .option-bar:nth-child(2) {
    background: var(--primary-color);
}

.option-button.active.level-3 .option-bar:nth-child(1),
.option-button.active.level-3 .option-bar:nth-child(2),
.option-button.active.level-3 .option-bar:nth-child(3) {
    background: var(--primary-color);
}

/* ============================================
   ICON STYLES (SVG)
   ============================================ */
.icon-svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: currentColor;
}

/* ============================================
   RESET BUTTON
   ============================================ */
.reset-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.reset-button:active {
    transform: translateY(0);
}

/* ============================================
   ACCESSIBILITY FEATURE STYLES
   ============================================ */

/* Text Size Adjustments */
body.text-size-small {
    font-size: 14px;
}

body.text-size-medium {
    font-size: 16px;
}

body.text-size-large {
    font-size: 18px;
}

body.text-size-extra-large {
    font-size: 20px;
}

/* Cursor Adjustments */
body.cursor-large * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="14" fill="%232563eb" opacity="0.5"/><circle cx="16" cy="16" r="8" fill="%232563eb"/></svg>') 16 16, auto !important;
}

/* Letter Spacing */
body.letter-spacing-wide * {
    letter-spacing: 0.1em !important;
}

body.letter-spacing-wider * {
    letter-spacing: 0.2em !important;
}

body.letter-spacing-widest * {
    letter-spacing: 0.3em !important;
}

/* Readable Font - 3 Levels */
body.readable-font-light {
    font-family: 'Georgia', 'Times New Roman', serif !important;
}

body.readable-font-medium {
    font-family: 'Georgia', 'Times New Roman', serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
}

body.readable-font-full {
    font-family: 'Georgia', 'Times New Roman', serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    line-height: 1.8 !important;
}

/* Text Alignment */
body.text-align-left * {
    text-align: left !important;
}

body.text-align-center * {
    text-align: center !important;
}

body.text-align-right * {
    text-align: right !important;
}

/* Line Height */
body.line-height-tight * {
    line-height: 1.4 !important;
}

body.line-height-normal * {
    line-height: 1.6 !important;
}

body.line-height-relaxed * {
    line-height: 1.8 !important;
}

body.line-height-loose * {
    line-height: 2 !important;
}

/* Color Adjustments - Apply filters only to page content, NOT body */
body.grayscale,
body.grayscale * {
    filter: grayscale(100%) !important;
}

body.grayscale-light,
body.grayscale-light * {
    filter: grayscale(50%) !important;
}

body.grayscale-medium,
body.grayscale-medium * {
    filter: grayscale(75%) !important;
}

body.grayscale-full,
body.grayscale-full * {
    filter: grayscale(100%) !important;
}

/* CRITICAL: Drawer and toolbar are NEVER affected by any filters */
.drawer,
.drawer *,
.drawer *::before,
.drawer *::after,
.accessibility-toolbar,
.accessibility-toolbar *,
.accessibility-toolbar *::before,
.accessibility-toolbar *::after,
.drawer-overlay,
.reading-mask,
.reading-line {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Ensure drawer scrollbar is always visible and never filtered */
.drawer::-webkit-scrollbar,
.drawer::-webkit-scrollbar-track,
.drawer::-webkit-scrollbar-thumb,
.drawer::-webkit-scrollbar-button,
body.grayscale-light .drawer::-webkit-scrollbar,
body.grayscale-light .drawer::-webkit-scrollbar-track,
body.grayscale-light .drawer::-webkit-scrollbar-thumb,
body.grayscale-light .drawer::-webkit-scrollbar-button,
body.grayscale-medium .drawer::-webkit-scrollbar,
body.grayscale-medium .drawer::-webkit-scrollbar-track,
body.grayscale-medium .drawer::-webkit-scrollbar-thumb,
body.grayscale-medium .drawer::-webkit-scrollbar-button,
body.grayscale-full .drawer::-webkit-scrollbar,
body.grayscale-full .drawer::-webkit-scrollbar-track,
body.grayscale-full .drawer::-webkit-scrollbar-thumb,
body.grayscale-full .drawer::-webkit-scrollbar-button,
body.brightness-50 .drawer::-webkit-scrollbar,
body.brightness-50 .drawer::-webkit-scrollbar-track,
body.brightness-50 .drawer::-webkit-scrollbar-thumb,
body.brightness-50 .drawer::-webkit-scrollbar-button,
body.brightness-75 .drawer::-webkit-scrollbar,
body.brightness-75 .drawer::-webkit-scrollbar-track,
body.brightness-75 .drawer::-webkit-scrollbar-thumb,
body.brightness-75 .drawer::-webkit-scrollbar-button,
body.brightness-125 .drawer::-webkit-scrollbar,
body.brightness-125 .drawer::-webkit-scrollbar-track,
body.brightness-125 .drawer::-webkit-scrollbar-thumb,
body.brightness-125 .drawer::-webkit-scrollbar-button,
body.brightness-150 .drawer::-webkit-scrollbar,
body.brightness-150 .drawer::-webkit-scrollbar-track,
body.brightness-150 .drawer::-webkit-scrollbar-thumb,
body.brightness-150 .drawer::-webkit-scrollbar-button,
body.invert-colors .drawer::-webkit-scrollbar,
body.invert-colors .drawer::-webkit-scrollbar-track,
body.invert-colors .drawer::-webkit-scrollbar-thumb,
body.invert-colors .drawer::-webkit-scrollbar-button {
    filter: none !important;
    -webkit-filter: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure drawer never inherits filters from body */
body.grayscale-light .drawer,
body.grayscale-light .drawer *,
body.grayscale-light .accessibility-toolbar,
body.grayscale-light .accessibility-toolbar *,
body.grayscale-light .drawer-overlay,
body.grayscale-medium .drawer,
body.grayscale-medium .drawer *,
body.grayscale-medium .accessibility-toolbar,
body.grayscale-medium .accessibility-toolbar *,
body.grayscale-medium .drawer-overlay,
body.grayscale-full .drawer,
body.grayscale-full .drawer *,
body.grayscale-full .accessibility-toolbar,
body.grayscale-full .accessibility-toolbar *,
body.grayscale-full .drawer-overlay,
body.brightness-50 .drawer,
body.brightness-50 .drawer *,
body.brightness-50 .accessibility-toolbar,
body.brightness-50 .accessibility-toolbar *,
body.brightness-50 .drawer-overlay,
body.brightness-75 .drawer,
body.brightness-75 .drawer *,
body.brightness-75 .accessibility-toolbar,
body.brightness-75 .accessibility-toolbar *,
body.brightness-75 .drawer-overlay,
body.brightness-125 .drawer,
body.brightness-125 .drawer *,
body.brightness-125 .accessibility-toolbar,
body.brightness-125 .accessibility-toolbar *,
body.brightness-125 .drawer-overlay,
body.brightness-150 .drawer,
body.brightness-150 .drawer *,
body.brightness-150 .accessibility-toolbar,
body.brightness-150 .accessibility-toolbar *,
body.brightness-150 .drawer-overlay,
body.invert-colors .drawer,
body.invert-colors .drawer *,
body.invert-colors .accessibility-toolbar,
body.invert-colors .accessibility-toolbar *,
body.invert-colors .drawer-overlay {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Brightness adjustments - Applied to page content only */
body.brightness-50 {
    filter: brightness(0.5) !important;
}

body.brightness-75 {
    filter: brightness(0.75) !important;
}

body.brightness-100 {
    filter: brightness(1) !important;
}

body.brightness-125 {
    filter: brightness(1.25) !important;
}

body.brightness-150 {
    filter: brightness(1.5) !important;
}

body.brightness-175 {
    filter: brightness(1.75) !important;
}

body.brightness-200 {
    filter: brightness(2) !important;
}

body.invert-colors,
body.invert-colors * {
    filter: invert(1) !important;
}

/* Highlight Links - Only apply to page content */
body.highlight-links a {
    background-color: yellow !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: bold !important;
    text-decoration: underline !important;
}

/* Stop Animations */
body.stop-animations *,
body.stop-animations *::before,
body.stop-animations *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* Hide Images - Only apply to page content */
body.hide-images img {
    display: none !important;
}

/* Reading Mask */
.reading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 9997;
    display: none;
}

.reading-mask.active {
    display: block;
}

.reading-mask::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 200px;
    background: transparent;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}

/* Reading Line */
.reading-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff0000;
    z-index: 9996;
    display: none;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.reading-line.active {
    display: block;
}

/* Highlight Everything - Only apply to page content */
body.highlight-everything,
body.highlight-everything * {
    background-color: yellow !important;
    color: black !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .drawer {
        width: 100%;
        max-width: 100vw;
    }

    .toolbar-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .options-grid.colors,
    .options-grid.orientation {
        grid-template-columns: repeat(2, 1fr);
    }

    .option-button {
        min-height: 90px;
        padding: 0.75rem 0.25rem;
    }

    .option-icon {
        width: 28px;
        height: 28px;
    }

    .option-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .option-button {
        min-height: 80px;
    }
}

/* ============================================
   SCROLLBAR STYLING - ALWAYS VISIBLE
   ============================================ */
.drawer::-webkit-scrollbar {
    width: 12px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    visibility: visible !important;
}

.drawer::-webkit-scrollbar-track {
    background: #e5e7eb !important;
    border-left: 1px solid #d1d5db !important;
    border-radius: 0 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.drawer::-webkit-scrollbar-thumb {
    background: var(--primary-color) !important;
    border-radius: 6px !important;
    border: 2px solid #e5e7eb !important;
    min-height: 40px !important;
    background-clip: padding-box !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.drawer::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover) !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.drawer::-webkit-scrollbar-thumb:active {
    background: var(--primary-hover) !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Ensure scrollbar buttons are visible (up/down arrows) */
.drawer::-webkit-scrollbar-button {
    display: block !important;
    height: 16px !important;
    background: #e5e7eb !important;
    border: 1px solid #d1d5db !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.drawer::-webkit-scrollbar-button:vertical:start:decrement {
    background: #e5e7eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2364748b' d='M4 0l4 4H0z'/%3E%3C/svg%3E") no-repeat center !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.drawer::-webkit-scrollbar-button:vertical:end:increment {
    background: #e5e7eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2364748b' d='M4 8L0 4h8z'/%3E%3C/svg%3E") no-repeat center !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Firefox scrollbar - always visible */
.drawer {
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary-color) #e5e7eb !important;
}

/* Force scrollbar to always be visible - override any parent filters */
body.grayscale-light .drawer::-webkit-scrollbar,
body.grayscale-light .drawer::-webkit-scrollbar-track,
body.grayscale-light .drawer::-webkit-scrollbar-thumb,
body.grayscale-light .drawer::-webkit-scrollbar-button,
body.grayscale-medium .drawer::-webkit-scrollbar,
body.grayscale-medium .drawer::-webkit-scrollbar-track,
body.grayscale-medium .drawer::-webkit-scrollbar-thumb,
body.grayscale-medium .drawer::-webkit-scrollbar-button,
body.grayscale-full .drawer::-webkit-scrollbar,
body.grayscale-full .drawer::-webkit-scrollbar-track,
body.grayscale-full .drawer::-webkit-scrollbar-thumb,
body.grayscale-full .drawer::-webkit-scrollbar-button {
    filter: none !important;
    -webkit-filter: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

