html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
}

@media (prefers-color-scheme: dark) {
  body {
    background: black;
  }
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   BlueLine MapInfoPopup — Ultra-Compact Vehicle Card
   ═══════════════════════════════════════════════════════════════ */

/* Override MapLibre's popup wrapper */
.bl-mapinfo-popup-wrapper {
  z-index: 5 !important;
}
.bl-mapinfo-popup-wrapper .maplibregl-popup-content {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Main popup container */
.bl-popup {
  width: 200px;
  background: linear-gradient(145deg, rgba(10, 20, 40, 0.95), rgba(15, 25, 45, 0.92));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: blPopupSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes blPopupSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.bl-popup-header {
  padding: 7px 9px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Row 1: Name (full width) */
.bl-popup-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.bl-popup-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: blDotPulse 2s ease-in-out infinite;
}

@keyframes blDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.bl-popup-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
  flex: 1;
}

/* Row 2: Status badge + action buttons */
.bl-popup-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bl-popup-status-badge {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.bl-popup-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bl-popup-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.35);
}

.bl-popup-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

.bl-nav-btn:hover {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
}

.bl-zoom-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.bl-close-btn:hover {
  background: rgba(255, 23, 68, 0.15);
  color: #FF1744;
}

/* Ghost warning */
.bl-popup-ghost-warn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(255, 145, 0, 0.1);
  border-bottom: 1px solid rgba(255, 145, 0, 0.15);
  font-size: 0.58rem;
  font-weight: 600;
  color: #FF9100;
}

/* Body */
.bl-popup-body {
  padding: 5px 9px 7px;
}

/* Key-value rows */
.bl-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5px 0;
}

.bl-popup-label {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
}

.bl-popup-val {
  font-size: 0.68rem;
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* Smart anchor tip */
.bl-mapinfo-popup-wrapper .maplibregl-popup-tip {
  border-top-color: rgba(10, 20, 40, 0.92) !important;
  border-bottom-color: rgba(10, 20, 40, 0.92) !important;
  border-left-color: rgba(10, 20, 40, 0.92) !important;
  border-right-color: rgba(10, 20, 40, 0.92) !important;
}
