/* =====================================================================
   Cursor coordinate indicator — STYLES (HydroSim integration)
   - Engine + several swappable designs, all namespaced (ci-* / rg-*).
   - Keyed off #canvasWrap (the positioned map wrapper).
   ===================================================================== */

/* hide the OS cursor over the map only while the indicator is enabled;
   #mapCanvas's own cursor rules (crosshair / help / pointer) still win */
#canvasWrap.ci-on { cursor: none; }

/* transient confirmation pill shown when a gesture toggles the indicator */
.ci-hint {
  position: absolute; left: 50%; top: 16px; z-index: 40;
  transform: translateX(-50%) translateY(-8px);
  padding: 7px 14px; border-radius: 999px;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  color: #eafcff; background: rgba(6,16,28,.82);
  border: 1px solid rgba(37,217,255,.55);
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ci-hint.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.ci-hint.ci-hint--off { border-color: rgba(160,180,200,.45); color: #cdd9e6; }

/* the floating host that tracks the pointer (a 0x0 anchor point) */
.ci-host {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  z-index: 26; pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.ci-host.ci-show { opacity: 1; }
#canvasWrap.ci-profiling .ci-host { opacity: 0 !important; }

/* ============================ Design: Orbit Ring ===================== */
.ci-orbit { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.ci-orbit .rg-gauge { position: relative; width: 96px; height: 96px; }
.ci-orbit svg { position: absolute; inset: 0; transform: rotate(-90deg); } /* s=0 at top (N), clockwise */
.ci-orbit .rg-bgring { fill: none; stroke: rgba(120,170,190,.6); stroke-width: 7; }
.ci-orbit .rg-track  { fill: none; stroke: rgba(120,170,190,.26); stroke-width: 3; }
.ci-orbit .rg-ghost  { fill: none; stroke: rgba(120,170,190,.28); stroke-width: 1.4;
                       stroke-linecap: round; stroke-dasharray: 0.5 5; }
.ci-orbit .rg-anchor { fill: #6ff0e6; filter: drop-shadow(0 0 4px rgba(95,240,230,.85)); }
.ci-orbit .rg-fill   { fill: none; stroke-width: 3.5; stroke-linecap: round;
                       filter: drop-shadow(0 0 5px rgba(120,200,150,.6)); }
.ci-orbit .rg-center { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%;
                       transform: translate(-50%,-50%); background: #6ff0e6;
                       box-shadow: 0 0 8px 2px rgba(95,240,230,.7); }
.ci-orbit .rg-lab {
  position: absolute; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; white-space: nowrap; display: flex; gap: 4px; align-items: baseline;
  text-shadow: 0 1px 5px rgba(0,0,0,.95); color: #eaf7fa;
}
.ci-orbit .rg-lbl  { color: #4ed8d8; font-weight: 700; }
.ci-orbit .rg-unit { color: #7fa3b3; font-size: 10px; }
.ci-orbit .rg-n { left: 50%; top: 50%; transform: translate(-50%,-50%) translateY(-48px); }
.ci-orbit .rg-e { left: 50%; top: 50%; transform: translate(-50%,-50%) translateX(48px); }
.ci-orbit .rg-z { left: 50%; top: 50%; transform: translate(-50%,-50%) translateX(-64px);
                  flex-direction: column; gap: 1px; align-items: flex-end; text-align: right; }
.ci-orbit .rg-zlbl { color: #4ed8d8; font-weight: 700; font-size: 10px; letter-spacing: .5px; }
.ci-orbit .rg-zval { display: flex; gap: 3px; align-items: baseline; line-height: 1; }
.ci-orbit .rg-zval .rg-val { font-weight: 700; transition: font-size .08s linear; }

/* ============================ Design: Crosshair HUD ================== */
.ci-cross { position: absolute; left: 0; top: 0; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ci-cross .cx-h, .ci-cross .cx-v {
  position: absolute; left: 0; top: 0; background: rgba(110,240,230,.85);
  box-shadow: 0 0 6px rgba(95,240,230,.7);
}
.ci-cross .cx-h { width: 46px; height: 1.5px; transform: translate(-50%, -50%); }
.ci-cross .cx-v { width: 1.5px; height: 46px; transform: translate(-50%, -50%); }
.ci-cross .cx-ring {
  position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 1.5px solid rgba(110,240,230,.9);
  box-shadow: 0 0 8px rgba(95,240,230,.55); background: rgba(8,22,32,.25);
}
.ci-cross .cx-box {
  position: absolute; left: 14px; top: 14px; padding: 7px 9px; border-radius: 9px;
  background: rgba(3,12,24,.78); border: 1px solid rgba(120,200,180,.5);
  backdrop-filter: blur(6px); box-shadow: 0 8px 22px rgba(0,0,0,.4);
  font-size: 11px; line-height: 1.45; color: #eaf7fa; white-space: nowrap;
}
.ci-cross .cx-box b { color: #4ed8d8; font-weight: 700; margin-right: 4px; }
.ci-cross .cx-box .u { color: #7fa3b3; }

/* When a dam tooltip is open it occupies the bottom-right of the cursor,
   so move the crosshair readout to the top-left to keep both legible. */
#canvasWrap.dam-tip-open .ci-cross .cx-box {
  left: auto; top: auto; right: 14px; bottom: 14px;
}

/* ============================ Design: Coordinate Tag ================ */
.ci-tag { position: absolute; left: 0; top: 0; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ci-tag .tg-dot {
  position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%;
  transform: translate(-50%, -50%); background: #6ff0e6; box-shadow: 0 0 9px 2px rgba(95,240,230,.75);
}
.ci-tag .tg-card {
  position: absolute; left: 13px; top: 13px; min-width: 96px; padding: 8px 11px; border-radius: 11px;
  background: linear-gradient(160deg, rgba(8,22,38,.92), rgba(4,14,26,.92));
  border: 1px solid rgba(120,200,180,.45); box-shadow: 0 10px 26px rgba(0,0,0,.45);
  backdrop-filter: blur(7px); color: #eaf7fa;
}
.ci-tag .tg-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; line-height: 1.6; }
.ci-tag .tg-row i { font-style: normal; color: #4ed8d8; font-weight: 700; }
.ci-tag .tg-row b { font-weight: 600; }
.ci-tag .tg-elev {
  margin-top: 5px; padding-top: 5px; border-top: 1px dashed rgba(120,200,180,.3);
  font-size: 14px; font-weight: 700; text-align: right; transition: color .1s linear;
}
.ci-tag .tg-elev .u { color: #7fa3b3; font-size: 10px; font-weight: 500; }

/* ============================ Design: Minimal Dot =================== */
.ci-dot2 { position: absolute; left: 0; top: 0; }
.ci-dot2 .d2-dot {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); background: #6ff0e6;
  box-shadow: 0 0 12px 3px rgba(95,240,230,.8); transition: background .1s linear;
}
.ci-dot2 .d2-cap {
  position: absolute; left: 0; top: 12px; transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; white-space: nowrap;
  color: #eaf7fa; text-shadow: 0 1px 5px rgba(0,0,0,.95);
}

/* ===================================================================
   Control cluster: on/off toggle + design selector (bottom-left)
   The list opens UPWARD and the preview opens to the RIGHT so nothing
   ever spills below or outside the viewport.
   =================================================================== */
.ci-controls {
  position: absolute; left: 18px; bottom: 18px; z-index: 24;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
}

/* toggle */
.ci-toggle {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(3,12,24,.62); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px); box-shadow: 0 16px 40px rgba(0,0,0,.20);
}
.ci-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ci-toggle__track {
  position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: rgba(120,150,170,.30); border: 1px solid rgba(255,255,255,.18);
  transition: background .15s ease;
}
.ci-toggle__thumb {
  position: absolute; top: 1.5px; left: 1.5px; width: 15px; height: 15px; border-radius: 50%;
  background: #cfe0ee; transition: transform .15s ease, background .15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.ci-toggle input:checked + .ci-toggle__track { background: rgba(37,217,255,.55); border-color: rgba(37,217,255,.7); }
.ci-toggle input:checked + .ci-toggle__track .ci-toggle__thumb { transform: translateX(16px); background: #eafcff; }
.ci-toggle input:focus-visible + .ci-toggle__track { outline: 2px solid var(--accent, #25d9ff); outline-offset: 2px; }
.ci-toggle__label { font-size: 12.5px; font-weight: 600; color: #dbe9f6; white-space: nowrap; }

/* selector */
.ci-selector { position: relative; }
.ci-sel-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border-radius: 12px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: #dbe9f6; background: rgba(3,12,24,.62); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px); box-shadow: 0 16px 40px rgba(0,0,0,.20);
  transition: border-color .15s ease, opacity .15s ease;
}
.ci-sel-btn:hover { border-color: rgba(37,217,255,.45); }
.ci-sel-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ci-sel-btn .ci-sel-caret { color: #7fa3b3; font-size: 10px; transition: transform .15s ease; }
.ci-sel-btn[aria-expanded="true"] .ci-sel-caret { transform: rotate(180deg); }
.ci-sel-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #25d9ff);
  box-shadow: 0 0 10px rgba(37,217,255,.7);
}

/* dropdown list — opens upward */
.ci-sel-list {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30;
  min-width: 188px; padding: 6px; border-radius: 12px;
  background: rgba(6,16,28,.92); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 2px;
}
.ci-sel-list[hidden] { display: none; }
.ci-sel-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  font: inherit; font-size: 12.5px; color: #dbe9f6;
}
.ci-sel-item:hover, .ci-sel-item.is-active { background: rgba(37,217,255,.12); border-color: rgba(37,217,255,.35); }
.ci-sel-item .ci-item-glyph {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; display: grid; place-items: center;
  background: rgba(120,170,190,.16); color: #8fe6dc; font-size: 13px;
}
.ci-sel-item .ci-item-name { font-weight: 600; }
.ci-sel-item.is-active .ci-item-name { color: #aef3ff; }

/* hover preview panel — appears to the RIGHT of the list */
.ci-preview {
  position: absolute; left: calc(100% + 10px); bottom: 0; z-index: 31;
  width: 176px; padding: 10px; border-radius: 12px;
  background: rgba(6,16,28,.94); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.ci-preview[hidden] { display: none; }
.ci-preview__title { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #8fb6c8; margin-bottom: 8px; }
.ci-preview__stage {
  position: relative; height: 132px; border-radius: 9px; overflow: hidden;
  background:
    radial-gradient(circle at 35% 40%, rgba(40,160,110,.45), transparent 55%),
    radial-gradient(circle at 72% 68%, rgba(230,150,50,.40), transparent 55%),
    linear-gradient(160deg, #0c2233, #0a1622);
  border: 1px solid rgba(255,255,255,.08);
}
.ci-prev-pt { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
