/**
 * CC_114 — HTMX Refresh Stability Fixes
 *
 * Problem 1: .htmx-indicator shifts layout when request is in progress
 * (display: none → display: block causes reflow)
 * Fix: Use visibility: hidden instead, reserve space with min-height
 *
 * Problem 2: HTMX polls reset open dropdowns/inputs on outerHTML swap
 * (Addressed partially here; use hx-preserve on critical form elements)
 */

/* ── HTMX Request Indicator ─────────────────────────────────────────────── */

/**
 * Standardmässig unsichtbar aber mit reserviertem Platz (kein Layout-Shift).
 * HTMX setzt .htmx-request auf dem trigger-Element (oder global Body).
 */
.htmx-indicator {
    visibility: hidden;
    opacity: 0;
    min-height: 1.5em;
    transition: opacity 0.2s ease;
}

/* Anzeigen wenn HTMX-Request läuft */
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    visibility: visible;
    opacity: 1;
}

/* Indicator in Navbar-Position: absolut positioniert um aus dem Flow zu nehmen */
.htmx-indicator.htmx-indicator--floating {
    position: fixed;
    top: 8px;
    right: 16px;
    min-height: auto;
    z-index: 9999;
    background: rgba(0, 100, 200, 0.8);
    color: #fff;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
}

/* ── Scan-Timer Label (CC_108) ───────────────────────────────────────────── */
.scan-timer-label {
    fill: #00aaff;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    animation: scan-pulse 1s ease-in-out infinite;
}

.sector.scanning {
    fill: rgba(0, 100, 255, 0.2);
    stroke: #00aaff;
    stroke-width: 2;
    animation: scan-pulse 1s ease-in-out infinite;
}

@keyframes scan-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
