@font-face {
  font-family:"Sans-Regular";
  src: url("https://rupabumi.com/font/GoogleSans-Regular.ttf");
}

@font-face {
  font-family: "Sans-Bold";
  src: url("https://rupabumi.com/font/GoogleSans-Bold.ttf");
}

*{
  box-sizing: border-box;
}

html,body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Sans-Regular', sans-serif;
  overflow-x: hidden;
}

#container {
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#topNav {
  width: 100%;
  height: 64px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

#topNavLogo {
  font-size: 26px;
  color: black;
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Sans-Bold', sans-serif;
  margin-left: 10px;
}

#map {
  width: 100%;
  height: calc(100vh - 64px) !important;
  flex-shrink: 0;
  position: relative;
}

@media(min-width:601px) {
  #container {
    height: 100%;
  }
  #map {
    width: 100%;
    height: 100%;
  }
}

.leaflet-control-attribution {
  display: none!important;
}

.leaflet-left {
  left: 10px !important;
  z-index: 993 !important;
}

#map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1500;
  display: none;
  pointer-events: none;
}

#map-loader.active {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}

#map-loader .loader-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #4988C4;
  border-radius: 50%;
  animation: loaderSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.user-data-panel {
  position: absolute;
  bottom: 10px;
  right: 20px;
  z-index: 1000;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-data-btn {
  cursor: pointer;
}

.user-data-dropdown {
  display: none;
  position: absolute;
  bottom: 42px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  padding: 12px;
  width: 220px;
}

.user-data-dropdown.open {
  display: block;
}

.user-data-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin: 0 auto;
  text-align: center;
}

.user-data-section-title:first-child {
  margin-top: 0;
}

.user-data-upload-btn {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  text-align: center;
  color: #555;
  margin-bottom: 6px;
}
.user-data-upload-btn:hover {
  border-color: #4988C4;
  color: #4988C4;
  background: #f0f6ff;
}

.draw-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.draw-btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  color: #333;
}

.draw-btn:hover {
  background: #f0f0f0;
}

.draw-btn.active {
  background: #e8f0fe;
  border-color: #4988C4;
  color: #4988C4;
}

.user-layer-list {
  margin-top: 6px;
}

.user-layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.user-layer-remove {
  cursor: pointer;
  color: #e63946;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
}

.ctx-menu {
  position: absolute;
  z-index: 2000;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  padding: 4px 0;
  min-width: 130px;
  font-size: 13px;
}
.ctx-menu-item {
  padding: 8px 14px;
  cursor: pointer;
  color: #333;
  white-space: nowrap;
}
.ctx-menu-item:hover {
  background: #f0f6ff;
  color: #4988C4;
}

.clearBoundaryBtn {
  display:none;
  position:absolute;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:1000;
  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(4px);
  padding:8px 14px;
  border-radius:20px;
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
  font-size:13px;
  color:#333;
  cursor:pointer;
  white-space:nowrap;
}

.basemap-control {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}
.basemap-btn {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 8px;
    box-shadow: rgba(0,0,0,0.12) 0px 1px 3px, rgba(0,0,0,0.24) 0px 1px 2px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.basemap-panel {
    display: none;
    position: absolute;
    top: 45px;
    right: 0px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    min-width: 180px;
    overflow: hidden;
}
.basemap-control:hover .basemap-panel {
    display: block;
}
.basemap-panel-title {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0;
}
.basemap-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 1.0s;
}
.basemap-item:hover { background: #f5f5f5; }
.basemap-item.active { background: #e8f0fe; }
.basemap-item img { width: 32px; height: 32px; border-radius: 4px; }
.basemap-item div { font-size: 13px; font-weight: 500; color: #333; }

.footerRB { position: absolute; z-index: 999; width: 90px; padding: 4px; bottom: 30px; left: 50%; transform: translateX(-50%); cursor: pointer; color: white; box-sizing: border-box; border-radius: 6px; outline: none; user-select: none; text-shadow: 2px 2px 4px black; font-size: 18px; font-family: 'Sans-Regular', sans-serif; }
.footerRB a { text-decoration: none; color: white !important; }

.info-box {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  padding: 8px 12px 12px;
  z-index: 1000;
  width: 400px;
}

.info-box-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -20px !important;
}

.info-box-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #e63946;
  font-weight: bold;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

.info-box-content {
  font-size: 14px;
  line-height: 1.4;
  margin-top: 4px;
  padding: 10px;
}

.toast-confirm {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,30,0.95);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 99999;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

.toast-confirm button {
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.toast-confirm .yes {
  background: #e63946;
  color: white;
}

.toast-confirm .no {
  background: #2563eb;
  color: white;
}

#pusatkanBtns {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pusatkanBtn {
  background-color: #f8f9fa;
  border: 1px solid #f8f9fa;
  border-radius: 4px;
  color: #3c4043;
  cursor: pointer;
  font-family: arial,sans-serif;
  font-size: 14px;
  height: 36px;
  line-height: 27px;
  min-width: 54px;
  padding: 0 16px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: pre;
}

.pusatkanBtn:hover {
  border-color: #dadce0;
  box-shadow: rgba(0, 0, 0, .1) 0 1px 1px;
  color: #202124;
}

.pusatkanBtn:focus {
  border-color: #4285f4;
  outline: none;
}

.feature-popup {
  font-family: inherit;
  min-width: 200px;
  max-width: 320px;
  max-height: 280px;
  overflow-y: auto;
}
.feature-popup table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.feature-popup tr:nth-child(even) {
  background: #f7f7f7;
}
.feature-popup td {
  padding: 5px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  word-break: break-word;
}
.feature-popup td:first-child {
  font-weight: 600;
  color: #555;
  width: 40%;
  white-space: nowrap;
}
.feature-popup td:last-child {
  color: #222;
}

.main-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 392px;
    height: calc(100vh - 128px) !important;
    background-color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    border-radius: 1.75rem;
    padding: 40px;
}

.main-panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -40px -40px 16px -40px;
  padding: 16px 20px;
  background: #4285f4;
  border-radius: 1.75rem 1.75rem 0 0;
}

.main-panel-title {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

.main-panel-minimize {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.main-panel-minimize:hover {
  background: rgba(255,255,255,0.4);
}


.main-panel.minimized {
  height: auto !important;
  padding-bottom: 0 !important;
}

.main-panel.minimized .main-panel-titlebar {
  margin-bottom: 0;
  border-radius: 1.75rem;
}

.main-panel.minimized .main-panel-body {
  display: none;
}

.detail-panel {
    position: absolute;
    bottom: 40px;
    right: 20px;
    z-index: 1000;
    width: 392px;
    height: calc((100vh - 128px)/2) !important;
    background-color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    border-radius: 1.75rem;
    padding: 40px;
}
