/* Map and GPX Preview Styles */
/* Modal styles */
.map-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.75);
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(3px);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.map-modal-content {
  position: relative;
  background-color: var(--surface-color);
  margin: 5vh auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
  overflow: hidden;
}
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.map-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: var(--text-color);
  font-size: 28px;
  font-weight: bold;
  z-index: 10;
  cursor: pointer;
}
.map-modal-close:hover,
.map-modal-close:focus {
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
}
#map-modal-title {
  padding: 15px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.4rem;
  color: var(--text-color);
}
/* Alternative map-modal-content h3 from main.css */
.map-modal-content h3 {
  margin: 0;
  padding: 20px;
  background-color: var(--primary-color);
  color: white;
}
#map-container {
  height: 400px;
  width: 100%;
  position: relative;
  background-color: var(--surface-color-alt);
  flex: 1;
  min-height: 400px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.map-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--text-color-light);
  background: var(--surface-color-alt);
}
.map-placeholder p {
  margin: 8px 0;
}
.map-note {
  font-size: 0.85rem;
  opacity: 0.8;
  max-width: 500px;
  margin-top: 15px;
  font-size: 0.9rem;
  max-width: 600px;
}
.map-error-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 15px 20px;
  background-color: rgba(var(--error-rgb), 0.85);
  color: white;
  border-radius: 8px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.map-error-overlay p {
  margin: 5px 0;
}
#map-circuit-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
#map-circuit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 5px;
  color: var(--text-color-secondary);
}
#map-circuit-stats span {
  display: inline-flex;
  align-items: center;
  color: var(--text-color);
}
#map-circuit-stats i {
  margin-right: 5px;
  color: var(--primary-color);
}
#map-description {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-color);
  margin: 0;
  line-height: 1.6;
}
.map-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
/* Leaflet custom styles */
.leaflet-container {
  font-family: 'Inter', sans-serif;
}
.leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.5;
}
.leaflet-popup-tip {
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}
.leaflet-control-attribution {
  font-size: 10px;
}
/* Elevation profile styles */
.elevation-profile {
  height: 150px;
  width: 100%;
  margin-top: 10px;
  background-color: var(--surface-color-alt);
  border-radius: 4px;
  overflow: hidden;
}

/* Circuit Page Styles */
.circuit-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}
.circuit-content {
  display: none;
}
.circuit-content.active {
  display: block;
}
.circuit-content h2 {
  margin-bottom: 30px;
  color: var(--primary-color);
  text-align: center;
}
.circuit-cards {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.circuit-card {
  display: flex;
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.circuit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}
.circuit-image {
  flex: 1;
  max-width: 300px;
  overflow: hidden;
}
.circuit-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.circuit-card:hover .circuit-image img {
  transform: scale(1.05);
}
.circuit-details {
  flex: 2;
  padding: 20px;
}
.circuit-details h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-color);
}
.circuit-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  color: var(--text-color-secondary);
}
.spec {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
}
.spec i {
  color: var(--primary-color);
}
.circuit-details p {
  margin-bottom: 20px;
  line-height: 1.6;
}
.circuit-highlights {
  background-color: var(--surface-color-alt);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.circuit-highlights p {
  margin-bottom: 10px;
}
.circuit-highlights ul {
  margin-left: 20px;
  list-style-type: disc;
}
.circuit-highlights li {
  margin-bottom: 5px;
}
.circuit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive styles */
@media (max-width: 992px) {
  .circuit-card {
    flex-direction: column;
  }
  
  .circuit-image {
    max-width: 100%;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .map-modal-content {
    width: 95%;
    margin: 10px auto;
  }
  
  #map-container {
    height: 300px;
  }
  
  #map-circuit-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .map-modal-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .map-modal-actions a, 
  .map-modal-actions button {
    width: 100%;
    text-align: center;
  }
  
  .circuit-tabs {
    flex-direction: column;
    align-items: center;
    border-bottom: none;
  }
}

/* Dark theme adjustments */
[data-theme='dark'] .leaflet-tile {
  filter: brightness(0.8) invert(1) contrast(0.9) hue-rotate(180deg) saturate(0.8);
}
[data-theme='dark'] .leaflet-marker-pane img,
[data-theme='dark'] .leaflet-shadow-pane img {
  filter: brightness(0.8);
}
[data-theme='dark'] .leaflet-control-zoom a {
  color: #222;
}
