/* ========================================
   Accessibility Widget - תקן ישראלי 5568 AA
   כלי נגישות - עיצוב מותאם למערכת
   ======================================== */

/* ========================================
   Phosphor Icons - Global Optimization
   ======================================== */
.acc-panel i.ph,
.acc-toggle-btn i.ph,
.acc-magnifier-indicator i.ph,
.acc-virtual-keyboard i.ph,
.acc-voice-indicator i.ph {
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ========================================
   Side Tab Toggle
   ======================================== */
.acc-toggle-btn {
    position: fixed !important;
    left: 0 !important;
    bottom: auto !important;
    top: 198px !important;
    transform: none !important;
    z-index: 999999 !important;
    width: 42px;
    height: 42px;
    border-radius: 0 12px 12px 0;
    background: #1e293b !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s ease, background 0.2s ease;
    line-height: 1;
    padding: 0;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    pointer-events: auto !important;
}
.acc-toggle-btn i {
    font-size: 20px !important;
    line-height: 1 !important;
}
.acc-toggle-btn:hover,
.acc-toggle-btn:focus {
    width: 50px;
    background: #334155 !important;
    outline: none;
}
.acc-toggle-btn.panel-open {
    left: 450px !important;
}
.acc-toggle-btn i {
    font-size: 25px !important;
    color: #fff !important;
    opacity: 1 !important;
}

/* Panel */
.acc-panel {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999999999;
    width: 450px;
    height: 100vh;
    background: #f1f5f9 !important;
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    flex-direction: column;
    direction: rtl;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #1e293b !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
}
.acc-panel.active {
    transform: translateX(0);
}

/* Overlay */
.acc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.acc-overlay.active {
    opacity: 1;
    visibility: visible;
}

.acc-panel *,
.acc-panel *::before,
.acc-panel *::after {
    filter: none !important;
}

/* Panel Header */
.acc-panel-header {
    background: #4f46e5 !important;
    color: #fff !important;
    padding: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.acc-panel-header h3 {
    margin: 0;
    font-size: 16px !important;
    font-weight: 600;
    color: #fff !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.acc-panel-header h3 i {
    font-size: 18px;
}
.acc-panel-close {
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    color: #fff !important;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}
.acc-panel-close:hover,
.acc-panel-close:focus {
    background: rgba(255, 255, 255, 0.3) !important;
    outline: none !important;
}

/* Panel Body */
.acc-panel-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #f1f5f9 !important;
}

/* Section Label */
.acc-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 4px;
}

/* ========================================
   Toggle Buttons (3 columns)
   ======================================== */
.acc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.acc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 6px 12px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px;
    background: #fff !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #475569 !important;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
    opacity: 1 !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.acc-btn .acc-btn-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f1f5f9;
    transition: all 0.2s ease;
}
.acc-btn .acc-btn-icon i {
    font-size: 28px;
    color: #4f46e5;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure Phosphor icons display correctly */
.acc-btn .acc-btn-icon i::before {
    display: block;
    font-weight: 400;
}
.acc-btn:hover {
    background: #fff !important;
    border-color: #c7d2fe !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}
.acc-btn:hover .acc-btn-icon {
    background: #eef2ff;
}
.acc-btn:focus {
    outline: 2px solid #4f46e5 !important;
    outline-offset: 2px;
}
.acc-btn.active {
    background: #fff !important;
    border-color: #4f46e5 !important;
    color: #4f46e5 !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.acc-btn.active .acc-btn-icon {
    background: #4f46e5;
}
.acc-btn.active .acc-btn-icon i {
    color: #fff;
}

/* ========================================
   Slider Controls
   ======================================== */
.acc-slider-section {
    background: #fff !important;
    border-radius: 12px;
    border: 1px solid #e2e8f0 !important;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Extra margin for letter spacing slider (last slider) */
.acc-slider-section:last-of-type {
    margin-bottom: 16px;
}

.acc-slider-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155 !important;
    text-align: center;
    margin-bottom: 12px;
}
.acc-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.acc-slider-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.2s ease;
}
.acc-slider-btn i {
    font-size: 14px;
    color: #4f46e5;
}
.acc-slider-btn:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}
.acc-slider-btn:focus {
    outline: 2px solid #4f46e5 !important;
    outline-offset: 2px;
}
.acc-slider-track {
    flex: 1;
    height: 32px;
    background: #e2e8f0 !important;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.acc-slider-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: #4f46e5 !important;
    border-radius: 8px;
    transition: width 0.2s;
}
.acc-slider-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: #334155 !important;
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
}
.acc-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}
.acc-slider-labels span {
    font-size: 10px;
    color: #334155 !important;
}

/* ========================================
   Panel Footer
   ======================================== */
.acc-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0 !important;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: #f8fafc !important;
}
.acc-reset-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px;
    background: #fff !important;
    color: #ef4444 !important;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.acc-reset-btn:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}
.acc-reset-btn:focus {
    outline: 2px solid #ef4444 !important;
    outline-offset: 2px;
}
.acc-statement-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px;
    background: #fff !important;
    color: #4f46e5 !important;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none !important;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    outline: none !important;
}
.acc-statement-btn:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}
.acc-statement-btn:focus {
    outline: 2px solid #4f46e5 !important;
    outline-offset: 2px;
}

/* ========================================
   Accessibility Active Styles
   ======================================== */

.acc-page-wrapper {
    min-height: inherit;
    display: inherit;
    flex-direction: inherit;
    flex-wrap: inherit;
    align-items: inherit;
    justify-content: inherit;
    gap: inherit;
    padding: inherit;
    flex: 1;
    width: 100%;
}

/* High Contrast */
body.acc-high-contrast .acc-page-wrapper {
    background: #000 !important;
    color: #ffff00 !important;
}
body.acc-high-contrast .acc-page-wrapper * {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.acc-high-contrast .acc-page-wrapper a {
    color: #00ffff !important;
    text-decoration: underline !important;
}
body.acc-high-contrast .acc-page-wrapper button,
body.acc-high-contrast .acc-page-wrapper input,
body.acc-high-contrast .acc-page-wrapper select,
body.acc-high-contrast .acc-page-wrapper textarea {
    background: #333 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}
body.acc-high-contrast .acc-page-wrapper img {
    filter: brightness(1.2) contrast(1.3) !important;
    background: transparent !important;
}

/* Inverted Contrast - use backdrop-filter to avoid breaking sticky/fixed positioning */
body.acc-invert-contrast .acc-page-wrapper {
    position: relative;
}
body.acc-invert-contrast .acc-page-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: invert(1) hue-rotate(180deg);
    pointer-events: none;
    z-index: 999990;
}
body.acc-invert-contrast .acc-page-wrapper img,
body.acc-invert-contrast .acc-page-wrapper video {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Grayscale - use backdrop-filter to avoid breaking sticky/fixed positioning */
body.acc-grayscale .acc-page-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: grayscale(100%);
    pointer-events: none;
    z-index: 999990;
}

/* Black & White - use backdrop-filter to avoid breaking sticky/fixed positioning */
body.acc-blackwhite .acc-page-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: grayscale(100%) contrast(1.5);
    pointer-events: none;
    z-index: 999990;
}

/* Highlight Links */
body.acc-highlight-links .acc-page-wrapper a {
    outline: 3px solid #f57c00 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
    color: #e65100 !important;
    background: #fff3e0 !important;
}

/* Readable Font */
body.acc-readable-font .acc-page-wrapper,
body.acc-readable-font .acc-page-wrapper * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Hide Images */
body.acc-hide-images .acc-page-wrapper img {
    opacity: 0 !important;
}

/* Screen Reader */
body.acc-screen-reader .acc-page-wrapper [aria-hidden="true"] {
    display: none !important;
}
body.acc-screen-reader .acc-page-wrapper img:not([alt]) {
    outline: 4px solid #f44336 !important;
}

/* Big Dark Cursor */
body.acc-cursor-dark,
body.acc-cursor-dark * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 1l19 15-8 1.5 5 11-4 2-5-11-7 6z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 5 1, auto !important;
}

/* Big Light Cursor */
body.acc-cursor-light,
body.acc-cursor-light * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 1l19 15-8 1.5 5 11-4 2-5-11-7 6z' fill='%23fff' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") 5 1, auto !important;
}

/* Reading Guide */
.acc-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 12px;
    background: rgba(79, 70, 229, 0.15);
    border-top: 2px solid #4f46e5;
    border-bottom: 2px solid #4f46e5;
    pointer-events: none;
    z-index: 999990;
    transition: top 0.05s linear;
    filter: none !important;
}

/* Highlight Headings */
body.acc-highlight-headings .acc-page-wrapper h1,
body.acc-highlight-headings .acc-page-wrapper h2,
body.acc-highlight-headings .acc-page-wrapper h3,
body.acc-highlight-headings .acc-page-wrapper h4,
body.acc-highlight-headings .acc-page-wrapper h5,
body.acc-highlight-headings .acc-page-wrapper h6 {
    outline: 3px solid #4f46e5 !important;
    outline-offset: 2px !important;
    background: #eef2ff !important;
    padding: 4px 8px !important;
    color: #000 !important;
}
body.acc-highlight-headings .acc-page-wrapper h1 *,
body.acc-highlight-headings .acc-page-wrapper h2 *,
body.acc-highlight-headings .acc-page-wrapper h3 *,
body.acc-highlight-headings .acc-page-wrapper h4 *,
body.acc-highlight-headings .acc-page-wrapper h5 *,
body.acc-highlight-headings .acc-page-wrapper h6 * {
    color: #000 !important;
}

/* Stop Animations */
body.acc-stop-animations .acc-page-wrapper,
body.acc-stop-animations .acc-page-wrapper *,
body.acc-stop-animations .acc-page-wrapper *::before,
body.acc-stop-animations .acc-page-wrapper *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Keyboard Navigation */
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper *:focus {
    outline: 3px solid #4f46e5 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.25) !important;
}
/* Enhanced focus styles for content elements */
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h1:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h2:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h3:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h4:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h5:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper h6:focus {
    background: rgba(79, 70, 229, 0.1) !important;
    outline: 3px solid #4f46e5 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.25) !important;
}
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper p:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper li:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper td:focus,
body.acc-keyboard-nav.acc-keyboard-active .acc-page-wrapper th:focus {
    background: rgba(79, 70, 229, 0.05) !important;
    outline: 2px solid #4f46e5 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}
body.acc-keyboard-nav .acc-page-wrapper a,
body.acc-keyboard-nav .acc-page-wrapper button,
body.acc-keyboard-nav .acc-page-wrapper input,
body.acc-keyboard-nav .acc-page-wrapper select,
body.acc-keyboard-nav .acc-page-wrapper textarea,
body.acc-keyboard-nav .acc-page-wrapper [role="button"],
body.acc-keyboard-nav .acc-page-wrapper [tabindex] {
    outline-offset: 3px !important;
}
.acc-skip-link {
    position: fixed !important;
    top: -200px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #4f46e5 !important;
    color: #fff !important;
    padding: 14px 28px !important;
    border-radius: 0 0 12px 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    z-index: 99999999 !important;
    text-decoration: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    direction: rtl !important;
    text-align: center !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: none !important; /* Hidden by default */
    pointer-events: auto !important;
    filter: none !important;
}

/* Show skip link when keyboard nav is active */
body.acc-keyboard-nav .acc-skip-link {
    display: block !important;
}

/* Bring skip link to view when focused */
.acc-skip-link:focus {
    top: 0 !important;
    outline: 4px solid #fff !important;
    outline-offset: -4px !important;
}

.acc-skip-link:hover {
    background: #4338ca !important;
}

/* Focus Highlight */
body.acc-focus-highlight *:focus {
    outline: 4px solid #ff6d00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(255, 109, 0, 0.3) !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .acc-panel {
        width: 100%;
    }
    .acc-toggle-btn {
        width: 38px;
        height: 38px;
    }
    .acc-toggle-btn.panel-open {
        left: 100% !important;
    }
    .acc-toggle-btn i {
        font-size: 16px !important;
    }
    .acc-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .acc-btn {
        padding: 10px 4px 8px;
        font-size: 10px;
    }
    .acc-btn .acc-btn-icon {
        width: 30px;
        height: 30px;
    }
    .acc-btn .acc-btn-icon i {
        font-size: 14px;
    }
}

/* ========================================
   Text-to-Speech (הקראת טקסט)
   ======================================== */
body.acc-text-to-speech .acc-page-wrapper p,
body.acc-text-to-speech .acc-page-wrapper h1,
body.acc-text-to-speech .acc-page-wrapper h2,
body.acc-text-to-speech .acc-page-wrapper h3,
body.acc-text-to-speech .acc-page-wrapper h4,
body.acc-text-to-speech .acc-page-wrapper h5,
body.acc-text-to-speech .acc-page-wrapper h6,
body.acc-text-to-speech .acc-page-wrapper li,
body.acc-text-to-speech .acc-page-wrapper td,
body.acc-text-to-speech .acc-page-wrapper th,
body.acc-text-to-speech .acc-page-wrapper a,
body.acc-text-to-speech .acc-page-wrapper button,
body.acc-text-to-speech .acc-page-wrapper label {
    position: relative;
}

body.acc-text-to-speech .acc-page-wrapper [data-acc-tts]:hover {
    background: rgba(79, 70, 229, 0.1) !important;
    outline: 2px solid rgba(79, 70, 229, 0.3) !important;
    outline-offset: 2px !important;
}

.acc-tts-speaking {
    background: rgba(79, 70, 229, 0.2) !important;
    animation: acc-tts-pulse 0.5s ease-in-out;
}

@keyframes acc-tts-pulse {
    0%, 100% { background: rgba(79, 70, 229, 0.2) !important; }
    50% { background: rgba(79, 70, 229, 0.4) !important; }
}

/* TTS Instruction Tooltip */
.acc-tts-instruction {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #4f46e5 !important;
    color: #fff !important;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    z-index: 9999999 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: acc-tts-fade-in 0.3s ease-in-out;
    direction: rtl;
}

@keyframes acc-tts-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Voice Commands (פקודות קוליות)
   ======================================== */
.acc-voice-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff !important;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    z-index: 9999999 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    transition: all 0.3s ease;
}

.acc-voice-indicator i {
    font-size: 16px;
    color: #94a3b8;
}

.acc-voice-indicator.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
    animation: acc-voice-pulse 1.5s ease-in-out infinite;
}

.acc-voice-indicator.active i {
    color: #fff !important;
}

@keyframes acc-voice-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(79, 70, 229, 0.6);
    }
}

/* Voice command feedback bubble */
.acc-voice-feedback {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85) !important;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    z-index: 9999998 !important;
    direction: rtl;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.acc-voice-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Virtual Keyboard (מקלדת וירטואלית)
   ======================================== */
.acc-virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    background: #fff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999998 !important;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    direction: rtl;
    display: none;
}

.acc-virtual-keyboard.acc-vk-active {
    display: block;
    animation: acc-vk-slide-up 0.3s ease-out;
}

@keyframes acc-vk-slide-up {
    from {
        transform: translateX(-50%) translateY(100%);
    }
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.acc-vk-header {
    background: #4f46e5 !important;
    color: #fff !important;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px 10px 0 0;
    cursor: move;
    user-select: none;
}

.acc-vk-title {
    font-size: 14px;
    font-weight: 600;
}

.acc-vk-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.acc-vk-lang {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: #fff !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.acc-vk-lang:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.acc-vk-close {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: #fff !important;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.acc-vk-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.acc-vk-body {
    padding: 16px;
    background: #f8fafc !important;
}

.acc-vk-row {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    justify-content: center;
}

.acc-vk-special-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}

.acc-vk-key {
    min-width: 45px;
    height: 45px;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b !important;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    padding: 0 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.acc-vk-key:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.acc-vk-key:active,
.acc-vk-key-pressed {
    transform: translateY(1px) !important;
    background: #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.acc-vk-key.active {
    background: #4f46e5 !important;
    color: #fff !important;
    border-color: #4f46e5 !important;
}

.acc-vk-key-space {
    min-width: 300px !important;
}

.acc-vk-key-shift,
.acc-vk-key-caps {
    min-width: 70px !important;
    font-size: 13px;
}

.acc-vk-key-backspace,
.acc-vk-key-enter {
    min-width: 80px !important;
}

.acc-vk-key-backspace i {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .acc-virtual-keyboard {
        width: 100%;
        max-width: 100%;
    }
    
    .acc-vk-key {
        min-width: 35px;
        height: 40px;
        font-size: 14px;
    }
    
    .acc-vk-key-space {
        min-width: 200px !important;
    }
    
    .acc-vk-key-shift,
    .acc-vk-key-caps,
    .acc-vk-key-backspace,
    .acc-vk-key-enter {
        min-width: 60px !important;
        font-size: 12px;
    }
}

/* ========================================
   Magnifier (זכוכית מגדלת) - Hover to Magnify
   ======================================== */
.acc-magnifier-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4f46e5 !important;
    border-radius: 50px;
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 9999998 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.acc-mag-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.acc-mag-info i {
    font-size: 16px;
}

.acc-magnifier-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.acc-mag-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 8px;
    color: #fff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.acc-mag-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    transform: scale(1.1);
}

.acc-mag-btn:active {
    transform: scale(0.95);
}

.acc-mag-btn i {
    font-size: 13px;
}

.acc-mag-zoom-level {
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    min-width: 35px;
    text-align: center;
}

/* Magnified elements styling - text only */
.acc-magnified {
    position: relative !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.25) !important;
    border: 2px solid #4f46e5 !important;
    margin: 5px 0 !important;
}

/* Ensure magnified text is readable */
.acc-magnified,
.acc-magnified * {
    color: #1e293b !important;
}

/* Smooth hover effect ONLY for buttons, headings, and paragraphs */
body.acc-magnifier-active .acc-page-wrapper p:hover,
body.acc-magnifier-active .acc-page-wrapper h1:hover,
body.acc-magnifier-active .acc-page-wrapper h2:hover,
body.acc-magnifier-active .acc-page-wrapper h3:hover,
body.acc-magnifier-active .acc-page-wrapper h4:hover,
body.acc-magnifier-active .acc-page-wrapper h5:hover,
body.acc-magnifier-active .acc-page-wrapper h6:hover,
body.acc-magnifier-active .acc-page-wrapper button:hover {
    background: rgba(79, 70, 229, 0.08) !important;
    border-radius: 6px;
    transition: background 0.15s ease;
    cursor: pointer;
}

/* Visual indicator that element is hoverable */
body.acc-magnifier-active .acc-page-wrapper p,
body.acc-magnifier-active .acc-page-wrapper h1,
body.acc-magnifier-active .acc-page-wrapper h2,
body.acc-magnifier-active .acc-page-wrapper h3,
body.acc-magnifier-active .acc-page-wrapper h4,
body.acc-magnifier-active .acc-page-wrapper h5,
body.acc-magnifier-active .acc-page-wrapper h6,
body.acc-magnifier-active .acc-page-wrapper button {
    cursor: zoom-in;
}

/* ========================================
   Print
   ======================================== */
@media print {
    .acc-toggle-btn,
    .acc-panel,
    .acc-overlay,
    .acc-reading-guide,
    .acc-tts-instruction,
    .acc-voice-indicator,
    .acc-voice-feedback,
    .acc-virtual-keyboard,
    .acc-magnifier-indicator {
        display: none !important;
    }
}