/* The original #map-v rule outranks the generic .view height, making the map taller than other views. */
#map-v {
  position: relative;
  height: calc(100vh - 100px);
  width: 100%;
}

.map-root {
  height: 100%;
}

#map {
  height: 100%;
  width: 100%;
  background: var(--c-black);
}

.plane-icon {
  background: none !important;
  border: none !important;
}

.plane-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-ping {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.4;
  z-index: 1;
}

.pulse {
  animation: radar-pulse 2.5s infinite ease-out !important;
}

.emergency-pulse {
  animation: radar-pulse 0.9s infinite ease-out !important;
}

@keyframes radar-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}

.plane-svg-box {
  position: absolute;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plane-datatag {
  position: absolute;
  left: 28px;
  top: -5px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(46, 213, 255, 0.4);
  border-left: 2px solid;
  padding: 2px 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: bold;
  white-space: nowrap;
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.5px;
  transition: all 0.3s ease;
}

.tag-callsign {
  font-size: 0.62rem;
  letter-spacing: 0.5px;
}

.tag-altitude {
  opacity: 0.8;
  font-size: 0.5rem;
}

.leaflet-popup-content-wrapper {
  background: var(--c-grey-0a0a0a);
  color: var(--c-cyan);
  border: 1px solid var(--c-amber);
  border-radius: 2px;
  width: 260px;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  width: auto !important;
}

.apt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--c-white);
  cursor: pointer;
}

.apt-icon {
  background: none !important;
  border: none !important;
}

#map-search-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.85);
  padding: 5px;
  border: 1px solid var(--c-grey-333);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#map-search-input {
  background: var(--c-grey-0a0a0a) !important;
  border: 1px solid var(--c-grey-444) !important;
  color: var(--c-cyan-bright) !important;
  font-family: var(--font-mono) !important;
  padding: 8px 12px !important;
  outline: none !important;
  width: 130px;
  border-radius: 0 !important;
  text-transform: uppercase;
}

#map-search-input:focus {
  border-color: var(--c-cyan-bright) !important;
  box-shadow: inset 0 0 5px rgba(0, 242, 255, 0.5);
}

.map-btn {
  background: var(--c-grey-1a1a1a) !important;
  border: 1px solid var(--c-grey-444) !important;
  border-left: none !important;
  color: var(--c-grey-aaa) !important;
  font-family: var(--font-mono) !important;
  padding: 8px 15px !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  transition: all 0.2s;
}

#find-btn:hover {
  background: var(--c-cyan-bright) !important;
  color: var(--c-black) !important;
  box-shadow: 0 0 10px var(--c-cyan-bright);
}

#boh-btn:hover {
  background: var(--c-amber) !important;
  color: var(--c-black) !important;
  box-shadow: 0 0 10px var(--c-amber);
}

.leaflet-control-layers {
  background: rgba(0, 0, 0, 0.85) !important;
  border: 1.5px solid var(--c-cyan) !important;
  border-radius: 4px !important;
  color: var(--c-white) !important;
  font-family: var(--font-mono) !important;
  box-shadow: 0 0 15px rgba(46, 213, 255, 0.3) !important;
  transition: all 0.3s ease;
}

.leaflet-control-layers-toggle {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300f2ff'><path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/></svg>") !important;
  background-size: 26px 26px !important;
  background-position: center !important;
  width: 36px !important;
  height: 36px !important;
}

.leaflet-control-layers-expanded {
  padding: 10px !important;
  background: rgba(0, 0, 0, 0.92) !important;
  border-color: var(--c-pink) !important;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4) !important;
}

.leaflet-control-layers-selector {
  accent-color: var(--c-cyan) !important;
  margin-right: 6px !important;
  cursor: pointer;
}

.leaflet-control-layers-base label {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.leaflet-control-layers-base label:last-child {
  margin-bottom: 0;
}

.leaflet-top.leaflet-left {
  margin-top: 65px !important;
  margin-left: 2px !important;
}

#cockpit-hud {
  position: absolute;
  bottom: 25px;
  left: 15px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--c-green);
  border-radius: 6px;
  padding: 12px;
  font-family: monospace;
  color: var(--c-green);
  z-index: 1000;
  box-shadow: 0 0 15px rgba(85, 255, 0, 0.25);
  pointer-events: none;
  transition: all 0.3s ease;
  display: flex;
  min-width: 270px;
  flex-direction: column;
  gap: 8px;
}

#cockpit-hud[hidden] {
  display: none;
}

.hud-title {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(85, 255, 0, 0.4);
  padding-bottom: 4px;
  font-weight: bold;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

#hud-callsign {
  color: var(--c-cyan);
}

.hud-dials {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 8px 0;
  gap: 8px;
}

.hud-dial-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hud-dial {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px solid;
  background: var(--c-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-dial--speed { border-color: var(--c-yellow); }
.hud-dial--alt { border-color: var(--c-cyan); }

.hud-dial--horizon {
  border-color: var(--c-green);
  background: #002200;
  overflow: hidden;
}

.hud-hand {
  position: absolute;
  width: 2px;
  height: 20px;
  top: 7px;
  transform-origin: bottom center;
  transform: rotate(0deg);
  transition: all 0.5s;
}

.hud-hand--speed {
  background: var(--c-yellow);
  filter: drop-shadow(0 0 2px var(--c-yellow));
}

.hud-hand--alt {
  background: var(--c-cyan);
  filter: drop-shadow(0 0 2px var(--c-cyan));
}

.hud-dial-text {
  font-size: 0.6rem;
  font-weight: bold;
  z-index: 5;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 2px;
  border-radius: 2px;
}

.hud-dial-text--speed { color: var(--c-yellow); }
.hud-dial-text--alt { color: var(--c-cyan); }

.hud-dial-label {
  font-size: 0.5rem;
  color: var(--c-grey-aaa);
  font-weight: bold;
  letter-spacing: 0.5px;
}

#hud-horizon-sky {
  position: absolute;
  width: 90px;
  height: 90px;
  background: #004400;
  border-bottom: 1px solid var(--c-green);
  top: -45px;
  left: -17px;
  transform: rotate(0deg) translateY(0px);
  transition: all 0.5s;
}

.hud-horizon-wing {
  position: absolute;
  width: 12px;
  height: 2px;
  background: var(--c-pink);
  z-index: 5;
  filter: drop-shadow(0 0 2px var(--c-pink));
}

.hud-horizon-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-pink);
  z-index: 5;
}

.hud-horizon-tip {
  position: absolute;
  width: 3px;
  height: 2px;
  background: var(--c-pink);
  z-index: 5;
}

.hud-horizon-tip--left { left: 12px; }
.hud-horizon-tip--right { right: 12px; }

.hud-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  color: var(--c-grey-aaa);
  border-top: 1px dashed rgba(85, 255, 0, 0.2);
  padding-top: 4px;
  margin-top: 2px;
}

#hud-vs-text { color: var(--c-green); }
#hud-hdg-text { color: var(--c-white); }

@media (max-width: 768px) {
  #cockpit-hud {
    left: 4%;
    right: 4%;
    width: 92%;
    bottom: 15px;
    min-width: auto;
    padding: 8px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.6);
  }

  .hud-dial {
    width: 48px;
    height: 48px;
  }

  #hud-horizon-sky {
    width: 78px;
    height: 78px;
    left: -15px;
    top: -39px;
  }
}
