/* Laisner Accessibility Plugin Styles - Modern Redesign 1.6.0 */

/* 1. The Main FAB Button */
#la-accessibility-button.la-button {
    /* Fixed positioning */
    position: fixed !important;
    z-index: 2147483647 !important;
    /* Maximum Z-index */

    /* Size & Shape */
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;

    /* Colors - Light background to match icon */
    background-color: #e3f2fd !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
    border: 2px solid #ffffff !important;
    /* High contrast border */

    /* Flexbox Centering - The Magic */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Reset Button default styles */
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1) !important;
    outline: none !important;
}

/* 2. Style the Icon (PNG Image) */
#la-accessibility-button.la-button .la-icon-img {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
    pointer-events: none !important;
}

/* Hover Effect */
#la-accessibility-button.la-button:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23) !important;
    background-color: #bbdefb !important;
}

/* Focus Effect for Accessiblity */
#la-accessibility-button.la-button:focus-visible {
    outline: 3px solid #FFC107 !important;
    outline-offset: 2px !important;
}

/* Conflicting rule removed */

/* 3. Positioning Classes */
.la-position-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

.la-position-bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

.la-position-top-right {
    top: 20px !important;
    right: 20px !important;
}

.la-position-top-left {
    top: 20px !important;
    left: 20px !important;
}

/* 4. The Accessibility Panel - Right Side (Default) */
.la-panel {
    position: fixed;
    top: 0;
    right: -400px;
    left: auto;
    width: 320px;
    height: 100vh;
    max-width: 90vw;
    background: #ffffff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 2147483648;
    transition: right 0.3s ease, left 0.3s ease;
    overflow-y: auto;
    direction: rtl;
}

.la-panel.la-open {
    right: 0;
}

/* Panel opens from LEFT when button is on left side */
.la-panel.la-panel-left {
    right: auto;
    left: -400px;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

.la-panel.la-panel-left.la-open {
    left: 0;
    right: auto;
}

.la-panel-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.la-panel-header h2 {
    margin: 0;
    font-size: 20px;
    font-family: system-ui, -apple-system, sans-serif;
}

.la-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.la-panel-content {
    padding: 20px;
}

/* Features List */
.la-feature {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-family: system-ui, -apple-system, sans-serif;
}

.la-feature label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.la-feature input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-left: 12px;
    /* Hebrew RTL */
    accent-color: #0073aa;
}

.la-reset-btn {
    background: #dc3545;
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.la-credits {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #888;
}

/* Accessibility Features Classes */

/* High Contrast Mode */
body.la-high-contrast {
    filter: contrast(125%) !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.la-high-contrast * {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.la-high-contrast img {
    filter: contrast(125%) !important;
}

/* Grayscale (Black & White) Mode - Using Backdrop Filter to preserve layout */
body.la-grayscale::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647; /* Below panel (..48) but above content */
    backdrop-filter: grayscale(100%) !important;
    pointer-events: none !important; /* Allow clicking through */
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: grayscale(100%)) {
    body.la-grayscale {
        filter: grayscale(100%) !important;
    }
}

/* Highlight Links */
body.la-highlight-links a,
body.la-highlight-links a:visited {
    background-color: #FFFF00 !important;
    color: #000000 !important;
    text-decoration: underline !important;
    padding: 2px 4px !important;
    border: 2px solid #FF0000 !important;
    font-weight: bold !important;
}

/* Line Spacing */
body.la-line-spacing,
body.la-line-spacing * {
    line-height: 2 !important;
}

body.la-line-spacing p,
body.la-line-spacing li,
body.la-line-spacing span,
body.la-line-spacing div {
    margin-bottom: 1em !important;
}

/* Readable Font */
body.la-readable-font,
body.la-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* Stop Animations */
body.la-stop-animations,
body.la-stop-animations * {
    animation: none !important;
    transition: none !important;
}

body.la-stop-animations *::before,
body.la-stop-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* Pause GIFs and videos */
body.la-stop-animations img[src$=".gif"] {
    visibility: hidden !important;
}

body.la-stop-animations video {
    display: none !important;
}

/* Reading Mode */
body.la-reading-mode {
    background-color: #FDF6E3 !important;
    /* Warm sepia background */
}

body.la-reading-mode * {
    background-color: transparent !important;
    color: #5C4A32 !important;
    /* Brown text for reduced eye strain */
}

body.la-reading-mode p,
body.la-reading-mode article,
body.la-reading-mode main,
body.la-reading-mode .content {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: 1.1em !important;
    line-height: 1.8 !important;
}

body.la-reading-mode img,
body.la-reading-mode video,
body.la-reading-mode iframe {
    opacity: 0.8 !important;
}

body.la-reading-mode a {
    color: #0066CC !important;
}