html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #121212;
  color: #f0f0f0;
  font-family: "Segoe UI", sans-serif;
}

main {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-left: 60px;
  transition: margin-left 0.3s ease;
}

.sidebar.open ~ main {
  margin-left: 250px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 100%;
  background-color: #181818;
  color: white;
  transition: width 0.3s ease;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
}

.sidebar.open {
  width: 250px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background-color: #1e1e1e;
  border-bottom: 1px solid #333;
  margin-left: -3px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.sidebar.open .sidebar-header h2 {
  opacity: 1;
}

.btn-sidebar-toggle {
  background-color: #3a3a3a;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.btn-sidebar-toggle:hover {
  background-color: #555;
}

.sidebar nav {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.sidebar nav a,
.sidebar nav button {
  background: none;
  border: none;
  color: white;
  padding: 15px 20px;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar nav a span,
.sidebar nav button span {
  display: none;
  transition: opacity 0.3s ease;
}

.sidebar.open nav a span,
.sidebar.open nav button span {
  display: inline;
  opacity: 1;
}

.sidebar nav a:hover,
.sidebar nav button:hover {
  background-color: #333;
}

.filtros {
  background-color: #181818;
  margin: 16px;
  padding: 24px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.filtros label {
  font-weight: 500;
  margin-bottom: 6px;
  display: inline-block;
}

.filtro-linha {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-padrao {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border: 1px solid #444;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}

.input-padrao::placeholder {
  color: #aaa;
}

.choices {
  background-color: #1e1e1e !important;
  border: 1px solid #444 !important;
  color: #f0f0f0 !important;
  border-radius: 10px !important;
  width: 100% !important;
  box-sizing: border-box;
}

.choices__inner {
  padding: 14px 18px !important;
  font-size: 15px !important;
  background-color: #1e1e1e !important;
  border: none !important;
  color: #f0f0f0 !important;
  border-radius: 10px !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  background-color: #1e1e1e !important;
  border: 1px solid #444 !important;
  color: #f0f0f0 !important;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 10px !important;
}

.choices__input {
  background-color: #1e1e1e !important;
  color: #f0f0f0 !important;
}

.choices__item--selectable.is-highlighted {
  background-color: #333 !important;
}

.choices__button {
  color: #bbb !important;
}

.btn-clear {
  background-color: #3a3a3a;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  width: fit-content;
}

.btn-clear:hover {
  background-color: #555;
}

.btn-local {
  background-color: #2a7f62;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  width: fit-content;
}

.btn-local:hover {
  background-color: #239b80;
}

#contador {
  font-size: 16px;
  color: #bbb;
  font-weight: 500;
}

.toggle-filtros-wrapper {
  background-color: #181818;
  padding: 12px 0;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: center;
  z-index: 1001;
}

.btn-toggle-filtros {
  background-color: #3a3a3a;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn-toggle-filtros:hover {
  background-color: #555;
}

#map {
  width: 100%;
  flex-grow: 1;
}

body.filtros-fechados .filtros {
  display: none !important;
}

body:not(.filtros-fechados) .filtros {
  display: flex !important;
}

body.filtros-fechados #map {
  height: 100%;
}

body:not(.filtros-fechados) #map {
  height: auto !important;
}

@media (max-width: 768px) {
  .filtros {
    padding: 20px;
    margin: 10px;
  }

  .filtro-linha {
    flex-direction: column;
  }

  .btn-clear,
  .btn-local,
  .btn-sidebar-toggle {
    width: 100%;
  }
}

.leaflet-popup-content-wrapper {
  background-color: #1e1e1e !important;
  color: #f0f0f0 !important;
  border-radius: 16px !important;
  padding: 0 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6) !important;
  border: none !important;
}

.leaflet-popup-tip {
  background-color: #1e1e1e !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 16px 20px 12px 20px !important;
  width: 220px !important;
  font-size: 14px;
  line-height: 1.4;
}

.leaflet-popup-content h3 {
  margin-top: 0;
  font-size: 16px;
  font-weight: 600;
  color: #00bfff;
  word-break: break-word;
}

.leaflet-popup-content p {
  margin: 4px 0;
}

.leaflet-popup-content a {
  color: #00bfff;
  text-decoration: underline;
}

.popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.popup-buttons a,
.popup-buttons button {
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.popup-btn-ver {
  background-color: #444;
  color: white;
}

.popup-btn-rotas {
  background-color: #2a7f62;
  color: white;
}

.popup-btn-fav {
  background-color: #b02851;
  color: white;
}

.leaflet-routing-container {
  background-color: #1e1e1e !important;
  color: #f1f1f1 !important;
  border-left: 1px solid #333;
  font-family: "Segoe UI", sans-serif;
  max-width: 320px !important;
  width: 90%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 1003;
}

.leaflet-routing-container h2 {
  color: #f1f1f1 !important;
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.leaflet-routing-alt {
  border-top: 1px solid #333;
  padding: 10px;
  background-color: #222 !important;
  color: #f1f1f1 !important;
}

.leaflet-routing-alt:hover {
  background-color: #333 !important;
  color: #fff !important;
}

.leaflet-routing-alt .leaflet-routing-summary {
  color: #ccc !important;
}

.leaflet-routing-alt .leaflet-routing-instructions {
  list-style: none;
  padding-left: 0;
}

.leaflet-routing-alt .leaflet-routing-instruction {
  border-bottom: 1px solid #333;
  padding: 6px 8px;
  transition: background-color 0.2s ease;
  color: #f1f1f1 !important;
}

.leaflet-routing-alt .leaflet-routing-instruction:hover {
  background-color: #444 !important;
  color: #fff !important;
  opacity: 1 !important;
}

.leaflet-routing-instruction:hover span,
.leaflet-routing-instruction:hover .leaflet-routing-icon {
  color: #fff !important;
  opacity: 1 !important;
}

.leaflet-routing-icon {
  filter: brightness(0.8) invert(0.8);
}
