:root {
  --bg-glass: rgba(15, 23, 42, 0.82);
  --bg-glass-card: rgba(30, 41, 59, 0.7);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(56, 189, 248, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #34d399;
  --shadow-main: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: #020617;
  color: var(--text-main);
}

/* Container do Cesium Viewer */
#cesiumContainer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Ocultar barra inferior, toolbar nativa, InfoBox e caixa de seleção do Cesium */
.cesium-viewer-bottom,
.cesium-infoBox,
.cesium-selection-wrapper,
.cesium-viewer-toolbar {
  display: none !important;
}

.cesium-button {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(12px) !important;
  border-radius: 12px !important;
  fill: var(--text-main) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Zona de Ativação Fixa no Topo (NUNCA se move, atinge os 16px superiores) */
.top-navbar-trigger {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 16px;
  z-index: 1002;
  pointer-events: auto;
}

/* Navbar Superior Retrátil (Full Width 100%, Preto Estreito, Auto-Hide por Hover) */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(-100%);
  z-index: 1000;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(56, 189, 248, 0.15);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  pointer-events: auto;
  user-select: none;
}

/* Quando o cursor passa na zona de ativação ou no próprio navbar ou ativa a classe expanded */
.top-navbar-trigger:hover+.top-navbar,
.top-navbar:hover,
.top-navbar.expanded {
  transform: translateY(0) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(56, 189, 248, 0.25);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  max-width: 100%;
}

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

.nav-brand-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

.nav-brand-icon svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.nav-brand-text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.nav-brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.nav-brand-subtitle {
  font-size: 9.5px;
  color: var(--accent-blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Camadas de Satélite & Mapeamento no Centro da Navbar (Sem Borda) */
.nav-center-layers {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
}

.nav-layer-btn {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-layer-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-layer-btn.active {
  color: var(--accent-blue);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.nav-layer-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

/* Grupo Direito da Navbar (Controlos de Vista Home/3D/2D e Relógio) */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-view-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-icon-btn {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-icon-btn.active {
  color: var(--accent-blue);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Relógio Digital em Tempo Real (Local & UTC) - Sem Borda */
.nav-clock-container {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: none;
  padding: 0;
}

.clock-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.clock-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.clock-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
  font-family: monospace;
}

.clock-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
}

/* Puxador visual minimalista na borda inferior do navbar */
.nav-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1px 0 2px 0;
  cursor: pointer;
}

.handle-bar {
  width: 40px;
  height: 3px;
  background: rgba(56, 189, 248, 0.5);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.top-navbar:hover .handle-bar {
  background: rgba(255, 255, 255, 0.4);
  width: 24px;
}

/* Painel Flutuante Principal */
.overlay-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: 380px;
  max-height: calc(100vh - 40px);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(129, 140, 248, 0.05) 100%);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.panel-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-body::-webkit-scrollbar {
  width: 5px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grelha de Camadas do Mapa Real */
.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.layer-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-card:hover,
.layer-card.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.layer-card .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.layer-card .sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Grelha de Cidades e Continentes Reais */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-blue);
}

.preset-card .name {
  font-size: 13px;
  font-weight: 600;
}

/* Inputs e Formulários */
.control-group {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-field {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: all 0.2s;
}

.input-field:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.coord-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-action:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-size: 13px;
  font-weight: 500;
}

#quakesControlLabel {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#quakesControlLabel:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.6);
}

/* Switch Custom */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-blue);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Telemetria de Posição Real */
.status-bar {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-muted);
  box-shadow: var(--shadow-main);
}

.status-item span {
  color: var(--accent-blue);
  font-weight: 600;
}

/* Crédito Discreto de Fontes no Rodapé (Canto Inferior Direito) */
.source-credit {
  position: absolute;
  bottom: 12px;
  right: 60px;
  z-index: 10;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-family);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.reopen-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 9;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-main);
}

/* Popup Flutuante de Dados Telemétricos & Notícias (Modal Fixo no Centro do Ecrã) */
.floating-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 320px;
  max-width: 90vw;
  background: rgba(10, 18, 38, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  padding: 16px 18px;
  display: none;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  animation: popupFadeCenter 0.25s ease-out;
}

@keyframes popupFadeCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.floating-popup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-right: 22px;
  padding-left: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  padding-bottom: 8px;
  text-align: center;
}

.status-dot {
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}

.floating-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  text-align: center;
  flex: 1;
}

.floating-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.floating-popup-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Grelha de Dados Gerais */
.popup-data-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.55);
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  gap: 6px;
}

.popup-data-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* Chip de info compacto (Info + Data) */
.popup-info-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.popup-info-chip {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Imagem e Resumo da Notícia no Popup (Centrados) */
.popup-news-image-wrapper {
  position: relative;
  width: 100%;
  height: 145px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(244, 63, 94, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-news-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0 auto;
  transition: transform 0.35s ease;
}

.popup-news-image-wrapper:hover img {
  transform: scale(1.06);
}

.popup-news-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 18, 38, 0.9) 0%, rgba(10, 18, 38, 0.15) 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 10px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.9;
  text-align: center;
  transition: opacity 0.2s ease;
}

.popup-news-image-wrapper:hover .popup-news-image-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(225, 29, 72, 0.9) 0%, rgba(10, 18, 38, 0.2) 70%);
}

.popup-news-summary {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}

/* Grelha 2×2 de Telemetria (Boias) */
.popup-telem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-top: 1px solid rgba(56, 189, 248, 0.15);
  padding-top: 7px;
}

.popup-telem-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(14, 165, 233, 0.07);
  border: 1px solid rgba(14, 165, 233, 0.13);
  border-radius: 7px;
  padding: 5px 4px;
  gap: 2px;
  text-align: center;
}

.popup-telem-cell.ptc-full {
  grid-column: span 2;
}

.ptc-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ptc-val {
  font-size: 12px;
  font-weight: 800;
  color: #e0f2fe;
  font-variant-numeric: tabular-nums;
}

.telemetry-loading {
  color: #facc15;
  font-size: 10px;
  font-weight: 400;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Legado — ocultar elementos obsoletos */
.floating-popup-info,
.popup-data-grid,
.popup-telemetry-grid {
  display: none !important;
}

/* Botões de Alternância ON/OFF de Categorias */
.btn-filter {
  border-radius: 10px;
  padding: 8px 4px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Estado OFF — cor da categoria escurecida */
.btn-filter.type-nuclear {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: rgba(252, 165, 165, 0.45);
}

.btn-filter.type-hydro {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: rgba(125, 211, 252, 0.45);
}

.btn-filter.type-wind {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: rgba(110, 231, 183, 0.45);
}

.btn-filter.type-solar {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: rgba(253, 224, 71, 0.45);
}

.btn-filter.type-thermal {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: rgba(216, 180, 254, 0.45);
}

.btn-filter.type-lines {
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.28);
  color: rgba(103, 232, 249, 0.45);
}

.btn-filter.type-fiber {
  background: rgba(217, 70, 239, 0.14);
  border: 1px solid rgba(217, 70, 239, 0.28);
  color: rgba(240, 171, 252, 0.45);
}

.btn-filter.type-buoys {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: rgba(56, 189, 248, 0.45);
}

.btn-filter.type-all {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.35);
}

.btn-filter:hover {
  filter: brightness(1.35);
  transform: translateY(-1px);
}

/* Estado ON — cor plena, iluminado */
.btn-filter.active {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-filter.type-nuclear.active {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.75);
  color: #fca5a5;
}

.btn-filter.type-hydro.active {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(14, 165, 233, 0.75);
  color: #7dd3fc;
}

.btn-filter.type-wind.active {
  background: rgba(52, 211, 153, 0.3);
  border-color: rgba(52, 211, 153, 0.75);
  color: #6ee7b7;
}

.btn-filter.type-solar.active {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.75);
  color: #fde047;
}

.btn-filter.type-thermal.active {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.75);
  color: #d8b4fe;
}

.btn-filter.type-lines.active {
  background: rgba(6, 182, 212, 0.3);
  border-color: rgba(6, 182, 212, 0.75);
  color: #67e8f9;
}

.btn-filter.type-fiber.active {
  background: rgba(217, 70, 239, 0.3);
  border-color: rgba(217, 70, 239, 0.75);
  color: #f0abfc;
}

.btn-filter.type-buoys.active {
  background: rgba(14, 165, 233, 0.35);
  border-color: rgba(14, 165, 233, 0.75);
  color: #38bdf8;
}

.btn-filter.type-all.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

/* Botões de Estações Orbitais */
.btn-orbital {
  border-radius: 10px;
  padding: 9px 6px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* OFF state */
.btn-orbital.type-iss {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: rgba(253, 230, 138, 0.5);
}

.btn-orbital.type-css {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: rgba(252, 165, 165, 0.5);
}

.btn-orbital.type-geo {
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(147, 51, 234, 0.3);
  color: rgba(216, 180, 254, 0.5);
}

.btn-orbital:hover {
  filter: brightness(1.4);
  transform: translateY(-1px);
}

/* ON state — luminoso com glow */
.btn-orbital.type-iss.active {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.8);
  color: #fde68a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-orbital.type-css.active {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.8);
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-orbital.type-geo.active {
  background: rgba(147, 51, 234, 0.28);
  border-color: rgba(147, 51, 234, 0.8);
  color: #d8b4fe;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Painel de Vídeo Ao Vivo (HDEV) */
.live-video-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 340px;
  height: 230px;
  background: rgba(10, 18, 38, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.live-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.5px;
}

.pulse-dot {
  animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(1.2);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.live-video-close {
  background: transparent;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.live-video-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.live-video-content {
  flex: 1;
  background: #000;
  width: 100%;
}

/* =========================================================================
   ESTILOS DO AUTOCOMPLETE E PESQUISA INTELIGENTE (SEM ÍCONES, GLASSMORPHISM)
   ========================================================================= */

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-spinner {
  position: absolute;
  right: 50px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: search-spin 0.6s linear infinite;
  display: none;
  pointer-events: none;
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(56, 189, 248, 0.2);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  display: none;
}

.search-dropdown.active {
  display: block;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-dropdown-header {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: rgba(56, 189, 248, 0.18);
  border-left: 3px solid var(--accent-blue);
  padding-left: 11px;
  color: #ffffff;
}

.suggestion-title {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
}

.suggestion-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clear-pins-btn {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 11px;
  font-family: var(--font-family);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.clear-pins-btn:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* Popup de Informação de Localização (Rua, Temperatura, Hora Local) */
.location-pin-popup {
  position: absolute;
  bottom: 60px;
  right: 20px;
  z-index: 1000;
  width: 310px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popupSlideUp 0.3s ease-out;
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.location-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}

.location-popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.location-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 20px;
}

.location-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-popup-address {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.location-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.location-popup-cell {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lpc-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.lpc-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
}

/* =========================================================================
   BARRA MARQUEE FLUTUANTE DE NOTÍCIAS EM DESTAQUE DO MOMENTO
   ========================================================================= */

#newsTickerBar {
  position: fixed;
  bottom: 14px;
  left: calc(50% + 60px);
  transform: translateX(-50%);
  width: calc(100% - 160px);
  max-width: 1150px;
  height: 38px;
  z-index: 1000;
  background: rgba(10, 18, 38, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(244, 63, 94, 0.2);
  pointer-events: auto;
}

.news-ticker-label {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
  z-index: 2;
  flex-shrink: 0;
}

#newsTickerViewport {
  overflow: hidden;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

#newsTickerContent {
  display: flex;
  align-items: center;
  gap: 36px;
  white-space: nowrap;
  will-change: transform;
  animation: marqueeScroll 90s linear infinite;
  padding-left: 20px;
}

#newsTickerContent:hover {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.news-ticker-item {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.news-ticker-item:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.news-flag {
  font-size: 14px;
}

.news-time-tag {
  color: var(--text-muted);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}