.map-container {
  margin: 15px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.map-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-toggle-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.map-btn-secondary {
  background: rgba(255, 255, 255, 0.14);
}

.map-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.map-fullscreen-open {
  overflow: hidden;
}

.map-container.map-fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  z-index: 9999;
}

.map-container.map-fullscreen .map-content.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
}

.map-container.map-fullscreen .map-visualization {
  flex: 1;
  height: auto;
}

.map-content {
  display: none;
  padding: 15px;
  background: #f8f9fa;
}

.map-content.active {
  display: block;
}

.map-visualization {
  position: relative;
  width: 100%;
  height: 300px;
  background: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.amap-jsapi-map {
  width: 100%;
  height: 100%;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  font-size: 14px;
}

.map-placeholder-icon {
  font-size: 48px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.transport {
  background: var(--primary);
}

.legend-dot.hotel {
  background: var(--secondary);
}

.legend-dot.spot {
  background: var(--accent);
}

.legend-dot.food {
  background: var(--multi-select);
}

.map-stats {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  font-size: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  color: var(--subtext);
  font-size: 11px;
}

.stat-value {
  font-weight: 600;
  color: var(--text);
}

.simple-map {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #f3f6fa;
  --static-map: none;
  background-image:
    var(--static-map),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0, rgba(0, 0, 0, 0.06) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0, rgba(0, 0, 0, 0.06) 1px, transparent 1px, transparent 24px);
  background-size: cover, auto, auto;
  background-position: center, 0 0, 0 0;
  overflow: hidden;
  cursor: grab;
}

.simple-map:active {
  cursor: grabbing;
}

.map-content-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
}

.map-static {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
}

.map-controls {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 20;
}

.map-zoom-in,
.map-zoom-out,
.map-reset {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.map-zoom-in:hover,
.map-zoom-out:hover,
.map-reset:hover {
  background: #f8f9fa;
  transform: scale(1.05);
}

.map-zoom-in:active,
.map-zoom-out:active,
.map-reset:active {
  transform: scale(0.95);
}

.map-point {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--accent);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 10;
}

.map-point:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-label {
  position: absolute;
  transform: translate(10px, -50%);
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 11px;
  color: #333;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 9;
}

.map-point.transport {
  border-color: var(--primary);
  color: var(--primary);
}

.map-point.hotel {
  border-color: var(--secondary);
  color: var(--secondary);
}

.map-point.spot {
  border-color: var(--accent);
  color: var(--accent);
}

.map-point.food {
  border-color: var(--multi-select);
  color: var(--multi-select);
}

.map-line {
  position: absolute;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transform-origin: left center;
  border-radius: 2px;
  opacity: 0.7;
  z-index: 1;
}

.map-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-tooltip.visible {
  opacity: 1;
}
