/* ========================================
   ACCESSIBILITY MENU & FEATURES
   נגישות מלאה לאתר - RTL
   ======================================== */

/* Accessibility Button - כפתור נגישות */
.accessibility-button {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(93, 62, 191, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.accessibility-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(93, 62, 191, 0.6);
}

.accessibility-button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.accessibility-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* Accessibility Menu Panel - תפריט נגישות */
.accessibility-menu {
    position: fixed;
    bottom: 100px;
    left: 90px;
    width: 320px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    direction: rtl;
}

.accessibility-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

/* Menu Header - כותרת התפריט */
.accessibility-menu-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accessibility-menu-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accessibility-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.accessibility-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* Menu Content - תוכן התפריט */
.accessibility-menu-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.accessibility-menu-content::-webkit-scrollbar {
    width: 8px;
}

.accessibility-menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.accessibility-menu-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Option Groups - קבוצות אפשרויות */
.accessibility-option-group {
    margin-bottom: 24px;
}

.accessibility-option-group-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Option Item - פריט אפשרות */
.accessibility-option {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accessibility-option:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.accessibility-option:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.accessibility-option.active {
    background: linear-gradient(135deg, rgba(93, 62, 191, 0.1) 0%, rgba(241, 91, 181, 0.1) 100%);
    border-color: var(--primary-color);
}

.accessibility-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.accessibility-option-icon {
    font-size: 18px;
    color: var(--primary-color);
}

/* Toggle Switch - מתג */
.accessibility-toggle {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
    cursor: pointer;
}

.accessibility-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.accessibility-option.active .accessibility-toggle {
    background: var(--primary-color);
}

.accessibility-option.active .accessibility-toggle::after {
    transform: translateX(-20px);
}

/* Size Controls - בקרות גודל */
.accessibility-size-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.accessibility-size-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-size-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.accessibility-size-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.accessibility-size-indicator {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

/* Reset Button - כפתור איפוס */
.accessibility-reset-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.accessibility-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(93, 62, 191, 0.4);
}

.accessibility-reset-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========================================
   ACCESSIBILITY FEATURES - תכונות נגישות
   ======================================== */

/* High Contrast Mode - ניגודיות גבוהה */
body.high-contrast {
    filter: contrast(1.5);
}

body.high-contrast-dark {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast-dark * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.high-contrast-dark a {
    color: #ffff00 !important;
}

body.high-contrast-dark button,
body.high-contrast-dark .btn-primary-new,
body.high-contrast-dark .btn-secondary-new {
    background: #fff !important;
    color: #000 !important;
}

/* Invert Colors - היפוך צבעים */
body.invert-colors {
    filter: invert(1) hue-rotate(180deg);
}

body.invert-colors img,
body.invert-colors video {
    filter: invert(1) hue-rotate(180deg);
}

/* Grayscale - גווני אפור */
body.grayscale {
    filter: grayscale(1);
}

/* Text Size - גודל טקסט */
body.text-size-110 {
    font-size: 110% !important;
}

body.text-size-120 {
    font-size: 120% !important;
}

body.text-size-130 {
    font-size: 130% !important;
}

body.text-size-140 {
    font-size: 140% !important;
}

body.text-size-150 {
    font-size: 150% !important;
}

/* Readable Font - גופן קריא */
body.readable-font,
body.readable-font * {
    font-family: 'Arial', 'Heebo', sans-serif !important;
}

/* Highlight Links - הדגשת קישורים */
body.highlight-links a {
    background: yellow !important;
    color: #000 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
}

/* Highlight Headings - הדגשת כותרות */
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: rgba(93, 62, 191, 0.2) !important;
    padding: 8px !important;
    border-right: 4px solid var(--primary-color) !important;
}

/* Stop Animations - עצירת אנימציות */
body.stop-animations,
body.stop-animations * {
    animation: none !important;
    transition: none !important;
}

/* Cursor Enhancement - שיפור סמן */
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="M2,2 L2,26 L10,18 L14,28 L18,26 L14,16 L22,16 Z" fill="black" stroke="white" stroke-width="1"/></svg>') 0 0, auto !important;
}

body.black-cursor,
body.black-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" fill="black" stroke="white" stroke-width="2"/></svg>') 20 20, auto !important;
}

body.white-cursor,
body.white-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" fill="white" stroke="black" stroke-width="2"/></svg>') 20 20, auto !important;
}

/* Line Height - גובה שורה */
body.line-height-15 * {
    line-height: 1.5 !important;
}

body.line-height-18 * {
    line-height: 1.8 !important;
}

body.line-height-20 * {
    line-height: 2.0 !important;
}

/* Letter Spacing - ריווח אותיות */
body.letter-spacing-1 * {
    letter-spacing: 1px !important;
}

body.letter-spacing-2 * {
    letter-spacing: 2px !important;
}

body.letter-spacing-3 * {
    letter-spacing: 3px !important;
}

/* Word Spacing - ריווח מילים */
body.word-spacing-5 * {
    word-spacing: 5px !important;
}

body.word-spacing-10 * {
    word-spacing: 10px !important;
}

/* Reading Mask - מסכת קריאה */
.reading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9997;
    display: none;
}

body.reading-mask-active .reading-mask {
    display: block;
    background:
        linear-gradient(to bottom,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.8) calc(var(--mask-top, 0) * 1px),
            transparent calc(var(--mask-top, 0) * 1px),
            transparent calc((var(--mask-top, 0) + 100) * 1px),
            rgba(0, 0, 0, 0.8) calc((var(--mask-top, 0) + 100) * 1px),
            rgba(0, 0, 0, 0.8) 100%
        );
}

/* Reading Guide - מדריך קריאה */
.reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    pointer-events: none;
    z-index: 9997;
    display: none;
    box-shadow: 0 0 10px var(--primary-color);
}

body.reading-guide-active .reading-guide {
    display: block;
}

/* Text Align - יישור טקסט */
body.text-align-right * {
    text-align: right !important;
}

body.text-align-center * {
    text-align: center !important;
}

body.text-align-left * {
    text-align: left !important;
}

/* Hide Images - הסתרת תמונות */
body.hide-images img {
    opacity: 0 !important;
}

/* Screen Reader Only - קורא מסך בלבד */
.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;
}

/* Skip to Content Link - קישור דילוג לתוכן */
.skip-to-content {
    position: fixed;
    top: -100px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 20px;
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Focus Visible Enhancement - שיפור מיקוד */
body.enhanced-focus *:focus {
    outline: 3px solid var(--accent-color) !important;
    outline-offset: 3px !important;
}

/* Keyboard Navigation Indicator - סימון ניווט במקלדת */
.keyboard-navigation-active *:focus {
    outline: 3px dashed var(--secondary-color) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 6px rgba(241, 91, 181, 0.2) !important;
}

/* Mobile Responsive - תגובתי למובייל */
@media (max-width: 768px) {
    .accessibility-button {
        width: 50px;
        height: 50px;
        bottom: 80px;
        left: 15px;
        font-size: 24px;
    }

    .accessibility-menu {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(20px) scale(1);
    }

    .accessibility-menu.active {
        transform: translateY(0) scale(1);
    }
}

/* Print Styles - סגנונות הדפסה */
@media print {
    .accessibility-button,
    .accessibility-menu,
    .reading-mask,
    .reading-guide {
        display: none !important;
    }
}

/* Reduced Motion - הפחתת תנועה */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
