/**
 * צמד אש - עיצוב תוסף נגישות
 * עומד בתקני WCAG 2.1 AA
 */

/* כפתור נגישות ראשי - מוסתר זמנית */
.accessibility-button {
    display: none !important;
    position: fixed;
    bottom: 100px;
    inset-inline-end: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: #000000;
    cursor: grab;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    user-select: none;
    backdrop-filter: blur(10px);
}

.accessibility-button:hover {
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 1);
    background: linear-gradient(135deg, #ffffff, #ffffff);
    transform: scale(1.05);
}

.accessibility-button:active {
    cursor: grabbing;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.accessibility-button[data-is-dragging="true"] {
    cursor: grabbing;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.accessibility-button:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.accessibility-button svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    fill: #000000;
}

/* פאנל נגישות */
.accessibility-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-height: 90vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 255, 255, 0.2);
}

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

/* כותרת הפאנל */
.accessibility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.accessibility-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.close-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* תוכן הפאנל */
.accessibility-content {
    padding: 25px;
}

.accessibility-section {
    margin-bottom: 30px;
}

.accessibility-section:last-child {
    margin-bottom: 0;
}

.accessibility-section h4 {
    margin: 0 0 15px 0;
    color: #ff4444;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 68, 68, 0.3);
    padding-bottom: 8px;
}

/* קבוצת בקרה */
.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.control-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.control-btn:active {
    transform: translateY(0);
}

/* ערך נוכחי */
.current-value {
    background: rgba(255, 68, 68, 0.2);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    border: 1px solid rgba(255, 68, 68, 0.4);
}

/* בחירת מהירות קריאה */
#reading-speed {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #666666;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reading-speed:hover {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

#reading-speed:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

#reading-speed option {
    background: #333333;
    color: #ffffff;
}

/* מידע על קיצורי מקלדת */
.shortcuts-info {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.shortcuts-info p {
    margin: 8px 0;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.shortcuts-info strong {
    color: #ff4444;
    font-weight: 600;
}

/* סגנונות נגישות */
/* ניגודיות גבוהה */
.high-contrast {
    filter: contrast(1.5) brightness(1.2);
}

.high-contrast * {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

.high-contrast .site-header,
.high-contrast .site-footer {
    background-color: #000000 !important;
    color: #ffffff !important;
}

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

/* שחור לבן */
.grayscale {
    filter: grayscale(1);
}

/* חום */
.sepia {
    filter: sepia(0.8);
}

/* צבעים רגילים */
.normal-colors {
    filter: none;
}

/* סמן גדול */
.large-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"><circle cx="16" cy="16" r="14" fill="none" stroke="%23ff4444" stroke-width="3"/><circle cx="16" cy="16" r="2" fill="%23ff4444"/></svg>') 16 16, auto !important;
}

/* הדגשת קישורים */
.highlight-links a {
    background: rgba(255, 68, 68, 0.2) !important;
    border: 2px solid #ff4444 !important;
    border-radius: 5px !important;
    padding: 5px 10px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.highlight-links a:hover {
    background: rgba(255, 68, 68, 0.4) !important;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4) !important;
}

/* התאמות למובייל */
@media (max-width: 768px) {
    .accessibility-button {
        bottom: 90px;
        inset-inline-end: 20px;
        width: 50px;
        height: 50px;
    }
    
    .accessibility-button svg {
        width: 24px;
        height: 24px;
    }
    
    .accessibility-panel {
        width: 90vw;
        max-width: 400px;
        left: 5vw;
        top: 80px;
    }
    
    .accessibility-content {
        padding: 20px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-btn {
        width: 100%;
        min-width: auto;
    }
}

/* התאמות לטאבלט */
@media (min-width: 769px) and (max-width: 1024px) {
    .accessibility-panel {
        width: 400px;
    }
}

/* אנימציות נוספות */
.accessibility-button:active {
    /* ללא אנימציה */
}

/* מצב כהה לפאנל */
@media (prefers-color-scheme: dark) {
    .accessibility-panel {
        background: rgba(20, 20, 20, 0.98);
        border-color: #ff6666;
    }
}

/* מצב בהיר לפאנל */
@media (prefers-color-scheme: light) {
    .accessibility-panel {
        background: rgba(240, 240, 240, 0.98);
        border-color: #cc0000;
    }
    
    .accessibility-header h3,
    .accessibility-section h4 {
        color: #333333;
    }
    
    .shortcuts-info p {
        color: #333333;
    }
}

/* התאמות למוגבלי ראייה */
@media (prefers-reduced-motion: reduce) {
    .accessibility-button,
    .accessibility-panel,
    .control-btn {
        transition: none;
    }
    
    .accessibility-button:hover {
        transform: none;
    }
    
    .control-btn:hover {
        transform: none;
    }
}

/* מצב קורא מסך */
@media (prefers-reduced-motion: reduce) {
    .accessibility-panel {
        animation: none;
    }
}

/* התאמות למוגבלי ראייה - טקסט גדול */
@media (prefers-reduced-motion: reduce) {
    .accessibility-panel {
        font-size: 1.1rem;
    }
    
    .control-btn {
        font-size: 1rem;
        padding: 12px 18px;
    }
}

/* אנימציות */
@keyframes accessibilityPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* מצב חירום - תמיד נראה */
.accessibility-button[aria-expanded="true"] {
    background: linear-gradient(135deg, #ff0000, #cc0000) !important;
    animation: accessibilityPulse 2s infinite !important;
}

/* התאמות למוגבלי שמיעה */
.accessibility-panel {
    scrollbar-width: thin;
    scrollbar-color: #ff4444 #333333;
}

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

.accessibility-panel::-webkit-scrollbar-track {
    background: #333333;
    border-radius: 4px;
}

.accessibility-panel::-webkit-scrollbar-thumb {
    background: #ff4444;
    border-radius: 4px;
}

.accessibility-panel::-webkit-scrollbar-thumb:hover {
    background: #ff6666;
}

/* מצב נגישות מתקדם */
.accessibility-advanced .accessibility-panel {
    border-width: 3px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.accessibility-advanced .control-btn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* מצב נגישות בסיסי */
.accessibility-basic .accessibility-panel {
    border-width: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.accessibility-basic .control-btn {
    font-size: 0.8rem;
    padding: 8px 12px;
}

/* התאמות למובייל */
@media (max-width: 768px) {
    .accessibility-button {
        bottom: 90px;
        inset-inline-end: 20px;
        width: 50px;
        height: 50px;
    }
    
    .accessibility-button svg {
        width: 24px;
        height: 24px;
    }
    
    .accessibility-panel {
        width: 90vw;
        max-width: 400px;
        left: 5vw;
        top: 80px;
    }
    
    .accessibility-content {
        padding: 20px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-btn {
        width: 100%;
        min-width: auto;
    }
}
