/* Responsive Metro Map Styles */

/* Default styling for map container */
.map-container {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 2rem auto;
}

#metro-map,
.map-image,
#map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Controls for map navigation */
.map-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.map-control-btn {
  background: #e82b2b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.map-control-btn:hover {
  background-color: #c81313;
}

/* Tablet Styles */
@media (max-width: 768px) {
  .map-container {
    height: 60vh;
    margin: 1rem auto;
  }

  .map-control-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  #metro-map,
  .map-image,
  #map-image {
    max-width: 100%;
    max-height: 100%;
  }
}

/* Mobile Styles */
@media (max-width: 480px) {
  .map-container {
    height: 65vh;
    margin: 0.5rem auto;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #metro-map,
  .map-image,
  #map-image {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform-origin: center;
    transform: scale(1);
  }

  .map-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .map-control-btn {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .map-container {
    height: 75vh;
  }

  #metro-map,
  .map-image,
  #map-image {
    max-height: 100%;
  }
}

/* Fix for very small screens */
@media (max-width: 360px) {
  .map-container {
    height: 55vh;
  }

  #metro-map,
  .map-image,
  #map-image {
    max-width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .map-container {
    background: #333;
    border-color: #444;
  }

  .map-controls {
    background-color: rgba(0, 0, 0, 0.7);
  }
}

/* Fix for Safari mobile */
@supports (-webkit-touch-callout: none) {
  .map-container {
    -webkit-overflow-scrolling: touch;
  }
}
