/* ============================================= */
/*           Reset e Estilos Globais             */
/* ============================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'Roboto', sans-serif;
}

/* ============================================= */
/*               Layout Principal                */
/* ============================================= */
.container {
  display: flex;
  height: 100%;
  overflow: hidden;
  position: relative;
  flex-direction: row;
}

/* ============================================= */
/*                Sidebar (Menu)                 */
/* ============================================= */
.sidebar {
  width: 300px;
  background-color: #f1f1f1;
  padding: 20px;
  overflow-y: auto;
  transition: all 0.3s ease;
  text-align: left;
}

.sidebar.closed {
  width: 0;
  padding: 20px 0;
  overflow: hidden;
}

.sidebar ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 20px;
}

.sidebar ul li {
  margin-bottom: 15px;
}

.sidebar h2 strong {
  color: #636363;
  font-size: 1em;
  font-weight: bold;
}

/* ============================================= */
/*              Grupo Map Base                   */
/* ============================================= */
.map-base-group {
  margin-top: 30px;
}

.map-base-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-base-header h3 {
  margin-bottom: 0;
}

.map-base-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5em;
}

.map-base-options {
  margin-top: 10px;
}

.map-base-options div {
  margin-bottom: 10px;
}

.map-base-options.collapsed {
  display: none;
}

.diagonal-line.mapa-base {
  height: 3px;
  background: linear-gradient(45deg, #cfcfcf 20%, #bfc200 60%, #0e0e0e 20%);
  margin: 5px 0 10px;
}

/* ============================================= */
/*              Grupo Cadastro                   */
/* ============================================= */
.cadastro-group {
  margin-top: 30px;
}

.cadastro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cadastro-header h3 {
  margin-bottom: 0;
  font-size: 1.3em;
}

.cadastro-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5em;
}

.diagonal-line {
  height: 3px;
  background: linear-gradient(45deg, #E7700D 50%, #6F1A48 50%);
  margin: 5px 0 10px;
}

.cadastro-options {
  margin-top: 10px;
}

.cadastro-options div {
  margin-bottom: 10px;
}

.cadastro-options.collapsed {
  display: none;
}

/* ============================================= */
/*           Container Botões Fixos              */
/* ============================================= */
#containerBotoesFixos {
  position: absolute;
  top: 120px;
  left: 310px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  transition: left 0.3s ease;
}

#btnLimparSelecao:hover {
  background-color: #f8d7da;
  border-color: red;
  color: red;
}

.sidebar.closed ~ #containerBotoesFixos {
  left: 11px;
}

#containerBotoesFixosVertical {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  padding: 4px;
}

.botao-fixo {
  background: none;
  border: none;
  padding: 10px;
  font-size: 1em;
  cursor: pointer;
  color: #000;
  transition: background 0.2s;
  position: relative;
}

.botao-fixo:hover {
  background-color: #111310;
  color: #fff;
}

.botao-fixo i {
  pointer-events: none;
}

.botao-fixo:hover::after {
  content: attr(title);
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  background: #111310;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
  z-index: 99999;
  opacity: 1;
  pointer-events: none;
}

/* ============================================= */
/*                Área do Mapa                   */
/* ============================================= */
.map {
  flex: 1;
  background-color: #ddd;
  position: relative;
  text-align: center;
}

#map {
  width: 100%;
  height: 100%;
}

/* ============================================= */
/*              Controles de Busca               */
/* ============================================= */
.search-wrapper {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
  width: 90vw;
  max-width: 1400px;
}

.linha-busca {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

.search-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  flex: 1;
}

.search-control input,
.search-control select {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px;
  width: 100%;
}

.botao-busca {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 18px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #001E62;
  color: white;
  border: none;
  cursor: pointer;
}

fieldset {
  background: #fff;
  border: 1px solid #ccc;
  padding: 12px 16px;
  border-radius: 8px;
}

legend {
  font-weight: bold;
  font-size: 0.95em;
  padding: 0 6px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* ============================================= */
/*              Ocultação e Grupos               */
/* ============================================= */
.hidden {
  display: none;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-group input {
  flex: 1;
}

.search-inline .botao-busca {
  margin-top: 0;
  height: 100%;
}

/* ============================================= */
/*               Estilos Responsivos             */
/* ============================================= */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    width: 100%;
    height: auto;
    text-align: center;
    order: 0;
  }
  .sidebar.closed {
    height: 0;
  }
  .toggle-btn {
    order: 1;
    left: auto;
    right: 20px;
    top: 10px;
  }
  .search-wrapper {
    order: 2;
    position: relative;
    top: auto;
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 5px;
  }
  .search-control {
    width: 100%;
    justify-content: space-between;
  }
  .map {
    order: 3;
  }
  #searchQuadraLote {
    flex-direction: column;
    align-items: flex-start;
  }
  #searchQuadraLote label,
  #searchQuadraLote select,
  #searchQuadraLote button {
    width: 100%;
    margin-right: 0;
    margin-bottom: 5px;
  }
}

/* ============================================= */
/*                 Logo do Mapa                  */
/* ============================================= */
#mapLogo {
  position: fixed;
  bottom: 15px;
  right: 10px;
  width: 200px;
  height: 70px;
  z-index: 1000;
}

@media (max-width: 767px) {
  #mapLogo {
    display: none;
  }
}

/* ============================================= */
/*              Botão de Confirmação             */
/* ============================================= */
.confirm.btn.btn-lg.btn-danger {
  background-color: #dc3545;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
  cursor: pointer;
}

/* ============================================= */
/*                   Loader                      */
/* ============================================= */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* ============================================= */
/*              Modal Índice Cadastral           */
/* ============================================= */
.modal-indice {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-indice-content {
  background-color: #f2f2f2;
  margin: 10% auto;
  padding: 0;
  border: 1px solid #888;
  width: 50%;
  border-radius: 6px;
  overflow: hidden;
}

.modal-indice-header {
  background-color: #001e62;
  color: #f2f2f2;
  padding: 10px 20px;
}

.modal-indice-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-indice-close {
  float: right;
  font-size: 22px;
  font-weight: bold;
  color: #f2f2f2;
  cursor: pointer;
}

.modal-indice-close:hover {
  color: #ccc;
}

.modal-indice-body {
  padding: 20px;
  background-color: #f2f2f2;
}

/* ============================================= */
/*       Botão fixo para Liga/Desliga Menu       */
/* ============================================= */
.btnLigarDesligarMenu-btn-fixed {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background-color: #001E62;
  color: #fff;
  border: none;
  border-radius: 15px;
  padding: 10px 20px;
  font-weight: bold;
  font-size: 0.7em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btnLigarDesligarMenu-btn-fixed:hover {
  background-color: #00174f;
}

/* ============================================= */
/*               Controle de Zoom                */
/* ============================================= */
.zoom-control-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 4px;
  margin-top: 8px;
  font-family: sans-serif;
  font-size: 1em;
}

.zoom-control-custom button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  width: 100%;
}

.zoom-control-custom button:hover {
  background-color: #111310;
  color: #fff;
}

#nivelZoom {
  font-size: 14px;
  padding: 2px;
  margin: 2px 0;
}

.leaflet-control-zoom {
  display: none !important;
}
