/* =============================================
   GIN GANGA FLOOD ALERT — Premium Redesign
   ============================================= */

:root {
  --bg:        #0a0e1a;
  --bg2:       #111827;
  --bg3:       #1a2235;
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);
  --text:      #f0f4ff;
  --text2:     #8b9cb8;
  --text3:     #4e6080;
  --accent:    #3b82f6;
  --accent2:   #60a5fa;

  --safe:      #22c55e;
  --safe-bg:   rgba(34,197,94,0.12);
  --safe-border: rgba(34,197,94,0.3);

  --warn:      #eab308;
  --warn-bg:   rgba(234,179,8,0.12);
  --warn-border: rgba(234,179,8,0.3);

  --minor:     #f97316;
  --minor-bg:  rgba(249,115,22,0.12);
  --minor-border: rgba(249,115,22,0.3);

  --major:     #ef4444;
  --major-bg:  rgba(239,68,68,0.12);
  --major-border: rgba(239,68,68,0.3);

  --font-display: 'Space Mono', monospace;
  --font-body:    'DM Sans', sans-serif;

  --radius:  12px;
  --radius2: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(59,130,246,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 30% at 80% 90%, rgba(34,197,94,0.06) 0%, transparent 60%);
}

/* ─── HEADER ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.header-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
  flex-shrink: 0;
}

.header-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 1px;
}

.live-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--safe);
  letter-spacing: 0.1em;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--safe);
  animation: livepulse 2s infinite;
}

@keyframes livepulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%      { opacity: 0.8; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ─── MAIN ─── */
.main-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── HERO SECTION ─── */
.hero-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 28px;
  animation: fadeup 0.5s ease both;
}

@keyframes fadeup {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: center;
}

/* ─── TANK ─── */
.tank-label {
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--text3);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tank-outer {
  display: flex;
  justify-content: center;
}

.tank-body {
  width: 68px;
  height: 160px;
  border: 2px solid var(--border2);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.tank-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 0%;
  transition: height 1.4s cubic-bezier(.4,0,.2,1), background 0.8s ease;
  overflow: hidden;
}

.tank-wave {
  position: absolute;
  top: -14px; left: -60%;
  width: 220%; height: 28px;
  background: currentColor;
  border-radius: 40%;
  opacity: 0.35;
  animation: tankwave 3s linear infinite;
}
.wave2 { animation-duration: 4.5s; animation-direction: reverse; opacity: 0.2; }

@keyframes tankwave {
  from { transform: translateX(0); }
  to   { transform: translateX(45%); }
}

.tank-marker {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
}
.marker-line {
  display: block;
  width: 12px; height: 1px;
  background: var(--border2);
}
.marker-label {
  font-size: 9px;
  font-family: var(--font-display);
  margin-left: 4px;
  opacity: 0.6;
}
.marker-label.red   { color: var(--major); }
.marker-label.orange{ color: var(--minor); }

.tank-reading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-top: 14px;
  letter-spacing: -0.03em;
}

.tank-pct {
  font-size: 12px;
  text-align: center;
  color: var(--text2);
  margin-top: 3px;
}

/* ─── STATUS INFO ─── */
.status-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.5s ease;
  border: 1px solid;
}

.status-icon {
  font-size: 10px;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Status states */
.badge-safe   { background: var(--safe-bg); border-color: var(--safe-border); color: var(--safe); }
.badge-warn   { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.badge-minor  { background: var(--minor-bg); border-color: var(--minor-border); color: var(--minor); }
.badge-major  { background: var(--major-bg); border-color: var(--major-border); color: var(--major); }

/* ─── TREND ─── */
.trend-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.trend-arrow {
  font-size: 32px;
  font-family: var(--font-display);
  line-height: 1;
  transition: color 0.5s;
  width: 40px;
  text-align: center;
}

.trend-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.trend-delta {
  font-size: 13px;
  font-family: var(--font-display);
  color: var(--text2);
  margin-top: 2px;
}

/* ─── META ROW ─── */
.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.meta-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  font-family: var(--font-display);
  margin-bottom: 4px;
}

.meta-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-display);
}

/* ─── THRESHOLD STRIP ─── */
.threshold-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
  animation: fadeup 0.5s 0.1s ease both;
}

.threshold-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  transition: background 0.3s;
  cursor: default;
}

.threshold-item.active {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(239,68,68,0.9);
  box-shadow: inset 0 0 0 1px rgba(239,68,68,0.4), 0 0 0 2px rgba(239,68,68,0.12);
}

.th-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.th-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.th-range {
  font-size: 11px;
  font-family: var(--font-display);
  color: var(--text3);
  margin-top: 1px;
}

.th-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* ─── CHART SECTION ─── */
.chart-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 24px;
  animation: fadeup 0.5s 0.2s ease both;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
}

.section-badge {
  font-size: 11px;
  font-family: var(--font-display);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

/* ─── SOURCE NOTE ─── */
.source-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeup 0.5s 0.3s ease both;
}

.source-icon {
  color: var(--text3);
  flex-shrink: 0;
  margin-top: 2px;
}

.source-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.source-text strong { color: var(--text); font-weight: 500; }
.source-text a { color: var(--accent2); text-decoration: none; }
.source-text a:hover { text-decoration: underline; }

/* ─── FOOTER ─── */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-dot { opacity: 0.4; }
.site-footer a { color: var(--text2); text-decoration: none; }
.site-footer a:hover { color: var(--accent2); }

/* ─── ALERT PULSE (major flood) ─── */
.pulse-major {
  animation: majorpulse 1.5s infinite;
}
@keyframes majorpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50%     { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* ─── LOADING STATE ─── */
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  color: transparent;
  user-select: none;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 24px;
  }
  .status-info { width: 100%; }
  .threshold-strip {
    grid-template-columns: 1fr 1fr;
  }
  .th-divider:nth-child(4) { display: none; }
  .meta-row { grid-template-columns: 1fr 1fr; }
  .header-title { font-size: 12px; }
  .header-sub { display: none; }
}

@media (max-width: 400px) {
  .threshold-strip { grid-template-columns: 1fr; }
  .th-divider { height: 1px; width: auto; }
}
