/* Route Planner Styles */

.route-warning {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 193, 7, 0.95);
  color: #333;
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 1000;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 90%;
  text-align: center;
  display: none;
}

.route-stats {
  position: absolute;
  top: 60px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  display: none;
  gap: 16px;
}

.route-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  font-size: 18px;
}

.stat-value {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

/* Route Planner Button */
.btn-route-planner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.btn-route-planner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-route-planner.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Route Preferences Panel */
.route-preferences {
  position: absolute;
  top: 120px;
  right: 10px;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 1001;
  min-width: 250px;
  display: none;
}

.route-preferences.open {
  display: block;
}

.route-preferences h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.pref-group {
  margin-bottom: 16px;
}

.pref-group:last-child {
  margin-bottom: 0;
}

.pref-group h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pref-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.pref-group input[type="checkbox"],
.pref-group input[type="radio"] {
  margin-right: 8px;
}

/* GPX Export Buttons */
.route-export-buttons {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 1000;
  display: none;
  gap: 12px;
}

.route-export-buttons.show {
  display: flex;
}

.btn-export {
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-export-points {
  background: #3bd16f;
  color: white;
}

.btn-export-full {
  background: #2d7ff9;
  color: white;
}

.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .route-stats {
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 8px 12px;
    gap: 12px;
  }
  
  .stat-value {
    font-size: 14px;
  }
  
  .route-preferences {
    right: 10px;
    left: 10px;
    top: auto;
    bottom: 80px;
  }
  
  .route-export-buttons {
    flex-direction: column;
    width: calc(100% - 40px);
    max-width: 300px;
  }
}


/* iOS Safari: map callout/selection tiltás, popup szöveg kijelölhető */
.leaflet-container {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Egyéni kurzor: célpont-ikon (körkör + pontok) – pontosabb mint a tenyér */
.leaflet-grab,
.leaflet-container:not(.leaflet-dragging) {
  cursor: url("data:image/svg+xml,<svg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2224%22%20height=%2224%22%20viewBox=%220%200%2024%2024%22><circle%20cx=%2212%22%20cy=%2212%22%20r=%228%22%20fill=%22none%22%20stroke=%22white%22%20stroke-width=%223%22/><circle%20cx=%2212%22%20cy=%2212%22%20r=%222.5%22%20fill=%22white%22/><circle%20cx=%2212%22%20cy=%2212%22%20r=%228%22%20fill=%22none%22%20stroke=%22%231a1a1a%22%20stroke-width=%221.5%22/><circle%20cx=%2212%22%20cy=%2212%22%20r=%222%22%20fill=%22%231a1a1a%22/><line%20x1=%2212%22%20y1=%222%22%20x2=%2212%22%20y2=%226%22%20stroke=%22white%22%20stroke-width=%222.5%22%20stroke-linecap=%22round%22/><line%20x1=%2212%22%20y1=%2218%22%20x2=%2212%22%20y2=%2222%22%20stroke=%22white%22%20stroke-width=%222.5%22%20stroke-linecap=%22round%22/><line%20x1=%222%22%20y1=%2212%22%20x2=%226%22%20y2=%2212%22%20stroke=%22white%22%20stroke-width=%222.5%22%20stroke-linecap=%22round%22/><line%20x1=%2218%22%20y1=%2212%22%20x2=%2222%22%20y2=%2212%22%20stroke=%22white%22%20stroke-width=%222.5%22%20stroke-linecap=%22round%22/><line%20x1=%2212%22%20y1=%222%22%20x2=%2212%22%20y2=%226%22%20stroke=%22%231a1a1a%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22/><line%20x1=%2212%22%20y1=%2218%22%20x2=%2212%22%20y2=%2222%22%20stroke=%22%231a1a1a%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22/><line%20x1=%222%22%20y1=%2212%22%20x2=%226%22%20y2=%2212%22%20stroke=%22%231a1a1a%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22/><line%20x1=%2218%22%20y1=%2212%22%20x2=%2222%22%20y2=%2212%22%20stroke=%22%231a1a1a%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22/></svg>") 12 12, crosshair !important;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-container {
  cursor: grabbing !important;
}
.leaflet-popup-content {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.leaflet-popup-close-button {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 22px !important;
  text-align: center !important;
  padding: 0;
  border-radius: 10px;
}

.leaflet-popup-close-button:hover {
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════
   POI POPUP MOBIL INTERAKCIÓ OPTIMALIZÁLÁS
   ═══════════════════════════════════════════════════════════════════ */

.poi-popup-actions .btn {
  min-height: 44px;
  min-width: 44px;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.poi-popup-actions .btn:active {
  transform: scale(0.95) translateZ(0);
  opacity: 0.8;
  filter: brightness(0.95);
}

.poi-popup-actions .btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

@media (hover: none) and (pointer: coarse) {
  .poi-popup-actions .btn {
    padding: 10px 16px !important;
    margin: 0 4px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }


/* FIX START: safe marker pointer behavior */
.leaflet-marker-pane {
  z-index: 600 !important;
  pointer-events: auto;
}

.leaflet-marker-icon,
.poi-numbered-icon,
.my-position-icon {
  pointer-events: auto !important;
  cursor: pointer;
}
/* FIX END */
  .poi-popup-actions .btn:active {
    transform: scale(0.92) translateZ(0);
    opacity: 0.7;
    filter: brightness(0.9);
  }
}

.poi-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  min-height: 44px;
}

.leaflet-popup-content-wrapper {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.leaflet-popup {
  transform: translateZ(0);
  backface-visibility: hidden;
}

@supports (-webkit-touch-callout: none) {
  .poi-popup-actions .btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .leaflet-popup-content button {
    -webkit-overflow-scrolling: touch;
  }
}

.poi-popup-actions .btn:focus-visible {
  outline: 2px solid var(--green, #3bd16f);
  outline-offset: 2px;
  z-index: 1;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .poi-popup-actions .btn {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Saját lokáció marker: nagy koppintási felület mobilon is */
.current-location-hitarea {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.current-location-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d62828;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(214, 40, 40, 0.2);
}


.current-location-hitarea {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.current-location-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d62828;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(214, 40, 40, 0.2);
}
