/* Base Reset & Core Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #090D16;
  color: #F8FAFC;
}
#map {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

/* Glassmorphism Control Panels */
.glass-panel {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.15);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* Header Brand Panel */
.brand-card {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 18px 22px;
  width: 340px;
}
.brand-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge-dot {
  width: 10px;
  height: 10px;
  background-color: #F59E0B;
  border-radius: 50%;
  box-shadow: 0 0 10px #F59E0B;
}
.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background-color: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-badge.offline {
  background-color: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.brand-sub {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Telemetry Data Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.telemetry-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: 6px;
}
.telemetry-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 2px;
}
.telemetry-val {
  font-size: 12px;
  font-weight: 700;
  color: #F59E0B;
}

/* Controls Panel (Top Right) */
.controls-card {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  width: 280px;
}
.panel-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.layer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-weight: 500;
}
.layer-toggle:last-child {
  border-bottom: none;
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #D97706;
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* Primary Action Buttons */
.btn-action-primary {
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #D97706;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-action-primary:hover {
  background-color: #B45309;
}

/* Map Error Log Toast */
#error-toast {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.95);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* MapLibre Controls Override */
.maplibregl-ctrl-group {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(226, 232, 240, 0.15) !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.maplibregl-ctrl-group button span {
  filter: invert(1);
}
