@import url("https://fonts.googleapis.com/css2?family=Lato&display=swap");

/* === MAPA BASE === */
#mapa-obras {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

#input-search {
  font-size: 2vh;
}

/* === SIDEBAR PADRÃO === */
.sidebar {
  display: block;
  position: absolute;
  width: 100%;
  max-width: 480px;
  z-index: 99999;
  background: #fff;
  overflow: hidden;
  height: 100%;
  transform: translateX(calc(-100% - 20px));
  box-shadow: 0px 0px 22px -11px rgba(66, 68, 90, 1);
}

.active-sidebar .sidebar {
  max-width: 560px;
  width: 100%;
  transform: translateX(0);
}

/* === SIDEBAR QUASE CHEIA (EXPANDIDA) === */
body.active-sidebar .sidebar {
  width: 95vw !important;
  max-width: none;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 2000;
  transition: all 0.3s ease;
}

/* === CONTEÚDO SCROLL === */
#scroll {
  height: calc(100vh - 150px);
  overflow-y: auto;
}

/* === ESCURECER MAPA === */
body.active-sidebar #mapa-obras {
  filter: brightness(0.5);
  transition: filter 0.3s ease;
}

/* === BOTÃO FECHAR === */
.close-button,
.sidebar .close-button {
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  padding: 0;
  border-radius: 3px;
  z-index: 2100;
  background: none;
}

.sidebar .close-button svg {
  fill: grey;
  width: 30px;
  height: 30px;
}

/* === CONTEÚDO === */
.sidebar-content {
  height: inherit;
  width: 100%;
  max-width: 100%;
}

.sidebar-content h5 {
  position: sticky;
  top: 0;
  color: #fff;
  background: #0d6efd;
  padding: 0.625rem 2.1875rem 0.625rem 0.9375rem;
  z-index: 10 !important;
}

.sidebar-content img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-content h6,
.sidebar-content p {
  padding-left: 0.9375rem;
  padding-right: 0.9375rem;
}

.sidebar-content small {
  display: block;
  padding: 0.312rem 0.9375rem;
}

/* === LAYOUT EM DUAS COLUNAS === */
.sidebar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  height: calc(100vh - 100px);
  padding: 0 1rem;
}

.sidebar-filtros {
  background: #f8f9fa;
  border-left: 2px solid #dee2e6;
  padding: 1rem;
  border-radius: 0.5rem;
}

.sidebar-filtros form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-filtros .input-group {
  width: 100%;
}

/* === AJUSTES VISUAIS === */
.sidebar .card {
  width: 100% !important;
  margin-bottom: 1rem;
}

.card-body {
  padding: 0.5rem 0.6rem;
}

.info-description {
  padding: 0.312rem 0.9375rem 0.9375rem;
  line-height: 150%;
}

.info-content {
  height: 100%;
  overflow: auto;
  padding-bottom: 3.125rem;
}

/* === MARCADORES === */
.leaflet-marker-icon {
  display: flex;
  justify-content: center !important;
  align-items: center;
  line-height: 1;
  color: black;
  font-size: 12px;
  box-shadow: 0px 0px 10px #ebe4e4;
  border-radius: 100%;
  border: 2px solid #fff;
  background: #0d6efda6;
}

.active-sidebar .leaflet-marker-icon,
.leaflet-marker-icon:hover {
  animation: border-pulse 1.5s infinite;
}

@keyframes border-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 1);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

/* === SCROLLBAR === */
.info-content::-webkit-scrollbar {
  width: 0.625rem;
}

.info-content::-webkit-scrollbar-track {
  box-shadow: inset 0 0 6px rgba(0, 81, 255, 0.3);
}

.info-content::-webkit-scrollbar-thumb {
  background-color: #003764;
  outline: 1px solid #002449;
}

/* === MENUBAR === */
.menubar {
  background-color: #fff;
  width: 33px;
  height: 33px;
  cursor: pointer;
  justify-content: center;
  font-size: 0.9rem;
}

/* === RESPONSIVIDADE === */
@media (max-width: 992px) {
  .sidebar-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding-bottom: 1rem;
  }

  .sidebar-filtros {
    border-left: none;
    border-top: 2px solid #dee2e6;
    margin-top: 1rem;
  }

  #scroll {
    height: auto;
    overflow: visible;
  }

  body.active-sidebar .sidebar {
    width: 100vw !important;
    height: auto;
  }
}

@media screen and (max-width: 400px) {
  #input-search {
    font-size: 1.5vh;
  }

  .sidebar-content {
    font-size: 2.5vw;
  }

  .sidebar-content h5,
  .accordion-button b {
    font-size: 2vh;
  }

  .active-sidebar .leaflet-left {
    transform: translateX(155px);
    transition: transform 100ms;
  }
}
