/* =============================================
   metro-map.css — Light theme for interactive map
   ============================================= */

.metro-map-section {
  padding: 80px 0;
}

.mm-header {
  margin-bottom: 32px;
}

.mm-subtitle {
  color: var(--muted);
  max-width: 560px;
  margin-top: 8px;
}

.mm-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Map area */
.mm-map-area {
  background: #0c0d1a;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.mm-map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 777 / 774;
  max-height: 75vh;
}

.mm-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.mm-image.dimmed {
  filter: grayscale(0.4) opacity(0.25) contrast(0.55) brightness(0.5);
}

.mm-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* SVG paths */
.mm-line-bg {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), stroke-width 0.5s ease;
}

.mm-line-bg.visible {
  opacity: 0.6;
}

.mm-line-bg.dimmed {
  opacity: 0.08;
  stroke-width: 2;
}

.mm-line-highlight {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#mm-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out;
}

.mm-line-highlight.active {
  opacity: 1 !important;
}

.mm-line-flow {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10, 24;
  animation: mmFlow 12s linear infinite;
  animation-delay: 0.5s;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

@keyframes mmFlow {
  from { stroke-dashoffset: 500; }
  to { stroke-dashoffset: 0; }
}

.mm-line-flow.active {
  opacity: 1 !important;
}

/* Station label popup on map */
.mm-station-label {
  position: absolute;
  z-index: 10;
  background: rgba(12, 13, 26, 0.92);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 14px;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transform: translate(-50%, -100%);
  margin-top: -14px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
}

.mm-station-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(12, 13, 26, 0.92);
}

.mm-station-label .sl-name {
  font-weight: 700;
}

.mm-station-label .sl-lines {
  font-size: 11px;
  color: #9aa5b9;
  margin-top: 2px;
}

.mm-station-label .sl-lines .sl-line {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  color: white;
  font-size: 10px;
  font-weight: 700;
  margin: 0 1px;
}

/* Station markers on the map */
.mm-station-dot {
  fill: white;
  stroke: #1a1a2e;
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.3s ease, r 0.3s ease;
  opacity: 0;
}

.mm-station-dot.visible {
  opacity: 1;
}

.mm-station-dot:hover {
  r: 6;
  stroke-width: 2;
}

.mm-line-flow {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10, 24;
  animation: mmFlow 12s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

@keyframes mmFlow {
  from { stroke-dashoffset: 800; }
  to { stroke-dashoffset: 0; }
}

.mm-line-interactive {
  fill: none;
  stroke: transparent;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  pointer-events: stroke;
}

/* Sidebar */
.mm-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mm-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.mm-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  border-left: 3px solid var(--red);
  padding-left: 10px;
}

.mm-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

/* Line selector grid */
.mm-line-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 4px 0;
}

.mm-line-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.mm-line-btn:hover {
  border-color: var(--mm-color);
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.mm-line-btn.active {
  border-color: var(--mm-color);
  background: rgba(from var(--mm-color) r g b / 0.04);
  box-shadow: 0 0 0 2px var(--mm-color);
}

.mm-line-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: 9px;
  font-family: var(--font-display);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mm-line-btn:hover .mm-line-badge,
.mm-line-btn.active .mm-line-badge {
  transform: scale(1.1);
}

.mm-line-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Info card */
.mm-info-card {
  flex: 1;
  min-height: 300px;
}

.mm-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.mm-placeholder-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
  animation: mmBounce 2s infinite ease-in-out;
}

@keyframes mmBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.mm-placeholder h4 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.mm-placeholder p {
  font-size: 13px;
  max-width: 260px;
}

.mm-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mm-line-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mm-badge-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.25);
}

.mm-line-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.mm-route {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Stats */
.mm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mm-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.mm-stat-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.mm-stat-lbl {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Communes */
.mm-communes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mm-commune-tag {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Stations */
.mm-stations-wrap h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.mm-stations-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mm-stations-list::-webkit-scrollbar {
  width: 4px;
}
.mm-stations-list::-webkit-scrollbar-track {
  background: transparent;
}
.mm-stations-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.mm-station-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.mm-station-item:hover {
  background: var(--bg);
  border-color: var(--line);
}

.mm-station-combos {
  display: flex;
  gap: 3px;
}

.mm-combo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* PDF CTA */
.mm-pdf-cta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.mm-pdf-cta-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mm-pdf-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(227,6,19,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}

.mm-pdf-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.mm-pdf-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .mm-layout {
    grid-template-columns: 1fr;
  }
  .mm-map-wrapper {
    max-height: 60vh;
  }
  .mm-sidebar {
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .mm-map-wrapper {
    max-height: 50vh;
  }
  .mm-line-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .mm-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .mm-line-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mm-line-label {
    font-size: 9px;
  }
}
