:root {
  --bus-color: #4da3ff;
  --tram-color: #ff64c1;
  --trolley-color: #b8ff5f;
  --night-color: #000000;
  --stop-color: #00e5ff;
  --bg-color: #0b0b0b;
  --panel-bg: rgba(15, 15, 15, 0.95);
  --text-color: #fff;
  --accent: #007aff;
  --danger: #ff3b30;
}

html, body { height: 100%; margin: 0; background: var(--bg-color); color: var(--text-color); font-family: sans-serif; }
#map { height: 100%; width: 100%; background: #222; }

/* --- ANIMATION (GPU Accelerated) --- */
.leaflet-marker-icon.animate-move {
  transition: transform 6s linear;
  will-change: transform;
}

/* --- ICONS --- */
.leaflet-div-icon { background: transparent !important; border: none !important; }

/* Dots */
.veh-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.6);
  box-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* Pills */
.veh-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 4px;
  border-radius: 14px;
  background: rgba(20, 20, 30, 0.9);
  border: 2px solid;
  color: #fff; font-weight: bold; font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.veh-pill .arrow {
  width: 0; height: 0; 
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid currentColor;
  transform-origin: center;
}

.type-bus { border-color: var(--bus-color); color: var(--bus-color); }
.type-tram { border-color: var(--tram-color); color: var(--tram-color); }
.type-trolley { border-color: var(--trolley-color); color: var(--trolley-color); }
.type-night { border-color: #fff; color: #fff; background: #000; box-shadow: 0 0 8px rgba(255,255,255,0.4); }

/* SLEEP MODE (Depot / Inactive) */
.type-sleep {
    border-color: #444 !important;
    color: #666 !important;
    background: rgba(20, 20, 20, 0.3) !important;
    box-shadow: none !important;
    z-index: 100 !important;
    filter: grayscale(100%);
}
.type-sleep .arrow { border-bottom-color: #555 !important; }
.veh-dot.type-sleep { background: #444 !important; border-color: #222 !important; opacity: 0.4; }

/* Stops */
.stop-marker {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(80, 80, 80, 1), #000);
  border: 1.5px solid var(--stop-color);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 0 5px var(--stop-color);
  z-index: 500;
}

/* --- PANEL --- */
#hamburger {
  position: absolute; top: 10px; left: 10px; z-index: 1001;
  width: 36px; height: 36px; background: var(--panel-bg);
  border-radius: 8px; display: flex; flex-direction: column; 
  justify-content: center; align-items: center; gap: 4px;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
#hamburger span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }

#panel {
  position: absolute; top: 55px; left: 10px; z-index: 1000;
  background: var(--panel-bg); backdrop-filter: blur(10px);
  padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
  width: 260px; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}
#panel.hidden { opacity: 0; pointer-events: none; transform: translateY(-10px); }

/* --- DROPDOWN --- */
.multiselect { position: relative; margin-bottom: 10px; }
.select-btn {
  width: 100%; padding: 8px; background: rgba(255,255,255,0.1);
  border: 1px solid #444; border-radius: 6px; color: #fff;
  font-size: 13px; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; box-sizing: border-box;
}
.select-btn:hover { background: rgba(255,255,255,0.15); }

.dropdown-content {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #1a1a1a; border: 1px solid #444; border-radius: 6px;
  max-height: 200px; overflow-y: auto; z-index: 2000; margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.dropdown-content.open { display: block; }

.dropdown-item {
  padding: 8px 10px; font-size: 13px; border-bottom: 1px solid #333;
  display: flex; align-items: center; cursor: pointer;
}
.dropdown-item:hover { background: #333; }
.dropdown-item input { margin-right: 10px; cursor: pointer; }
.active-indicator { width: 6px; height: 6px; background: #00ff66; border-radius: 50%; margin-left: auto; box-shadow: 0 0 4px #00ff66; }

/* Toggles */
.row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
label { font-size: 12px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
small { color: #888; font-size: 11px; display: block; margin-top: 5px; }

.indicator-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.indicator-dot.bus { background: linear-gradient(90deg, var(--night-color) 50%, var(--bus-color) 50%); }
.indicator-dot.tram { background: var(--tram-color); }
.indicator-dot.trolley { background: var(--trolley-color); }

/* Tripwire Buttons */
.tripwire-row { display: flex; gap: 8px; margin-top: 8px; }
#btnDraw { flex: 1; background: var(--accent); color: #fff; border: none; padding: 8px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
#btnDraw.active { background: var(--danger); animation: pulse 2s infinite; }
#btnClearWires { background: #444; color: #fff; border: none; padding: 8px; border-radius: 6px; font-weight: bold; cursor: pointer; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); } }
.cursor-crosshair { cursor: crosshair !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #222; } ::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
.leaflet-control-layers { background: var(--panel-bg) !important; border: 1px solid rgba(255,255,255,0.1) !important; color: #fff !important; border-radius: 8px !important; }
.leaflet-control-zoom { display: none; }

/* --- SMART DEPOT MARKER --- */
.depot-marker-box {
  background: rgba(15, 15, 20, 0.85); /* Dark Glass */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid #888; /* Grey accent */
  border-radius: 8px;
  padding: 8px 12px;
  color: #ccc;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  min-width: 150px;
  max-width: 220px;
  z-index: 2000 !important;
}

.depot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.depot-name {
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.depot-count {
  background: #333;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
}

.depot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.depot-chip {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 6px;
  color: #eee;
  font-weight: 600;
  font-size: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Debug Labels */
.debug-label {
    background: transparent;
    border: none;
    color: #ff3333;
    font-weight: bold;
    box-shadow: none;
}
/* --- COLORED ICONS (CSS Mask) --- */
.veh-icon-mask {
  width: 14px;
  height: 14px;
  /* This magic makes it take the parent's text color */
  background-color: currentColor; 
  
  /* Use the icon file as a mask */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
  vertical-align: middle;
}
/* Hide Leaflet/Map Attributions */
.leaflet-control-attribution {
    display: none !important;
}
