@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

/* Cursor de carregamento de camada WMS */
.map-is-loading,
.map-is-loading .leaflet-grab,
.map-is-loading .leaflet-interactive {
  cursor: progress !important;
}

*{
  margin: 0;
  padding: 0;
  list-style: none;
  text-decoration: none;
  box-sizing: border-box;
  font-family: "open sans", sans-serif;
}

body {
  background: #fff;
}

.link-button label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 110%;
}

.leaflet-touch .link-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  background: #fff;
  margin-bottom: 5px;
  padding: 5px;
}

.link-button:hover {
  background-color: #f4f4f4;
  fill: #a200ff;
}

.link-button:hover:after {
  position: absolute;
  display: flex;
  justify-content: end;
  content: attr(title);
  right: 40px;
  width: auto;
  white-space: nowrap;
  background: #fff;
  padding: 5px;
}

.geojson {
  display: none;
}

input[type="file"] {
  font-size: 0;
}
::file-selector-button {
  font-size: initial;
}

.icon-geojson {
  width: 25px;
  height: 25px;
}

.geojson-tool-window {
  min-width: 36px;
  background: rgba(240, 234, 217, 0.82);
  border: 1px solid rgba(178, 165, 134, 0.75);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(1px);
  overflow: hidden;
}

.geojson-tool-window-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(227, 216, 186, 0.76);
  border-bottom: 1px solid rgba(178, 165, 134, 0.7);
}

.geojson-tool-window-title {
  font-size: 15px;
  color: #3c3321;
  user-select: none;
  line-height: 1;
  display: flex;
  align-items: center;
}

.geojson-tool-window-toggle {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(178, 165, 134, 0.75);
  background: rgba(255, 250, 240, 0.88);
  color: #3c3321;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.geojson-tool-window-content {
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  zoom: 0.75;
}

.geojson-tool-window .leaflet-control {
  margin: 0;
  float: none;
}
.geojson-tool-window .leaflet-draw-toolbar {
  margin-top: 0;
}
.geojson-tool-window .leaflet-draw-actions {
  display: none !important;
}

.geojson-tool-window .leaflet-draw-section {
  margin: 0;
}

.geojson-tool-window .link-button i {
  font-size: 15px;
  color: #333;
  pointer-events: none;
}

.geojson-tool-window .link-button:hover i {
  color: #4a90c4;
}

.geojson-tool-window .link-button:hover:after {
  display: none;
}

.geojson-tool-window .legend-panel-toggle-active i {
  color: #00AFF0;
}

.geojson-tool-divider-line {
  height: 1px;
  background: rgba(178, 165, 134, 0.7);
  margin: 3px 4px;
}



.geojson-tool-window-minimized {
  min-width: 40px;
  max-width: 40px;
  min-height: 34px;
  height: 34px !important;
}

.geojson-tool-window-minimized .geojson-tool-window-content {
  display: none;
}

.geojson-tool-window-minimized .geojson-tool-window-header {
  border-bottom: 0;
  justify-content: center;
  padding: 4px 6px;
}

.legend-floating-window {
  min-width: 240px;
  width: max-content;
  max-width: min(580px, calc(100vw - 24px));
  background: rgba(240, 234, 217, 0.88);
  border: 1px solid rgba(178, 165, 134, 0.75);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(1px);
  overflow: hidden;
  transition: opacity 220ms ease, transform 220ms ease;
}

.legend-floating-window.legend-hidden {
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
}

.legend-floating-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(227, 216, 186, 0.76);
  border-bottom: 1px solid rgba(178, 165, 134, 0.7);
}

.legend-floating-window-title {
  color: #3c3321;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.legend-floating-window-toggle {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(178, 165, 134, 0.75);
  background: rgba(255, 250, 240, 0.88);
  color: #3c3321;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.legend-floating-window-content {
  max-height: min(44vh, 380px);
  overflow-y: auto;
  padding: 8px;
}

.legend-floating-window-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-floating-window-item {
  border: 1px solid rgba(178, 165, 134, 0.5);
  background: rgba(255, 250, 240, 0.7);
  border-radius: 4px;
  padding: 6px;
}

.legend-floating-window-item-grid {
  display: grid;
  grid-template-columns: max-content minmax(120px, 1fr);
  gap: 8px;
}

.legend-floating-window-column {
  min-width: 0;
  overflow-x: hidden;
}

.legend-floating-window-column-title {
  font-size: 11px;
  font-weight: 700;
  color: #5c4f33;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.legend-floating-window-description-column {
  border-left: 1px solid rgba(178, 165, 134, 0.4);
  padding-left: 8px;
}

.legend-floating-window-description-value {
  font-size: 12px;
  line-height: 1.4;
  color: #4d4029;
  word-break: break-word;
  display: flex;
  flex-direction: column;
}

.legend-floating-window-description-line {
  display: block;
  padding: 4px 0;
}

.legend-floating-window-description-line + .legend-floating-window-description-line {
  border-top: 1px dashed rgba(178, 165, 134, 0.55);
}

.legend-floating-window-item-title {
  font-size: 12px;
  color: #4d4029;
  line-height: 1.25;
  margin-bottom: 4px;
}

.legend-floating-window-item-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 320px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
}

.legend-floating-window-unavailable {
  display: block;
  font-size: 11px;
  color: #888;
  font-style: italic;
  padding: 4px 0;
}

.legend-feicao-container {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(178, 165, 134, 0.3);
}

.legend-feicao-label {
  display: block;
  font-size: 11px;
  color: #9a8a6a;
  font-style: italic;
  line-height: 1.3;
}

.legend-feicao-label.legend-feicao-active {
  font-style: normal;
  color: #3d3020;
  font-size: 12px;
}

/* ── EFEITO: destaque da feição na legenda ao clicar ──────────────────────
   Para desativar: remova este bloco inteiro.                               */
@keyframes feicao-highlight-flash {
  0%   { background-color: rgba(212, 167, 38, 0.38); }
  65%  { background-color: rgba(212, 167, 38, 0.18); }
  100% { background-color: rgba(212, 167, 38, 0.15); }
}
.legend-feicao-container.feicao-flash {
  animation: feicao-highlight-flash 0.85s ease-out forwards;
}
/* ── FIM DO EFEITO ─────────────────────────────────────────────────────── */

.legend-description-placeholder {
  font-style: italic;
  color: #9a8a6a;
}

.legend-floating-window-description-value.legend-description-active {
  font-style: normal;
  color: #3d3020;
}

@media (max-width: 640px) {
  .legend-floating-window-item-grid {
    grid-template-columns: 1fr;
  }

  .legend-floating-window-description-column {
    border-left: 0;
    border-top: 1px solid rgba(178, 165, 134, 0.4);
    padding-left: 0;
    padding-top: 6px;
  }
}

.legend-floating-window-empty {
  font-size: 12px;
  color: #5b4e34;
  margin: 0;
}

.legend-floating-window-minimized {
  min-width: 40px;
  max-width: 40px;
  min-height: 34px;
  height: 34px !important;
}

.legend-floating-window-minimized .legend-floating-window-content {
  display: none;
}

.legend-floating-window-minimized .legend-floating-window-title {
  display: none;
}

.legend-floating-window-minimized .legend-floating-window-header {
  border-bottom: none;
  justify-content: center;
  padding: 4px 6px;
}




/* ═══ BANNER DE 'EM HOMOLOGAÇÃO' ═══════════════════════════
   Para remover: Tem q deletar a <div class="banner-homologacao"> no base.html
   e este bloco inteiro abaixo até o próximo comentário de fim.
   ════════════════════════════════════════════════════════════════════ 
.banner-homologacao {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: #8b0000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 9999;
}*/

.banner-homologacao i {
  font-size: 14px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-homologacao ~ .wrapper .header        { top: 20px; }
.banner-homologacao ~ .wrapper .sidebar       { top: 90px; }
.banner-homologacao ~ .wrapper #map           { margin-top: 90px; height: calc(100vh - 90px); }
.banner-homologacao ~ .wrapper .main-container{ margin-top: 90px; height: calc(100vh - 90px); }
/* ═══ FIM BLOCO HOMOLOGAÇÃO ═══════════════════════════════════════════ */

.wrapper .header {
  z-index:1;
  background: #22242A;
  position: fixed;
  width: calc(100% - 0%);
  height: 70px;
  display: flex;
  top: 0;
}

.wrapper .header .header-menu {
  width: calc(100% - 0%);
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.wrapper .header .header-menu .title{
  color: #fff;
  font-size: 25px;
  text-transform: uppercase;
  font-weight: 900;
}
.wrapper .header .header-menu .title span{
  color: #009ee3;
}

.wrapper .header .header-menu .sidebar-btn{
  color:#fff;
  position: absolute;
  margin-left: 240px;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.3s;
  transition-property: color;
}

.wrapper .header .header-menu .sidebar-btn:hover{
  color: #009ee3;
}

.wrapper .header .header-menu ul{
  display: flex;
}

.wrapper .header .header-menu ul li a{
  background: #fff;
  color:#000;
  display: block;
  margin: 0 10px;
  font-size: 18px;
  width: 34px;
  height: 34px;
  line-height: 35px;
  text-align: center;
  border-radius: 50px;
  transition: 0.3s;
  transition-property: backround, color;
}

.wrapper .header .header-menu ul li a:hover{
  background: #009ee3;
  color:#fff;
}

.wrapper .sidebar{
  z-index:1;
  background: #2f323a;
  position: fixed;
  top: 70px;
  width: 250px;
  height: calc(100% - 0%);
  transition: 0.3s;
  transition-property: width;
  overflow-y: auto;
}

.wrapper .sidebar .sidebar-menu{
  overflow: hidden;
}

.wrapper .sidebar .sidebar-menu .profile img{
  margin:20px 0;
  width: 170px;
  height: 90px;
  /* border-radius: 50px; */
}

.wrapper .sidebar .sidebar-menu .profile p{
  color:#bbb;
  font-weight: 700;
  margin-bottom: 10px;
}

.wrapper .sidebar .sidebar-menu .item{
  width: 250px;
  overflow: hidden;
}

.wrapper .sidebar .sidebar-menu .item .menu-btn{
  display: block;
  color: #fff;
  position: relative;
  padding: 25px 20px;
  transition: 0.3s;
  transition-property: color;
}

.wrapper .sidebar .sidebar-menu .item .menu-btn:hover{
  color: #009ee3;
}

.wrapper .sidebar .sidebar-menu .item .menu-btn i{
  margin-right: 20px;
}

.wrapper .sidebar .sidebar-menu .item .menu-btn .drop-down{
  float:right;
  font-size: 12px;
  margin-top: 3px;
}

.wrapper .sidebar .sidebar-menu .item .sub-menu{
  background: #009ee3;
  overflow: hidden;
  max-height: 0;
  transition: 0.3s;
  transition-property: background, max-height;
}

.wrapper .sidebar .sidebar-menu .item .sub-menu a{
  display: block;
  position: relative;
  color: #fff;
  white-space: nowrap;
  font-size: 15px;
  padding: 20px;
  border-bottom: 1px solid #8fc5e9;
  transition: 0.3s;
  transition-property: background;
}

.wrapper .sidebar .sidebar-menu .item .sub-menu a:hover{
  background: #009ee3;
}

.wrapper .sidebar .sidebar-menu .item .sub-menu i{
  padding-right: 20px;
  font-size:10px;
}

.wrapper .sidebar .sidebar-menu .item:target .sub-menu{
  max-height: 500px;
}


.wrapper .main-container{
  width: calc(100% - 0px);
  margin-top: 70px;
  margin-left: 250px;
  padding: 15px;
  background: #e5e5e5;
  background-size: cover;
  height: calc(100vh - 70px);
  transition: 0.3s;
}

.wrapper #map{
  width: calc(100% - 0px);
  margin-top: 70px;
  background-size: cover;
  height: calc(100vh - 70px);
  transition: 0.3s;
}

.wrapper.collapse .sidebar .profile img,
.wrapper.collapse .sidebar .profile p,
.wrapper.collapse .sidebar a span{
  display: none;
}

.wrapper.collapse .sidebar .sidebar-menu .item .menu-btn{
  font-size: 23px;
}

.wrapper.collapse .sidebar .sidebar-menu .item .sub-menu i{
  font-size: 18px;
  padding-left: 3px;
}

.wrapper.collapse #map{
  width: auto;
  margin-left: 70px;
}

.wrapper.collapse .main-container{
  width: calc(100% - 0%);
  margin-left: 70px;
}

.wrapper .main-container .card{
  background: #fff;
  padding: 15px;
  font-size: 16px;
  margin-bottom: 10px;
}

.wrapper .main-container .card .contentBX{
  position: relative;
  margin: 10px 20px;
}


.wrapper .main-container .card{
  max-width: 700px;
}

.wrapper .main-container .card .contentBX .label{
  position: relative;
  padding: 10px;
  background: #009ee3;
  color: #fff;
  cursor: pointer;
}

.wrapper .main-container .card .contentBX .label::before{
  content: '+';
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  font-size: 1.5em;
}

.wrapper .main-container .card .contentBX.active .label::before{
  content: '-';
}

.wrapper .main-container .card .contentBX .content{
  position:relative;
  background: #fff;
  height: 0;
  overflow: hidden;
  transition: 0.5s;
  overflow-y: auto;
}

.wrapper .main-container .card .contentBX.active .content{
  height: auto;
  padding: 10px;
}

.wrapper .main-container .card .contentBX .content .minha-tabela{
  border-collapse: collapse;
  width: 100%;
}

.wrapper .main-container .card .contentBX .content .minha-tabela td{
  border: 1px #000 solid;
}

.wrapper .main-container .content_list{
  display: flex;
  justify-content: space-between;
}

.wrapper .main-container .content_list .links{
  display: flex;
  gap: 12px;
}



.dblclick-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(54, 54, 54, 0.82);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font: 12px/18px "Helvetica Neue", Arial, Helvetica, sans-serif;
  z-index: 1100;
  pointer-events: none;
  white-space: nowrap;
}

.basemap-select {
  display: block;
  width: 100%;
  padding: 3px 5px;
  margin-top: 3px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.floating-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 55%, rgba(140, 120, 80, 0.45) 55%);
  border-radius: 0 0 6px 0;
  z-index: 20;
  touch-action: none;
}
.floating-resize-handle:hover {
  background: linear-gradient(135deg, transparent 55%, rgba(100, 80, 40, 0.65) 55%);
}

/* Tarjas dos títulos de grupo no controle de camadas — hierarquia por profundidade */
.leaflet-layerstree-header:has(strong) {
  border-radius: 3px;
  margin: 3px 0 2px 0;
  padding: 2px 5px;
  background-color: #c8c8c8;
}

/* depth 1 — Base ZEE, Base Cartográfica */
.leaflet-layerstree-children .leaflet-layerstree-header:has(strong) {
  background-color: #c8c8c8;
}

/* depth 2 — Aptidão Agrícola, Biodiversidade, Clima… */
.leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-header:has(strong) {
  background-color: #d8d8d8;
}

/* depth 3 — Fauna, Ictiofauna, Por Área:, Por Zonas:… */
.leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-header:has(strong) {
  background-color: #e8e8e8;
}

/* depth 4 — Zona 1/2/3 subzonas, Por Espécie:… */
.leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-children .leaflet-layerstree-header:has(strong) {
  background-color: #f8f8f8;
}

/* ── Tooltip consolidado de clique (wms-click-tooltip) ───────────────────── */
.wms-click-tooltip {
  white-space: normal;
  max-width: 260px;
}
.wms-click-tooltip .leaflet-tooltip-content {
  padding: 4px 2px;
}
/* Headers hierárquicos */
.wms-gh {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  padding: 4px 0 0;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
.wms-gh1 { font-size: 10px; color: #333; padding-top: 0; }
.wms-gh2 { color: #666; }
.wms-gh3 { color: #888; font-size: 8.5px; }
.wms-gh-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 5px 0 3px;
}

.wms-click-row {
  display: flex;
  flex-direction: column;
  padding: 3px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  min-width: 140px;
  max-width: 240px;
}
.wms-click-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.wms-click-layer {
  font-size: 10px;
  color: #555;
  line-height: 1.2;
  margin-bottom: 1px;
}
.wms-click-value {
  font-size: 12px;
  font-weight: normal;
  color: #222;
  line-height: 1.3;
  word-break: break-word;
  white-space: pre-line;
}

/* ═══════════════════════════════════════════════════════════════
   Painel Flutuante de Download de Camada
   ═══════════════════════════════════════════════════════════════ */
.download-panel {
  display: none;
  position: absolute;
  z-index: 2100;
  width: 265px;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.20);
  font-family: inherit;
  font-size: 13px;
  overflow: hidden;
  touch-action: none;
}

.download-panel.download-panel-visible {
  display: block;
}

.download-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  background: #00AEEF;
  color: #fff;
  cursor: move;
  user-select: none;
}

.download-panel-header-title {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.download-panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  opacity: 0.80;
  flex: 0 0 auto;
}
.download-panel-close:hover { opacity: 1; }

.download-panel-body {
  padding: 10px 12px 10px;
}

.download-panel-layer-title {
  font-weight: 600;
  font-size: 12px;
  color: #222;
  margin-bottom: 10px;
  line-height: 1.35;
  word-break: break-word;
}

.download-panel-formats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.download-panel-formats-label {
  font-size: 12px;
  color: #555;
  flex: 0 0 auto;
}

.download-panel-format-opt {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  cursor: pointer;
}

.download-panel-format-opt input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.download-panel-format-opt label {
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.download-panel-btn-row {
  text-align: center;
  margin-bottom: 8px;
}

.download-panel-btn {
  background: #00AEEF;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.download-panel-btn:hover:not(:disabled) { background: #0097cc; }
.download-panel-btn:disabled {
  background: #80d6f7;
  cursor: not-allowed;
}

/* Barra de progresso */
.download-panel-progress-wrap {
  display: none;
  margin: 0 0 8px;
  height: 7px;
  background: #e4e4e4;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.download-panel-progress-wrap.download-panel-progress-visible {
  display: block;
}

.download-panel-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #00AEEF;
  border-radius: 4px;
  transition: width 0.25s ease;
}

/* Animação indeterminada: barra deslizante */
.download-panel-progress-indeterminate {
  width: 38% !important;
  transition: none !important;
  animation: dlProgressSlide 1.3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes dlProgressSlide {
  0%   { left: -38%; }
  100% { left: 100%; }
}

.download-panel-status {
  min-height: 18px;
  font-size: 12px;
  text-align: center;
  color: #666;
}

.download-panel-status-loading {
  color: #00AEEF;
}

.download-panel-status-success {
  color: #1e7a1e;
  font-weight: 600;
}

.download-panel-status-error {
  color: #c00;
}

/* Seção de checkboxes de layers (layerGroups) */
.download-panel-layers-section {
  display: none;
  margin-bottom: 10px;
}

.download-panel-layers-checks {
  margin-top: 4px;
}

.download-panel-layer-check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}

.download-panel-layer-check-input {
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  accent-color: #00AEEF;
}

.download-panel-layer-check-label {
  cursor: pointer;
  margin: 0;
  font-size: 12px;
  user-select: none;
}
