/* =====================================================
   המדייק - מערכת נגישות
   Accessibility System Styles
   ===================================================== */

/* Skip to Content Link */
.skip-to-content {
    position: fixed;
    top: -100px;
    right: 50%;
    transform: translateX(50%);
    background: var(--color-secondary, #B8975F);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--color-secondary, #B8975F);
    outline-offset: 2px;
}

/* =====================================================
   ACCESSIBILITY BUTTON
   ===================================================== */
.accessibility-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #B8975F 0%, #D4BC8A 50%, #B8975F 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(184, 151, 95, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accessibility-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(184, 151, 95, 0.5);
}

.accessibility-btn:focus {
    outline: 3px solid var(--color-secondary, #B8975F);
    outline-offset: 3px;
}

.accessibility-btn svg {
    width: 28px;
    height: 28px;
    fill: #1A1A1A;
    transition: transform 0.3s ease;
}

.accessibility-btn:hover svg {
    transform: scale(1.1);
}

.accessibility-btn.active {
    background: #1A1A1A;
}

.accessibility-btn.active svg {
    fill: #B8975F;
}

/* Tooltip */
.accessibility-btn::before {
    content: 'נגישות';
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1A1A1A;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.accessibility-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   ACCESSIBILITY MENU
   ===================================================== */
.accessibility-menu {
    position: fixed;
    bottom: 170px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 200px);
    background: #FDFCFA;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 9997;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Menu Header */
.accessibility-menu-header {
    background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accessibility-menu-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accessibility-menu-header h3 svg {
    width: 24px;
    height: 24px;
    fill: #B8975F;
}

.accessibility-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

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

.accessibility-close-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

/* Menu Content */
.accessibility-menu-content {
    padding: 16px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

/* Font Size Controls */
.accessibility-font-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F5F3EE;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.accessibility-font-controls span {
    font-size: 14px;
    font-weight: 500;
    color: #1A1A1A;
}

.font-size-btns {
    display: flex;
    gap: 8px;
}

.font-size-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #E0E0E0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
    transition: all 0.2s;
}

.font-size-btn:hover {
    border-color: #B8975F;
    background: rgba(184, 151, 95, 0.1);
}

.font-size-btn:active {
    transform: scale(0.95);
}

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

.accessibility-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: #F5F3EE;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.accessibility-option:hover {
    background: #EDE9E0;
    border-color: #B8975F;
}

.accessibility-option.active {
    background: rgba(184, 151, 95, 0.15);
    border-color: #B8975F;
}

.accessibility-option svg {
    width: 28px;
    height: 28px;
    fill: #5A5A5A;
    transition: fill 0.2s;
}

.accessibility-option.active svg {
    fill: #B8975F;
}

.accessibility-option span {
    font-size: 12px;
    font-weight: 500;
    color: #5A5A5A;
    line-height: 1.3;
}

.accessibility-option.active span {
    color: #1A1A1A;
}

/* Reset Button */
.accessibility-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: #1A1A1A;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.accessibility-reset:hover {
    background: #B8975F;
}

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

/* =====================================================
   ACCESSIBILITY MODES - CSS Classes
   ===================================================== */

/* Font Size Adjustments */
html.acc-font-size-1 {
    font-size: 18px !important;
}

html.acc-font-size-2 {
    font-size: 20px !important;
}

html.acc-font-size-3 {
    font-size: 22px !important;
}

html.acc-font-size-4 {
    font-size: 24px !important;
}

/* High Contrast Mode */
html.acc-high-contrast,
html.acc-high-contrast body {
    background: #000 !important;
    color: #fff !important;
}

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

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

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

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

/* Inverted Contrast */
html.acc-invert-colors {
    filter: invert(1) hue-rotate(180deg);
}

html.acc-invert-colors img,
html.acc-invert-colors video {
    filter: invert(1) hue-rotate(180deg);
}

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

/* Highlight Links */
html.acc-highlight-links a {
    background: #ffff00 !important;
    color: #000 !important;
    padding: 2px 4px !important;
    text-decoration: underline !important;
    outline: 2px solid #000 !important;
}

/* Highlight Headings */
html.acc-highlight-headings h1,
html.acc-highlight-headings h2,
html.acc-highlight-headings h3,
html.acc-highlight-headings h4,
html.acc-highlight-headings h5,
html.acc-highlight-headings h6 {
    background: linear-gradient(90deg, rgba(184, 151, 95, 0.3), transparent) !important;
    padding: 8px 12px !important;
    border-right: 4px solid #B8975F !important;
}

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

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

/* Line Height */
html.acc-line-height * {
    line-height: 2 !important;
}

/* Big Cursor */
html.acc-big-cursor,
html.acc-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='2' d='M8 8l40 16-16 8-8 24z'/%3E%3C/svg%3E"), auto !important;
}

html.acc-big-cursor a,
html.acc-big-cursor button,
html.acc-big-cursor [role="button"],
html.acc-big-cursor input[type="submit"],
html.acc-big-cursor input[type="button"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath fill='%23B8975F' stroke='%23000' stroke-width='2' d='M8 8l40 16-16 8-8 24z'/%3E%3C/svg%3E"), pointer !important;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */
@media (max-width: 768px) {
    .accessibility-btn {
        width: 50px;
        height: 50px;
        bottom: 90px;
        right: 15px;
    }

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

    .accessibility-btn::before {
        display: none;
    }

    .accessibility-menu {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 150px;
        max-height: calc(100vh - 180px);
    }

    .accessibility-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .accessibility-option {
        padding: 12px 8px;
    }

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

    .accessibility-option span {
        font-size: 11px;
    }
}

/* =====================================================
   FOCUS STATES IMPROVEMENTS
   ===================================================== */
*:focus {
    outline: 2px solid var(--color-secondary, #B8975F);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--color-secondary, #B8975F);
    outline-offset: 3px;
}

/* =====================================================
   PRINT STYLES - Hide accessibility elements
   ===================================================== */
@media print {

    .accessibility-btn,
    .accessibility-menu,
    .skip-to-content {
        display: none !important;
    }
}