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

/* =========================
   BASE
========================= */
html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background: #0f0f0f;
  color: #ffffff;
}

/* =========================
   MAP
========================= */
#map {
  height: 100vh;
  width: 100%;
}

/* =========================
   LINKS
========================= */
a {
  color: inherit;
  text-decoration: none;
}

/* =========================
   SCROLLBAR
========================= */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
  background: #62705C;
  border-radius: 10px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #62705C #0f0f0f;
}

/* =========================
   PWA PROMPT
========================= */
#pwaPrompt {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 360px;

  background: #2a3a2f;
  color: #fff;
  padding: 15px;
  border-radius: 14px;

  z-index: 9999;
  text-align: center;

  border: 1px solid #62705C;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.pwa-buttons {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#installBtn {
  padding: 10px 14px;
  background: #62705C;
  color: #0f0f0f;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

#closeBtn {
  padding: 10px 14px;
  background: transparent;
  color: white;
  border: 1px solid #555;
  border-radius: 10px;
  cursor: pointer;
}

/* =========================
   OFFLINE INDICATOR
========================= */
#offline-indicator {
  position: fixed;
  bottom: 10px;
  right: 10px;

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

  padding: 8px 12px;
  border-radius: 6px;

  font-weight: bold;

  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;

  z-index: 1000;
}

/* =========================
   FOOTER
========================= */
#footer {
  position: fixed;
  bottom: 10px;
  left: 0;

  width: 100%;
  text-align: center;

  font-size: 12px;
  padding: 6px 0;

  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.2);

  backdrop-filter: blur(4px);

  z-index: 999;
}

/* =========================
   LEAFLET CLEAN RESET
========================= */
.leaflet-control {
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================
   GPS + TRAIL STACK
========================= */

.gps-btn {
  position: fixed !important;
  top: 100px !important;
  left: 10px !important;

  width: 42px;
  height: 42px;

  background: rgba(98, 112, 92, 0.95);
  color: #ffffff;

  border-radius: 12px;

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

  font-size: 18px;
  line-height: 1;

  border: 1px solid rgba(164, 191, 156, 0.30);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);

  cursor: pointer;

  z-index: 1100;
}

/* hover */
.gps-btn:hover {
  background: rgba(42, 58, 47, 0.95);
}

/* click */
.gps-btn:active {
  transform: scale(0.94);
  transition: 0.1s;
}
.gps-btn {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#trailBtn {
  position: fixed !important;
  top: 154px !important;
  left: 10px !important;

  width: 42px;
  height: 42px;

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

  border-radius: 12px;

  background: rgba(98, 112, 92, 0.95);
  color: #fff;

  border: 1px solid rgba(164, 191, 156, 0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);

  z-index: 1100;

 
}
.gps-btn {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* click feel */
.gps-btn:active,
#trailBtn:active {
  transform: scale(0.95);
  transition: 0.1s;
}

/* =========================
   TRAIL PANEL
========================= */
#trailPanel {
  position: fixed;
  top: 0;
  right: -260px;

  width: 240px;
  height: 100%;

  background: rgba(98, 112, 92, 0.95);
  color: white;

  z-index: 999;

  transition: 0.3s ease;

  padding: 10px;

  box-shadow: -2px 0 10px rgba(0,0,0,0.4);

  overflow-y: auto;

  border-left: 1px solid rgba(164, 191, 156, 0.15);
}

#trailPanel.open {
  right: 0;
}

.trail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 10px;
}

#closeTrailPanel {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.trail-item {
  padding: 10px;
  margin-bottom: 6px;

  background: rgba(164, 191, 156, 0.08);
  border: 1px solid rgba(164, 191, 156, 0.08);

  border-radius: 8px;

  cursor: pointer;

  transition: 0.2s;
}

.trail-item:hover {
  background: rgba(164, 191, 156, 0.18);
}

.trail-item.active {
  background: rgba(164, 191, 156, 0.35);
}