/* Hide reset button ONLY - exclude infopanel close button */
.interactive-map-page>div>button:first-child,
button[class*="reset"]:not([aria-label*="close"]):not([aria-label*="Close"]),
button[class*="Reset"]:not([aria-label*="close"]):not([aria-label*="Close"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Make sure infopanel close button is visible */
[class*="infopanel"] button,
[class*="info-panel"] button,
button[aria-label*="close"],
button[aria-label*="Close"],
button[class*="close"],
button[class*="Close"] {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Minimal GPU acceleration */
.interactive-map-page svg {
    transform: translateZ(0);
}

/* Optimize SVG paths - no transitions by default */
.interactive-map-page svg path {
    shape-rendering: optimizeSpeed;
    /* Only animate fill when NOT zooming */
}

/* Disable pointer events on non-interactive elements */
.interactive-map-page svg text {
    pointer-events: none;
    user-select: none;
}

/* Simple hover - only when not zooming */
.interactive-map-page svg path:hover {
    fill-opacity: 0.8;
}

/* AGGRESSIVE optimization during zoom/pan */
.is-zooming {

    /* Disable all animations globally */
    * {
        animation-play-state: paused !important;
        transition: none !important;
    }
}

.is-zooming svg {
    /* Force fastest rendering */
    shape-rendering: optimizeSpeed !important;
    text-rendering: optimizeSpeed !important;
    image-rendering: optimizeSpeed !important;
}

.is-zooming svg g {
    /* Removed translateZ/will-change on group to prevent massive texture allocation on PC */
    /* Browsers handle 2D vector transforms efficiently without forcing a bitmap cache here */
}

.is-zooming svg path {
    transition: none !important;
    pointer-events: none !important;

    /* CRITICAL OPTIMIZATION:
       Stop re-calculating stroke width on every frame.
       The React app tries to keep lines thin by updating attributes via JS.
       This overrides that and uses the native GPU-accelerated scalable stroke.
    */
    vector-effect: non-scaling-stroke !important;
    stroke-width: 1px !important;
    /* Visual width - adjust if too thick/thin */

    /* Performance: Opaque strokes are faster to blend */
    stroke-opacity: 1 !important;
    /* Optional: slightly lighter color to compensate for opacity */
    stroke: #94a3b8 !important;
    /* slate-400 */

    /* Simplify painting */
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Hide non-essential elements during zoom */
.is-zooming svg text,
.is-zooming svg title,
.is-zooming svg desc,
.is-zooming .tooltip,
.is-zooming #tooltip {
    display: none !important;
    visibility: hidden !important;
}