/* ==========================================================================
   Wuhan High-Speed Rail Isochrone Map Section (.isochrone-section)
   Apple-inspired Liquid Glass design with dark/light mode responsiveness.
   ========================================================================== */

.isochrone-section {
  max-width: 1220px;
  margin: 0 auto;
  padding: 96px 32px 72px;
  background: var(--surface-alt);
  box-shadow: 0 0 0 100vmax var(--surface-alt);
  clip-path: inset(0 -100vmax);
  position: relative;
}

.isochrone-copy {
  max-width: 860px;
  margin: 0 auto 36px;
  text-align: center;
}

.isochrone-copy h2 {
  margin-top: 14px;
  color: var(--ink);
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 700;
}

.isochrone-copy h2 .sub-en {
  display: block;
  font-size: 0.44em;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin-top: 6px;
}

.isochrone-copy p {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

/* Control Hub Bar (Liquid Glass) */
.isochrone-controls {
  max-width: 980px;
  margin: 0 auto 32px;
  padding: 22px 28px;
  border-radius: var(--radius-lg, 22px);
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 36px var(--card-shadow), var(--glass-inner-glow);
  -webkit-backdrop-filter: var(--glass-filter-md);
  backdrop-filter: var(--glass-filter-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

html[data-theme="dark"] .isochrone-controls {
  background: rgba(26, 28, 36, 0.72);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.isochrone-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.isochrone-origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pill-surface);
  border: 1px solid var(--card-border);
}

.isochrone-origin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 10px #34c759;
  animation: isochrone-pulse 2s infinite ease-in-out;
}

@keyframes isochrone-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.isochrone-stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.isochrone-stat-pill strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Slider Section */
.isochrone-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.isochrone-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.isochrone-slider-val {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
}

.isochrone-slider-val span {
  color: var(--blue);
}

.isochrone-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--blue) var(--range-progress, 60%), rgba(120, 120, 128, 0.2) var(--range-progress, 60%));
  outline: none;
  cursor: pointer;
  transition: background 150ms ease;
}

.isochrone-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--blue);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35), 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: grab;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 180ms ease;
}

.isochrone-range-input:active::-webkit-slider-thumb {
  transform: scale(1.18);
  cursor: grabbing;
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.5), 0 2px 5px rgba(0, 0, 0, 0.2);
}

.isochrone-range-input::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--blue);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
  cursor: grab;
}

.isochrone-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
  padding: 0 4px;
}

/* Preset Pills */
.isochrone-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.isochrone-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--pill-surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms var(--ease);
}

.isochrone-preset-btn:hover {
  background: var(--pill-surface-hover);
  transform: translateY(-1px);
}

.isochrone-preset-btn.is-active {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

/* Main Interactive Canvas: Map & Cards */
.isochrone-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .isochrone-canvas {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Map Container */
.isochrone-map-shell {
  position: relative;
  border-radius: var(--radius-lg, 22px);
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 48px var(--card-shadow);
  overflow: hidden;
  aspect-ratio: 720 / 520;
  min-height: 420px;
  isolation: isolate;
}

html[data-theme="dark"] .isochrone-map-shell {
  background: #12141a;
  border-color: rgba(255, 255, 255, 0.1);
}

.isochrone-leaflet {
  width: 100%;
  height: 100%;
  background: transparent;
}

.isochrone-leaflet .leaflet-tile-pane {
  filter: contrast(1.04) brightness(0.98);
}

html[data-theme="dark"] .isochrone-leaflet .leaflet-tile-pane {
  filter: brightness(0.85) contrast(1.15) saturate(0.9);
}

/* Map Overlays */
.isochrone-map-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), var(--glass-inner-glow);
  -webkit-backdrop-filter: var(--glass-filter-sm);
  backdrop-filter: var(--glass-filter-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  pointer-events: none;
}

html[data-theme="dark"] .isochrone-map-hud {
  background: rgba(20, 22, 28, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

/* Leaflet Zoom Styling matching the site */
.isochrone-leaflet .leaflet-control-zoom {
  border: 0 !important;
  margin: 14px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.isochrone-leaflet .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1d1d1f !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-weight: 600 !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

html[data-theme="dark"] .isochrone-leaflet .leaflet-control-zoom a {
  background: rgba(30, 32, 40, 0.88) !important;
  color: #f5f5f7 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Custom Leaflet Pins */
.isochrone-center-pin {
  position: relative;
}

.wuhan-beacon {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.wuhan-beacon-core {
  width: 14px;
  height: 14px;
  background: #ff3b30;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.8);
  z-index: 2;
}

.wuhan-beacon-wave {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 59, 48, 0.6);
  animation: beacon-wave 2.2s infinite ease-out;
}

.wuhan-beacon-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  background: rgba(29, 29, 31, 0.9);
  color: #ffffff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes beacon-wave {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Destination City Pin */
.isochrone-city-pin {
  position: relative;
  cursor: pointer;
  transition: transform 200ms var(--ease), opacity 300ms ease;
}

.isochrone-city-pin:hover {
  transform: translateY(-3px) scale(1.08);
  z-index: 700 !important;
}

.isochrone-city-pin.is-active {
  transform: translateY(-4px) scale(1.15);
  z-index: 800 !important;
}

.city-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 113, 227, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  transition: all 180ms ease;
}

html[data-theme="dark"] .city-pin-badge {
  background: rgba(24, 26, 32, 0.92);
  border-color: rgba(90, 200, 250, 0.35);
  color: #f5f5f7;
}

.isochrone-city-pin.is-active .city-pin-badge,
.isochrone-city-pin:hover .city-pin-badge {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45);
}

.city-pin-time {
  font-weight: 500;
  opacity: 0.85;
}

/* Rails & Isochrone Rings SVG Styling */
.isochrone-glow-ring {
  filter: drop-shadow(0 0 12px rgba(0, 113, 227, 0.45));
}

.isochrone-rail-line {
  stroke-dasharray: 4 8;
  animation: rail-dash 25s linear infinite;
}

@keyframes rail-dash {
  to { stroke-dashoffset: -300; }
}

/* Destination Cards List Panel */
.isochrone-cards-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
  overflow: hidden;
}

.isochrone-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.isochrone-cards-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.isochrone-cards-sort {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}

.isochrone-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 2px 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

html[data-theme="dark"] .isochrone-cards-scroll {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.isochrone-card {
  padding: 16px 18px;
  border-radius: var(--radius, 16px);
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 16px var(--card-shadow);
  cursor: pointer;
  transition: all 220ms var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  text-align: left;
}

.isochrone-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: var(--card-hover-border);
  box-shadow: 0 10px 28px var(--card-shadow);
}

.isochrone-card.is-active {
  border-color: var(--blue);
  background: var(--card-hover);
  box-shadow: 0 12px 32px rgba(0, 113, 227, 0.18), inset 0 0 0 1px var(--blue);
}

.isochrone-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.isochrone-card-city {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.isochrone-card-pinyin {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.isochrone-card-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.isochrone-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.isochrone-card-train {
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--pill-surface);
  padding: 2px 7px;
  border-radius: 4px;
}

.isochrone-card-tag {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
  font-weight: 500;
}

.isochrone-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Time ratio progress bar */
.isochrone-card-bar-wrap {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 2px;
}

html[data-theme="dark"] .isochrone-card-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.isochrone-card-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34c759, var(--blue));
  transition: width 300ms ease;
}

/* Responsive adjustments */
@media (max-width: 680px) {
  .isochrone-section {
    padding: 64px 20px 48px;
  }

  .isochrone-copy h2 {
    font-size: 34px;
  }

  .isochrone-controls {
    padding: 18px 18px;
  }

  .isochrone-map-shell {
    min-height: 320px;
  }

  .isochrone-cards-panel {
    max-height: 440px;
  }
}

/* Nav Item Styling */
.nav-isochrone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 180ms ease, background 180ms ease;
}

.nav-isochrone:hover {
  color: var(--ink);
  background: var(--pill-surface-hover);
}

@media (max-width: 1000px) {
  .header-socials .nav-isochrone {
    display: none !important;
  }
}

