/* ── SimStore — In-Store Tech Simulation ─────────────────────────────────── */

:root {
    --ss-dark:         #0b1c1a;
    --ss-primary:      #0f2620;
    --ss-accent:       #16a34a;
    --ss-accent-light: #4ade80;
    --ss-surface:      #10241f;
    --ss-text:         #f1f5f9;
    --ss-muted:        #94a3b8;
    --ss-border:       rgba(74,222,128,0.18);
}

.ss-page {
    background-color: var(--ss-dark);
    min-height: 100vh;
    color: var(--ss-text);
}

/* ── Status badge ──────────────────────────────────────────────────────── */

.ss-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ss-badge-active      { background: rgba(74,222,128,0.15);  color: #86efac; border: 1px solid rgba(74,222,128,0.3); }
.ss-badge-inactive     { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); }
.ss-badge-maintenance  { background: rgba(234,179,8,0.15);   color: #fcd34d; border: 1px solid rgba(234,179,8,0.3); }
.ss-badge-archived     { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); }
.ss-badge-ai           { background: rgba(59,130,246,0.15);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.ss-badge-warning      { background: rgba(234,179,8,0.15);   color: #fcd34d; border: 1px solid rgba(234,179,8,0.3); }
.ss-badge-incident     { background: rgba(239,68,68,0.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.ss-badge-generating   { background: rgba(59,130,246,0.15);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.ss-badge-draft        { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); }
.ss-badge-failed       { background: rgba(239,68,68,0.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }

/* ── Store card (landing page) ────────────────────────────────────────── */

.ss-store-card {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: 14px;
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
}

.ss-store-card:hover {
    border-color: var(--ss-accent);
    transform: translateY(-3px);
}

.ss-store-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ss-text);
    margin-bottom: 0.5rem;
}

.ss-store-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ss-border);
    margin-bottom: 0.75rem;
    background: rgba(255,255,255,0.03);
}

/* ── Form panels ───────────────────────────────────────────────────────── */

.ss-form-panel {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    padding: 2rem;
}

.ss-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ss-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    display: block;
}

.ss-divider {
    border: none;
    border-top: 1px solid var(--ss-border);
    margin: 1.5rem 0;
}

/* ── 2D store plan map ─────────────────────────────────────────────────── */

.ss-map-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    background: #fff;
    touch-action: none;
}

.ss-map-viewport {
    position: relative;
    transform-origin: 0 0;
    width: 100%;
}

.ss-map-viewport img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.ss-map-controls {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ss-map-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ss-border);
    background: rgba(16,36,31,0.92);
    color: var(--ss-text);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ss-map-zoom-btn:hover {
    border-color: var(--ss-accent);
    color: var(--ss-accent-light);
}

.ss-coverage-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(37,99,235,0.10);
    border: 1px solid rgba(37,99,235,0.35);
    pointer-events: none;
    z-index: 2;
}

.ss-pin {
    position: absolute;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 3;
}

.ss-pin.draggable {
    cursor: grab;
}

/* Fixed EB markers on the combined Store-View map — a diamond (rotated square), display-only,
   deliberately not .ss-pin so it never enters the drag-pin resolution (EGN points and broadcasters
   are separate tables with independent IDs that could otherwise collide). */
.ss-eb-marker {
    position: absolute;
    width: 13px;
    height: 13px;
    margin-left: -6.5px;
    margin-top: -6.5px;
    transform: rotate(45deg);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    z-index: 3;
}

/* RTE simulation playback — one live-computed dot per unit, position recalculated every tick from
   its most recent Location event. Also deliberately not .ss-pin/data-pin-id (never draggable), and a
   distinct shape (circle, no rotation) from both .ss-pin (EGN, status-colored) and .ss-eb-marker
   (diamond, static) so there's no visual or ID-space ambiguity between the three marker kinds. */
.ss-rte-unit {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.25s linear, top 0.25s linear, background-color 0.25s linear;
    background-color: #16a34a; /* Green — normal/Info state, the default until a Warning/Incident flag is set */
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
    z-index: 6;
}

.ss-rte-unit-warning {
    background-color: #eab308; /* Yellow */
    box-shadow: 0 0 0 2px #eab308;
    animation: ss-rte-pulse 1s ease-in-out infinite;
}

.ss-rte-unit-incident {
    background-color: #ef4444; /* Red */
    box-shadow: 0 0 0 2px #ef4444;
    animation: ss-rte-pulse 0.6s ease-in-out infinite;
}

@keyframes ss-rte-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.5); }
}

.ss-pin.draggable:active {
    cursor: grabbing;
}

.ss-pin-active       { background: #16a34a; }
.ss-pin-inactive      { background: #94a3b8; }
.ss-pin-maintenance   { background: #eab308; }

/* RTE playback only (StorePlanMap's PlaybackMode) — smaller and a distinct purple so EGN points read
   as background infrastructure while the severity-colored mobile EB dots (.ss-rte-unit) stay the
   visually dominant signal on the map. */
.ss-pin-playback {
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-top: -5px;
    background: #a855f7;
    border: 1.5px solid #fff;
}

/* Deliberately high-contrast against every pin status color (green/grey/yellow) and enlarged +
   brought to front so it stays legible even when pins overlap (e.g. freshly-added, not yet dragged
   apart). A blue ring + pulse reads as "selected" regardless of the pin's own color. */
.ss-pin-selected {
    z-index: 10;
    width: 26px;
    height: 26px;
    margin-left: -13px;
    margin-top: -13px;
    outline: 3px solid #fff;
    outline-offset: 1px;
    box-shadow: 0 0 0 4px #2563eb, 0 2px 10px rgba(0,0,0,0.6);
    animation: ss-pin-pulse 1.1s ease-in-out infinite;
}

@keyframes ss-pin-pulse {
    0%, 100% { box-shadow: 0 0 0 4px #2563eb, 0 2px 10px rgba(0,0,0,0.6); }
    50%      { box-shadow: 0 0 0 9px rgba(37,99,235,0.35), 0 2px 10px rgba(0,0,0,0.6); }
}

/* ── POI / off-map EGN side panel ─────────────────────────────────────── */

.ss-poi-card {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
}

.ss-poi-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ss-text);
    margin-bottom: 0.2rem;
}

.ss-poi-meta {
    font-size: 0.8rem;
    color: var(--ss-muted);
}

/* ── Store Event Viewer rows ───────────────────────────────────────────── */

.ss-rte-event-row-warning  { border-left: 3px solid #eab308; }
.ss-rte-event-row-incident { border-left: 3px solid #ef4444; }

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .ss-nav-email  { display: none !important; }
    .ss-header-nav { gap: 0.85rem !important; }
}
