/* Shared Building Detail Panel — extracted from SimCity */

/* ── Panel container ─────────────────────────────── */
.sp-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  z-index: 200;
  background: linear-gradient(180deg, rgba(30, 46, 82, 0.98), rgba(18, 28, 54, 0.98));
  border-left: 1px solid rgba(41, 182, 246, 0.35);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #c8cde0;
}
.sp-panel.panel-open { transform: translateX(0); }

/* ── Header ──────────────────────────────────────── */
.sp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(41, 182, 246, 0.25);
  flex-shrink: 0;
}
.sp-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #f3c54b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
}
.sp-panel-subtitle {
  font-size: 11px;
  color: #8a96b4;
  margin-top: 2px;
}
.sp-panel-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(243, 197, 75, 0.3);
  background: rgba(16, 24, 46, 0.6);
  color: #8a96b4;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-family: inherit;
}
.sp-panel-close:hover { border-color: #f3c54b; color: #f3c54b; background: rgba(243, 197, 75, 0.1); }

/* ── Scrollable body ─────────────────────────────── */
.sp-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}
.sp-panel-body::-webkit-scrollbar { width: 4px; }
.sp-panel-body::-webkit-scrollbar-track { background: transparent; }
.sp-panel-body::-webkit-scrollbar-thumb { background: rgba(243, 197, 75, 0.25); border-radius: 2px; }

/* ── Card sections ───────────────────────────────── */
.sp-section { margin-bottom: 16px; }
.sp-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f3c54b;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(243, 197, 75, 0.15);
}
.sp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.sp-meta-field { display: flex; flex-direction: column; }
.sp-meta-field.full-width { grid-column: 1 / -1; }
.sp-meta-label { font-size: 10px; text-transform: uppercase; color: #6b7a9e; letter-spacing: 0.3px; }
.sp-meta-value { font-size: 13px; font-weight: 600; color: #c8cde0; }

/* ── Signal cards (utility data) ─────────────────── */
.sp-signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sp-signal-card {
  background: rgba(10, 16, 32, 0.6);
  border: 1px solid #1e2d4d;
  border-radius: 6px;
  padding: 10px 12px;
}
.sp-signal-label { font-size: 10px; color: #6b7a9e; text-transform: uppercase; letter-spacing: 0.5px; }
.sp-signal-value { font-size: 1.5rem; font-weight: 700; color: #c8cde0; margin-top: 2px; }
.sp-signal-value .sp-unit { font-size: 0.7rem; color: #6b7a9e; font-weight: 400; }
.sp-signal-sub { font-size: 10px; color: #556; margin-top: 2px; }

/* ── Charts ──────────────────────────────────────── */
.sp-chart-wrap {
  margin-top: 10px;
  background: rgba(10, 16, 32, 0.4);
  border-radius: 6px;
  padding: 10px;
  border: 1px solid #1e2d4d;
  position: relative;
  height: 160px;
}
.sp-chart-title { font-size: 11px; color: #6b7a9e; margin-bottom: 6px; font-weight: 600; }

/* ── Commodity badges ────────────────────────────── */
.sp-commodities { display: flex; flex-wrap: wrap; gap: 4px; }
.sp-commodity {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; letter-spacing: 0.3px;
}
.sp-commodity.electricity { background: rgba(255, 213, 79, 0.15); color: #ffd54f; border: 1px solid rgba(255, 213, 79, 0.3); }
.sp-commodity.water { background: rgba(128, 203, 196, 0.15); color: #80cbc4; border: 1px solid rgba(128, 203, 196, 0.3); }
.sp-commodity.gas { background: rgba(165, 214, 167, 0.15); color: #a5d6a7; border: 1px solid rgba(165, 214, 167, 0.3); }
.sp-commodity.steam { background: rgba(255, 138, 101, 0.15); color: #ff8a65; border: 1px solid rgba(255, 138, 101, 0.3); }
.sp-commodity.chilled_water { background: rgba(79, 195, 247, 0.15); color: #4fc3f7; border: 1px solid rgba(79, 195, 247, 0.3); }
.sp-commodity.solar { background: rgba(255, 241, 118, 0.15); color: #fff176; border: 1px solid rgba(255, 241, 118, 0.3); }
.sp-commodity.hot_water { background: rgba(239, 154, 154, 0.15); color: #ef9a9a; border: 1px solid rgba(239, 154, 154, 0.3); }

/* ── Sensor coverage ─────────────────────────────── */
.sp-sensors { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-sensor {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #8a96b4;
}
.sp-sensor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #66bb6a; box-shadow: 0 0 4px rgba(102, 187, 106, 0.4);
}

/* ── LEED badge ──────────────────────────────────── */
.sp-leed {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.sp-leed.platinum { background: rgba(176, 190, 197, 0.2); color: #b0bec5; border: 1px solid #78909c; }
.sp-leed.gold { background: rgba(243, 197, 75, 0.2); color: #f3c54b; border: 1px solid #f3c54b; }
.sp-leed.silver { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; border: 1px solid #757575; }
.sp-leed.certified { background: rgba(102, 187, 106, 0.2); color: #66bb6a; border: 1px solid #4caf50; }

/* ── Utility-specific placeholder ────────────────── */
.sp-utility-section { margin-top: 12px; }

/* ── Footer link ─────────────────────────────────── */
.sp-footer-link {
  display: block; text-align: center; margin-top: 16px;
  color: #64b5f6; text-decoration: none; font-size: 12px;
}
.sp-footer-link:hover { color: #f3c54b; }
