/* ================================================================
   == TỆP: CSS/CENTERTRACKER.CSS
   == GIAO DIỆN CHẾ ĐỘ NGƯỜI PHÁT TRIỂN & ĐỊNH VỊ TÂM VR 360
   == Phím tắt bật/tắt: [C] + [D]
   ================================================================ */

/* --- 1. ĐIỂM TÂM GIỮA (CROSSHAIR / RETICLE) --- */
#pano-dev-crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999998;
  display: none; /* Mặc định ẩn, bật lên khi vào Dev Mode */
  user-select: none;
  transition: opacity 0.25s ease;
}

#pano-dev-crosshair.active {
  display: block;
}

/* Vòng tròn ngắm chính */
#pano-dev-crosshair .reticle-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.7), inset 0 0 6px rgba(0, 255, 136, 0.4);
  box-sizing: border-box;
}

/* Vòng tròn phụ bên trong */
#pano-dev-crosshair .reticle-inner-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-sizing: border-box;
}

/* Chấm đỏ trung tâm chính xác pixel 0,0 */
#pano-dev-crosshair .reticle-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  background-color: #ff3366;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff3366, 0 0 10px #ff3366;
}

/* 4 tia chữ thập căn toạ độ */
#pano-dev-crosshair .cross-line-h {
  position: absolute;
  top: 50%;
  left: 0;
  width: 50px;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(0,255,136,0) 0%, #00ff88 30%, transparent 40%, transparent 60%, #00ff88 70%, rgba(0,255,136,0) 100%);
  box-shadow: 0 0 4px rgba(0, 255, 136, 0.6);
}

#pano-dev-crosshair .cross-line-v {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 50px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(0,255,136,0) 0%, #00ff88 30%, transparent 40%, transparent 60%, #00ff88 70%, rgba(0,255,136,0) 100%);
  box-shadow: 0 0 4px rgba(0, 255, 136, 0.6);
}

/* Nhãn góc toạ độ nhỏ ngay cạnh tâm ngắm */
#pano-dev-crosshair .crosshair-tag {
  position: absolute;
  top: 38px;
  left: 38px;
  background: rgba(0, 0, 0, 0.75);
  color: #00ff88;
  font-family: monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 136, 0.4);
  white-space: nowrap;
  pointer-events: none;
}

/* --- 2. BẢNG ĐIỀU KHIỂN NHÀ PHÁT TRIỂN (DEV HUD PANEL) --- */
#pano-dev-panel {
  position: fixed;
  top: 80px;
  right: 25px;
  width: 330px;
  max-width: calc(100vw - 40px);
  background: rgba(13, 20, 36, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 255, 136, 0.45);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 255, 136, 0.2);
  color: #e2e8f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  z-index: 999999;
  display: none; /* Mặc định ẩn */
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.2s ease;
  user-select: none;
}

#pano-dev-panel.active {
  display: flex;
}

/* Header kéo thả */
#pano-dev-panel .dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.15) 0%, rgba(20, 30, 50, 0.6) 100%);
  border-bottom: 1px solid rgba(0, 255, 136, 0.3);
  cursor: grab;
}

#pano-dev-panel .dev-header:active {
  cursor: grabbing;
}

#pano-dev-panel .dev-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pano-dev-panel .dev-icon {
  font-size: 16px;
  animation: devIconPulse 2s infinite ease-in-out;
}

@keyframes devIconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #00ff88); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 6px #00ff88); }
}

#pano-dev-panel .dev-title {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  color: #00ff88;
  text-transform: uppercase;
}

#pano-dev-panel .dev-controls-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pano-dev-panel .dev-badge {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 136, 0.4);
  font-family: monospace;
}

#pano-dev-panel .dev-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#pano-dev-panel .dev-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Thân bảng điều khiển */
#pano-dev-panel .dev-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #00ff88 #141c2e;
}

#pano-dev-panel .dev-body::-webkit-scrollbar {
  width: 5px;
}
#pano-dev-panel .dev-body::-webkit-scrollbar-thumb {
  background: #00ff88;
  border-radius: 4px;
}

/* Khối hiển thị toạ độ */
.coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coord-card {
  background: rgba(22, 34, 58, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.coord-card.full-width {
  grid-column: span 2;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.25);
}

.coord-card .coord-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.coord-card .coord-val {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-top: 3px;
}

.coord-card .coord-val.highlight {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.coord-card .node-tag {
  color: #38bdf8;
  font-family: monospace;
  font-size: 13px;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Khu vực nút chức năng Copy */
.dev-action-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.dev-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dev-btn-primary {
  background: linear-gradient(135deg, #00ff88 0%, #00b359 100%);
  color: #052312;
  box-shadow: 0 3px 12px rgba(0, 255, 136, 0.35);
}

.dev-btn-primary:hover {
  background: linear-gradient(135deg, #26ff9d 0%, #00c964 100%);
  box-shadow: 0 5px 16px rgba(0, 255, 136, 0.5);
  transform: translateY(-1px);
}

.dev-btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dev-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(0, 255, 136, 0.4);
  color: #00ff88;
  transform: translateY(-1px);
}

.dev-btn-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1a1002;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
}

.dev-btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.dev-btn-copy-done {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: 0 0 16px #ffffff !important;
}

/* Phần danh sách điểm đã ghim */
.pinned-section {
  background: rgba(18, 27, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pinned-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
}

.pinned-list {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pinned-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 20, 36, 0.7);
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: monospace;
  font-size: 11px;
}

.pinned-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0 4px;
  font-weight: bold;
}

.pinned-item-remove:hover {
  color: #ff6b6b;
}

.pinned-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Hướng dẫn phím tắt ở chân bảng */
.dev-footer-hint {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.dev-footer-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: monospace;
}

/* --- 3. TOAST THÔNG BÁO POPUP --- */
#pano-dev-toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  color: #00ff88;
  border: 1px solid #00ff88;
  border-radius: 30px;
  padding: 9px 24px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 136, 0.4);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#pano-dev-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* Điểm nút ảo thử nghiệm gắn trên màn hình */
.virtual-dev-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff3366 30%, #ff0055 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 15px #ff3366, 0 0 25px #ff0055;
  z-index: 999997;
  pointer-events: none;
  animation: markerPulse 1.2s infinite alternate;
}

@keyframes markerPulse {
  0% { transform: scale(0.9); opacity: 0.85; }
  100% { transform: scale(1.15); opacity: 1; }
}
