/* x13screendots — frontend overlay + custom zoom lightbox.
 *
 * Two render modes:
 *   .x13sd-overlay--compact: only dots, gentle pulse, clickable → opens zoom.
 *   .x13sd-overlay--full:    dots + leader line + label (inside zoom).
 *
 * Sizes for dot/line/label are computed in JS based on displayed image width,
 * so the whole overlay scales proportionally on small viewports and zoomed-in
 * lightbox. The CSS contains NO fixed-px dot dimensions on purpose.
 */

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    src: url('../../fonts/sora-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    src: url('../../fonts/sora-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --x13sd-color: #000f42;
}

.x13sd-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}
.x13sd-pin {
    position: absolute;
    pointer-events: none;
}

/* --- Dot (ring + inner) ------------------------------------------------ */

.x13sd-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    border: solid var(--x13sd-color);
    border-radius: 50%;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform .2s ease, opacity .2s ease;
}
.x13sd-dot__inner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--x13sd-color);
    border-radius: 50%;
}

/* Compact (main gallery): subtle opacity pulse, no shadow noise. */
.x13sd-overlay--compact .x13sd-dot {
    opacity: .85;
    animation: x13sd-soft 2.6s ease-in-out infinite;
}
.x13sd-overlay--compact .x13sd-dot:hover {
    opacity: 1;
    animation: none;
    /* No scale — scaling the ring on hover misaligns the leader line
     * connecting to its outer edge (line endpoint is computed for the
     * resting size). */
}
@keyframes x13sd-soft {
    0%, 100% { opacity: .65; }
    50%      { opacity: 1;   }
}

/* Full (zoom lightbox): static, fully visible, not interactive. */
.x13sd-overlay--full .x13sd-dot {
    opacity: 1;
    animation: none;
    cursor: default;
}

/* Legend toggle: when the user hides the legend via the bottom-left button
 * inside the modal, only the dots stay visible — the chat labels and leader
 * lines fade out. */
.x13sd-overlay--full.is-legend-hidden .x13sd-label,
.x13sd-overlay--full.is-legend-hidden .x13sd-line {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity .2s ease;
}

/* --- Legend toggle button (fixed bottom-left, only while modal is open) --- */

.x13sd-legend-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100000; /* above Bootstrap modal backdrop (1050) and modal (1060) */
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: 600 13px/1 system-ui, -apple-system, sans-serif;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: background .15s ease, transform .15s ease, opacity .15s ease;
    display: none;
    opacity: 0;
    pointer-events: none;
}
.x13sd-legend-toggle.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.x13sd-legend-toggle:hover {
    background: rgba(0, 0, 0, 0.92);
    transform: translateY(-1px);
}
@media (max-width: 600px) {
    .x13sd-legend-toggle { bottom: 12px; left: 12px; padding: 8px 12px; font-size: 12px; }
}

/* --- Leader line + label ---------------------------------------------- */

.x13sd-line {
    position: absolute;
    background: var(--x13sd-color);
    pointer-events: none;
    z-index: 1;
}
.x13sd-label {
    position: absolute;
    top: 0; left: 0;
    background: var(--x13sd-color);
    color: #fff;
    font-family: 'Sora', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    white-space: nowrap;
    z-index: 2;
}

/* Compact mode: label + line collapsed by default. Hover dot → animate in.
 * (Plain CSS :hover so the callout appears the moment the user reaches the
 * dot, with no click required.) */
.x13sd-overlay--compact .x13sd-label,
.x13sd-overlay--compact .x13sd-line {
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.3,1.2);
    pointer-events: none;
}
/* Transform origin = the corner the dot extends from, so the label appears
 * to grow OUT of the dot. */
.x13sd-overlay--compact .x13sd-pin[data-corner="TL"] .x13sd-label { transform-origin: 0% 0%; }
.x13sd-overlay--compact .x13sd-pin[data-corner="TR"] .x13sd-label { transform-origin: 100% 0%; }
.x13sd-overlay--compact .x13sd-pin[data-corner="BL"] .x13sd-label { transform-origin: 0% 100%; }
.x13sd-overlay--compact .x13sd-pin[data-corner="BR"] .x13sd-label { transform-origin: 100% 100%; }
.x13sd-overlay--compact .x13sd-line { transform-origin: 0 50%; transform: scaleX(0); }
.x13sd-overlay--compact .x13sd-pin:hover .x13sd-line,
.x13sd-overlay--compact .x13sd-pin:focus-within .x13sd-line {
    opacity: 1;
    transform: scaleX(1);
    transition: transform .25s cubic-bezier(.2,.8,.3,1.2), opacity .15s ease;
}
.x13sd-overlay--compact .x13sd-pin:hover .x13sd-label,
.x13sd-overlay--compact .x13sd-pin:focus-within .x13sd-label {
    opacity: 1;
    transform: scale(1);
}
.x13sd-overlay--compact .x13sd-pin:hover .x13sd-dot,
.x13sd-overlay--compact .x13sd-pin:focus-within .x13sd-dot {
    animation: none;
    opacity: 1;
}

