﻿/* Mir Maps — Godlike dark BigMap (no legacy purple/white flash) */

.mir-maps,
.mir-maps * {
  box-sizing: border-box;
}

.mir-maps {
  color: rgba(255, 255, 255, 0.88);
}

.mir-maps-stamp,
#dataStamp {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65) !important;
}

.mir-maps .maps-container,
.mir-maps-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

.mir-maps .sidebar {
  width: 280px;
  flex: 0 0 280px;
  color: #e8e8e8;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.mir-maps .sidebar h2 {
  margin: 0 0 10px;
  color: #fff !important;
  font-size: 1.05rem;
}

.mir-maps .map-search input,
.mir-maps #mapSearch {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5) !important;
  color: #fff !important;
}

.mir-maps .map-list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7) !important;
}

.mir-maps .map-list,
.mir-maps #mapList {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4) !important;
}

.mir-maps .map-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8e8e8 !important;
  background: transparent !important;
}

.mir-maps .map-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.mir-maps .map-item.active {
  background: rgba(180, 40, 40, 0.4) !important;
  color: #fff !important;
}

.mir-maps .map-item-title {
  font-weight: 700;
  color: inherit !important;
}

.mir-maps .map-item-sub {
  font-size: 11px;
  opacity: 0.75;
  color: inherit !important;
}

.mir-maps .content {
  flex: 1;
  min-width: 0;
}

.mir-maps .map-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff !important;
}

.mir-maps .map-subtitle,
.mir-maps #mapScalingInfo {
  color: rgba(255, 255, 255, 0.65) !important;
}

.mir-maps .map-image-panel {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.mir-maps .bigmap-wrap {
  flex: 1 1 640px;
  min-width: 0;
}

.mir-maps .bigmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.mir-maps .bigmap-toolbar button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.mir-maps .bigmap-toolbar button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mir-maps .bigmap-toolbar button.active {
  background: #b42828;
  border-color: #b42828;
}

.mir-maps .bigmap-toolbar .hint {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.mir-maps .bigmap-viewport {
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0d12;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mir-maps .bigmap-viewport.is-dragging {
  cursor: grabbing;
}

.mir-maps .bigmap-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.mir-maps .bigmap-stage img {
  display: block;
  max-width: none;
  image-rendering: pixelated;
  pointer-events: none;
}

.mir-maps .bigmap-overlay {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.mir-maps .map-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
  background: #22c55e;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mir-maps .map-marker.npc.bigmap {
  background: #f59e0b;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
}

.mir-maps .map-marker:hover {
  transform: scale(1.25);
  z-index: 3;
}

/* Selected NPC pin — clear pulse + ring */
.mir-maps .map-marker.is-selected {
  background: #ef4444 !important;
  border-color: #fff;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  z-index: 5;
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.55),
    0 0 18px rgba(239, 68, 68, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.5);
  animation: mir-npc-pulse 1.1s ease-in-out infinite;
}

@keyframes mir-npc-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.mir-maps .bigmap-coords {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
}

.mir-maps .map-info {
  flex: 0 0 230px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78) !important;
}

.mir-maps .map-info p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.78) !important;
}

.mir-maps .map-info strong {
  color: #fff !important;
}

.mir-maps .npc-list {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4) !important;
}

.mir-maps .npc-list-item {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 12px;
  color: #e8e8e8 !important;
  background: transparent !important;
}

.mir-maps .npc-list-item:hover {
  background: rgba(180, 40, 40, 0.25) !important;
}

.mir-maps .npc-list-item.is-selected {
  background: rgba(180, 40, 40, 0.45) !important;
  box-shadow: inset 3px 0 0 #ef4444;
}

.mir-maps .npc-list-item .sub {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 11px;
}

.mir-maps .scaling-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  background: #b42828;
  color: #fff;
  font-size: 12px;
  margin-left: 8px;
}

.mir-maps .monster-list-panel {
  margin-top: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 420px;
  display: flex;
  flex-direction: column;
}

.mir-maps .monster-list-header,
.mir-maps .monster-row {
  display: grid;
  grid-template-columns: 150px minmax(160px, 1.2fr) minmax(120px, 0.85fr) minmax(120px, 0.85fr);
  gap: 8px;
  padding: 10px 12px;
  color: #fff !important;
}

.mir-maps .monster-list-header {
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 13px;
}

.mir-maps .monster-list {
  overflow: auto;
  flex: 1;
}

.mir-maps .monster-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: start;
}

.mir-maps .monster-name-main,
.mir-maps .monster-stat-block strong {
  color: #fff !important;
}

.mir-maps .monster-name-sub,
.mir-maps .monster-stat-block {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 12px;
  line-height: 1.45;
}

.mir-maps .monster-sprite {
  position: relative;
  width: 145px;
  height: 145px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.mir-maps .monster-frame {
  position: absolute;
  inset: 0;
  width: 145px;
  height: 145px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0;
}

.mir-maps .monster-frame.is-on {
  opacity: 1;
}

.mir-maps .loading,
.mir-maps .error {
  text-align: center;
  padding: 14px;
  color: rgba(255, 255, 255, 0.7) !important;
}

.mir-maps .error {
  background: rgba(180, 40, 40, 0.2);
  border: 1px solid rgba(180, 40, 40, 0.4);
  border-radius: 6px;
  color: #ff8a80 !important;
}

.mir-maps .tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 4px;
  margin-top: 3px;
}

.mir-maps .tag-boss { background: #b91c1c; color: #fff; }
.mir-maps .tag-undead { background: #4b5563; color: #fff; }
.mir-maps .tag-sub { background: #6d28d9; color: #fff; }
.mir-maps .tag-pushable { background: #059669; color: #fff; }

/* Hide legacy static-site chrome if ever injected */
.mir-maps .fixed-nav,
.mir-maps .nav-container {
  display: none !important;
}

/* Kill any accidental white page title flash from parent header on Mir tools */
body.mir-evolved .nk-header-title,
body.mir-evolved .nk-header-title-box,
body.mir-evolved .nk-box-1,
body.mir-evolved .nk-box-2,
body.mir-evolved .nk-box-3 {
  background: transparent !important;
  color: #fff !important;
}
body.mir-evolved .nk-header-title h1,
body.mir-evolved .nk-header-title .nk-page-title-box,
body.mir-evolved .nk-header-title * {
  color: #fff !important;
}

@media (max-width: 1000px) {
  .mir-maps .maps-container,
  .mir-maps-layout {
    flex-direction: column;
  }
  .mir-maps .sidebar {
    width: 100%;
    flex: none;
    position: static;
    max-height: 42vh;
  }
  .mir-maps .map-image-panel {
    flex-direction: column;
  }
  .mir-maps .map-info {
    flex: 1 1 auto;
  }
  .mir-maps .bigmap-viewport {
    height: 360px;
  }
}
