/* קובץ: css/accessibility-menu.css */

/* כפתור פתיחה */
.accessibility-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    padding: 0px;
    border-radius: 50%;
    background: rgb(37 99 235);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none !important;
    transition: none !important;
}

.accessibility-toggle:hover {
    background: rgb(29 78 216);
    transform: scale(1.05);
}

.accessibility-toggle:focus {
    background: rgb(37 99 235);
}

.accessibility-toggle svg {
    position: absolute;
    color: #ffffff;
}

/* תפריט נגישות - מופיע מצד שמאל */
.accessibility-menu {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: none;
    direction: rtl;
    display: none;
}

.accessibility-menu h2, .accessibility-menu h3 {
    font-family: 'Roboto Condensed', sans-serif;
}

.accessibility-menu-header h2 {
    color: #ffffff;
}

.accessibility-menu.active {
    left: 0;
    display: block;
}

/* כותרת */
.accessibility-menu-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    height: 85px;
    background: linear-gradient(270deg, #1d4ed8, #2563eb);
    color: white;
    border-bottom: 1px solid #1976D2;
    z-index: 10;
}

.accessibility-menu-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.accessibility-close {
    /*background: rgba(255, 255, 255, 0.2);*/
    background: ;: initial;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0px;
}

.accessibility-close:hover, .accessibility-close:focus, .accessibility-close:active, .accessibility-close:target {
    /*background: rgba(255, 255, 255, 0.3);*/
    background: initial;
}

.accessibility-close svg {
    position: absolute;
    color: #ffffff;
}

/* תוכן */
.accessibility-menu-body {
    padding: 20px;
    overflow-y: scroll;
    height: calc(100% - 85px);
    scrollbar-color: #a1a1a1 #ffffff;
    scrollbar-width: thin;
}

/* קטגוריות */
.accessibility-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.accessibility-section:last-child {
    border-bottom: none;
}

.accessibility-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* כפתורים */
.accessibility-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: right;
    color: #333;
    margin-bottom: 8px;
}

.accessibility-btn:hover {
    background: #e8f4fd;
    border-color: #2196F3;
    color: #000;
}

.accessibility-btn:focus, .control-btn:focus {
    background-color: #71828b;
    border: 2px solid transparent;
}

.accessibility-btn[aria-pressed="true"] {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.accessibility-btn .icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.accessibility-btn .label {
    flex: 1;
    font-weight: 500;
}

/* בקרות (גופן, זום) */
.control-group {
    margin-top: 12px;
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.control-btn {
    padding: 10px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.control-btn:hover {
    background: #e8f4fd;
    border-color: #2196F3;
    color:#000;
}

.control-btn:active {
    transform: scale(0.95);
}

/* כפתור איפוס */
.accessibility-btn-reset {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 600;
}

.accessibility-btn-reset:hover {
    background: #d32f2f;
}

/* תווית ALT מרחפת */
.alt-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    max-width: 300px;
    word-wrap: break-word;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: normal;
}

.alt-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* מצבי נגישות */
body.stop-animations *,
body.stop-animations *::before,
body.stop-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* רקע לתוכן בלבד - לא משפיע על תפריט */
body.monochrome::before,
body.sepia::before,
body.high-contrast::before,
body.invert-colors::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9997;
}

.accessibility-toggle {
    filter: none !important;
}

body.monochrome #page, body.monochrome .accessibility-menu, body.monochrome .accessibility-toggle {
    filter: grayscale(100%) !important;
}

body.sepia #page, body.sepia .accessibility-menu, body.sepia .accessibility-toggle{
    filter: sepia(100%) !important;
}

body.high-contrast #page, body.high-contrast .accessibility-menu, body.high-contrast .accessibility-toggle{
    filter: contrast(135%) !important;
    color: black;
}

/*body.high-contrast #page img, body.high-contrast .accessibility-menu, body.high-contrast .accessibility-toggle {*/
/*    filter: contrast(125%) !important;*/
/*}*/

body.yellow-black #page img[src*="logo"], body.yellow-black [aria-controls*="photoswipe-fullscreen-dialog"] {
    filter: invert(0.12) sepia(1) saturate(10000%) hue-rotate(75deg) brightness(5);
}

body.yellow-black #page *:not(img[src*="logo"]):not([aria-controls*="photoswipe-fullscreen-dialog"]), body.yellow-black .accessibility-menu *, body.yellow-black .accessibility-toggle * {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.yellow-black .accessibility-menu-header, body.yellow-black .accessibility-menu, body.yellow-black .accessibility-toggle {
    background: #000;
}

body.invert-colors #page, body.invert-colors .accessibility-menu, body.invert-colors .accessibility-toggle {
    filter: invert(100%) hue-rotate(180deg) !important;
}

body.invert-colors #page img:not(.accessibility-menu img):not(.accessibility-toggle img),
body.invert-colors #page video,
body.invert-colors #page [style*="background-image"]:not(.accessibility-menu):not(.accessibility-menu *) {
    /* filter: invert(100%) hue-rotate(180deg) !important; */
}

body.highlight-headings h1,
body.highlight-headings h2,
body.highlight-headings h3,
body.highlight-headings h4,
body.highlight-headings h5,
body.highlight-headings h6 {
    background: #ffeb3b !important;
    color: #000 !important;
    padding: 4px 8px !important;
    border-right: 4px solid #f57c00 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

body.highlight-links a, body.yellow-black.highlight-links a, body.yellow-black.highlight-links a:not(img[src*="logo"]):not([aria-controls*="photoswipe-fullscreen-dialog"]){
    background: #4caf50 !important;
    color: white !important;
    display: inline-block;
    border: 0px !important;
    outline: 6px solid #4caf50 !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

body.readable-font,
body.readable-font * {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    letter-spacing: 0.02em !important;
}

body.big-cursor,
body.big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M4 4 L4 24 L12 18 L16 28 L20 26 L16 16 L26 16 Z" fill="white" stroke="black" stroke-width="1.5"/></svg>') 4 4, auto !important;
}

body.black-cursor,
body.black-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M4 4 L4 24 L12 18 L16 28 L20 26 L16 16 L26 16 Z" fill="black" stroke="white" stroke-width="1.5"/></svg>') 4 4, auto !important;
}

body.reading-mode {
    background: #faf8f3 !important;
}

body.reading-mode *:not(.accessibility-menu):not(.accessibility-menu *):not(.accessibility-toggle):not(.accessibility-toggle *) {
    background: #faf8f3 !important;
    color: #2e2e2e !important;
    line-height: 1.8 !important;
}

/* סרגל גלילה */
.accessibility-menu::-webkit-scrollbar {
    width: 6px;
}

.accessibility-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.accessibility-menu::-webkit-scrollbar-thumb {
    background: #2196F3;
    border-radius: 3px;
}

.accessibility-menu::-webkit-scrollbar-thumb:hover {
    background: #1976D2;
}

/* בקרות ריווח חדשות */
.spacing-controls-wrapper {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.spacing-controls-wrapper .control-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    text-align: right;
}

.spacing-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.spacing-selector-btn {
    padding: 10px 8px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.spacing-selector-btn:hover {
    background: #e8f4fd;
    border-color: #2196F3;
}

.spacing-selector-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.spacing-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.control-btn-spacing {
    width: 44px;
    height: 44px;
    padding: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn-spacing:hover {
    background: #e8f4fd;
    border-color: #2196F3;
    transform: scale(1.05);
}

.control-btn-spacing:focus {
    outline: 2px solid #FF9800;
    outline-offset: 2px;
}

.control-btn-spacing:active {
    transform: scale(0.95);
}

.spacing-value {
    min-width: 65px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

/* wrapper לזום */
#accessibility-zoom-wrapper {
    transition: transform 0.3s ease;
}

/* התאמה למובייל */
@media (max-width: 768px) {
    .accessibility-menu {
        width: 300px;
        left: -300px;
    }
    
    .accessibility-toggle {
        width: 50px;
        height: 50px;
        bottom: 16px;
        left: 16px;
    }
}

/* הנפשה חלקה */
.accessibility-menu.active {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        left: -350px;
    }
    to {
        left: 0;
    }
}

/* שיפור נגישות מקלדת */
body.keyboard-navigation .accessibility-menu:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.5);
}