/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BODY */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #0f0f14;
  color: #ffffff;
  text-align: center;

  display: flex;
  flex-direction: column;
  min-height: 100vh;

  transition: background 0.4s, color 0.4s;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 20px;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(8px);

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  z-index: 2000;
}

/* NAV TITLE */
.nav-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #fff;
}

/* NAV BUTTONS */
.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 4px;
}

.nav-actions button {
  width: 34px;
  height: 34px;

  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);

  background: transparent;
  color: #fff;

  font-size: 14px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.25s ease;
}

.nav-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-actions button:active {
  transform: scale(0.92);
}

/* MAP */
#map {
  flex: 1;
  width: 100%;
  margin-top: 60px; /* prevents overlap with navbar */
}

/* LEGEND POPUP */
.legend-popup {
  position: fixed;
  top: 70px;
  right: 20px;

  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);

  padding: 14px;
  border-radius: 12px;

  width: 170px;

  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;

  transition: all 0.25s ease;
  z-index: 2000;
}

.legend-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* LEGEND ITEMS */
.legend-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-red { background: #ff3b3b; }
.dot-yellow { background: #ffd84a; }
.dot-green { background: #3ad17a; }

/* POPUPS */
.leaflet-popup-content-wrapper {
  background: rgba(25, 25, 35, 0.95);
  color: #fff;
  border-radius: 10px;
}

.leaflet-popup-tip {
  background: rgba(25, 25, 35, 0.95);
}

/* TOOLTIP */
.icon-btn {
  position: relative;
}

.icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  right: 0;

  background: rgba(0, 0, 0, 0.85);
  color: #fff;

  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;

  opacity: 0;
  transition: 0.2s;
}

.icon-btn:hover::after {
  opacity: 1;
}

/* LIGHT MODE */
body.light {
  background: #f5f5f5;
  color: #111;
}

body.light .navbar {
  background: rgba(255, 255, 255, 0.9);
}

body.light .nav-title {
  color: #111;
}

body.light .nav-actions button {
  border: 1.5px solid rgba(0, 0, 0, 0.5);
  color: #111;
}

body.light .footer {
  background: #eee;
  color: #111;
}

body.light .legend-popup {
  background: #fff;
  color: #111;
}

/* MOBILE */
@media (max-width: 600px) {
  .navbar {
    padding: 10px 12px;
  }

  .nav-title {
    font-size: 16px;
  }

  .nav-actions button {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}