/* Magnifier widget — native screen capture lens following cursor
 *
 * Uses getDisplayMedia({ preferCurrentTab: true }) to capture the viewport
 * as a video stream, grabs frames periodically, and shows zoomed crop
 * inside a circular lens. Pixel-perfect rendering — no CSS parsing issues.
 */

body.accessibility-magnifier-enabled #acc-magnifier-lens {
    display: block;
}

#acc-magnifier-lens {
    display: none;
    position: fixed;
    width: 50vmin;
    height: 50vmin;
    border-radius: 50%;
    border: 3px solid #142691;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    background-color: #ffffff;
    background-repeat: no-repeat;
    overflow: hidden;
    pointer-events: none;
    z-index: 2147483600;
    transform: translate(-50%, -50%);
    transition: opacity 0.1s ease;
}

/* Crosshair at lens centre */
#acc-magnifier-lens::before,
#acc-magnifier-lens::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(20, 38, 145, 0.35);
    z-index: 1;
}
#acc-magnifier-lens::before {
    width: 14px;
    height: 2px;
    margin-left: -7px;
    margin-top: -1px;
}
#acc-magnifier-lens::after {
    width: 2px;
    height: 14px;
    margin-left: -1px;
    margin-top: -7px;
}

/* Capturing / focusing state — white bg + 2 concentric pulsing circles */
#acc-magnifier-lens.acc-magnifier-capturing {
    background-image: none !important;
    background-color: #ffffff;
}

#acc-magnifier-lens.acc-magnifier-capturing::before {
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border: 2px solid rgba(20, 38, 145, 0.5);
    border-radius: 50%;
    background: transparent;
    animation: acc-focus-inner 1.8s ease-out infinite;
    z-index: 2;
}

#acc-magnifier-lens.acc-magnifier-capturing::after {
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border: 2px solid rgba(20, 38, 145, 0.4);
    border-radius: 50%;
    background: transparent;
    animation: acc-focus-outer 1.8s ease-out infinite 0.6s;
    z-index: 1;
}

@keyframes acc-focus-inner {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3.5); opacity: 0; }
}

@keyframes acc-focus-outer {
    0%   { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(3.5); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #acc-magnifier-lens.acc-magnifier-capturing::before {
        animation: none;
        transform: scale(2);
        opacity: 0.3;
    }
    #acc-magnifier-lens.acc-magnifier-capturing::after {
        animation: none;
        transform: scale(3);
        opacity: 0.15;
    }
}
