/* app/components/mini-map.css —— 浮动 mini-map 玻璃拟态样式（包 B） */

/* ===== 默认：桌面端右上角浮动 mini-map（默认收起，只露一个 🗺️ 触发按钮） ===== */
.mini-map {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 360px;
  height: 220px;
  z-index: 800;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(26,13,31, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: none;                /* 默认收起 */
  flex-direction: column;
  color: var(--text, #f7eafb);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, sans-serif;
}
.mini-map.expanded { display: flex; }   /* 触发后展开 */
.mini-map--mobile-open { display: flex !important; } /* 移动端全屏预览时强制展开 */

.mini-map__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mini-map__title { font-size: 12px; font-weight: 600; letter-spacing: .3px; opacity: .92; }
.mini-map__tools { display: flex; gap: 6px; }
.mini-map__btn {
  width: 26px; height: 26px; line-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #f7eafb);
  border-radius: 7px; cursor: pointer; font-size: 13px;
  transition: background .15s, transform .15s;
}
.mini-map__btn:hover { background: rgba(94,234,212, 0.25); transform: translateY(-1px); }

.mini-map__canvas {
  position: relative;
  flex: 1;
  width: 100%;
  background: #1a0d1f;
}
.mini-map__canvas .tmap-container { width: 100% !important; height: 100% !important; }

/* 缩放控件 */
.mini-map__zoom {
  position: absolute;
  left: 8px; bottom: 8px;
  display: flex; flex-direction: column; gap: 4px;
  z-index: 5;
}
.mini-map__zbtn {
  width: 28px; height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(26,13,31, 0.7);
  color: var(--text, #f7eafb);
  border-radius: 7px; cursor: pointer; font-size: 12px;
  backdrop-filter: blur(4px);
}
.mini-map__zbtn:hover { background: rgba(94,234,212, 0.25); }

/* 悬停 tooltip */
.mini-map__tooltip {
  position: absolute;
  left: 50%; top: 38px;
  transform: translateX(-50%);
  z-index: 9;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(13,4,15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  font-size: 11.5px;
  line-height: 1.5;
  pointer-events: none;
}
.mini-map__tooltip b { color: #ffb38a; }
.mini-map__tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
.mini-map__tooltip .tt-k { opacity: .65; }
.mini-map__tooltip .tt-v { color: #f7eafb; }

/* 用户定位脉冲圆（覆盖在 canvas 中心，locate 后随地图中心对齐） */
.mini-map__pulse {
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(90, 170, 255, 0.9);
  box-shadow: 0 0 0 rgba(90, 170, 255, 0.6);
  z-index: 6;
  pointer-events: none;
  animation: mm-pulse 1.8s ease-out infinite;
}
@keyframes mm-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(90, 170, 255, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(90, 170, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 170, 255, 0); }
}

/* 桌面端 🗺️ 触发按钮（默认显示在右下角，点开才展开 mini-map） */
.map-desktop-trigger {
  position: fixed;
  left: 24px;
  bottom: 28px;
  z-index: 800;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(26,13,31, 0.78);
  border: 1px solid rgba(94,234,212, 0.35);
  color: #5eead4;
  font-size: 22px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 14px rgba(94,234,212, 0.18);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.map-desktop-trigger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 18px rgba(193,63,224,.32); }
.map-desktop-trigger .tip { position: absolute; left: 60px; top: 50%; transform: translateY(-50%); background: rgba(13,4,15,.92); border: 1px solid rgba(255,255,255,.1); padding: 5px 9px; border-radius: 7px; font-size: 11.5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.map-desktop-trigger:hover .tip { opacity: 1; }

/* 移动端浮动触发按钮（默认隐藏桌面，仅移动端显示） */
.map-mobile-trigger { display: none; }

/* ===== 全屏地图模态层 ===== */
#mapFullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 8, 6, 0.82);
  backdrop-filter: blur(3px);
  display: none;
}
#mapFullscreen[hidden] { display: none; }
#mapFullscreen.open { display: block; }

.map-full {
  position: absolute;
  top: 4vh; left: 4vw;
  width: 92vw; height: 92vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: #1a0d1f;
}
.map-full__canvas { width: 100%; height: 100%; }
.map-full__close {
  position: absolute; top: 14px; right: 14px; z-index: 20;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(26,13,31, 0.8); color: #fff; font-size: 18px; cursor: pointer;
}
.map-full__panel {
  position: absolute; top: 14px; left: 14px; z-index: 20;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(26,13,31, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  font-size: 12px;
}
.map-full__panel h4 { margin: 0 0 6px; font-size: 12px; opacity: .85; }
.map-full__layer { display: flex; align-items: center; gap: 6px; margin: 3px 0; cursor: pointer; }
.map-full__panel label { cursor: pointer; }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .mini-map { display: none; }            /* 移动端不显示缩略图，避免占屏 */
  .map-mobile-trigger {
    display: flex; align-items: center; justify-content: center;
    position: fixed; left: 14px; bottom: 24px; z-index: 800;
    width: 42px; height: 42px; border-radius: 11px;
    background: rgba(26,13,31, 0.66);
    border: 1px solid rgba(217,140,240, 0.24);
    color: #D98CF0; font-size: 18px; cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform .25s ease, border-color .25s ease;
  }
  .map-mobile-trigger:active { transform: scale(.94); border-color: rgba(217,140,240,.5); }
  .map-mobile-trigger .ti-ico { width: 18px; height: 18px; margin: 0; }
  .map-full { top: 2vh; left: 2vw; width: 96vw; height: 96vh; }
}
