/* ===============================================
   Accessibility Widget Styles
   תקן נגישות ישראלי - חובה על פי חוק!
   =============================================== */

/* Widget Container */
#accessibility-widget {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    font-family: 'Heebo', Arial, sans-serif;
}

/* Toggle Button */
#accessibility-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#accessibility-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

#accessibility-toggle svg {
    width: 24px;
    height: 24px;
}

#accessibility-toggle span {
    font-size: 12px;
    font-weight: 600;
}

/* Accessibility Panel */
.accessibility-panel {
    position: fixed;
    left: -400px;
    top: 0;
    width: 350px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    overflow-y: auto;
    z-index: 100000;
}

.accessibility-panel.open {
    left: 0;
}

/* Header */
.accessibility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accessibility-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

#accessibility-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

#accessibility-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Content */
.accessibility-content {
    padding: 20px;
}

.accessibility-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.accessibility-section:last-of-type {
    border-bottom: none;
}

.accessibility-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #333;
}

/* Buttons */
.accessibility-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.accessibility-buttons button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.accessibility-buttons button:hover {
    background: #e3f2fd;
    border-color: #1e88e5;
    transform: translateY(-2px);
}

.accessibility-buttons button:active,
.accessibility-buttons button.active {
    background: #1e88e5;
    color: white;
    transform: scale(0.95);
}

.accessibility-buttons .icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.accessibility-buttons span:last-child {
    font-size: 0.85rem;
    text-align: center;
}

/* Reset Button */
.reset-button {
    width: 100%;
    padding: 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Info Section */
.accessibility-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.accessibility-info p {
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.accessibility-info strong {
    color: #1e88e5;
}

.accessibility-info a {
    color: #1e88e5;
    text-decoration: none;
    font-weight: 600;
}

.accessibility-info a:hover {
    text-decoration: underline;
}

/* ===============================================
   Accessibility Modes - Applied to <html>
   =============================================== */

/* High Contrast */
html.high-contrast {
    filter: contrast(1.5);
}

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

html.high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

html.high-contrast button {
    border: 2px solid #fff !important;
}

/* Negative Contrast */
html.negative-contrast {
    filter: invert(1) hue-rotate(180deg);
}

/* Light Background */
html.light-background body {
    background: #ffffff !important;
    color: #000000 !important;
}

html.light-background * {
    background-color: transparent !important;
    color: inherit !important;
}

html.light-background .hero,
html.light-background .page-header,
html.light-background section {
    background: #ffffff !important;
}

/* Highlight Links */
html.highlight-links a {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 2px 4px !important;
    font-weight: bold !important;
}

/* Readable Font */
html.readable-font,
html.readable-font * {
    font-family: Arial, sans-serif !important;
    letter-spacing: 0.5px !important;
}

/* Large Cursor */
html.large-cursor,
html.large-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><circle cx="24" cy="24" r="20" fill="black" stroke="white" stroke-width="3"/></svg>') 24 24, auto !important;
}

/* ===============================================
   Mobile Responsive
   =============================================== */
@media (max-width: 768px) {
    #accessibility-widget {
        left: 10px;
        bottom: 80px;
        top: auto;
        transform: none;
    }
    
    .accessibility-panel {
        width: 100%;
        left: -100%;
    }
    
    .accessibility-panel.open {
        left: 0;
    }
    
    .accessibility-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===============================================
   Skip to Content Link (Required for accessibility)
   =============================================== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e88e5;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 600;
    z-index: 100001;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ===============================================
   Focus Indicators (Required for accessibility)
   =============================================== */
*:focus {
    outline: 3px solid #1e88e5 !important;
    outline-offset: 2px !important;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #1e88e5 !important;
    outline-offset: 2px !important;
}

/* ===============================================
   Screen Reader Only (SR-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;
}
