/* Accessibility Menu Styles */

/* Floating Button */
.accessibility-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #2c5aa0;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
}

.accessibility-floating-btn:hover {
    background-color: #1e3d6f;
    transform: scale(1.1);
}

/* Overlay */
.accessibility-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.accessibility-container {
    background-color: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Header */
.accessibility-header {
    background-color: #2c5aa0;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

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

.accessibility-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accessibility-close-btn:hover {
    opacity: 0.8;
}

/* Grid */
.accessibility-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
    padding: 0;
}

/* Grid Items */
.accessibility-item {
    background-color: white;
    border: none;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    color: #333;
}

.accessibility-item:hover {
    background-color: #f5f5f5;
}

.accessibility-item.active {
    background-color: #e3f2fd;
    border: 2px solid #2c5aa0;
}

.accessibility-item i {
    font-size: 2.5rem;
    color: #2c5aa0;
}

.accessibility-item span {
    text-align: center;
    font-weight: 500;
}

/* Reset Button */
.accessibility-reset-btn {
    width: 100%;
    padding: 20px;
    background-color: white;
    border: none;
    border-top: 1px solid #e0e0e0;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

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

.accessibility-reset-btn i {
    font-size: 1.3rem;
}

/* Accessibility Features */

/* Screen Reader Only - Hidden visually but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard Navigation - Enhanced Focus Indicators */
body.acc-keyboard-nav *:focus,
body.acc-keyboard-nav *:focus-visible {
    outline: 3px solid #2c5aa0 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(44, 90, 160, 0.2) !important;
}

body.acc-keyboard-nav a:focus,
body.acc-keyboard-nav button:focus {
    outline: 3px solid #2c5aa0 !important;
    outline-offset: 2px !important;
    background-color: rgba(44, 90, 160, 0.1) !important;
}

/* Stop Animations */
body.acc-stop-animations * {
    animation: none !important;
    transition: none !important;
}

/* Big Cursor */
body.acc-big-cursor,
body.acc-big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="black" stroke="white" stroke-width="1" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 12 12, auto !important;
}

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

/* High Contrast */
body.acc-high-contrast {
    filter: contrast(150%) brightness(110%);
}

/* Invert Colors */
body.acc-invert {
    filter: invert(1) hue-rotate(180deg);
}

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

/* Bigger Text */
body.acc-bigger-text {
    font-size: 120% !important;
}

body.acc-bigger-text * {
    line-height: 1.6 !important;
}

/* Smaller Text */
body.acc-smaller-text {
    font-size: 90% !important;
}

/* Readable Font */
body.acc-readable-font,
body.acc-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Underline Links */
body.acc-underline-links a {
    text-decoration: underline !important;
}

/* Underline Headers */
body.acc-underline-headers h1,
body.acc-underline-headers h2,
body.acc-underline-headers h3,
body.acc-underline-headers h4,
body.acc-underline-headers h5,
body.acc-underline-headers h6 {
    text-decoration: underline !important;
}

/* Image Titles */
body.acc-image-titles img[alt]:not([alt=""]):after {
    content: attr(alt);
    display: block;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px;
    font-size: 0.9rem;
}

/* White Cursor */
body.acc-white-cursor,
body.acc-white-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="white" stroke="black" stroke-width="1" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 8 8, auto !important;
}

/* Black Cursor */
body.acc-black-cursor,
body.acc-black-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="black" stroke="white" stroke-width="1" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 8 8, auto !important;
}

/* Zoom Screen */
body.acc-zoom-screen {
    transform: scale(1.2);
    transform-origin: top center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .accessibility-container {
        width: 95%;
        max-height: 95vh;
    }

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

    .accessibility-item {
        padding: 25px 10px;
    }

    .accessibility-item i {
        font-size: 2rem;
    }

    .accessibility-item span {
        font-size: 0.85rem;
    }

    .accessibility-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .accessibility-grid {
        grid-template-columns: 1fr;
    }

    .accessibility-header h2 {
        font-size: 1.2rem;
    }
}

/* NEW FEATURES */

/* Text Spacing - WCAG 2.1 Success Criterion 1.4.12 */
body.acc-text-spacing * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
    line-height: 1.5 !important;
}

body.acc-text-spacing p,
body.acc-text-spacing li,
body.acc-text-spacing td {
    margin-bottom: 2em !important;
}

/* Reading Guide - Horizontal ruler that follows cursor */
body.acc-reading-guide {
    cursor: none;
}

body.acc-reading-guide::before {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(44, 90, 160, 0.6);
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 0 10px rgba(44, 90, 160, 0.8);
    transition: top 0.1s ease-out;
}

#reading-guide-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(44, 90, 160, 0.8) 20%,
            rgba(44, 90, 160, 0.8) 80%,
            transparent 100%);
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 0 15px rgba(44, 90, 160, 0.6),
        0 0 5px rgba(255, 255, 255, 0.8);
    display: none;
}

body.acc-reading-guide #reading-guide-line {
    display: block;
}

/* Dyslexia Friendly Font */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABl...') format('woff2');
    /* Note: Full font data would be embedded here or loaded from external source */
    font-weight: normal;
    font-style: normal;
}

body.acc-dyslexia-font,
body.acc-dyslexia-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', Arial, sans-serif !important;
}

body.acc-dyslexia-font {
    line-height: 1.8 !important;
}

body.acc-dyslexia-font p,
body.acc-dyslexia-font li {
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* Print Styles - Disable accessibility overlays when printing */
@media print {

    .accessibility-floating-btn,
    .accessibility-overlay,
    #reading-guide-line {
        display: none !important;
    }

    body.acc-invert,
    body.acc-grayscale,
    body.acc-high-contrast {
        filter: none !important;
    }
}

/* Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2c5aa0;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
    font-weight: bold;
}

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