/* UDH MapIndoor Custom Styles */

body {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

#map {
  background-color: #f1f5f9;
}

/* Floor switcher buttons */
.floor-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #475569;
}

.floor-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.floor-btn.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  transform: scale(1.05);
}

/* Search result item hover */
.search-item {
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.search-item:hover {
  background-color: #f8fafc;
}

/* Room tooltip on hover */
.room-tooltip {
  background-color: rgba(15, 23, 42, 0.88);
  border: none;
  border-radius: 0.5rem;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.75rem;
  padding: 4px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.room-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.88) !important;
}

/* Highlighted room pulse animation */
@keyframes roomPulse {
  0% {
    stroke-width: 2px;
    stroke-opacity: 1;
  }
  50% {
    stroke-width: 6px;
    stroke-opacity: 0.6;
  }
  100% {
    stroke-width: 2px;
    stroke-opacity: 1;
  }
}

.highlighted-room {
  animation: roomPulse 1.2s infinite ease-in-out;
}

/* Radar pulse marker for "You Are Here" */
.radar-pulse-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.radar-pulse-marker .dot {
  width: 14px;
  height: 14px;
  background-color: #2563eb;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 5px;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
  z-index: 2;
}

.radar-pulse-marker .pulse {
  width: 24px;
  height: 24px;
  background-color: rgba(37, 99, 235, 0.35);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: radarWave 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  z-index: 1;
}

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

/* Custom scrollbar for search results */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dotted animated navigation path */
@keyframes dash {
  to {
    stroke-dashoffset: -20;
  }
}

.nav-path-animated {
  stroke-dasharray: 6, 6;
  animation: dash 0.8s linear infinite;
}

/* Building badge and tooltip */
.building-tooltip {
  background-color: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.6rem;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.75rem;
  padding: 6px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.building-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

.bldg-center-label {
  background: transparent;
  border: none;
}

/* Route Step Item Styling */
.route-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.route-step-item:hover {
  background-color: #f0fdf4;
  border-color: #86efac;
  transform: translateX(2px);
}

.route-step-item.active {
  background-color: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.route-step-badge {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Distinct path styling */
.nav-path-outdoor {
  stroke-dasharray: 8, 6;
  animation: dash 0.9s linear infinite;
}

.nav-path-indoor {
  stroke-dasharray: 6, 6;
  animation: dash 0.7s linear infinite;
}

/* Walkway Editor Markers & Controls */
.walkway-node-marker {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2.5px solid #475569;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.walkway-node-marker:hover {
  transform: scale(1.35);
  border-color: #0284c7;
  background: #e0f2fe;
}

.walkway-entrance-marker {
  width: 26px;
  height: 26px;
  background: #10b981;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.walkway-entrance-marker:hover {
  transform: scale(1.25);
  background: #059669;
}

.walkway-gate-marker {
  width: 28px;
  height: 28px;
  background: #0284c7;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.walkway-gate-marker:hover {
  transform: scale(1.25);
  background: #0369a1;
}

/* Floating View Controls (Satellite, 2.5D, Multi-floor) */
.map-view-controls {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.35rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.map-control-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.map-control-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.map-control-btn.active {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

/* 2.5D / 3D Isometric Mode Styles */
.map-container-3d {
  perspective: 1200px;
  overflow: hidden;
}

.map-3d-active .leaflet-map-pane {
  transform: rotateX(45deg) rotateZ(-18deg) scale(0.95);
  transform-origin: 50% 50%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.leaflet-map-pane {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3D Extrusion on Building Polygons */
.bldg-3d-extruded {
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.3));
}

/* 3D Elevated Skywalk styling */
.skywalk-3d-elevated {
  transition: all 0.3s ease;
}
.map-3d-active .skywalk-3d-elevated {
  filter: drop-shadow(0 4px 6px rgba(124, 58, 237, 0.35));
}

.campus-walkway-faint {
  transition: opacity 0.3s ease;
}

/* Multi-floor Stack Visuals */
.floor-stack-plane {
  transition: all 0.3s ease;
}

.floor-stack-badge {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.vertical-shaft-line {
  stroke-dasharray: 4, 4;
  animation: shaftPulse 1.2s ease-in-out infinite alternate;
}

@keyframes shaftPulse {
  0% { opacity: 0.4; }
  100% { opacity: 0.95; }
}

/* Print Styles for QR Code Cards */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  header, nav, #toolbarCampus, #toolbarFloor, .tab-btn, .no-print,
  #roomModal, #buildingModal, #floorModal, #singleQrModal,
  .toast, #statBuildingCount, .editor-tool-btn, #saveAllBtn,
  #tabRooms, #tabMapEditor, #tabBuildings, #tabExport,
  #tabQrCode > div:first-child {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  #tabQrCode {
    display: block !important;
  }

  #qrPrintArea {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .qr-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1.5px solid #94a3b8 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
}
