/* ===== BYD Charge PK — styles ===== */
:root {
  --deep:   #0a2d5e;
  --deep-2: #06214a;
  --blue:   #1e88e5;
  --blue-l: #4fa9f6;
  --green:  #2ecc71;
  --green-d:#27ae60;
  --amber:  #f5a623;
  --red:    #e74c3c;
  --white:  #ffffff;
  --ink:    #0e1726;
  --muted:  #5b6b82;
  --bg:     #f4f7fb;
  --card:   #ffffff;
  --line:   #e4ebf3;
  --shadow: 0 10px 30px rgba(10, 45, 94, 0.08);
  --shadow-lg: 0 24px 60px rgba(10, 45, 94, 0.16);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: 'Poppins','Inter',sans-serif; line-height: 1.1; }
a { text-decoration: none; color: inherit; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .95rem;
  padding: .7rem 1.3rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-lg { padding: .95rem 1.7rem; font-size: 1.02rem; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 22px rgba(30,136,229,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(30,136,229,.45); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ===== Navbar ===== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 1.4rem;
}
.brand { display: flex; align-items: center; gap: .35rem; font-weight: 800; }
.brand-mark {
  font-family: 'Poppins',sans-serif; font-weight: 800;
  background: var(--deep); color: #fff; padding: .15rem .5rem;
  border-radius: 7px; letter-spacing: .5px; font-size: 1.05rem;
}
.brand-bolt { color: var(--blue); font-size: 1.1rem; }
.brand-name { color: var(--deep); font-weight: 700; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .94rem; transition: color .2s; }
.nav-links a:hover { color: var(--blue); }
.nav-cta { margin-left: .4rem; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--deep-2) 0%, var(--deep) 45%, #0d3a78 100%);
  color: #fff; text-align: center;
  padding: 6rem 1.4rem 5.5rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(30,136,229,.45), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(46,204,113,.18), transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 820px; margin: 0 auto; }
.live-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 500;
  margin-bottom: 1.6rem;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -1px; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--blue-l), #fff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: rgba(255,255,255,.82); font-size: clamp(1rem,2.2vw,1.22rem); margin: 1.3rem auto 2.2rem; max-width: 620px; }
.hero-cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.demo-note { margin-top: 1.8rem; font-size: .8rem; color: rgba(255,255,255,.5); }

/* live dot */
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(46,204,113,.7); animation: pulse 1.8s infinite; display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,204,113,.7); }
  70%  { box-shadow: 0 0 0 10px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

/* ===== Stats ===== */
.stats { max-width: 1240px; margin: -3rem auto 0; padding: 0 1.4rem; position: relative; z-index: 5; }
.stats-inner {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(4,1fr);
  padding: 1.8rem 1rem; border: 1px solid var(--line);
}
.stat { text-align: center; padding: .4rem 1rem; position: relative; }
.stat + .stat::before { content:''; position: absolute; left: 0; top: 18%; height: 64%; width: 1px; background: var(--line); }
.stat-value { font-family: 'Poppins',sans-serif; font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 800; color: var(--deep); transition: color .3s; }
.stat-green { color: var(--green-d); }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; margin-top: .2rem; }
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ===== Section heads ===== */
.section-head { max-width: 1240px; margin: 0 auto; padding: 3.5rem 1.4rem 1.5rem; }
.section-head h2 { font-size: clamp(1.6rem,3.5vw,2.3rem); color: var(--deep); }
.section-head p { color: var(--muted); margin-top: .4rem; }
.inline-live { display: inline-flex; align-items: center; gap: .35rem; color: var(--green-d); font-weight: 600; margin-left: .3rem; }

/* ===== Network grid ===== */
.network { padding-bottom: 2rem; }
.network-grid {
  max-width: 1240px; margin: 0 auto; padding: 0 1.4rem;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.4rem;
}
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
#leaflet-map { height: 620px; width: 100%; background: #dfe8f2; }
.map-legend {
  position: absolute; bottom: 14px; left: 14px; z-index: 500;
  background: rgba(255,255,255,.95); border-radius: 10px; padding: .55rem .8rem;
  display: flex; gap: .9rem; font-size: .8rem; font-weight: 500; box-shadow: var(--shadow); color: var(--ink);
}
.map-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .3rem; vertical-align: middle; }
.dot-available { background: var(--green); }
.dot-inuse { background: var(--amber); }
.dot-offline { background: var(--red); }

/* ===== List + filters ===== */
.list-wrap { display: flex; flex-direction: column; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.search, .select {
  font: inherit; padding: .6rem .85rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); outline: none;
}
.search { flex: 1 1 180px; min-width: 0; }
.search:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,136,229,.15); }
.status-tabs { display: flex; gap: .3rem; flex: 1 1 100%; }
.tab {
  flex: 1; font: inherit; font-size: .85rem; font-weight: 600;
  padding: .5rem .4rem; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; cursor: pointer; color: var(--muted); transition: all .15s;
}
.tab:hover { border-color: var(--blue-l); color: var(--blue); }
.tab.active { background: var(--deep); border-color: var(--deep); color: #fff; }

.station-list {
  display: flex; flex-direction: column; gap: .7rem;
  max-height: 560px; overflow-y: auto; padding-right: .3rem;
}
.station-list::-webkit-scrollbar { width: 8px; }
.station-list::-webkit-scrollbar-thumb { background: #cdd9e8; border-radius: 8px; }

.station-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .95rem 1.05rem; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
  border-left: 4px solid var(--line);
}
.station-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.station-card.s-available { border-left-color: var(--green); }
.station-card.s-in-use   { border-left-color: var(--amber); }
.station-card.s-offline  { border-left-color: var(--red); }
.station-card.changed { animation: cardflash .8s ease; }
@keyframes cardflash { 0% { background:#eaf4ff;} 100%{ background:#fff;} }

.sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.sc-name { font-weight: 700; color: var(--deep); font-size: 1rem; }
.sc-city { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.badge {
  font-size: .72rem; font-weight: 700; padding: .28rem .6rem; border-radius: 999px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: .3px;
}
.badge-available { background: #e6f9ef; color: var(--green-d); }
.badge-in-use   { background: #fef3e0; color: #b9750e; }
.badge-offline  { background: #fdeceb; color: #c0392b; }

.sc-ports { margin-top: .7rem; }
.ports-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.ports-label b { color: var(--ink); }
.bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.bar-available { background: linear-gradient(90deg, var(--green), #58d68d); }
.bar-in-use { background: var(--amber); }
.bar-offline { background: var(--red); }

.sc-meta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .65rem; font-size: .78rem; color: var(--muted); }
.sc-meta .chip { background: #f0f5fb; padding: .2rem .55rem; border-radius: 7px; color: var(--deep); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }

/* ===== Popup ===== */
.leaflet-popup-content { margin: .8rem 1rem; font-family: 'Inter',sans-serif; }
.pop-name { font-weight: 700; color: var(--deep); font-size: 1rem; font-family:'Poppins',sans-serif;}
.pop-addr { color: var(--muted); font-size: .82rem; margin: .15rem 0 .5rem; }
.pop-row { font-size: .82rem; margin: .15rem 0; }
.pop-row b { color: var(--ink); }
.pop-badge { display:inline-block; margin-top:.4rem; }

/* ===== How ===== */
.how { background: #fff; border-top: 1px solid var(--line); padding-bottom: 4rem; }
.how-grid { max-width: 1240px; margin: 0 auto; padding: 0 1.4rem; display: grid; grid-template-columns: repeat(4,1fr); gap: 1.2rem; }
.how-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 1.4rem; text-align: center; transition: transform .2s; }
.how-card:hover { transform: translateY(-4px); }
.how-icon { font-size: 2.2rem; }
.how-card h3 { color: var(--deep); margin: .8rem 0 .4rem; }
.how-card p { color: var(--muted); font-size: .9rem; }

/* ===== Footer ===== */
.footer { background: var(--deep-2); color: rgba(255,255,255,.8); padding: 3rem 1.4rem 1.2rem; }
.footer-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 2fr; gap: 2rem; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: rgba(255,255,255,.55); margin-top: .7rem; font-size: .9rem; max-width: 300px; }
.footer-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; }
.footer-cols h4 { color: #fff; font-size: .95rem; margin-bottom: .7rem; }
.footer-cols a, .footer-cols span { display: block; color: rgba(255,255,255,.6); font-size: .88rem; margin-bottom: .35rem; transition: color .2s; }
.footer-cols a:hover { color: var(--blue-l); }
.footer-bottom { max-width: 1240px; margin: 2rem auto 0; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; color: rgba(255,255,255,.45); text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .network-grid { grid-template-columns: 1fr; }
  #leaflet-map { height: 420px; }
  .stats-inner { grid-template-columns: repeat(2,1fr); gap: .8rem 0; }
  .stat:nth-child(3)::before, .stat:nth-child(odd)::before { display: none; }
  .how-grid { grid-template-columns: repeat(2,1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .hero { padding: 4rem 1.2rem 4.5rem; }
}
