/* The map panel and everything drawn on the map. */
#mapDiv { position: absolute; inset: 0; background: #e5e3df; }
.leaflet-container { font: inherit; background: #e5e3df; }
.leaflet-container a { color: inherit; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.7); }
.leaflet-div-icon { background: none; border: 0; }

/* Toolbar */
.mapToolBar { position: absolute; left: 60px; top: 10px; right: 0; z-index: 500; display: flex; flex-wrap: wrap; max-width: calc(100% - 60px); width: max-content; background: #fff; border-radius: 4px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); }
.mapToolBar .grip { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--gray-400); cursor: move; align-self: center; }
.mapToolBar .tools { display: flex; flex-wrap: wrap; flex: 1; }
.mapTool { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; }
.mapTool:hover { background: var(--gray-50); }
.mapTool.active { background: var(--gray-100); }
.mapTool.layers { align-self: center; margin-left: auto; }
.mapToolBar.narrow { width: auto; }
.mapNarrow .mapTypeBox { display: none; }

/* Top-right map controls: Traffic and map type */
.mapTypeBox { position: absolute; right: 10px; top: 10px; z-index: 500; display: flex; gap: 8px; }
.mapTypeBox .mtBtn { height: 28px; padding: 0 10px; display: flex; align-items: center; background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); font-size: 11px; font-weight: 500; cursor: pointer; gap: 18px; }

/* Zoom buttons and the person marker on the left */
.mapZoom { position: absolute; left: 10px; top: 72px; z-index: 500; width: 40px; background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.mapZoom div { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 300; color: #666; cursor: pointer; }
.mapZoom div + div { border-top: 1px solid #e6e6e6; }
.mapPerson { position: absolute; left: 10px; top: 16px; z-index: 500; width: 40px; height: 40px; background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; color: #f5b400; }
.mapCamera { position: absolute; right: 8px; bottom: 26px; z-index: 500; width: 40px; height: 40px; background: #fff; border-radius: 20px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; color: #666; cursor: pointer; }

/* Vehicle name label */
.vLabel { position: absolute; left: 0; top: 0; display: flex; flex-direction: column-reverse; align-items: center; transform: translate(-50%, -100%); pointer-events: none; }
.vLabel .tip { width: 0; height: 0; border-style: solid; border-color: transparent; border-width: 5px 5px 0; border-top-color: var(--gray-700); }
.vLabel .content { position: relative; display: flex; background: var(--gray-700); color: #fff; border-radius: 4px; outline: 2px solid var(--gray-900-01); cursor: pointer; pointer-events: auto; transition: background-color 0.2s; }
.vLabel .left { width: 8px; border-radius: 4px 0 0 4px; background: #000; }
.vLabel .name { padding: 4px; white-space: nowrap; }
.vLabel .content:hover { background: var(--gray-850); outline-color: var(--gray-900-025); }
.vLabel.active .content { background: var(--gray-900); outline: 2px solid var(--green-400); }
.vLabel.active .tip { border-top-color: var(--gray-900); }
.vBadge { position: absolute; top: 0; right: 0; transform: translate(calc(50% + 4px), -50%); min-width: 24px; height: 24px; padding: 0 4px; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: var(--red-400); outline: 2px solid var(--gray-900-01); color: #fff; font-size: 11px; }

/* Vehicle status icon */
.vIcon { width: 26px; height: 26px; cursor: pointer; }
.vIcon svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }

/* Cluster */
.vCluster { cursor: pointer; }
.vCluster circle.c { fill: rgb(0, 114, 150); fill-opacity: 0.7; stroke: rgb(26, 157, 198); stroke-opacity: 0.35; stroke-width: 8; paint-order: stroke; }
.vCluster:hover circle.c { stroke: rgb(78, 194, 138); stroke-opacity: 1; }
.vCluster text.n { fill: #fff; font-size: 20px; text-anchor: middle; font-family: var(--font-family); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 1px 3px rgba(0, 0, 0, 0.25); }
.vCluster .badge circle { fill: var(--red-400); stroke: var(--red-400); stroke-opacity: 0.27; stroke-width: 6; paint-order: stroke; }
.vCluster .badge text { fill: #fff; font-size: 11px; text-anchor: middle; font-family: var(--font-family); }

/* Status card on a clicked vehicle */
.vCard { position: absolute; left: 0; top: 0; width: 320px; transform: translate(-50%, calc(-100% - 22px)); border-radius: 8px; background: var(--gray-50); box-shadow: var(--shadow-md); cursor: default; }
.vCard .head { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 5px 8px; }
.vCard .nameLabel { height: 22px; padding: 1px 6px; display: flex; align-items: center; border-radius: 4px; background: #000; color: #fff; font-weight: 600; }
.vCard .cog { display: flex; cursor: pointer; }
.vCard .rows { height: 113px; background: #fff; border-top: 1px solid var(--line-strong); overflow-y: scroll; }
.vCard .rows::-webkit-scrollbar { width: 15px; }
.vCard .rows::-webkit-scrollbar-thumb { background: #8a8a8a; border-radius: 6px; border: 4px solid #fff; }
.vCard .row { display: flex; justify-content: space-between; height: 20px; padding: 2px 8px; font-size: 11px; white-space: nowrap; }
.vCard .row .v { overflow: hidden; text-overflow: ellipsis; margin-left: 12px; }
.vCard .foot { height: 32px; padding: 0 12px; display: flex; align-items: center; gap: 18px; border-radius: 0 0 8px 8px; }
.vCard .foot span { display: flex; cursor: pointer; }
.vCard .arrow { position: absolute; left: 50%; bottom: -8px; margin-left: -8px; width: 0; height: 0; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--gray-50); }

/* Track drawing: legend and stop labels */
.trackLegend { position: absolute; right: 8px; top: 48px; z-index: 500; width: 276px; padding: 8px; display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.trackLegend .bar { height: 12px; border-radius: 4px; background: linear-gradient(to right, rgb(242, 13, 13) 0%, rgb(242, 108, 13) 9%, rgb(242, 228, 13) 18%, rgb(161, 242, 13) 27%, rgb(65, 242, 13) 36%, rgb(13, 242, 80) 45%, rgb(13, 242, 175) 55%, rgb(13, 190, 242) 64%, rgb(13, 94, 242) 73%, rgb(27, 13, 242) 82%, rgb(147, 13, 242) 91%, rgb(242, 13, 242) 100%); }
.trackLegend .ticks { display: flex; justify-content: space-between; margin-top: -4px; font-size: 11px; color: var(--gray-700); }
.stopLabel { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 6px)); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.stopLabel .box { display: flex; align-items: center; gap: 6px; height: 24px; padding: 2px 6px; border-radius: 4px; background: var(--gray-850); color: #fff; white-space: nowrap; }
.stopLabel .box .al { color: rgb(244, 99, 58); display: flex; }
.stopLabel .arr { width: 0; height: 0; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--gray-850); }
.stopDot { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 1px solid var(--gray-850); }
.legacyStop { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid rgb(233, 74, 18); background: rgba(255, 230, 128, 0.49); font-size: 10px; font-weight: 700; line-height: 11px; text-align: center; color: #222; }

/* Places and geofence names */
.poiIcon { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
.areaHandle { width: 8px; height: 8px; background: #4a4a4a; border: 1px solid #fff; }
.leaflet-container.crosshair, .leaflet-container.crosshair .leaflet-interactive { cursor: crosshair; }

/* Shown when the page is opened straight from the file, where the base map cannot load */
.mapNotice { position: absolute; left: 10px; bottom: 10px; z-index: 500; max-width: 330px; padding: 6px 10px; background: rgba(255, 255, 255, 0.94); border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); font-size: 11px; line-height: 15px; color: var(--gray-700); }
