/* ==================== W-CREATORS ACCESSIBILITY STYLES ==================== */
/* Compliant with Israeli Standard SI 5568 (WCAG 2.0 AA) */
/* Version 1.0 */

/* ==================== SKIP LINK ==================== */
.accessibility-skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    padding: 16px 32px;
    background: #22a559;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: top 0.3s ease;
}

.accessibility-skip-link:focus {
    top: 0;
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* ==================== WIDGET CONTAINER ==================== */
.accessibility-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    direction: rtl;
    font-family: 'Heebo', 'Arial', sans-serif;
}

/* ==================== TOGGLE BUTTON ==================== */
.accessibility-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #22a559 0%, #06b6d4 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(34, 165, 89, 0.4);
    transition: all 0.3s ease;
    min-height: 48px;
    min-width: 48px;
}

.accessibility-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(34, 165, 89, 0.5);
}

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

.accessibility-toggle svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.accessibility-toggle-text {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .accessibility-toggle {
        padding: 12px;
        border-radius: 50%;
    }

    .accessibility-toggle-text {
        display: none;
    }

    .accessibility-widget {
        bottom: 100px;
        right: 16px;
    }
}

/* ==================== OVERLAY ==================== */
.accessibility-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
}

.accessibility-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== PANEL ==================== */
.accessibility-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 100001;
}

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

@media (max-width: 600px) {
    .accessibility-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ==================== PANEL HEADER ==================== */
.accessibility-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #22a559 0%, #06b6d4 100%);
    color: #ffffff;
}

.accessibility-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.accessibility-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background 0.3s ease;
}

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

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

.accessibility-close svg {
    width: 20px;
    height: 20px;
}

/* ==================== PANEL BODY ==================== */
.accessibility-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #ffffff;
}

/* ==================== SECTIONS ==================== */
.accessibility-section {
    margin-bottom: 24px;
}

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

.accessibility-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== FONT CONTROLS ==================== */
.accessibility-font-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 12px;
}

.accessibility-font-controls button {
    width: 48px;
    height: 48px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #374151;
    transition: all 0.2s ease;
}

.accessibility-font-controls button:hover {
    border-color: #22a559;
    color: #22a559;
}

.accessibility-font-controls button:focus {
    outline: 2px solid #22a559;
    outline-offset: 2px;
}

.font-size-value {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    min-width: 50px;
    text-align: center;
}

/* ==================== OPTIONS GRID ==================== */
.accessibility-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.accessibility-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.accessibility-option:hover {
    border-color: #22a559;
    background: #f0fdf4;
}

.accessibility-option:focus {
    outline: 2px solid #22a559;
    outline-offset: 2px;
}

.accessibility-option.active {
    background: #22a559;
    border-color: #22a559;
    color: #ffffff;
}

.accessibility-option.active .option-icon {
    color: #ffffff;
}

.accessibility-option.active .option-label {
    color: #ffffff;
}

.option-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.option-icon svg {
    width: 24px;
    height: 24px;
}

.option-label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.3;
}

/* ==================== RESET BUTTON ==================== */
.accessibility-reset-section {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.accessibility-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #fee2e2;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    font-family: inherit;
    transition: all 0.2s ease;
}

.accessibility-reset-btn:hover {
    background: #fecaca;
}

.accessibility-reset-btn:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.accessibility-reset-btn svg {
    width: 18px;
    height: 18px;
}

/* ==================== PANEL FOOTER ==================== */
.accessibility-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.accessibility-footer p {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.accessibility-statement-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #22a559;
    text-decoration: none;
}

.accessibility-statement-link:hover {
    text-decoration: underline;
}

/* ==================== READING GUIDE ==================== */
.accessibility-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(255, 255, 0, 0.2);
    border-top: 2px solid #fbbf24;
    border-bottom: 2px solid #fbbf24;
    pointer-events: none;
    z-index: 99998;
    transform: translateY(-50%);
}

/* ==================== ACCESSIBILITY MODES ==================== */

/* High Contrast */
html.accessibility-high-contrast,
html.accessibility-high-contrast body {
    background: #000000 !important;
    color: #ffffff !important;
}

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

html.accessibility-high-contrast a,
html.accessibility-high-contrast button {
    color: #ffff00 !important;
}

html.accessibility-high-contrast img {
    filter: contrast(1.2);
}

/* Grayscale */
html.accessibility-grayscale {
    filter: grayscale(100%);
}

/* Invert Colors */
html.accessibility-invert {
    filter: invert(100%) hue-rotate(180deg);
}

html.accessibility-invert img,
html.accessibility-invert video {
    filter: invert(100%) hue-rotate(180deg);
}

/* Underline Links */
html.accessibility-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

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

/* Readable Font */
html.accessibility-readable-font,
html.accessibility-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.02em;
}

/* Text Spacing */
html.accessibility-text-spacing * {
    line-height: 2 !important;
    letter-spacing: 0.1em !important;
    word-spacing: 0.2em !important;
}

/* Big Cursor */
html.accessibility-big-cursor,
html.accessibility-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%23000' d='M8 8l28 12-12 4-4 12z'/%3E%3Cpath fill='%23fff' d='M10 10l22 9-9 3-3 9z'/%3E%3C/svg%3E"), auto !important;
}

html.accessibility-big-cursor a,
html.accessibility-big-cursor button,
html.accessibility-big-cursor [role="button"],
html.accessibility-big-cursor input[type="submit"],
html.accessibility-big-cursor input[type="button"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%23000' d='M20 8v24h4V20h8l-12-12z'/%3E%3Cpath fill='%23fff' d='M22 12v16h2V18h4l-6-6z'/%3E%3C/svg%3E"), pointer !important;
}

/* Stop Animations */
html.accessibility-stop-animations *,
html.accessibility-stop-animations *::before,
html.accessibility-stop-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* ==================== KEYBOARD NAVIGATION ==================== */
body.keyboard-nav *:focus {
    outline: 3px solid #22a559 !important;
    outline-offset: 2px !important;
}

/* ==================== SCREEN READER ONLY ==================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==================== FOCUS VISIBLE ==================== */
:focus-visible {
    outline: 3px solid #22a559;
    outline-offset: 2px;
}

/* ==================== PREFERS REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== PREFERS COLOR SCHEME ==================== */
@media (prefers-contrast: high) {
    html:not(.accessibility-high-contrast) {
        filter: contrast(1.2);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .accessibility-widget,
    .accessibility-skip-link,
    .accessibility-reading-guide {
        display: none !important;
    }
}
