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

html, body {
  height: 100%;
  width: 100%;
  font-family: Arial, sans-serif;
  background: #0f0f0f;
  color: #fff;
  overflow: hidden;
}

/* =========================
   MAP (CRITICAL)
========================= */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 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;
}

/* =========================
   MAP CONTROLS STACK
========================= */
.map-controls {
  position: fixed;
  left: 10px;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
}

/* =========================
   GPS BUTTON
========================= */
.gps-btn {
  width: 42px;
  height: 42px;
  background: rgba(25, 55, 90, 0.95);
  color: #fff;
  border-radius: 12px;
  border: 1px solid rgba(164, 191, 156, 0.55);

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

  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  cursor: pointer;
}
/* =========================
   GPS BUTTON ACTIVE STATE
========================= */

.gps-btn.active {
  background: rgba(180, 40, 40, 0.95);
  border: 1px solid rgba(255, 120, 120, 0.6);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 60, 60, 0.6);
}

/* =========================
   TRAIL BUTTON
========================= */
#trailBtn {
  width: 42px;
  height: 42px;
  background: rgba(98, 112, 92, 0.95);

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

  border-radius: 12px;
  border: 1px solid rgba(164, 191, 156, 0.25);

  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  cursor: pointer;
}
#trailBtn img {
  width: 32px;
  height: 32px;
  filter: invert(1);
}

/* =========================
   INFO BUTTON (HAMBURGER STYLE)
========================= */
#infoBtn {
  width: 42px;
  height: 42px;

  background: rgba(255,255,255,0.95);
  color: #62705C;

  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);

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

  font-size: 18px;
  font-weight: bold;

  cursor: pointer;
}

/* =========================
   LEGEND BOX
========================= */
.legend-box {
  position: fixed;
  left: 10px;
  top: 250px;

  width: 150px;

  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);

  color: #000;

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

  display: none;
  z-index: 1100;

  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.legend-box.open {
  display: block;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.legend-item {
  font-size: 12px;
}

/* DOTOVI */
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #fff;
}

.legend-dot.viewpoints { background: #8e44ad; }
.legend-dot.water { background: #1e90ff; }
.legend-dot.rest { background: #f1c40f; }
.legend-dot.sports { background: #ff7a00; }
.legend-dot.interesting { background: #2ecc71; }

/* TRAIL LINE */
.legend-line {
  width: 14px;
  height: 4px;
  background: rgba(98,112,92,0.95);
  border-radius: 2px;
}

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

  background: rgba(42, 58, 47, 0.95);
  border: 1px solid #62705C;

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

  z-index: 9999;
}

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

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

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

  display: none;
  z-index: 1000;
}

/* =========================
   FOOTER
========================= */
#footer {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;

  font-size: 12px;
  color: #fff;

  z-index: 99999;

  /* 🔥 OVO JE SIVA TRAKA */
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 0;
}
/* =========================
   MAP DOT ICONS
========================= */
.map-dot {
  width: 16px;
  height: 16px;
  display: block;

  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);

  box-shadow: 0 0 6px rgba(0,0,0,0.35);
}
/* =========================
   TRAIL PANEL (FIX)
========================= */

#trailPanel {
  position: fixed;
  top: 0;
  right: -240px;

  width: 220px;
  height: 100%;

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

  padding: 10px;
  overflow-y: auto;

  border-left: 1px solid rgba(164, 191, 156, 0.15);
  box-shadow: -2px 0 10px rgba(0,0,0,0.4);

  transition: right 0.3s ease;
  z-index: 1200;
}

/* OPEN STATE */
#trailPanel.open {
  right: 0;
}

/* HEADER */
.trail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-bottom: 8px;
  margin-bottom: 12px;

  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.trail-header span {
  font-size: 15px;
  font-weight: bold;
  color: #A4BF9C;
}

.trail-category {
  font-size: 14px;
  font-weight: 700;
  color: #A4BF9C;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(164,191,156,.25);
}

.trail-item {
  font-size: 13px;

  padding: 10px;
  margin-bottom: 6px;

  background: rgba(164, 191, 156, 0.08);
  border-radius: 8px;

  cursor: pointer;
}
.trail-item:hover {
  background: rgba(164, 191, 156, 0.18);
}
.trail-item {
  transition: all 0.2s ease;
}

#closeTrailPanel {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}
/* =========================
   PWA POPUP (FIXED)
========================= */

#pwaPrompt {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  width: calc(100% - 20px);
  max-width: 360px;

  background: rgba(42, 58, 47, 0.95);
  border: 1px solid #62705C;

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

  z-index: 9999;

  font-size: 14px;
  text-align: center;
  color: #fff;
}

/* BUTTON WRAPPER */
.pwa-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

/* BUTTONS */
.pwa-buttons button {
  flex: 1;
  padding: 10px;

  border: none;
  border-radius: 8px;

  cursor: pointer;
  font-weight: bold;
}

/* INSTALL BUTTON */
#installBtn {
  background: #62705C;
  color: #fff;
}

/* CLOSE BUTTON */
#closeBtn {
  background: rgba(255,255,255,0.9);
  color: #333;
}

/* =========================
   GPS PULSE MARKER
========================= */

.gps-wrapper {
  background: transparent;
}

.pulse-dot {
  width: 14px;
  height: 14px;

  background: #1e90ff;
  border: 2px solid #ffffff;
  border-radius: 50%;

  box-shadow: 0 0 10px rgba(30,144,255,0.8);

  animation: gpsPulse 2s infinite;
}

@keyframes gpsPulse {

  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(30,144,255,0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 12px rgba(30,144,255,0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(30,144,255,0);
  }

}
.popup-img {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.popup-img:active {
  transform: scale(0.98);
}