/* ===================================
   מערכת נגישות מלאה - קובץ משותף
   עדכון אחרון: 2025
   =================================== */

/* כפתור נגישות */
.accessibility-button {
    position: fixed;
    bottom: 120px;
    left: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #0066CC, #004499);
    color: white;
    border: 3px solid white;
    border-radius: 15px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.5);
    transition: all 0.3s ease;
    font-weight: bold;
}

.accessibility-button:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.7);
    background: linear-gradient(135deg, #0077DD, #0055AA);
}

.accessibility-button:focus {
    outline: 4px solid #FFD700 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 7px rgba(255, 215, 0, 0.3) !important;
}

/* פאנל נגישות */
.accessibility-panel {
    position: fixed;
    bottom: 200px;
    left: 20px;
    width: 340px;
    max-height: 450px;
    background: rgba(0, 20, 60, 0.95);
    backdrop-filter: blur(15px);
    border: 3px solid #0066CC;
    border-radius: 20px;
    padding: 25px;
    color: white;
    z-index: 1001;
    display: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.accessibility-panel.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.accessibility-panel h3 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.accessibility-controls {
    display: grid;
    gap: 15px;
}

.accessibility-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.accessibility-control:hover {
    background: rgba(255, 255, 255, 0.15);
}

.accessibility-control label {
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
}

.accessibility-toggle {
    width: 50px;
    height: 25px;
    background: #666;
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.accessibility-toggle.active {
    background: #4CAF50;
}

.accessibility-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.accessibility-toggle.active::before {
    transform: translateX(25px);
}

.font-size-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.font-size-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.font-size-btn:hover {
    background: #45A049;
    transform: scale(1.1);
}

.accessibility-reset {
    background: linear-gradient(135deg, #FF6B6B, #EE5A52);
    color: white;
    border: none;
    padding: 18px 25px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    font-weight: bold;
    transition: all 0.3s ease;
}

.accessibility-reset:hover {
    background: linear-gradient(135deg, #EE5A52, #DC4A3D);
    transform: translateY(-1px);
}

/* מצבי נגישות */
body.high-contrast {
    filter: contrast(1.5);
}

body.dark-mode {
    background: #000 !important;
}

body.dark-mode * {
    background-color: inherit !important;
}

body.large-text {
    font-size: 1.2rem;
}

body.large-text h1 {
    font-size: 4rem !important;
}

body.large-text h2 {
    font-size: 3rem !important;
}

body.large-text h3 {
    font-size: 2.5rem !important;
}

body.large-text .btn {
    font-size: 1.3rem !important;
    padding: 18px 35px !important;
}

body.underline-links a {
    text-decoration: underline !important;
}

body.reading-guide {
    position: relative;
}

.reading-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #FFD700;
    z-index: 9999;
    display: none;
    box-shadow: 0 0 10px #FFD700;
}

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

body.reduce-animations * {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
}

/* פוקוס נגיש */
body.enhanced-focus *:focus {
    outline: 3px solid #FFD700 !important;
    outline-offset: 2px !important;
    border-radius: 3px !important;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .accessibility-button {
        bottom: 30px !important;
        left: 15px !important;
        width: 60px !important;
        height: 60px !important;
        font-size: 1.4rem !important;
        z-index: 1002 !important;
    }

    .accessibility-button:hover {
        transform: scale(1.1) !important;
    }

    .accessibility-panel {
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        top: 50% !important;
        transform: translate(-50%, -50%) translateY(20px) !important;
        width: min(90vw, 320px) !important;
        max-width: 320px !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
    }

    .accessibility-panel.show {
        transform: translate(-50%, -50%) translateY(0) !important;
    }

    .accessibility-panel h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .accessibility-controls {
        gap: 12px;
    }

    .accessibility-control {
        padding: 8px;
        font-size: 0.85rem;
    }

    .accessibility-control label {
        font-size: 0.8rem;
    }

    .font-size-controls {
        gap: 6px;
    }

    .font-size-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .accessibility-reset {
        padding: 14px 20px;
        font-size: 0.85rem;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .accessibility-button {
        bottom: 70px !important;
        width: 55px !important;
        height: 55px !important;
        font-size: 1.2rem !important;
        border: 2px solid white !important;
    }

    .accessibility-panel {
        width: 90vw !important;
        max-width: 290px !important;
        max-height: 80vh !important;
        padding: 20px !important;
    }

    .accessibility-panel h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .accessibility-controls {
        gap: 10px;
    }

    .accessibility-control {
        padding: 7px;
        font-size: 0.8rem;
    }

    .accessibility-control label {
        font-size: 0.75rem;
    }

    .font-size-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .accessibility-toggle {
        width: 45px;
        height: 22px;
    }

    .accessibility-toggle::before {
        width: 18px;
        height: 18px;
    }

    .accessibility-toggle.active::before {
        transform: translateX(23px);
    }

    .accessibility-reset {
        padding: 12px 18px;
        font-size: 0.8rem;
        margin-top: 10px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .accessibility-button {
        bottom: auto !important;
        top: 10px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 1.1rem !important;
    }

    .accessibility-panel {
        top: 60px !important;
        max-height: calc(100vh - 80px) !important;
    }
}
