/* ===== MRT Progress Map ===== */

/* Widen #app when MRT tab is active (PC only) */
#app.mrt-wide {
  max-width: 960px;
}

/* Two-column layout: map left, sidebar right on PC */
.mrt-layout {
  display: flex;
  gap: var(--sp-md);
  align-items: flex-start;
}
.mrt-layout__map {
  flex: 1;
  min-width: 0;
}
.mrt-layout__sidebar {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

/* Mobile: stack vertically */
@media (max-width: 700px) {
  #app.mrt-wide { max-width: 480px; }
  .mrt-layout {
    flex-direction: column;
  }
  .mrt-layout__sidebar {
    flex: none;
    width: 100%;
  }
}

/* Line row in sidebar */
.mrt-line-row {
  padding: var(--sp-xs) var(--sp-sm);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
}
.mrt-line-row__header {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: 2px;
}
.mrt-line-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mrt-line-row__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
}
.mrt-line-row__stats {
  display: flex;
  gap: var(--sp-md);
  font-size: 0.75rem;
  color: var(--c-text-secondary);
  padding-left: 18px; /* align with name (dot width + gap) */
}

/* Map container — no scrolling, fits viewport */
.mrt-map-container {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  padding: var(--sp-sm);
}

/* Hover badge tooltip — code badges near station on hover */
.mrt-hover-badge {
  position: absolute;
  display: flex;
  gap: 2px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  animation: badgeFadeIn 0.15s ease-out;
}
@keyframes badgeFadeIn {
  from { opacity: 0; transform: translate(-50%, -90%); }
  to   { opacity: 1; transform: translate(-50%, -100%); }
}

/* Disclaimer overlay — construction-sign style */
.mrt-disclaimer {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    #ffd600 0, #ffd600 4px,
    #333 4px, #333 8px
  );
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mrt-disclaimer__inner {
  background: #1a1a1a;
  color: #ffd600;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.mrt-map {
  width: 100%;
  height: auto;
  display: block;
  min-height: 280px;
}

/* SVG text styles */
.mrt-map__label {
  font-size: 5.5px;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}
.mrt-map__interchange-label {
  font-size: 6px;
  font-weight: 600;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* CC station styles */
.mrt-map__cc-label {
  font-size: 4.5px;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  opacity: 0.6;
}
.mrt-map__cc-ring {
  pointer-events: none;
}

/* ===== Station Info Bottom Sheet ===== */
.station-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 55vh;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--sp-md) var(--sp-lg);
}
.station-sheet.is-open {
  transform: translateY(0);
}

/* Drag handle bar */
.station-sheet__handle {
  display: flex;
  justify-content: center;
  padding: var(--sp-sm) 0 var(--sp-xs);
  position: sticky;
  top: 0;
  background: var(--c-surface);
  z-index: 1;
  cursor: grab;
}
.station-sheet__handle::after {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-border);
}

/* Header: codes + name + tagline */
.station-sheet__header {
  margin-bottom: var(--sp-sm);
}
.station-sheet__codes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.station-sheet__code {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
  line-height: 1.4;
}
.station-sheet__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 2px 0;
}
.station-sheet__tagline {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  font-style: italic;
}

/* Body text */
.station-sheet__body {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--c-text);
  margin-bottom: var(--sp-sm);
}
/* Spots list */
.station-sheet__spots {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-sm);
}
.station-sheet__spot {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--c-border);
}
.station-sheet__spot:last-child {
  border-bottom: none;
}
.station-sheet__spot-icon {
  flex-shrink: 0;
}
.station-sheet__spot-name {
  font-weight: 600;
  color: var(--c-text);
}
.station-sheet__spot-name a {
  color: var(--c-primary);
  text-decoration: none;
}
.station-sheet__spot-name a:hover {
  text-decoration: underline;
}
.station-sheet__spot-desc {
  color: var(--c-text-secondary);
  font-size: 0.75rem;
}

/* Google Map link */
.station-sheet__map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--c-primary);
  text-decoration: none;
  padding: var(--sp-xs) 0;
}
.station-sheet__map-link:hover {
  text-decoration: underline;
}

/* "No info yet" state */
.station-sheet__placeholder {
  font-size: 0.82rem;
  color: var(--c-text-secondary);
  text-align: center;
  padding: var(--sp-md) 0;
}

/* Backdrop overlay */
.station-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.station-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* New station/segment fade-in with glow.
 * fill-mode:both applies 0% state during delay, so no separate opacity rule needed.
 * !important was preventing animation from working (spec: !important overrides animations). */
.mrt-new-segment {
  animation: mrtSegmentFadeIn 1.2s 0.4s ease-out both;
}
.mrt-new-station {
  animation: mrtStationFadeIn 1.2s 0.6s ease-out both;
}
@keyframes mrtSegmentFadeIn {
  0% { opacity: 0; }
  100% { opacity: 0.9; }
}
@keyframes mrtStationFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Dark mode */
[data-theme="dark"] .mrt-map-container {
  background: var(--c-surface);
  border-color: var(--c-border);
}
