/**
 * WP GPX Viewer Styles
 * Modern, responsive styling for GPX track viewer
 */

.gpx-viewer-container {
  position: relative;
  margin: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Map Container */
.gpx-viewer-map {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.gpx-viewer-map.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* Custom Map Controls */
.gpx-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gpx-control-btn {
  width: 40px;
  height: 40px;
  background: white !important;
  background-color: white !important;
  border: 2px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 4px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 0 !important;
  margin: 0 !important;
  text-decoration: none !important;
}

.gpx-control-btn:hover {
  background: #f4f4f4 !important;
  background-color: #f4f4f4 !important;
  border-color: rgba(0, 0, 0, 0.3) !important;
}

.gpx-control-btn:active {
  background: #e8e8e8 !important;
  background-color: #e8e8e8 !important;
}

.gpx-control-btn svg {
  width: 20px;
  height: 20px;
  fill: #333;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  background-color: transparent !important;
}

/* Elevation Chart */
.gpx-viewer-elevation {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gpx-viewer-elevation canvas {
  max-height: 250px;
  width: 100% !important;
  height: auto !important;
}

/* Statistics Box */
.gpx-viewer-statistics {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: transparent;
  color: inherit;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.7;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

/* Error Message */
.gpx-viewer-error {
  padding: 1.5rem;
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 8px;
  color: #c00;
  font-weight: 500;
}

/* Leaflet Marker Cluster Overrides */
.leaflet-container {
  font-family: inherit;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 1rem;
  font-family: inherit;
  line-height: 1.5;
}

/* Hover Effect on Track */
.gpx-track-hover-marker {
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Loading State */
.gpx-viewer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: #f5f5f5;
  border-radius: 8px;
  color: #666;
  font-size: 1.125rem;
}

.gpx-viewer-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  margin-left: 1rem;
  border: 4px solid #ddd;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: gpx-spin 0.8s linear infinite;
}

@keyframes gpx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .gpx-viewer-container {
    margin: 1rem 0;
  }

  .gpx-viewer-statistics {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .gpx-viewer-elevation {
    padding: 1rem;
  }

  .gpx-map-controls {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .gpx-control-btn {
    width: 36px;
    height: 36px;
  }

  .gpx-control-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .gpx-viewer-statistics {
    padding: 1rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* Dark Mode Support (optional) 
@media (prefers-color-scheme: dark) {
  .gpx-viewer-map {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .gpx-viewer-elevation {
    background: #2d3748;
    color: #e2e8f0;
  }

  .gpx-control-btn {
    background: #2d3748;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .gpx-control-btn:hover {
    background: #4a5568;
    border-color: rgba(255, 255, 255, 0.3);
  }

  .gpx-control-btn svg {
    fill: #e2e8f0;
  }
}
*/
/* Print Styles */
@media print {
  .gpx-map-controls {
    display: none;
  }

  .gpx-viewer-map {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .gpx-viewer-statistics {
    border: 1px solid #ddd;
  }
}
