/* 
    Impergo Global Accessibility Suite Styles
    Ensures accessibility across the site with premium UI.
*/

/* 1. Magic Accessibility Overlay (Protects Fixed Widgets) */
#tp-access-overlay {
    position: fixed !important;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000; /* Behind widgets but above content */
    pointer-events: none !important;
    transition: backdrop-filter 0.3s ease;
}

/* Feature States via Overlay */
html.access-grayscale #tp-access-overlay { backdrop-filter: grayscale(1) !important; -webkit-backdrop-filter: grayscale(1) !important; }
html.access-invert #tp-access-overlay { backdrop-filter: invert(1) hue-rotate(180deg) !important; -webkit-backdrop-filter: invert(1) hue-rotate(180deg) !important; }
html.access-contrast #tp-access-overlay { backdrop-filter: contrast(1.5) !important; -webkit-backdrop-filter: contrast(1.5) !important; }

/* 2. Global Widget Settings */
.tp-access-widget {
    position: fixed !important;
    bottom: 30px !important;
    left: 30px !important;
    z-index: 2147483647 !important; 
    pointer-events: auto !important;
    outline: none;
}

.tp-access-toggle {
    width: 60px;
    height: 60px;
    background: #000;
    color: #eab228;
    border: 2px solid #eab228;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tp-access-toggle:hover { transform: scale(1.1); }
.tp-access-toggle.active { background: #eab228; color: #000; }

/* 3. Accessibility Panel */
.tp-access-panel {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 300px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #ddd;
}
.tp-access-panel.show { display: flex; animation: apFadeIn 0.3s ease; }
@keyframes apFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-btn {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
}
.ap-btn:hover { background: #eee; border-color: #ccc; }
.ap-btn.active { background: #000; color: #eab228; border-color: #000; }
.ap-btn i { font-size: 18px; }
.ap-btn span { font-size: 10px; font-weight: 700; text-transform: uppercase; }

.ap-read-btn {
    width: 100%;
    background: #000;
    color: #eab228;
    padding: 12px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

/* --- Accessibility Rules --- */

/* Refined Big Text - Protects Layouts */
body.access-font-large p, 
body.access-font-large span, 
body.access-font-large a, 
body.access-font-large li {
    font-size: 1.12em !important;
    line-height: inherit !important;
}

/* Universal Clean Font - Protecting Icons */
body.access-readable-font *:not(i):not([class*="fa"]):not([class*="icon"]) {
    font-family: 'Open Sans', 'Arial', sans-serif !important;
    letter-spacing: 0.5px !important;
}

/* Ultra-Visible Links */
body.access-bold-links a {
    text-decoration: underline !important;
    font-weight: 900 !important;
    background-color: #eab228 !important;
    color: #000 !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
    outline: 2px solid #000 !important;
    outline-offset: 1px !important;
}

/* Reading Status Bar */
.reading-status-bar {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 400px);
    background: #000;
    border: 2px solid #eab228;
    border-radius: 50px;
    padding: 12px 25px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 2147483647 !important;
    color: #fff;
    transition: all 0.5s ease;
}
.reading-status-bar.show { display: flex; bottom: 30px; }

.rs-text { 
    font-size: 13px; 
    font-weight: 700;
    white-space: nowrap; 
    overflow: hidden; 
    flex: 1; 
    position: relative;
}
#rs-status-text {
    display: inline-block;
    padding-left: 20px;
    will-change: transform;
}

@keyframes rs-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.highlight-reading { background: rgba(234,178,40,0.3) !important; outline: 2px solid #eab228; }

/* --- ULTIMATE ACCESSIBILITY ADDITIONS --- */

/* Reading Guide */
#tp-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: #eab228;
    box-shadow: 0 0 15px rgba(234, 178, 40, 0.8);
    z-index: 19999;
    pointer-events: none;
    display: none;
    transition: top 0.1s ease-out;
}
html.access-guide #tp-reading-guide { display: block; }

/* Big Cursor */
html.access-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="%23eab228" stroke="black" stroke-width="1"><path d="M7 2l12 11.2l-5.8 0.5l3.3 5.3l-3 1.9l-3.3-5.3L7 19V2z"/></svg>'), auto !important;
}

/* Screen Reader Helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
