/* ============================================================
   Niltech Tank Monitor — futuristic glassmorphism / neon theme
   ============================================================ */
:root {
  --bg-0: #070b16;
  --bg-1: #0b1020;
  --glass: rgba(20, 28, 48, 0.55);
  --glass-brd: rgba(120, 160, 255, 0.18);
  --neon: #22d3ee;
  --neon-2: #6366f1;
  --neon-3: #38bdf8;
  --txt: #e8eef9;
}

* { scrollbar-width: thin; scrollbar-color: var(--neon-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--neon-2); border-radius: 8px; }

body {
  background: var(--bg-0);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Animated aurora background */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(45% 50% at 15% 20%, rgba(99,102,241,0.25), transparent 60%),
    radial-gradient(40% 45% at 85% 25%, rgba(34,211,238,0.22), transparent 60%),
    radial-gradient(50% 50% at 50% 100%, rgba(56,189,248,0.16), transparent 60%),
    var(--bg-0);
  animation: auroraShift 18s ease-in-out infinite alternate;
}
@keyframes auroraShift {
  0%   { filter: hue-rotate(0deg)   saturate(1); transform: scale(1); }
  100% { filter: hue-rotate(35deg)  saturate(1.25); transform: scale(1.08); }
}

/* Glass surfaces */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
.glass-nav {
  background: rgba(8, 12, 26, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-brd);
}

/* Brand orb */
.brand-orb, .login-orb, .brand-orb {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a5f3fc, var(--neon) 50%, var(--neon-2));
  box-shadow: 0 0 14px var(--neon), 0 0 26px var(--neon-2);
  animation: pulseGlow 2.4s ease-in-out infinite;
}
.login-orb { width: 64px; height: 64px; }
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px var(--neon), 0 0 26px var(--neon-2); }
  50%      { transform: scale(1.12); box-shadow: 0 0 22px var(--neon), 0 0 44px var(--neon-2); }
}

/* Buttons */
.btn-glow {
  background: linear-gradient(120deg, var(--neon-2), var(--neon));
  border: none; color: #04101a; font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(34,211,238,0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(34,211,238,0.5); color: #04101a; }

/* Device cards */
.device-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.device-card:hover {
  transform: translateY(-6px);
  border-color: var(--neon);
  box-shadow: 0 14px 40px rgba(34,211,238,0.25);
}
.card-offline { opacity: .72; filter: grayscale(.3); }

/* Status pills */
.status-pill {
  font-size: .68rem; font-weight: 700; letter-spacing: .5px;
  padding: 2px 10px; border-radius: 999px;
}
.status-pill.on  { background: rgba(34,197,94,.18); color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.status-pill.off { background: rgba(148,163,184,.15); color: #94a3b8; border: 1px solid rgba(148,163,184,.3); }

.live-badge { border: 1px solid var(--glass-brd); }
.live-badge.just-updated { box-shadow: 0 0 12px var(--neon); transition: box-shadow .2s; }
.live-dot, .status-pill.on::before {}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; margin-right: 5px; box-shadow: 0 0 8px #4ade80;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Water gauge */
.water-gauge {
  position: relative; height: 130px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--glass-brd);
}
.water-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(56,189,248,.55), rgba(34,211,238,.85));
  transition: height 1s cubic-bezier(.4,0,.2,1);
}
.water-fill::before {
  content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 14px;
  background: rgba(165,243,252,.5); border-radius: 50%;
  animation: wave 3s ease-in-out infinite;
}
@keyframes wave { 0%,100% { transform: translateX(-4%) scaleY(1); } 50% { transform: translateX(4%) scaleY(.7); } }
.water-label { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-shadow: 0 2px 8px rgba(0,0,0,.5); }

/* Metrics */
.metric-row .metric-val { font-weight: 700; font-size: .95rem; }
.metric-row .metric-lbl { font-size: .68rem; color: #94a3b8; text-transform: uppercase; }

.stat-tile { transition: transform .2s; }
.stat-tile:hover { transform: translateY(-4px); }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.stat-unit { font-size: .8rem; color: #94a3b8; margin-left: 2px; }
.stat-label { font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }

/* Forms */
.form-control, .form-select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-brd);
  color: var(--txt);
}
.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,.06);
  border-color: var(--neon);
  box-shadow: 0 0 0 .2rem rgba(34,211,238,.2);
  color: var(--txt);
}
.form-floating label { color: #94a3b8; }
.table-dark { --bs-table-bg: transparent; }
.modal-content.glass-card { background: rgba(15,22,40,.92); }

a { color: var(--neon-3); }
code { color: #a5f3fc; }
