/* ============================================================
   VIBRA H3 GEO ENGINE — CSS
   PR #45 · Hexagonal Urban Intelligence
   ============================================================ */

/* ── Panel ── */
#vibrah3-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #06040f;
  flex-direction: column;
  overflow: hidden;
}
#vibrah3-panel.vh3-open {
  display: flex;
}

/* ── Header ── */
.vh3-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem .7rem;
  border-bottom: 1px solid rgba(138,87,255,.2);
  background: rgba(9,6,18,.95);
  flex-shrink: 0;
}
.vh3-header-left {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.vh3-title {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: #e0d4ff;
  letter-spacing: -.01em;
}
.vh3-subtitle {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .58rem;
  color: rgba(138,87,255,.8);
  letter-spacing: .1em;
  margin-top: .1rem;
}
.vh3-live-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(0,214,255,.08);
  border: 1px solid rgba(0,214,255,.2);
  border-radius: 20px;
  padding: .2rem .6rem;
  font-family: var(--mono, monospace);
  font-size: .6rem;
  color: #00d4ff;
}
.vh3-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00d4ff;
  animation: vh3Pulse 1.4s ease-in-out infinite;
}
@keyframes vh3Pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}
.vh3-close {
  background: none;
  border: none;
  color: rgba(240,235,255,.5);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .3rem;
  line-height: 1;
}

/* ── Tab Bar ── */
.vh3-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(138,87,255,.15);
  background: rgba(9,6,18,.8);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.vh3-tabs::-webkit-scrollbar { display: none; }
.vh3-tab {
  flex: 1;
  min-width: 70px;
  padding: .7rem .5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(240,235,255,.4);
  font-family: var(--mono, monospace);
  font-size: .6rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.vh3-tab.active {
  color: #8a57ff;
  border-bottom-color: #8a57ff;
}

/* ── Content Area ── */
.vh3-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.vh3-view {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
}
.vh3-view.active { display: block; }

/* ── Hex Map Canvas ── */
#vh3-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#vh3-canvas:active { cursor: grabbing; }

/* ── Map Overlay ── */
.vh3-map-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 10;
  padding: .7rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.vh3-resolution-bar {
  display: flex;
  gap: .4rem;
  pointer-events: all;
}
.vh3-res-btn {
  background: rgba(9,6,18,.85);
  border: 1px solid rgba(138,87,255,.3);
  border-radius: 8px;
  padding: .3rem .65rem;
  color: rgba(240,235,255,.6);
  font-family: var(--mono, monospace);
  font-size: .6rem;
  cursor: pointer;
  transition: all .2s;
}
.vh3-res-btn.active {
  background: rgba(138,87,255,.2);
  border-color: #8a57ff;
  color: #8a57ff;
}
.vh3-stats-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.vh3-stat-chip {
  background: rgba(9,6,18,.85);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .25rem .55rem;
  font-family: var(--mono, monospace);
  font-size: .58rem;
  color: rgba(240,235,255,.7);
}
.vh3-stat-chip span {
  color: #8a57ff;
  font-weight: 600;
}

/* ── Hex Tooltip ── */
.vh3-tooltip {
  position: absolute;
  background: rgba(9,6,18,.96);
  border: 1px solid rgba(138,87,255,.4);
  border-radius: 10px;
  padding: .75rem 1rem;
  font-family: var(--mono, monospace);
  font-size: .65rem;
  color: #e0d4ff;
  pointer-events: none;
  z-index: 50;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  display: none;
}
.vh3-tooltip.visible { display: block; }
.vh3-tt-id {
  font-size: .55rem;
  color: #8a57ff;
  margin-bottom: .4rem;
  word-break: break-all;
}
.vh3-tt-name {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .35rem;
}
.vh3-tt-energy {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
}
.vh3-tt-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.vh3-tt-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.vh3-tt-meta {
  display: flex;
  gap: .6rem;
  font-size: .55rem;
  color: rgba(240,235,255,.5);
  margin-top: .3rem;
}

/* ── Zones View ── */
.vh3-zones-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.vh3-zone-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.vh3-zone-card:hover {
  background: rgba(138,87,255,.08);
  border-color: rgba(138,87,255,.3);
}
.vh3-zone-hex {
  width: 38px; height: 38px;
  position: relative;
  flex-shrink: 0;
}
.vh3-zone-hex svg {
  width: 100%; height: 100%;
}
.vh3-zone-info { flex: 1; min-width: 0; }
.vh3-zone-name {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .85rem;
  font-weight: 700;
  color: #e0d4ff;
  margin-bottom: .15rem;
}
.vh3-zone-id {
  font-family: var(--mono, monospace);
  font-size: .52rem;
  color: rgba(138,87,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vh3-zone-energy-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.vh3-zone-energy-val {
  font-family: var(--mono, monospace);
  font-size: .9rem;
  font-weight: 700;
}
.vh3-zone-status {
  font-family: var(--mono, monospace);
  font-size: .55rem;
  padding: .15rem .45rem;
  border-radius: 20px;
  border: 1px solid currentColor;
}

/* ── Intelligence View ── */
.vh3-intel-grid {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.vh3-intel-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.vh3-intel-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .8rem;
}
.vh3-intel-icon { font-size: 1.3rem; }
.vh3-intel-title {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .85rem;
  font-weight: 700;
  color: #e0d4ff;
}
.vh3-intel-desc {
  font-family: var(--mono, monospace);
  font-size: .62rem;
  color: rgba(240,235,255,.5);
  line-height: 1.6;
  margin-bottom: .8rem;
}
.vh3-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.vh3-metric-row:last-child { border-bottom: none; }
.vh3-metric-label {
  font-family: var(--mono, monospace);
  font-size: .62rem;
  color: rgba(240,235,255,.5);
}
.vh3-metric-val {
  font-family: var(--mono, monospace);
  font-size: .72rem;
  font-weight: 600;
  color: #8a57ff;
}

/* ── NERHIA Integration Badge ── */
.vh3-nerhia-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, rgba(138,87,255,.15), rgba(0,212,170,.1));
  border: 1px solid rgba(138,87,255,.3);
  border-radius: 8px;
  padding: .4rem .75rem;
  font-family: var(--mono, monospace);
  font-size: .62rem;
  color: #8a57ff;
  margin-top: .6rem;
}

/* ── Color Scales ── */
.vh3-legend {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(9,6,18,.9);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .6rem .75rem;
  pointer-events: none;
}
.vh3-legend-title {
  font-family: var(--mono, monospace);
  font-size: .55rem;
  color: rgba(240,235,255,.5);
  margin-bottom: .4rem;
  letter-spacing: .08em;
}
.vh3-legend-scale {
  display: flex;
  gap: 0;
  height: 6px;
  width: 120px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .3rem;
}
.vh3-legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono, monospace);
  font-size: .5rem;
  color: rgba(240,235,255,.4);
}

/* ── Loading state ── */
.vh3-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: .8rem;
  color: rgba(240,235,255,.4);
  font-family: var(--mono, monospace);
  font-size: .7rem;
}
.vh3-loading-hex {
  width: 40px; height: 40px;
  animation: vh3Spin 1.2s linear infinite;
}
@keyframes vh3Spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
