/* ===========================================================
   Hotspots overlay для assembly-страниц.
   Работает на любом viewport (desktop + mobile).
   Отдельно от dark theme — hotspots могут быть на light theme тоже.
=========================================================== */

.hotspot-stage {
    position: relative;
    display: block;
}
.hotspot-stage .assembly-diagram-media {
    position: relative;
}
.hotspot-stage img.assembly-diagram-image {
    display: block;
    width: 100%;
    height: auto;
}
.hotspot-stage svg.hotspots {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 5 !important;
    overflow: visible !important;
}
.hotspot-stage svg.hotspots a {
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
.hotspot-stage svg.hotspots circle {
    fill: transparent !important;
    stroke: none !important;
    transition: fill .12s, stroke .12s !important;
}
/* Debug mode: ?hotspots=show в URL → показать все кружки */
body.hotspots-debug .hotspot-stage svg.hotspots circle {
    stroke: #c8102e !important;
    stroke-width: 3px !important;
    vector-effect: non-scaling-stroke !important;
    fill: rgba(200, 16, 46, 0.10) !important;
}
.hotspot-stage svg.hotspots a:hover circle,
.hotspot-stage svg.hotspots a:focus circle,
.hotspot-stage svg.hotspots a:active circle,
.hotspot-stage svg.hotspots a.is-pos-hover circle,
.hotspot-stage svg.hotspots a.is-row-hover circle {
    fill: rgba(200, 16, 46, 0.30) !important;
    outline: none !important;
}
.hotspot-stage svg.hotspots .lbl {
    display: none !important;
}

/* Hover row highlight (hotspot-hl) — на td чтобы перебить theme bg */
table.list tbody tr.hotspot-hl > td,
table.parts-table tbody tr.hotspot-hl > td,
.assembly-parts table tbody tr.hotspot-hl > td,
body.theme-dark table.list tbody tr.hotspot-hl > td {
    background-color: rgba(200, 16, 46, 0.15) !important;
    background-image: linear-gradient(90deg, rgba(200, 16, 46, 0.18) 0%, transparent 100%) !important;
}
table.list tbody tr.hotspot-hl > td:first-child,
table.parts-table tbody tr.hotspot-hl > td:first-child,
.assembly-parts table tbody tr.hotspot-hl > td:first-child {
    box-shadow: inset 3px 0 0 #c8102e !important;
}

/* Click target (hotspot-target) — постоянная подсветка после scroll */
table.list tbody tr.hotspot-target > td,
table.parts-table tbody tr.hotspot-target > td,
.assembly-parts table tbody tr.hotspot-target > td,
body.theme-dark table.list tbody tr.hotspot-target > td {
    background-color: rgba(200, 16, 46, 0.30) !important;
    background-image: linear-gradient(90deg, rgba(200, 16, 46, 0.40) 0%, transparent 80%) !important;
    animation: hotspotFlash 1s ease-out !important;
}
table.list tbody tr.hotspot-target > td:first-child,
table.parts-table tbody tr.hotspot-target > td:first-child,
.assembly-parts table tbody tr.hotspot-target > td:first-child {
    box-shadow: inset 4px 0 0 #c8102e !important;
}
@keyframes hotspotFlash {
    0%   { background-color: rgba(200, 16, 46, 0.55); }
    100% { background-color: rgba(200, 16, 46, 0.30); }
}


/* === Hotspot buttons (Pixel pattern) — прозрачные на default, видны на hover === */
.assembly-hotspots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;  /* скрываем номер по умолчанию */
    font-weight: 700;
    cursor: pointer;
    z-index: 5;
    color: transparent;
    background: transparent;
    border: 1px solid transparent;
    transition: border-color .15s, background .15s, color .15s, font-size .15s, transform .12s;
    pointer-events: auto;
    padding: 0;
    line-height: 1;
    min-width: 16px;
    min-height: 16px;
    max-width: none;
    max-height: none;
    appearance: none;
    -webkit-appearance: none;
}
.hotspot:hover, .hotspot.active, .hotspot:focus {
    border-color: #c8102e;
    background: rgba(200, 16, 46, .15);
    color: #c8102e;
    font-size: 9px;
    transform: translate(-50%, -50%) scale(1.25);
    z-index: 10;
    outline: none;
}
/* Debug: ?hotspots=show в URL → видны все кружки */
body.hotspots-debug .hotspot {
    border-color: #c8102e !important;
    background: rgba(200, 16, 46, .08) !important;
}
