/* HTML: <div class="loader"></div> */
body {
  margin: 0;
  padding: 0;
  background-color: #eadede;
}

.loader {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10000;
  pointer-events: none;
  will-change: transform;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.map{
  position: absolute;
  top: 0;
  left: 0;
  height:100%;
  width: 100%;
}

.map-container {
  position: absolute;
  top: 0;
  min-width: 200px;
  min-height: 200px;
  left: 20%;
  width: 80%;
  height: 100%;
}

.map-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 999;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.map-toolbar-button {
  width: 45px;
  height: 45px;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
}

/* Sidebar + map layout */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20%;
  height: 100%;
  background: #ffffffee;
  box-shadow: 2px 0 8px rgba(0,0,0,0.12);
  z-index: 1500;
  padding: 12px;
  box-sizing: border-box;
  overflow: auto;
  transition: width 200ms ease, transform 200ms ease;
}

.sidebar .header {
  position: relative; 
  display:flex; 
  align-items:center; 
  gap:8px; 
  justify-content: center;
}

.sidebar .btn {
    appearance: none;
    border: 0;
    background: #969696;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display:flex; 
    align-items:center; 
    justify-content:center;
}

.sidebar #sidebar-content .btn-city {
    appearance: none;
    border: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    width: auto;
    height: auto;
    padding: 2px 12px;
    border-radius: 6px;
    cursor: pointer;
    display:flex; 
    margin: 5px;
    align-items:center; 
    justify-content:center;
    font-size: 18px;
    font-weight: bold ;
    display: grid;
    grid-template-columns: repeat(1,1fr);
    gap: 6px;
}

.btn-city .btn-district {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: grid;
  grid-template-columns: repeat(1,1fr);
}

.btn-district .area-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.btn-district .btn-area {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.btn-city .city-header {
  grid-column: 1 / -1;
  margin: 0 0 6px;
  text-align: center;
}

.btn-district .district-header {
  margin: 0;
  font-size: 16px;
  font-weight: normal;
  text-align: center;
}



/* when collapsed, hide sidebar and expand map */
body.sidebar-collapsed .sidebar { width: 0; padding: 0; transform: translateX(-100%); overflow: hidden; }

body.sidebar-collapsed .map { left: 0; width: 100%; }

#route0 {
    opacity: 10%;
}

/* Overlay canvas positioned inside the map container */
#overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}