/* Viking Networks — ReticPro-Grade Read-Only NZ Open-Data GIS Styling */
:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #0b1120;
  color: #e2e8f0;
  margin: 0;
  overflow: hidden;
  max-width: 100vw;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Left CAD-Style Compact Tool Rail (matching ReticPro) */
.vn-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 3px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.1;
  transition: background-color 0.14s ease, color 0.14s ease;
  cursor: pointer;
}

/* Compact Zoom-Aware Glass Pipe Badges (ReticPro style) */
.vn-pipe-label-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
  overflow: visible !important;
}

.vn-pipe-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  background: rgba(9, 15, 30, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  padding: 1.5px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  color: #e2e8f0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Animated Flow / Line Direction Chevrons (ReticPro style) */
.vn-flow-arrow-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
  overflow: visible !important;
}

.vn-flow-arrow-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

@keyframes vnArrowGlide {
  0%, 100% { transform: translateX(-2px) scale(0.95); opacity: 0.8; }
  50%      { transform: translateX(2.4px) scale(1.07); opacity: 1; }
}

.vn-flow-arrow-svg {
  display: block;
  will-change: transform, opacity;
  animation: vnArrowGlide 1.25s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .vn-flow-arrow-svg { animation: none !important; }
}

/* Crisp Asset Point Icons (Valves, Hydrants, Pump Stations, Backflows, Reservoirs) */
.vn-asset-icon {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}

.vn-asset-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
  transition: transform 0.12s ease;
}

.vn-asset-badge:hover {
  transform: scale(1.22);
}

/* Dark Leaflet overrides */
.leaflet-container {
  background: #0b1120;
  font-family: 'Inter', system-ui, sans-serif;
}

.leaflet-popup-content-wrapper {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.58);
}

.leaflet-popup-tip {
  background: #0f172a;
  border: 1px solid #334155;
}

.leaflet-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px 8px !important;
}

.leaflet-popup-close-button:hover {
  color: #ffffff !important;
}

.leaflet-control-zoom a {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

.leaflet-control-zoom a:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
}

.leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #cbd5e1 !important;
  border-top-left-radius: 8px;
  font-size: 10px !important;
  padding: 2px 8px !important;
}

.leaflet-control-attribution a {
  color: #38bdf8 !important;
}

.linz-hillshade-overlay {
  mix-blend-mode: multiply;
}

/* High-Contrast Sunlight Field Mode */
body.sunlight-mode {
  background: #f8fafc;
  color: #0f172a;
}

body.sunlight-mode header,
body.sunlight-mode aside,
body.sunlight-mode nav,
body.sunlight-mode .vn-surface {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.sunlight-mode .vn-card {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.sunlight-mode .vn-card .bg-\[\#0b1120\],
body.sunlight-mode .vn-card .bg-slate-900\/80 {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.sunlight-mode .vn-card .bg-emerald-950\/70,
body.sunlight-mode .vn-card .bg-emerald-950\/60 {
  background: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  color: #065f46 !important;
}

body.sunlight-mode .vn-card .text-white:not(a):not(button),
body.sunlight-mode .vn-surface .text-white:not(a):not(button),
body.sunlight-mode .vn-card span.text-white,
body.sunlight-mode .vn-card div.text-white {
  color: #0f172a !important;
}

body.sunlight-mode .vn-card .text-sky-300:not(button),
body.sunlight-mode .vn-card .text-sky-200:not(button),
body.sunlight-mode .vn-surface .text-sky-200 {
  color: #0369a1 !important;
}

body.sunlight-mode .vn-card .text-emerald-300:not(button),
body.sunlight-mode .vn-card .text-emerald-200:not(button) {
  color: #047857 !important;
}

body.sunlight-mode .vn-card .text-orange-300:not(button),
body.sunlight-mode .vn-card .text-orange-200:not(button),
body.sunlight-mode .vn-card .text-amber-300:not(button),
body.sunlight-mode .vn-card .text-amber-200:not(button) {
  color: #b45309 !important;
}

body.sunlight-mode .vn-card .text-rose-400:not(button),
body.sunlight-mode .vn-card .text-rose-300:not(button) {
  color: #be123c !important;
}

body.sunlight-mode .vn-card .text-slate-200:not(button),
body.sunlight-mode .vn-card .text-slate-300:not(button),
body.sunlight-mode .vn-surface .text-slate-300 {
  color: #334155 !important;
}

body.sunlight-mode .vn-card .text-slate-400:not(button),
body.sunlight-mode .vn-muted {
  color: #475569 !important;
}

body.sunlight-mode .vn-title {
  color: #0f172a !important;
}

body.sunlight-mode input[type="text"],
body.sunlight-mode input[type="email"],
body.sunlight-mode input[type="url"],
body.sunlight-mode select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

body.sunlight-mode #vnToolRail button:not(.bg-sky-600),
body.sunlight-mode #vnTopControls button:not(.bg-indigo-600):not(.bg-sky-600) {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
