/* ===== TOOLBAR VERTICAL ESQUERDA ===== */
.toolbar {
  position: fixed;
  left: 0;
  top: 0;
  width: 40px;
  height: 100vh;
  background: #0F1823;
  border-right: 1px solid #2D3E52;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  z-index: 998;
  transition: width 0.3s ease;
}

.toolbar.expanded {
  width: 280px;
}

.leaflet-right {
  right: 7px;
}

.toolbar-header {
  margin-bottom: 20px;
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: #1A2A47;
  color: #4A9EFF;
}

.toolbar-btn.active {
  background: #4A9EFF;
  color: #0F1823;
}

.toolbar-tools {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  margin-bottom: auto;
}

/* ===== SEARCH BOX TOP-LEFT ===== */
.search-box {
  position: fixed;
  top: 15px;
  left: 90px;
  width: 265px;
  display: flex;
  z-index: 900;
  background: rgb(15 24 35 / 53%);
  padding: 4px 5px;
  border-radius: 6px;
  border: 1px solid #95a1af61;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  background: rgba(15, 24, 35, 0.95);
  border-color: #4A9EFF;
  box-shadow: 0 4px 16px rgba(74, 158, 255, 0.2);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #E8EAED;
  font-size: 13px;
  outline: none;
}

.search-box input::placeholder {
  color: #9CA3AF;
}

.search-box button {
  background: transparent;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
  padding: 0 8px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box button:hover {
  color: #4A9EFF;
}

/* ===== TOOLBAR DIREITA (COLAPSÁVEL) ===== */
.toolbar-right {
  position: fixed;
  right: 0;
  top: 0;
  width: 40px;
  height: 100vh;
  background: #0F1823;
  border-left: 1px solid #2D3E52;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 0;
  z-index: 997;
  transition: all 0.3s ease;
}

.toolbar-right-header {
  margin-bottom: 20px;
}

.toolbar-right-btn {
  width: 40px;
  height: 38px;
  border: none;
  background: #3b8fff;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  border-radius: 0px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-right-btn:hover {
  background: #1A2A47;
  color: #4A9EFF;
}

.toolbar-right-tools {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

/* ===== PAINEL DIREITO (CENAS) ===== */
.right-panel {
  position: fixed;
  right: 40px;
  top: 0;
  width: 260px;
  height: 100vh;
  background: #212b35;
  border-left: 1px solid #2D3E52;
  display: flex;
  flex-direction: column;
  z-index: 900;
  overflow: hidden;
  transition: right 0.3s ease, width 0.3s ease;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
}

.right-panel.collapsed {
  right: -380px;
  width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #2D3E52;
  gap: 10px;
  background: #3b8fff;
  height: 38px;
}

.panel-header h2 {
  font-size: 14px;
  color: #ffffff;
  margin: 0;
  flex: 1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-icon,
.collapse-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  padding: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.settings-icon:hover,
.collapse-btn:hover {
  color: #4A9EFF;
  background: #1A2A47;
}

.thumbnails-container {
  flex: 1;
  overflow-y: auto;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.thumb-hint {
  color: #9CA3AF;
  font-size: 12px;
  padding: 20px 10px;
  text-align: center;
}

.thumb-hint i {
  margin-right: 6px;
}

.thumbnail-item {
  background: #1A2A47;
  border: 1px solid #2D3E52;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumbnail-item:hover {
  border-color: #4A9EFF;
  background: #212F48;
  transform: translateY(-2px);
}

/* ===== PAINEL DE CONFIGURAÇÕES (MECANISMOS DE BUSCA) ===== */
.settings-panel {
  position: fixed;
  right: 300px;
  top: 0;
  width: 295px;
  height: 100vh;
  background: #212b35;
  border-left: 1px solid #2D3E52;
  z-index: 901;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
}

.settings-panel.hidden {
  right: -360px;
}

.settings-header {
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #2D3E52;
  background: #3b8fff;
}

.settings-header h2 {
  font-size: 14px;
  color: #f2f2f2;
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  color: #4A9EFF;
  background: #1A2A47;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

/* ===== PAINEL SENTINEL-1 RVI ===== */
#s1-change-panel {
  position: fixed;
  right: 40px;
  top: 0;
  height: 100vh;
  width: 295px;
  background: #212b35;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  z-index: 895;
  /* abaixo da toolbar-right (997), acima do mapa */
  display: flex;
  flex-direction: column;

  /* animação igual ao layers-panel */
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
  /* ESCONDIDO por padrão */
}

/* Quando NÃO estiver hidden, desliza para dentro da tela */
#s1-change-panel:not(.hidden) {
  transform: translateX(0);
}

/* ===== PAINEL FOCOS DE INCÊNDIO ===== */
#fire-panel {
  position: fixed;
  right: 40px;
  top: 0;
  height: 100vh;
  width: 295px;
  background: #212b35;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  z-index: 895;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
}

#fire-panel:not(.hidden) {
  transform: translateX(0);
}

/* ===== CONTROLES AVANÇADOS ===== */
.control-group {
  margin-bottom: 18px;
}

.control-group label {
  display: block;
  font-size: 13px;
  font-weight: 100;
  color: #9CA3AF;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.control-group select,
.control-group input[type="text"],
.control-group input[type="date"],
.control-group input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  background: #303539;
  border: 1px solid #0077ff;
  color: #E8EAED;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.control-group select:hover,
.control-group input:hover {
  border-color: #4A9EFF;
  background: #212F48;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: #4A9EFF;
  background: #212F48;
  box-shadow: 0 0 8px rgba(74, 158, 255, 0.2);
}

/* ===== SLIDER COM VALOR ===== */
.slider-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.slider-group input[type="range"] {
  flex: 1;
}

.slider-group .value-display {
  min-width: 50px;
  text-align: right;
  color: #9CA3AF;
  font-weight: 600;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #2D3E52;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4A9EFF;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4A9EFF;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #3B8FFF;
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.6);
  transform: scale(1.15);
}

/* ===== BOTÕES ===== */
.settings-panel.btn {
  width: 100%;
  padding: 10px 15px;
  margin: 8px 0;
  background: #4A9EFF;
  color: #0F1823;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  max-width: 320px;
}

.settings-panel.btn:hover {
  background: #327bcf;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
  transform: translateY(-2px);
  color: #0F1823;

}

.btn:active {
  transform: translateY(0);
}

.btn i {
  margin-right: 8px;
}

.btn.secondary {
  background: transparent;
  color: #4A9EFF;
  border: 1px solid #4A9EFF;
}

.btn.secondary:hover {
  background: #4A9EFF;
  color: #0F1823;
}

/* ===== PAINEL DE CAMADAS (DIREITA) ===== */
.layers-panel {
  height: 38px;
  position: fixed;
  right: 40px;
  /* ao lado do toolbar-right */
  top: 0;
  height: 100vh;
  width: 295px;
  background-color: #1F2937;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  z-index: 896;
  /* MENOR que a toolbar-right (997) e que o right-panel (900) */
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
  /* ESCONDIDO por padrão */
}

.layers-panel.collapsed {
  transform: translateX(100%);
  /* ESCONDIDO */
}

/* Quando NÃO tem collapsed, aparece */
.layers-panel:not(.collapsed) {
  transform: translateX(0);
  /* VISÍVEL */
}

.layer-item {
  padding: 6px 12px;
  border-bottom: 1px solid #2a2a2a;
}

.layers-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  height: 38px;
  gap: 10px;
  background: linear-gradient(135deg, #3B8FFF 0%, #2196F3 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #2196F3;
}

.layers-panel-title {
  margin: 0;
}

.layers-close-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
}

.layers-panel-content {
  flex: 1;
  overflow-y: auto;
  background-color: #1F2937;
}

/* Ajuste visual dos switches de camadas dentro do painel */
.layers-panel .form-check.form-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* em vez de space-between */
  gap: 15px;
  /* espaço entre o switch e o label */
  padding: 4px 20px;
  margin: 0;
}

/* Corrige o offset padrão do Bootstrap (margin-left negativo) */
.layers-panel .form-check.form-switch .form-check-input {
  margin-left: 0;
  margin-right: 0;
  /* deixa o label “colado” ao lado do switch */
}

/* Conteúdo da categoria dentro do painel de camadas */
.layers-panel .categoria-content {
  padding: 4px 0 4px 0;
}

/* Quando colapsada, a categoria fica escondida */
.layers-panel .categoria-content.collapsed {
  display: none;
}

.layers-panel .categoria-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
}

.layers-panel .categoria-titulo {
  color: #E5E7EB;
  font-size: 1.3rem;

}

.layers-panel .categoria-icone {
  margin-right: 8px;
  /* afastamento entre o ícone e o título */
  font-size: 1.2rem;
  color: #4689db;
}

.layers-panel .categoria-chevron {
  font-size: 0.9rem;
  color: #9CA3AF;
}

/* Tabela de atributos nos popups */
.leaflet-popup-content {
  min-width: 450px;
  max-width: 360px;
  /* aumenta um pouco a largura máxima do balão */
}

.popup-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 10px;
  table-layout: fixed;
  /* distribui as colunas proporcionalmente */
}

.popup-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  vertical-align: top;
}

.popup-table td:first-child {
  width: 35%;
  /* coluna dos nomes dos campos mais estreita */
  color: #000000;
  white-space: nowrap;
}

.popup-table td:last-child {
  width: 65%;
  white-space: normal;
  /* permite quebra de linha só no valor */
  word-break: break-word;
  /* quebra textos muito longos (códigos, URLs, etc.) */
}

/* ===== TELA DE ABERTURA / SPLASH ===== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: radial-gradient(circle at top, #1f2937 0%, #020617 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-card {
  background: rgba(15, 24, 35, 0.95);
  border: 1px solid #3B8FFF;
  border-radius: 10px;
  padding: 26px 32px;
  width: 420px;
  max-width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
}

.splash-logo {
  width: 100px;
  height: 100px;
  border-radius: 999px;
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 26px;
}

.splash-title {
  margin: 4px 0 6px 0;
  font-size: 20px;
  color: #E5E7EB;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.splash-subtitle {
  margin: 0 0 18px 0;
  font-size: 13px;
  color: #9CA3AF;
}

.splash-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.splash-footer {
  margin-top: 10px;
  font-size: 11px;
  color: #6B7280;
}

.splash-logo {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo-img {
  max-width: 500%;
  max-height: 800%;
  object-fit: contain;
}

.splash-title {
  margin: 4px 0 6px 0;
  font-size: 20px;
  color: #E5E7EB;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
  /* deixa Sentinela Sat em negrito */
}

/* ===== LOGIN FORM NA SPLASH ===== */
#login-area {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#login-area input[type="email"],
#login-area input[type="password"] {
  width: 90%;
  max-width: 320px;
  padding: 11px 14px;
  border: 1px solid #3B8FFF;
  border-radius: 7px;
  background: rgba(30, 40, 50, 0.98);
  color: #E5E7EB;
  font-size: 15px;
  outline: none;
  margin-bottom: 7px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

#login-area input[type="email"]::placeholder,
#login-area input[type="password"]::placeholder {
  color: #64748B;
  opacity: 1;
}

#btn-login {
  width: 90%;
  max-width: 320px;
  padding: 11px 0;
  background: #3B8FFF;
  color: #0F1823;
  font-weight: 700;
  border-radius: 7px;
  border: none;
  font-size: 16px;
  transition: background 0.2s;
  cursor: pointer;
  margin-bottom: 2px;
}

#btn-login:hover {
  background: #2564c9;
}

/* Estado de loading do botão de login */
#btn-login.loading {
  background: #2d5a8c;
  cursor: wait;
  pointer-events: none;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#btn-login.loading .login-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: login-spin 0.8s linear infinite;
}

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

#login-erro {
  width: 90%;
  max-width: 320px;
  text-align: center;
  margin-bottom: 0;
  color: #ff5252;
  padding: 4px 0;
  font-size: 13px;
  border-radius: 6px;
  background: rgba(45, 20, 25, 0.14);
}




/* ===== RODAPÉ COM COORDENADAS ===== */
.footer-info {
  position: fixed;
  bottom: 2px;
  left: 560px;
  display: flex;
  gap: 15px;
  background: rgba(15, 24, 35, 0.9);
  padding: 0px 7px;
  border-radius: 3px;
  border: 1px solid #2D3E52;
  font-size: 11px;
  color: #b7bec9;
  z-index: 900;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.footer-info span {
  font-family: 'Roboto', sans-serif;
}

/* ===== MAPA AJUSTADO ===== */
.map-container {
  position: fixed;
  top: 0;
  left: 40px;
  right: 60px;
  bottom: 0;
  height: 100vh;
  width: calc(100vw - 120px);
  transition: right 0.3s ease, width 0.3s ease;
  z-index: 1;
}

.map-container.expand {
  right: 60px;
  width: calc(100vw - 120px);
}

/* ===== SCROLLBAR CUSTOMIZADO ===== */
.settings-content::-webkit-scrollbar,
.thumbnails-container::-webkit-scrollbar {
  width: 8px;
}

.settings-content::-webkit-scrollbar-track,
.thumbnails-container::-webkit-scrollbar-track {
  background: #1A2A47;
}

.settings-content::-webkit-scrollbar-thumb,
.thumbnails-container::-webkit-scrollbar-thumb {
  background: #2D3E52;
  border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb:hover,
.thumbnails-container::-webkit-scrollbar-thumb:hover {
  background: #4A9EFF;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 1024px) {
  .search-box {
    left: 70px;
    width: 250px;
  }

  .settings-panel {
    width: 320px;
    right: 380px;
  }

  .right-panel {
    width: 340px;
  }

  .map-container {
    right: 60px;
    width: calc(100vw - 120px);
  }
}

@media (max-width: 768px) {

  /* ===== TOOLBAR ESQUERDA - MANTÉM NA LATERAL COM TOGGLE ===== */
  .toolbar {
    width: 44px;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }

  .toolbar.hidden-mobile {
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }

  .toolbar-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  /* ===== TOOLBAR DIREITA - MANTÉM NA LATERAL COM TOGGLE ===== */
  .toolbar-right {
    width: 44px;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }

  .toolbar-right.hidden-mobile {
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
  }

  .toolbar-right .toolbar-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  /* ===== SEARCH BOX - AJUSTE PARA MOBILE ===== */
  .search-box {
    left: 54px;
    right: 54px;
    width: auto;
    top: 10px;
  }

  /* ===== PAINÉIS - ENTRE AS TOOLBARS ===== */
  /* No mobile, painéis ocupam espaço entre as toolbars (44px cada lado) */
  /* Usando !important para sobrescrever estilos desktop */

  .right-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 950 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .right-panel.collapsed {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  /* Settings-panel sobrepõe o right-panel no mobile */
  .settings-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 970 !important;
    /* Maior que right-panel (950) para sobrepor */
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    transform: translateX(0) !important;
    /* Visível por padrão */
  }

  .settings-panel.hidden {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  .settings-panel:not(.hidden) {
    transform: translateX(0) !important;
    /* Garante visibilidade */
    pointer-events: auto !important;
  }

  .layers-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 949 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .layers-panel.collapsed {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  /* ===== PAINEL SENTINEL-1 RVI ===== */
  #s1-change-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 948 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  #s1-change-panel.hidden {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  /* ===== PAINEL MAPBIOMAS ===== */
  #mapbiomas-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 947 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  #mapbiomas-panel.hidden {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  /* ===== PAINEL IMPORT VECTOR ===== */
  #import-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 100% !important;
    z-index: 946 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  #import-panel.hidden {
    transform: translateX(calc(100vw + 44px)) !important;
    pointer-events: none !important;
  }

  /* ===== PAINEL ELEVATION PROFILE - BOTTOM HALF ===== */
  #elevation-profile-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 44px !important;
    right: 44px !important;
    width: calc(100% - 88px) !important;
    height: 50% !important;
    max-height: 50vh !important;
    z-index: 945 !important;
    border-radius: 12px 12px 0 0 !important;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  #elevation-profile-panel.hidden {
    transform: translateY(100%) !important;
    pointer-events: none !important;
  }

  /* ===== CONTEÚDO DOS PAINÉIS - AJUSTE DE LARGURA ===== */
  .settings-content,
  .layers-panel-content,
  .thumbnails-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  /* Ajuste de campos/inputs para não cortar */
  .control-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  .control-group select,
  .control-group input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mapa ocupa toda a tela - toolbars ficam por cima */
  .map-container {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  /* ===== BOTÕES DE TOGGLE DAS TOOLBARS ===== */
  .toolbar-toggle-btn {
    position: fixed;
    width: 28px;
    height: 48px;
    background: rgba(15, 24, 35, 0.95);
    border: 1px solid #2D3E52;
    color: #9CA3AF;
    cursor: pointer;
    z-index: 1001;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
  }

  .toolbar-toggle-btn:hover {
    background: #1A2A47;
    color: #4A9EFF;
  }

  .toolbar-toggle-left {
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 6px 6px 0;
  }

  .toolbar-toggle-left.toolbar-hidden {
    left: 0;
  }

  .toolbar-toggle-right {
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 6px 0 0 6px;
  }

  .toolbar-toggle-right.toolbar-hidden {
    right: 0;
  }

  /* ===== OUTROS AJUSTES MOBILE ===== */
  .layers-toggle {
    right: 54px;
    bottom: 20px;
  }

  .splash-card {
    width: calc(100% - 30px);
    padding: 20px;
  }

  .leaflet-popup-content {
    min-width: 200px;
    max-width: 280px;
  }
}

/* Esconder botões de toggle em desktop */
@media (min-width: 769px) {
  .toolbar-toggle-btn {
    display: none !important;
  }
}

.layers-panel .form-check.form-switch .form-check-label {
  font-size: 1rem;
  color: #7c828b;
}

.layers-panel .form-check-input:checked+.form-check-label {
  color: #caced2 !important;
}

.splash-btn {
  background: #11ad51;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.splash-btn:hover {
  background: #109347;
  margin-top: 4px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

/* ===== MEASUREMENT OPTIONS - PADRÃO DO PROJETO ===== */

#measurementOptions {
  position: fixed !important;
  top: 256px !important;
  left: 47px !important;
  background: #212b35 !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4) !important;
  padding: 6px !important;
  z-index: 10000 !important;
  min-width: 280px !important;
  border: 1px solid #2D3E52 !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  backdrop-filter: blur(10px) !important;
  margin-top: auto;
  margin-bottom: auto;
}

#measurementOptions>div:first-child {
  margin-bottom: 12px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #E8EAED !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#measurementOptions>div:first-child i {
  color: #3b8fff !important;
}

#measureAreaBtn,
#measureDistanceBtn {
  width: 100% !important;
  padding: 8px 8px !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: all 0.2s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: auto;
  margin-bottom: auto;
}

#measureAreaBtn {
  background: #3b8fff !important;
  color: #0F1823 !important;
}

#measureAreaBtn:hover {
  background: #327bcf !important;
  box-shadow: 0 4px 12px rgba(59, 143, 255, 0.3) !important;
  transform: translateY(-2px) !important;
}

#measureDistanceBtn {
  background: transparent !important;
  color: #3b8fff !important;
  border: 1px solid #3b8fff !important;
}

#measureDistanceBtn:hover {
  background: #3b8fff !important;
  color: #0F1823 !important;
  box-shadow: 0 4px 12px rgba(59, 143, 255, 0.3) !important;
}

#measurementOptions>div:last-child {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid #2D3E52 !important;
  font-size: 12px !important;
  color: #9CA3AF !important;
}

.split-view {
  display: flex;
  height: 100%;
  gap: 0;
}

.split-map {
  flex: 1;
  position: relative;
}

.split-divider {
  width: 4px;
  background: rgba(0, 0, 0, 0.1);
  cursor: col-resize;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-divider:hover {
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* ===== COMPARE TABS STYLING ===== */

.compare-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}

.compare-tab-btn {
  padding: 6px 12px;
  background: transparent;
  border: 2px solid transparent;
  color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Estado padrão (não selecionado) */
.compare-tab-btn:hover {
  background: rgba(74, 158, 255, 0.2);
  border-bottom: 2px solid #4A9EFF;
}

/* Estado ativo (selecionado) */
.compare-tab-btn.active {
  background: #ffffff;
  color: #3b8fff;
  border: 2px solid #0d6efd;
  font-weight: 700;
}

.compare-tab-btn.active:hover {
  background: #f0f0f0;
  border: 2px solid #0d6efd;
}

/* ===== COMPARE SLIDER STYLES (COM DOIS DIVS SEPARADOS) ===== */
/* Substituir o CSS anterior completamente */

.compare-slider-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  overflow: hidden;
}

.compare-slider-container.hidden {
  display: none !important;
}

/* Mapa BOTTOM (fundo - sem clipping) */
#map-bottom-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#map-bottom-layer .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* Mapa TOP (sobreposto - COM CLIPPING) */
#map-top-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  overflow: hidden;
}

#map-top-layer .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* Divider Arrastável */
.compare-slider-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  cursor: col-resize;
  z-index: 100;
  transform: translateX(-50%);
  transition: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.compare-slider-divider:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 15px rgba(74, 158, 255, 0.8);
}

.slider-handle {
  width: 40px;
  height: 40px;
  background: rgba(74, 158, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.compare-slider-divider:hover .slider-handle {
  background: rgb(74, 158, 255);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.5);
}

/* Labels de Identificação - REMOVIDO */
.compare-label {
  position: absolute;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 50;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.top-label {
  display: none;
  /* Esconder a classe antiga */
}

.bottom-label {
  display: none;
  /* Esconder a classe antiga */
}

/* Ajuste para o right-panel aparecer acima */
#right-panel {
  z-index: 970 !important;
}

/* ===== COMPARE MODE LABELS ===== */
#top-image-label {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1002;
  pointer-events: none;
}

#bottom-image-label {
  position: absolute;
  bottom: 20px;
  right: 80px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1002;
  pointer-events: none;
}

/* ===== OVERRIDE COMPARE LABELS - VERSÃO CORRIGIDA ===== */

/* Remover TUDO dos DIVs das classes que conflitam */
.compare-label.top-label,
.compare-label.bottom-label {
  all: unset !important;
  /* ← REMOVER TODOS os estilos herdados */
  display: none !important;
  /* ← Esconder completamente */
}

/* TOP LABEL - LADO ESQUERDO */
#top-image-label {
  position: absolute !important;
  bottom: 80px !important;
  /* ← Mais para cima (fora da toolbar) */
  left: 80px !important;
  /* ← Mais para dentro */
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  z-index: 1002 !important;
  pointer-events: none !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  margin: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* BOTTOM LABEL - LADO DIREITO */
#bottom-image-label {
  position: absolute !important;
  bottom: 80px !important;
  /* ← Mais para cima (fora da toolbar) */
  right: 80px !important;
  /* ← Mais para dentro */
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  z-index: 1002 !important;
  pointer-events: none !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  margin: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ===== PAINEL MAPBIOMAS ALERTA ===== */
#mapbiomas-panel {
  position: fixed;
  right: 40px;
  top: 0;
  height: 100vh;
  width: 295px;
  background: #212b35;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  z-index: 894;
  /* abaixo do S1 (895), acima do mapa */
  display: flex;
  flex-direction: column;

  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
  /* escondido por padrão */
}

#mapbiomas-panel.hidden {
  transform: translateX(100%);
}

#mapbiomas-panel:not(.hidden) {
  transform: translateX(0);

  #mapbiomas-panel .mb-panel-body {
    padding: 12px;
  }

  /* datas lado a lado */
  #mapbiomas-panel .mb-dates-row {
    display: flex;
    gap: 8px;
  }

  #mapbiomas-panel .mb-date-field {
    flex: 1;
  }

  /* linha de botões */
  #mapbiomas-panel .mb-buttons-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
  }

  #mapbiomas-panel .mb-buttons-row .btn {
    flex: 1;
  }

  /* ícones nos labels */
  #mapbiomas-panel label i {
    margin-right: 4px;
    color: #4A9EFF;
  }
}

.mb-popup {
  max-width: 520px;
  /* controla a largura interna dentro do popup */
}

/* Quando estiver na aba Imagens (classe adicionada via JS) */
.mb-popup.mb-popup-large {
  max-width: 920px;
  /* bem mais largo para caber imagem grande */
}

.mb-popup-header {
  margin-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}

.mb-popup-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.mb-popup-title i {
  color: #EF4444;
  margin-right: 4px;
}

/* Abas */
.mb-popup-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 6px;
}

.mb-tab-btn {
  flex: 1;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.mb-tab-btn i {
  font-size: 11px;
}

.mb-tab-btn-active {
  background: #2563eb;
  color: #f9fafb;
  border-color: #2563eb;
}

.mb-tab-content {
  display: none;
}

.mb-tab-active {
  display: block;
}

/* Corpo de informações */
.mb-popup-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.mb-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.mb-popup-label {
  min-width: 135px;
  font-size: 11px;
  color: #4B5563;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mb-popup-label i {
  color: #4A9EFF;
  font-size: 11px;
}

.mb-popup-value {
  font-size: 12px;
  color: #111827;
  word-break: break-word;
}

.mb-popup-multiline {
  white-space: normal;
}

/* Aba de imagens */
.mb-images-placeholder,
.mb-images-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.mb-images-placeholder i,
.mb-images-error i {
  color: #4a9eff;
}

/* Grid de imagens: uma embaixo da outra */
.mb-images-grid {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.mb-image-card {
  flex: 1;
  min-width: 140px;
}

.mb-image-title {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Imagens grandes, centralizadas, sem estourar o popup */
.mb-image-card img {
  width: 100%;
  max-width: 880px;
  /* um pouco menor que 920 */
  max-height: 520px;
  /* aumenta a altura para ver mais detalhe */
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mb-image-meta {
  margin-top: 3px;
  font-size: 10px;
  color: #6b7280;
  display: flex;
  flex-direction: column;
}

.mb-popup-report {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
}

.mb-popup-report a {
  font-size: 11px;
  color: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mb-popup-report a:hover {
  text-decoration: underline;
}

.mb-popup-report i {
  font-size: 11px;
}

/* ===== PAINEL IMPORTAR VETOR ===== */
#import-panel {
  right: 40px;
  /* mesma posição horizontal do right-panel */
  width: 260px;
  /* opcional: alinhar largura com o right-panel */
}

/* Linha do arquivo no painel de importação */
.import-file-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Caixa de texto bem larga */
#importFileName {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: #303539;
  border: 1px solid #2D3E52;
  color: #E8EAED;
  border-radius: 4px;
  font-size: 13px;
}

/* Botão só com ícone, bem compacto */
#importBrowseBtn {
  padding: 6px;
  min-width: 28px;
  max-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#importBrowseBtn i {
  font-size: 14px;
}

/* Botão importar ativo (mesmo estilo dos outros botões .toolbar-btn.active) */
#toolbar-right .toolbar-btn.active {
  background: #4A9EFF;
  color: #0F1823;
}

/* Modal Perfil de Elevação */
.elevation-modal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 600px;
  max-width: 90vw;
  background: #1F2937;
  border: 1px solid #2D3E52;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.elevation-modal.hidden {
  display: none;
}

.elevation-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.elevation-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #2D3E52;
}

.elevation-modal-header h2 {
  margin: 0;
  font-size: 14px;
  color: #E8EAED;
}

.elevation-modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

/* PERFIL DE ELEVAÇÃO - CONTAINER DO GRÁFICO */
#elevation-chart-container {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ===== PAINEL ELEVAÇÃO INFERIOR FULLWIDTH ===== */
#elevation-profile-panel.elevation-panel-bottom {
  position: fixed;
  bottom: 0;
  left: 40px;
  /* toolbar esquerda = 40px */
  right: 40px;
  /* toolbar direita = 40px */
  width: calc(100% - 80px);
  /* 100% - 40px (esq) - 40px (dir) */
  height: 300px;
  background: #1a1e23;
  border-top: 2px solid #2D3E52;
  display: flex !important;
  flex-direction: column;
  z-index: 400;
  animation: slideUp 0.3s ease-out;
}

#elevation-profile-panel.elevation-panel-bottom.hidden {
  display: none !important;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.elevation-panel-header {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #2D3E52;
  background: #0F1823;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 6px;
  border: 1px solid #2D3E52;
  background: #303539;
  color: #E8EAED;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only:hover {
  background: #404549;
  border-color: #4A9EFF;
}

.btn-icon-only.active {
  background: #4A9EFF;
  color: #0F1823;
  border-color: #4A9EFF;
}

.elevation-chart-full {
  flex: 1;
  padding: 10px;
  overflow: auto;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
}

.elevation-chart-full #elevationChart {
  width: 100% !important;
  height: 100% !important;
}

/* ===== LAYERS PANEL FOOTER (BOTÃO ATUALIZAR) ===== */
.layers-panel-footer {
  padding: 12px;
  border-top: 1px solid #2d3748;
  background: #1a202c;
}

.btn-update-layers {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-update-layers:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-update-layers:active {
  transform: translateY(0);
}

/* ===== MODAL DE ATUALIZAÇÃO DE CAMADAS ===== */
.update-layers-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.update-layers-modal.hidden {
  display: none;
}

.update-layers-modal-content {
  background: #1f2937;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  width: 480px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.update-layers-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #374151;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 12px 12px 0 0;
}

.update-layers-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #ffffff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.update-layers-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.update-layers-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #374151;
  background: #1a202c;
  border-radius: 0 0 12px 12px;
}

.update-layers-modal-footer .btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.update-layers-modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.update-layers-modal-footer .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== PROGRESSO DO DOWNLOAD ===== */
.update-layers-progress {
  background: #111827;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.download-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9ca3af;
  font-size: 14px;
}

.download-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 600;
}

.download-summary.all-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.download-summary.has-errors {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.download-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
}

.download-item.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.download-item.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.download-item .layer-name {
  font-weight: 600;
  flex: 1;
}

.download-item .layer-info {
  color: #6b7280;
  font-size: 12px;
}

.download-item .layer-error {
  color: #f87171;
  font-size: 12px;
  flex: 1;
  text-align: right;
}

.download-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.update-layers-modal-body code {
  background: #374151;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #10b981;
}

/* ===== BOTÃO COM BARRA DE PROGRESSO ESTILO MERCADO LIVRE ===== */
.btn-progress-button {
  position: relative;
  width: 100%;
  padding: 14px 24px;
  background: #1f2937;
  border: 2px solid #10b981;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-progress-button:hover:not(:disabled) {
  border-color: #059669;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-progress-button:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

/* Barra de preenchimento (fundo do botão) */
.btn-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transition: width 0.5s ease-out;
  z-index: 1;
}

/* Conteúdo do botão (texto + ícone) */
.btn-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #10b981;
  transition: color 0.3s ease;
}

/* Quando está baixando, texto fica branco */
.btn-progress-button.downloading .btn-content {
  color: #ffffff;
}

/* Estado de sucesso */
.btn-progress-button.completed .btn-content {
  color: #ffffff;
}

/* Estado de erro */
.btn-progress-button.error .btn-content {
  color: #ffffff;
}

/* Animação do spinner */
.btn-content .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Animação de pulso para ícone de download */
@keyframes pulse {

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

  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Efeito shimmer durante download */
.btn-progress-button.downloading .btn-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 50%,
      transparent 100%);
  animation: shimmer 1.5s infinite;
}

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

  100% {
    transform: translateX(100%);
  }
}

/* ===== BOTÃO DE BUSCAR CENAS (VARIAÇÃO AZUL) ===== */
.btn-search-scenes {
  border-color: #3b82f6;
  padding: 8px 16px;
  /* Botão mais fino */
  font-size: 13px;
}

.btn-search-scenes .btn-content {
  color: #3b82f6;
}

.btn-search-scenes:hover:not(:disabled) {
  border-color: #2563eb;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
}

.btn-search-scenes:hover:not(:disabled) .btn-content {
  color: #60a5fa;
}

.btn-search-scenes .btn-progress-fill {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-search-scenes.downloading .btn-content,
.btn-search-scenes.completed .btn-content,
.btn-search-scenes.error .btn-content {
  color: #ffffff;
}

.btn-search-scenes.completed .btn-progress-fill {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-search-scenes.error .btn-progress-fill {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ===== POPUP DO INSPECTOR (COMPACTO) ===== */
/* Usa classe específica para não afetar outros popups */
.inspector-popup-wrapper .leaflet-popup-content-wrapper {
  padding: 4px 8px !important;
}

.inspector-popup-wrapper .leaflet-popup-content {
  margin: 6px 8px !important;
  width: auto !important;
  min-width: unset !important;
}

.inspector-popup-wrapper .leaflet-popup-content code {
  font-family: 'Consolas', 'Monaco', monospace;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #374151;
}

/* ===== PAINEL FLUTUANTE DE AJUSTES DE IMAGEM ===== */
.image-adjust-panel {
  position: fixed;
  top: 80px;
  left: 60px;
  width: 220px;
  background: rgba(15, 24, 35, 0.60);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 10px;
  z-index: 1000;
  font-family: 'Roboto', sans-serif;
  color: #E0E0E0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-adjust-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.image-adjust-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(74, 158, 255, 0.15);
  border-bottom: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: 13px;
}

.image-adjust-header i {
  color: #4A9EFF;
}

.image-adjust-header .close-btn-small {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.image-adjust-header .close-btn-small:hover {
  color: #FF4444;
  background: rgba(255, 68, 68, 0.1);
}

.image-adjust-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adjust-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adjust-slider-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 500;
}

.adjust-slider-group label i {
  color: #4A9EFF;
  font-size: 11px;
  width: 14px;
  text-align: center;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(74, 158, 255, 0.2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #4A9EFF;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
  transition: transform 0.1s ease;
}

.slider-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.slider-row input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.slider-row .value-display {
  min-width: 36px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #4A9EFF;
}

.reset-adjust-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 6px;
  color: #9CA3AF;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-adjust-btn:hover {
  background: rgba(74, 158, 255, 0.2);
  color: #4A9EFF;
  border-color: #4A9EFF;
}

.reset-adjust-btn i {
  font-size: 11px;
}

/* ===== BOTÃO DE DOWNLOAD NA THUMBNAIL ===== */
.download-geotiff-btn {
  position: relative;
  /* Necessário para o progress-fill absoluto */
  overflow: hidden;
  /* Garante que o fill não vaze */
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  color: #4A9EFF;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
  font-weight: 500;
}

.download-geotiff-btn .btn-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(74, 158, 255, 0.4);
  /* Cor do preenchimento */
  width: 0%;
  transition: width 0.1s linear;
  z-index: 0;
  /* Atrás do texto */
}

.download-geotiff-btn .btn-content {
  position: relative;
  z-index: 1;
  /* Na frente do fill */
  display: flex;
  align-items: center;
  gap: 6px;
}


.download-geotiff-btn:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: #4A9EFF;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.2);
}

.download-geotiff-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(1);
}

.download-geotiff-btn i {
  font-size: 11px;
}