/* ============================================================================
 * Touchpad & 3D Studio Camera Control Dock (SHOKKER: ON THE MAP)
 * Matte frosted obsidian glass aesthetic matching Apple Maps / 3D Studio
 * ============================================================================ */

/* Hide stock MapLibre bottom-right zoom/compass stack to prevent duplicate controls */
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-group {
  display: none !important;
}

.shokker-orbiting-cursor {
  cursor: grabbing !important;
}

/* Ephemeral Orbit & Tilt HUD Badge */
.shokker-orbit-hud {
  position: fixed;
  left: 50%;
  top: 76px;
  transform: translateX(-50%) translateY(-6px);
  z-index: 35;
  pointer-events: none;
  padding: 5px 12px;
  border-radius: 5px;
  font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #f3f6fb;
  background: rgba(10, 13, 19, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 2px solid #e6b84c;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.shokker-orbit-hud.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Architectural Bottom-Right 3D Studio Camera Dock */
.shokker-cam-dock {
  position: fixed;
  right: 12px;
  bottom: 94px;
  z-index: 14;
  width: 44px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
  background: rgba(10, 13, 19, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: opacity 0.28s ease, transform 0.28s ease, right 0.22s ease;
}

/* First-Visit Whisper-Subtle Camera Tip (compact bottom-right corner, clear of compass dock) */
.shokker-cam-tip {
  position: fixed;
  right: 68px;
  bottom: 58px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 10px;
  border-radius: 5px;
  background: rgba(10, 13, 19, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  color: #b8c4d4;
  font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  max-width: min(340px, calc(100vw - 84px));
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease, right 0.22s ease;
  z-index: 16;
}

.shokker-cam-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.shokker-cam-tip-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.shokker-cam-tip-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.shokker-cam-tip-close:hover,
.shokker-cam-tip-close:focus-visible {
  color: #e6b84c;
  background: rgba(230, 184, 76, 0.14);
  outline: none;
}

body:has(#right-drawer.open) .shokker-cam-dock,
body:has(#right-drawer.open) .shokker-cam-tip {
  right: 374px;
  transition: right 0.22s ease;
}

body.clean-presenter-mode .shokker-cam-dock,
body.clean-presenter-mode .shokker-cam-tip {
  opacity: 0 !important;
  pointer-events: none !important;
}

.shokker-dock-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
}

.shokker-dock-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 100%;
}

.shokker-dock-divider {
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1px 0;
}

.shokker-dock-btn {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  border-radius: 4px;
  height: 27px;
  width: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.shokker-dock-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.shokker-dock-btn--half {
  height: 24px;
  font-size: 10.5px;
  border-radius: 4px;
}

.shokker-dock-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
}

.shokker-dock-btn:active {
  transform: scale(0.94);
  background: rgba(230, 184, 76, 0.16);
  color: #e6b84c;
}

.shokker-dock-btn:focus-visible,
.shokker-dock-compass:focus-visible,
.shokker-dock-help-btn:focus-visible {
  outline: 2px solid #e6b84c;
  outline-offset: 1px;
}

/* Interactive Compass Dial */
.shokker-dock-compass {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 19, 0.84);
  cursor: grab;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.shokker-dock-compass:hover {
  border-color: rgba(230, 184, 76, 0.52);
  background: rgba(230, 184, 76, 0.08);
}

.shokker-dock-compass:active {
  cursor: grabbing;
}

.shokker-compass-ring,
.shokker-compass-needle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shokker-compass-needle {
  transition: transform 0.05s linear;
}

/* 2D / 3D Mode Switch */
.shokker-dock-mode {
  height: 24px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #9fb0c6;
}

.shokker-dock-mode.is-3d {
  color: #e6b84c;
  background: rgba(230, 184, 76, 0.12);
  border-color: rgba(230, 184, 76, 0.36);
}

/* Subtle ? Tooltip */
.shokker-dock-help-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.shokker-dock-help-btn {
  appearance: none;
  width: 22px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #9fb0c6;
  font-size: 10.5px;
  font-weight: 700;
  cursor: help;
  display: grid;
  place-items: center;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.shokker-dock-help-btn:hover,
.shokker-dock-help-btn:focus-visible {
  color: #e6b84c;
  border-color: rgba(230, 184, 76, 0.42);
  background: rgba(230, 184, 76, 0.10);
}

.shokker-dock-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 0;
  width: max-content;
  max-width: min(260px, calc(100vw - 80px));
  padding: 7px 10px;
  border-radius: 5px;
  background: rgba(10, 13, 19, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 2px solid #e6b84c;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.44);
  pointer-events: none;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 20;
}

.shokker-dock-help-wrap:hover .shokker-dock-tooltip,
.shokker-dock-help-wrap:focus-within .shokker-dock-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile / Tablet Safe Positioning */
@media (max-width: 960px) {
  body:has(#right-drawer.open) .shokker-cam-dock {
    right: 10px;
  }

  body:has(#right-drawer.open) .shokker-cam-tip {
    right: 58px;
  }

  .shokker-cam-dock {
    bottom: 124px;
    right: 10px;
    width: 44px;
    padding: 4px;
    gap: 3px;
  }

  .shokker-cam-tip {
    bottom: 124px;
    right: 62px;
    max-width: min(230px, calc(100vw - 76px));
  }

  .shokker-dock-btn {
    min-height: 36px;
    height: 36px;
  }

  .shokker-dock-btn--half {
    min-height: 36px;
    height: 36px;
  }

  .shokker-dock-compass {
    width: 36px;
    height: 36px;
  }

  .shokker-orbit-hud {
    top: 90px;
    font-size: 10.5px;
    padding: 4px 10px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 640px) {
  .shokker-cam-dock {
    bottom: 184px;
    right: 10px;
  }

  .shokker-cam-tip {
    bottom: 184px;
    right: 62px;
  }
}
