/* Animated Floating Button */
.a11y-btn-animated {
    position: fixed; bottom: 80px; right: 25px; width: 60px; height: 60px;
    background-color: transparent; border: none; border-radius: 50%; 
    cursor: pointer; z-index: 9999999 !important; 
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease; animation: pulseGlow 2.5s infinite;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(45, 10, 102, 0.5); border-radius: 50%; transform: scale(1); }
    50% { box-shadow: 0 0 0 15px rgba(45, 10, 102, 0); border-radius: 50%; transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(45, 10, 102, 0); border-radius: 50%; transform: scale(1); }
}
.a11y-btn-animated:hover { animation: none; transform: scale(1.1); }

/* Panel and Grid UI */
.a11y-panel {
    position: fixed; bottom: 110px; right: 30px; width: 440px;
    max-height: 65vh; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    z-index: 9999999 !important; opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s ease; border: 1px solid #e2e8f0; display: flex; flex-direction: column;
}
.a11y-panel.active { opacity: 1; visibility: visible; transform: translateY(0); }

.a11y-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: #2d0a66; color: #fff; border-radius: 12px 12px 0 0; flex-shrink: 0;
}
.a11y-header h3 { margin: 0; font-weight: 600; font-size: 16px !important; }
#a11y-close { background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; }
.a11y-body { padding: 15px; overflow-y: auto; flex-grow: 1; }

.a11y-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Cards & Adjusters */
.a11y-card, .a11y-adjuster {
    background: #f4f8fa; border: 2px solid transparent; border-radius: 8px;
    padding: 12px 5px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; cursor: pointer; transition: 0.2s; text-align: center;
    box-sizing: border-box !important;
}
.a11y-card:hover { background: #e6f0fa; }
.a11y-card.active-setting { border-color: #2d0a66; background: #ffffff; box-shadow: 0 4px 10px rgba(45,10,102,0.1); }
.a11y-card .icon { font-size: 20px; margin-bottom: 5px; color: #333; }
.a11y-card .label { font-size: 11px; font-weight: 500; color: #333; line-height: 1.2; }

/* Controls */
.adj-label { font-size: 11px; font-weight: 600; color: #333; margin-bottom: 8px; }
.adj-controls { display: flex; align-items: center; gap: 8px; }
.adj-btn { background: #1e293b; color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center;}
.adj-btn:hover { background: #2d0a66; }
.adj-val { font-size: 11px; font-weight: 600; width: 35px; text-align: center; }

.a11y-reset-btn {
    width: 60%; padding: 10px; margin-top: 10px; background: #fff; color: #ef4444;
    border: 1px solid #ef4444; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.a11y-reset-btn:hover { background: #ef4444; color: #fff; }

/* Widget Immunity */
#a11y-panel *, #a11y-trigger * {
    font-family: 'Poppins', sans-serif !important;
    letter-spacing: normal !important; line-height: 1.5 !important; zoom: 1 !important;
    text-align: center !important; text-transform: none !important; box-sizing: border-box !important;
}

/* Accessibility Logic */
body.a11y-high-contrast *:not(#a11y-panel *):not(#a11y-trigger *) { 
    background-color: #000 !important; color: #fff !important; border-color: #fff !important; 
}
body.a11y-readable-font, body.a11y-readable-font *:not(#a11y-panel *) { font-family: Arial, Helvetica, sans-serif !important; }
body.a11y-highlight-links a { background-color: #ffeb3b !important; color: #000 !important; text-decoration: underline !important; }
body.a11y-hide-images img, body.a11y-hide-images .hero-section::before { opacity: 0 !important; visibility: hidden !important; }

body.a11y-align-left *:not(#a11y-panel *) { text-align: left !important; }
body.a11y-align-center *:not(#a11y-panel *) { text-align: center !important; }
body.a11y-align-right *:not(#a11y-panel *) { text-align: right !important; }

body.a11y-highlight-titles h1, body.a11y-highlight-titles h2, body.a11y-highlight-titles h3,
body.a11y-highlight-titles h4, body.a11y-highlight-titles h5, body.a11y-highlight-titles h6 {
    border: 3px solid #4bb5c1 !important; padding: 5px !important; border-radius: 4px !important; background: rgba(75, 181, 193, 0.1) !important;
}

body.a11y-text-magnifier p:hover, body.a11y-text-magnifier h1:hover, body.a11y-text-magnifier h2:hover,
body.a11y-text-magnifier h3:hover, body.a11y-text-magnifier a:not(.btn-animated):hover, body.a11y-text-magnifier li:hover {
    transform: scale(1.15) !important; background-color: #1e293b !important; color: #ffffff !important;
    position: relative; z-index: 10000; padding: 2px 5px; border-radius: 4px; transition: transform 0.2s ease-in-out;
}
#a11y-panel *:hover, #a11y-trigger:hover { transform: none !important; background-color: inherit !important; color: inherit !important; }

/* =======================================
   100% FIXED READING MASK 
   ======================================= */
.a11y-mask-element {
    position: fixed; 
    left: 0; right: 0;
    background: rgba(0, 0, 0, 0.75); 
    pointer-events: none; 
    z-index: 9999998 !important; 
    display: none;
}
#a11y-mask-top { top: 0; height: 50vh; }
#a11y-mask-bottom { bottom: 0; top: 60vh; }

body.a11y-mask-active .a11y-mask-element { display: block; }