/* ============================================
   Accessibility Widget - CSS
   ============================================ */

/* Widget Container */
.accessibility-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: Arial, sans-serif;
    direction: rtl;
}

/* Wheelchair Icon Button */
.accessibility-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.accessibility-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.accessibility-toggle:hover::before {
    width: 100%;
    height: 100%;
}

.accessibility-toggle svg {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.accessibility-toggle:hover svg {
    transform: scale(1.1);
}

.accessibility-toggle:hover {
    background: #0052a3;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.accessibility-toggle:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.accessibility-toggle.active {
    background: #ff6600;
}

/* Widget Panel */
.accessibility-panel {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    direction: rtl;
}

.accessibility-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel Header */
.accessibility-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.accessibility-panel-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.accessibility-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.accessibility-panel-close:hover {
    background: #f0f0f0;
    color: #000;
}

.accessibility-panel-close:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Control Groups */
.accessibility-control-group {
    margin-bottom: 20px;
}

.accessibility-control-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

/* Buttons */
.accessibility-btn {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
    min-width: 80px;
}

.accessibility-btn:hover {
    background: #e8e8e8;
    border-color: #0066cc;
}

.accessibility-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.accessibility-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* Slider */
.accessibility-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

.accessibility-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
}

.accessibility-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
}

.accessibility-slider-value {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Toggle Switch */
.accessibility-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.accessibility-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.accessibility-toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.accessibility-toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.accessibility-toggle-switch input:checked + .accessibility-toggle-switch-slider {
    background-color: #0066cc;
}

.accessibility-toggle-switch input:checked + .accessibility-toggle-switch-slider:before {
    transform: translateX(26px);
}

/* Reset Button */
.accessibility-reset-btn {
    width: 100%;
    padding: 12px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.accessibility-reset-btn:hover {
    background: #e55a00;
}

.accessibility-reset-btn:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* Accessibility Classes Applied to Body */
body.accessibility-large-text {
    font-size: 120% !important;
}

body.accessibility-larger-text {
    font-size: 150% !important;
}

body.accessibility-largest-text {
    font-size: 200% !important;
}

body.accessibility-high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}

body.accessibility-high-contrast * {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.accessibility-high-contrast a {
    color: #ffff00 !important;
}

body.accessibility-high-contrast-blue {
    background: #000080 !important;
    color: #ffff00 !important;
}

body.accessibility-high-contrast-blue * {
    background: #000080 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.accessibility-high-contrast-blue a {
    color: #ffffff !important;
}

body.accessibility-highlight-links a {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 2px 4px !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

body.accessibility-readable-font * {
    font-family: Arial, sans-serif !important;
}

body.accessibility-highlight-headings h1,
body.accessibility-highlight-headings h2,
body.accessibility-highlight-headings h3,
body.accessibility-highlight-headings h4,
body.accessibility-highlight-headings h5,
body.accessibility-highlight-headings h6 {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 5px 10px !important;
    border-left: 5px solid #000000 !important;
}

body.accessibility-large-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="14" fill="black" stroke="white" stroke-width="2"/></svg>'), auto !important;
}

body.accessibility-no-animations *,
body.accessibility-no-animations *::before,
body.accessibility-no-animations *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* Virtual Keyboard */
.accessibility-virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f0f0f0;
    border-top: 2px solid #ccc;
    padding: 10px;
    display: none;
    z-index: 99998;
    direction: ltr;
    max-height: 300px;
    overflow-y: auto;
}

.accessibility-virtual-keyboard.active {
    display: block;
}

.accessibility-keyboard-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

.accessibility-keyboard-key {
    padding: 10px 15px;
    margin: 2px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
    transition: all 0.1s;
}

.accessibility-keyboard-key:hover {
    background: #e0e0e0;
}

.accessibility-keyboard-key:active {
    background: #0066cc;
    color: white;
}

.accessibility-keyboard-key.space {
    min-width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .accessibility-widget {
        bottom: 10px;
        left: 10px;
    }
    
    .accessibility-toggle {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .accessibility-panel {
        width: calc(100vw - 20px);
        max-width: 320px;
        bottom: 70px;
    }
}

/* Screen Reader Announcements */
.accessibility-sr-announce {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

