/* ==========================================================================
   SIGHTQUEST - NOVAPAY RADAR & WORLD MAP
   Theme: Dark Slate Map Frame with Sky-Blue Radar Pulses
   ========================================================================== */

.sq-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: var(--bg);
}

.sq-map-canvas-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.sq-leaflet-map {
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #0B0E14;
}

/* Dark Mode Filter for OpenStreetMap Tiles - tuned for NovaPay slate tone */
.leaflet-tile-pane {
  filter: invert(100%) hue-rotate(195deg) brightness(88%) contrast(96%) saturate(60%);
}

.leaflet-control-attribution {
  background: rgba(15, 19, 25, 0.85) !important;
  color: var(--text3) !important;
  font-size: 0.65rem !important;
  border-top-left-radius: 6px;
  border: 1px solid var(--border);
}

.leaflet-control-attribution a {
  color: var(--text2) !important;
}

/* Custom Glowing POI Markers */
.sq-poi-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid #fff;
  transition: transform 0.25s var(--silk);
  position: relative;
}

.sq-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.sq-marker-icon svg,
.sq-marker-icon .lucide {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  display: block;
}

.sq-poi-div-icon:hover {
  z-index: 12000 !important;
}

.sq-poi-marker:hover {
  transform: scale(1.25);
  z-index: 900 !important;
}

/* Square, half-sized playground marker for item locations (18x18px) */
.sq-poi-marker.sq-playground-marker {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.45);
}

.sq-poi-marker.sq-playground-marker .sq-marker-icon svg,
.sq-poi-marker.sq-playground-marker .sq-marker-icon .lucide {
  width: 10px;
  height: 10px;
  stroke: #facc15;
}

.sq-poi-marker.sq-playground-marker:hover {
  transform: scale(1.4);
  border-color: #fde047;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.7);
}

.sq-poi-marker.rarity-gewoehnlich {
  background: var(--bg3);
  border-color: var(--text2);
  box-shadow: 0 0 12px rgba(138, 174, 200, 0.4);
}

.sq-poi-marker.rarity-selten {
  background: var(--sky3);
  border-color: var(--sky);
  box-shadow: 0 0 16px rgba(74, 158, 232, 0.75);
}

.sq-poi-marker.rarity-episch {
  background: #7D3C98;
  border-color: #D7BDE2;
  box-shadow: 0 0 20px rgba(165, 105, 189, 0.85);
}

.sq-poi-marker.rarity-legendaer {
  background: linear-gradient(135deg, #B7950B, var(--gold));
  border-color: #FCF3CF;
  box-shadow: 0 0 24px rgba(245, 176, 65, 0.9);
}

.sq-poi-marker.rarity-einzigartig {
  background: linear-gradient(135deg, var(--red), var(--sky));
  border-color: #ffffff;
  box-shadow: 0 0 28px rgba(74, 158, 232, 0.95);
  animation: markerPulse 2.2s infinite alternate var(--silk);
}

.sq-marker-collected-check {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--green);
  color: #0A1A2C;
  font-size: 0.65rem;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg);
}

.sq-marker-collected-check svg,
.sq-marker-collected-check .lucide {
  width: 10px;
  height: 10px;
  stroke: #0A1A2C;
}

@keyframes markerPulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Player Avatar Marker */
.sq-player-div-icon,
.sq-friend-div-icon {
  background: transparent;
  border: none;
}

.sq-player-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky3), var(--sky));
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 16px rgba(74, 158, 232, 0.9);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.sq-marker-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sq-marker-avatar-initial {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b111e;
  text-transform: uppercase;
  line-height: 1;
}

.sq-player-marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(74, 158, 232, 0.7);
  animation: radarRipple 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes radarRipple {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Friend Avatar Marker (same as player marker, but in emerald green) */
.sq-friend-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b8754, var(--green));
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 16px rgba(61, 204, 142, 0.9);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.sq-friend-marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(61, 204, 142, 0.7);
  animation: radarRipple 2.2s infinite ease-out;
  pointer-events: none;
}

/* Floating Action Buttons on Map (NovaPay Glass Controls) */
.sq-map-fab-group {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 650;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.22s var(--silk), visibility 0.22s var(--silk), transform 0.22s var(--silk);
}

.sq-map-canvas-wrap.has-popup .sq-map-fab-group,
.sq-map-canvas-wrap.has-menu .sq-map-fab-group {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.92);
}

.sq-fab {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(20, 25, 32, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.3s var(--silk);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sq-fab svg,
.sq-fab .lucide {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.25s var(--silk);
}

.sq-fab:hover svg,
.sq-fab:hover .lucide {
  transform: scale(1.12);
}

.sq-fab:hover {
  border-color: var(--sky);
  color: var(--sky);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(74, 158, 232, 0.25);
}

/* Nearby POI Drawer / Sidebar (Always docked to right side of map) */
.sq-poi-drawer {
  width: 380px;
  max-width: 85vw;
  height: 100%;
  background: rgba(18, 23, 31, 0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  position: relative;
  flex-shrink: 0;
  transition: margin-right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.sq-poi-drawer.is-collapsed {
  margin-right: -380px;
}

/* ==========================================================================
   SMARTPHONEMODUS (<= 768px)
   Radar im Umkreis komplett ausgeblendet und nicht einblendbar
   ========================================================================== */
@media (max-width: 768px) {
  .sq-poi-drawer,
  #poi-drawer {
    display: none !important;
  }

  .sq-drawer-collapse-btn,
  #btn-toggle-poi-drawer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Sidebar Toggle Arrow Button on Drawer Border */
.sq-drawer-collapse-btn {
  position: absolute;
  top: 50%;
  left: -28px;
  transform: translateY(-50%);
  width: 28px;
  height: 64px;
  border-radius: 9px 0 0 9px;
  background: rgba(18, 24, 35, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--sky);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -5px 0 16px rgba(0, 0, 0, 0.5);
  z-index: 700;
  transition: all 0.25s var(--silk);
  padding: 0;
}

.sq-drawer-collapse-btn:hover {
  background: rgba(74, 158, 232, 0.18);
  color: #ffffff;
  border-color: var(--sky);
}

.sq-drawer-collapse-btn svg,
.sq-drawer-collapse-btn .lucide {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: transform 0.25s var(--silk);
}

.sq-drawer-handle {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sq-drawer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sq-drawer-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.sq-drawer-subtitle {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 2px;
}

.sq-poi-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sq-poi-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.3s var(--silk);
  cursor: pointer;
  position: relative;
}

.sq-poi-item:hover {
  border-color: var(--sky);
  transform: translateX(3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sq-poi-item.in-range {
  border-color: rgba(61, 204, 142, 0.5);
  box-shadow: 0 0 18px rgba(61, 204, 142, 0.12);
}

.sq-poi-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sq-poi-item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
}

.sq-poi-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 12px;
}

.sq-poi-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sq-dist-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
}

.sq-dist-tag.ready {
  background: rgba(61, 204, 142, 0.14);
  color: var(--green);
  border-color: rgba(61, 204, 142, 0.4);
}

.sq-dist-tag.cooldown {
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold);
  border-color: rgba(250, 204, 21, 0.35);
}

/* Leaflet Dark Popup & Layering above FAB controls */
.leaflet-popup-pane,
.leaflet-popup {
  z-index: 1200 !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--bg2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border2);
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  line-height: 1.5 !important;
}
