/* RESET */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Noto Sans", sans-serif;
  background: #f9f9f9;
  overflow: hidden;
}

body {
  display: flex;
  height: 100vh;
  color: #333;
}

/* Sidebar (right side with slide animation) */
#sidebar {
  width: 260px; /* slightly narrower */
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  padding: 16px;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s ease-in-out;
}

#sidebar.hidden {
  transform: translateX(100%);
}

#sidebar h2 {
  font-family: "Manrope", sans-serif;
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 18px;
  color: #4caf50;
  text-align: end;
}

/* Controls Container */
.control-group {
  margin-bottom: 14px;
}

.control-group strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #444;
}

/* Labels and inputs */
label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
  font-size: 12px;
}

label input[type="checkbox"],
label input[type="radio"] {
  margin-right: 6px;
  cursor: pointer;
}

/* Nested sub-layers (child checkboxes) */
.sub-layer {
  margin-left: 18px;
  font-size: 11px;
  color: #555;
}

.sub-layer label {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  cursor: pointer;
}

.sub-layer input[type="checkbox"] {
  margin-right: 6px;
  cursor: pointer;
}

/* Disabled state when parent is unchecked */
.sub-layer input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dropdown */
select {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: inherit;
  background-color: #fff;
  transition: border-color 0.2s ease-in-out;
}
select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 4px #4caf50aa;
}

/* Scroll for sidebar if content overflows */
#sidebar::-webkit-scrollbar {
  width: 6px;
}
#sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Logout button fixed at bottom */
#logoutButton button {
  background: none;
  width: 100%;
  padding: 6px;
  text-align: left;
  background-color: transparent;
  color: #444;
  border: none;
  font-size: 12px;
  font-weight: 500;
  border-radius: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Manrope", sans-serif;
}

#logoutButton {
  display: none;
}

#logoutButton button:hover {
  color: #000;
  border-color: #bbb;
}

/* Map container fills rest */
#map {
  flex-grow: 1;
  height: 100vh;
}

/* Popup styling */
.popup {
  background: white;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 220px;
}

/* Hamburger button (top-right) */
#openSidebarBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #4caf50;
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  font-size: 22px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}
#openSidebarBtn.visible {
  display: flex;
}
#openSidebarBtn:hover {
  background-color: #388e3c;
}

/* Close button inside sidebar */
#closeSidebarBtn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #4caf50;
  border: none;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  z-index: 20;
}
#closeSidebarBtn:hover {
  background-color: #388e3c;
}

/* Popup (Login/Register) */
.popup_login {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.popup_login.hidden {
  display: none;
}

/* Card inside popup */
.container {
  position: relative;
  width: 420px;
  padding: 2rem;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Title */
.title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

/* Input groups */
.input-group {
  position: relative;
  margin-bottom: 1rem;
}
.input-group .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: #f39c12;
}
.input-group input {
  width: 100%;
  padding: 12px 42px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  outline: none;
  transition: border 0.3s;
}
.input-group input::placeholder {
  color: #888;
}
.input-group input:focus {
  border: 1px solid #4cafef;
}

/* Toggle password eye */
.toggle-password,
.reg-toggle-password,
.confirm-reg-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 22px;
  color: #555;
}

/* Login/Register button */
.btn-login {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  background: #00bcd4;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}
.btn-login:hover {
  background: #0097a7;
  transform: translateY(-2px);
}

/* Divider */
.divider {
  text-align: center;
  margin: 15px 0;
  font-weight: 500;
  color: #777;
  position: relative;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: #ddd;
  position: absolute;
  top: 50%;
  width: 40%;
}
.divider::before {
  left: 0;
}
.divider::after {
  right: 0;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: 0.3s;
}
.btn-google img {
  width: 20px;
}
.btn-google:hover {
  background: #f5f5f5;
}

/* Forgot password button */
.btn-forgot {
  margin-top: 1.5rem;
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 0 0 12px 12px;
  background: #f39c12;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}
.btn-forgot:hover {
  background: #e67e22;
}

/* Popup close button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #555;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}
.popup-close .material-icons {
  font-size: 22px;
}
.popup-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

/* Compact view + language controls */
#viewControl,
#languageControl {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

#viewControl strong,
#languageControl strong {
  flex: 0 0 100%;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 12px;
}

#layerControl strong {
  margin: 4px 0;
  font-size: 12px;
}

#viewControl label,
#languageControl label {
  margin-bottom: 0;
  font-size: 12px;
}
