/* =========================
   Energy Dashboard - Base UI
   ========================= */

/* ---- Design tokens ---- */
:root{
  --bg: #0b1020;
  --panel: #0f1730;
  --panel-2: #101b3b;
  --text: #e8eefc;
  --muted: rgba(232,238,252,.72);
  --faint: rgba(232,238,252,.45);

  --border: rgba(255,255,255,.10);
  --border-2: rgba(255,255,255,.14);

  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius: 16px;

  --accent: #7aa2ff;
  --accent-2: #4cd7c6;
  --warn: #ffcc66;
  --bad: #ff6b6b;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --maxw: 1200px;
  --gap: 16px;
}
/* ===== Hero + pill nav (match teammate style) ===== */
:root{
  --bg0:#070b14;
  --bg1:#0b1020;
  --text:#e8eefc;
  --muted: rgba(232,238,252,.68);
  --border: rgba(255,255,255,.12);
  --pill: rgba(255,255,255,.06);
  --pill2: rgba(255,255,255,.08);
  --accent:#3b82f6; /* blue */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body{
  margin:0;
  color:var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 12% 15%, rgba(59,130,246,.22), transparent 55%),
    radial-gradient(800px 420px at 78% 5%, rgba(16,185,129,.14), transparent 55%),
    radial-gradient(1200px 700px at 50% -10%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
.site-header {
  width: 100%;
  padding: 28px 40px 24px 40px; /* left + right spacing */
  background: linear-gradient(135deg, #0b1020, #0f1c3d);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  position: relative;
  z-index: 10;
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
}


.hero{
  padding: 34px 28px 18px;
}

.hero__inner{
  max-width: 1180px;
  margin: 0 auto;
}

.hero__title{
  margin: 0;
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.hero__title .accent{
  color: var(--accent);
}

.hero__subtitle{
  margin: 14px 0 18px;
  font-size: 22px;
  color: var(--muted);
  max-width: 900px;
}

.pillnav{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  padding: 6px 0 0;
}

.pillnav__link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--pill);
  border: 1px solid var(--border);
  color: rgba(232,238,252,.78);
  text-decoration:none;
  font-size: 18px;
  font-weight: 650;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.pillnav__link:hover{
  background: var(--pill2);
  color: rgba(232,238,252,.92);
  border-color: rgba(255,255,255,.18);
}

.pillnav__link.is-active{
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.65);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59,130,246,.25) inset;
}

/* Optional: keep rest of page aligned under hero */
.page{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 48px;
}

/* ---- Reset / base ---- */
/* Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #0b1020, #0f1c3d);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e8eefc;
}

/* Main page container */
.wrap-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  background: linear-gradient(90deg, #ffffff, #9ecbff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

/* subtle glow */
.wrap-title::after {
  content: "Energy Dashboard";
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: blur(12px);
  opacity: 0.5;
}
.energy {
  color: white;
}

.dashboard {
  color: #60a5fa;
  font-weight: 800;
}


/* Section cards */
.section {
  background: #0f1730;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Headings */
h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

h2 {
  margin-top: 0;
  font-size: 22px;
}


a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

img,svg{ display:block; max-width:100%; }

::selection{ background: rgba(122,162,255,.35); }

/* ---- Layout ---- */
.container{
  width:min(var(--maxw), calc(100% - 40px));
  margin:0 auto;
}

.header{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11,16,32,.88), rgba(11,16,32,.55));
  border-bottom:1px solid var(--border);
}

.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--gap);
  padding:16px 0;
}

.brand{
  display:flex;
  align-items:baseline;
  gap:10px;
}

.brand__title{
  font-size:20px;
  font-weight:800;
  letter-spacing:.2px;
}
.brand-subtitle {
  margin-top: 6px;
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
}

.brand__tag{
  font-size:12px;
  color:var(--muted);
  font-family:var(--mono);
}

main{
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 40px 40px; /* aligns with header padding */
}

.grid{
  display:grid;
  gap:var(--gap);
}

.grid--2{
  grid-template-columns: 1.2fr .8fr;
}
@media (max-width: 980px){
  .grid--2{ grid-template-columns:1fr; }
}

/* ---- Cards / panels ---- */
.card{
  background: linear-gradient(180deg, rgba(16,27,59,.92), rgba(15,23,48,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.card__hd{
  padding:16px 16px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.card__title{
  margin:0;
  font-size:16px;
  font-weight:750;
}
.card__sub{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

.card__bd{
  padding:16px;
}

/* ---- Chart area ---- */
.chart-wrap{
  background: rgba(0,0,0,.10);
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
  padding:12px;
  overflow:hidden;
}
.chart{
  width:100%;
  height:auto;
  /* D3 will append SVG here */
}

/* ---- Controls ---- */
.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.control{
  display:flex;
  align-items:center;
  gap:8px;
}

.label{
  font-size:12px;
  color:var(--muted);
}

select, input[type="number"], input[type="text"]{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  min-width: 140px;
}
select:focus, input:focus{
  border-color: rgba(122,162,255,.55);
  box-shadow: 0 0 0 4px rgba(122,162,255,.12);
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(122,162,255,.14);
  color: var(--text);
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{
  background: rgba(122,162,255,.20);
  border-color: rgba(122,162,255,.35);
}
.btn:active{ transform: translateY(1px); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-family: var(--mono);
}

/* ---- Typography helpers ---- */
.h1{
  margin:0 0 10px;
  font-size:28px;
  font-weight:850;
  letter-spacing:.2px;
}
.p{
  margin:0;
  color:var(--muted);
}

/* ---- Table (if you show top-20 list beside chart) ---- */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
}
.table th, .table td{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.06);
  font-size:13px;
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:650;
  background: rgba(255,255,255,.04);
}
.table tr:last-child td{ border-bottom:none; }
.table td.num{ text-align:right; font-family:var(--mono); }

/* ---- D3 specific styling ---- */
svg{ overflow: visible; }

.axis path, .axis line{
  stroke: rgba(232,238,252,.25);
}
.axis text{
  fill: rgba(232,238,252,.72);
  font-size: 12px;
  font-family: var(--sans);
}

.gridline line{
  stroke: rgba(232,238,252,.10);
}

.tooltip{
  position: fixed;
  pointer-events: none;
  background: rgba(15,23,48,.95);
  border:1px solid rgba(255,255,255,.12);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.35;
  transform: translate(12px, 12px);
}
.tooltip .t-title{
  font-weight: 750;
  margin-bottom: 4px;
}
.tooltip .t-row{
  color: var(--muted);
  font-family: var(--mono);
}
nav {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: #cfd8ff;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.2s ease;
}

nav a:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

button {
  background: #2d4cff;
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s ease;
}

button:hover {
  background: #4c6bff;
}


.card {
  transition: 0.25s ease;
}

.card:hover {
  border-color: rgba(122,162,255,0.4);
}
